summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2015-04-17 14:54:41 +0200
committerMichal Kubecek <mkubecek@suse.cz>2015-04-19 11:44:25 +0200
commit405bd41472665d92cad485c24e762983a7c503da (patch)
tree64fdd335519502bd5c414866dec8a02df7d51572
parent23c36af6704e22cf12cdb583068ea25a574501f4 (diff)
downloadtwinkle-405bd41472665d92cad485c24e762983a7c503da.tar
twinkle-405bd41472665d92cad485c24e762983a7c503da.tar.gz
twinkle-405bd41472665d92cad485c24e762983a7c503da.tar.lz
twinkle-405bd41472665d92cad485c24e762983a7c503da.tar.xz
twinkle-405bd41472665d92cad485c24e762983a7c503da.zip
automatic conversion of getprofilenameform.ui
-rw-r--r--src/gui/getprofilenameform.cpp (renamed from src/gui/getprofilenameform.ui.h)55
-rw-r--r--src/gui/getprofilenameform.h26
-rw-r--r--src/gui/getprofilenameform.ui283
-rw-r--r--src/gui/twinkle.pro6
4 files changed, 181 insertions, 189 deletions
diff --git a/src/gui/getprofilenameform.ui.h b/src/gui/getprofilenameform.cpp
index 00c2f18..8716efb 100644
--- a/src/gui/getprofilenameform.ui.h
+++ b/src/gui/getprofilenameform.cpp
@@ -1,35 +1,36 @@
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you wish to add, delete or rename functions or slots use
-** Qt Designer which will update this file, preserving your code. Create an
-** init() function in place of a constructor, and a destroy() function in
-** place of a destructor.
-*****************************************************************************/
-/*
- Copyright (C) 2005-2009 Michel de Boer <michel@twinklephone.com>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+#include "getprofilenameform.h"
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+#include <QDir>
+#include <QMessageBox>
+#include "user.h"
+#include "protocol.h"
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+/*
+ * Constructs a GetProfileNameForm which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * true to construct a modal dialog.
+ */
+GetProfileNameForm::GetProfileNameForm(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
+ : QDialog(parent, name, modal, fl)
+{
+ setupUi(this);
+}
+/*
+ * Destroys the object and frees any allocated resources
+ */
+GetProfileNameForm::~GetProfileNameForm()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
void GetProfileNameForm::init()
{
// Letters, digits, underscore, minus
QRegExp rxFilenameChars("[\\w\\-][\\w\\-@\\.]*");
-
+
// Set validators
// USER
profileLineEdit->setValidator(new QRegExpValidator(rxFilenameChars, this));
@@ -38,7 +39,7 @@ void GetProfileNameForm::init()
void GetProfileNameForm::validate()
{
if (profileLineEdit->text().isEmpty()) return;
-
+
// Find the .twinkle directory in HOME
QDir d = QDir::home();
if (!d.cd(USER_DIR)) {
@@ -46,7 +47,7 @@ void GetProfileNameForm::validate()
tr("Cannot find .twinkle directory in your home directory."));
reject();
}
-
+
QString filename = profileLineEdit->text();
filename.append(USER_FILE_EXT);
QString fullname = d.filePath(filename);
@@ -55,7 +56,7 @@ void GetProfileNameForm::validate()
tr("Profile already exists."));
return;
}
-
+
accept();
}
diff --git a/src/gui/getprofilenameform.h b/src/gui/getprofilenameform.h
new file mode 100644
index 0000000..be49368
--- /dev/null
+++ b/src/gui/getprofilenameform.h
@@ -0,0 +1,26 @@
+#ifndef GETPROFILENAMEFORM_H
+#define GETPROFILENAMEFORM_H
+
+#include <QDialog>
+#include "ui_getprofilenameform.h"
+
+class GetProfileNameForm : public QDialog, private Ui::GetProfileNameForm
+{
+ Q_OBJECT
+
+public:
+ GetProfileNameForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0);
+ ~GetProfileNameForm();
+
+ QString getProfileName();
+ int execNewName();
+ int execRename( const QString & oldName );
+
+public slots:
+ void validate();
+
+private:
+ void init();
+};
+
+#endif // GETPROFILENAMEFORM_H
diff --git a/src/gui/getprofilenameform.ui b/src/gui/getprofilenameform.ui
index 599d778..e6d17ba 100644
--- a/src/gui/getprofilenameform.ui
+++ b/src/gui/getprofilenameform.ui
@@ -1,174 +1,137 @@
-<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
-<class>GetProfileNameForm</class>
-<widget class="QDialog">
- <property name="name">
- <cstring>GetProfileNameForm</cstring>
- </property>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0" stdsetdef="1">
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>GetProfileNameForm</class>
+ <widget class="QDialog" name="GetProfileNameForm">
<property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>430</width>
- <height>127</height>
- </rect>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>430</width>
+ <height>127</height>
+ </rect>
</property>
- <property name="caption">
- <string>Twinkle - Profile name</string>
+ <property name="windowTitle">
+ <string>Twinkle - Profile name</string>
</property>
- <grid>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel" row="0" column="0">
- <property name="name">
- <cstring>userIconTextLabel</cstring>
- </property>
- <property name="backgroundOrigin">
- <enum>WidgetOrigin</enum>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="pixmap">
- <pixmap>penguin_big.png</pixmap>
- </property>
- </widget>
- <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
- <property name="name">
- <cstring>layout24</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <spacer>
- <property name="name">
- <cstring>spacer41</cstring>
- </property>
- <property name="orientation">
- <enum>Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>Expanding</enum>
- </property>
- <property name="sizeHint">
- <size>
- <width>81</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget class="QPushButton">
- <property name="name">
- <cstring>okPushButton</cstring>
- </property>
- <property name="text">
- <string>&amp;OK</string>
- </property>
- <property name="default">
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QPushButton">
- <property name="name">
- <cstring>cancelPushButton</cstring>
- </property>
- <property name="text">
- <string>&amp;Cancel</string>
- </property>
- </widget>
- </hbox>
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="userIconTextLabel">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap>penguin_big.png</pixmap>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
</widget>
- <widget class="QLayoutWidget" row="0" column="1">
- <property name="name">
- <cstring>layout26</cstring>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QLabel">
- <property name="name">
- <cstring>profileTextLabel</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Enter a name for your profile:</string>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- <property name="alignment">
- <set>AlignVCenter</set>
- </property>
- </widget>
- <widget class="QLineEdit">
- <property name="name">
- <cstring>profileLineEdit</cstring>
- </property>
- <property name="text">
- <string></string>
- </property>
- <property name="whatsThis" stdset="0">
- <string>&lt;b&gt;The name of your profile&lt;/b&gt;
+ </item>
+ <item row="1" column="0" rowspan="1" colspan="2">
+ <layout class="QHBoxLayout">
+ <item>
+ <spacer name="spacer41">
+ <property name="sizeHint">
+ <size>
+ <width>81</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okPushButton">
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelPushButton">
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <layout class="QVBoxLayout">
+ <item>
+ <widget class="QLabel" name="profileTextLabel">
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Enter a name for your profile:</string>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignVCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="profileLineEdit">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;The name of your profile&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
A profile contains your user settings, e.g. your user name and password. You have to give each profile a name.
&lt;br&gt;&lt;br&gt;
If you have multiple SIP accounts, you can create multiple profiles. When you startup Twinkle it will show you the list of profile names from which you can select the profile you want to run.
&lt;br&gt;&lt;br&gt;
To remember your profiles easily you could use your SIP user name as a profile name, e.g. &lt;b&gt;example@example.com&lt;/b&gt;</string>
- </property>
- </widget>
- </vbox>
- </widget>
- </grid>
-</widget>
-<connections>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <tabstops>
+ <tabstop>profileLineEdit</tabstop>
+ <tabstop>okPushButton</tabstop>
+ <tabstop>cancelPushButton</tabstop>
+ </tabstops>
+ <connections>
<connection>
- <sender>cancelPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetProfileNameForm</receiver>
- <slot>reject()</slot>
+ <sender>cancelPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetProfileNameForm</receiver>
+ <slot>reject()</slot>
</connection>
<connection>
- <sender>okPushButton</sender>
- <signal>clicked()</signal>
- <receiver>GetProfileNameForm</receiver>
- <slot>validate()</slot>
+ <sender>okPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>GetProfileNameForm</receiver>
+ <slot>validate()</slot>
</connection>
-</connections>
-<tabstops>
- <tabstop>profileLineEdit</tabstop>
- <tabstop>okPushButton</tabstop>
- <tabstop>cancelPushButton</tabstop>
-</tabstops>
-<includes>
- <include location="local" impldecl="in implementation">qlineedit.h</include>
- <include location="local" impldecl="in implementation">qregexp.h</include>
- <include location="local" impldecl="in implementation">qvalidator.h</include>
- <include location="local" impldecl="in implementation">protocol.h</include>
- <include location="local" impldecl="in implementation">qmessagebox.h</include>
- <include location="local" impldecl="in implementation">qdir.h</include>
- <include location="local" impldecl="in implementation">qfile.h</include>
- <include location="local" impldecl="in implementation">user.h</include>
- <include location="local" impldecl="in implementation">getprofilenameform.ui.h</include>
-</includes>
-<slots>
- <slot>validate()</slot>
-</slots>
-<functions>
- <function access="private" specifier="non virtual">init()</function>
- <function returnType="QString">getProfileName()</function>
- <function returnType="int">execNewName()</function>
- <function returnType="int">execRename( const QString &amp; oldName )</function>
-</functions>
-<pixmapinproject/>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
+ </connections>
+</ui>
diff --git a/src/gui/twinkle.pro b/src/gui/twinkle.pro
index b4c73c2..0fee90b 100644
--- a/src/gui/twinkle.pro
+++ b/src/gui/twinkle.pro
@@ -14,6 +14,7 @@ HEADERS += gui.h \
deregisterform.h \
logviewform.h \
numberconversionform.h \
+ getprofilenameform.h \
historylistview.h \
freedesksystray.h \
twinklesystray.h \
@@ -34,6 +35,7 @@ SOURCES += main.cpp \
deregisterform.cpp \
logviewform.cpp \
numberconversionform.cpp \
+ getprofilenameform.cpp \
historylistview.cpp \
freedesksystray.cpp \
twinklesystray.cpp \
@@ -47,7 +49,8 @@ SOURCES += main.cpp \
FORMS = dtmfform.ui \
deregisterform.ui \
logviewform.ui \
- numberconversionform.ui
+ numberconversionform.ui \
+ getprofilenameform.ui
#The following line was changed from FORMS to FORMS3 by qt3to4
FORMS3 = mphoneform.ui \
@@ -59,7 +62,6 @@ FORMS3 = mphoneform.ui \
authenticationform.ui \
userprofileform.ui \
selectprofileform.ui \
- getprofilenameform.ui \
transferform.ui \
syssettingsform.ui \
wizardform.ui \