author | drw <drw> | 2003-02-04 17:52:14 (UTC) |
---|---|---|
committer | drw <drw> | 2003-02-04 17:52:14 (UTC) |
commit | 294f0a9b5e5678a6eba1fb77943201fac804049f (patch) (side-by-side diff) | |
tree | b37638264f6bd22bb0894025ea70037294f15c9d /noncore/settings/aqpkg | |
parent | 328aeec813c953b260a992afc53a5c9d812e1bcf (diff) | |
download | opie-294f0a9b5e5678a6eba1fb77943201fac804049f.zip opie-294f0a9b5e5678a6eba1fb77943201fac804049f.tar.gz opie-294f0a9b5e5678a6eba1fb77943201fac804049f.tar.bz2 |
Updates to configure dialog
-rw-r--r-- | noncore/settings/aqpkg/.cvsignore | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 3 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settings.ui | 872 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 237 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.h | 45 |
6 files changed, 239 insertions, 922 deletions
diff --git a/noncore/settings/aqpkg/.cvsignore b/noncore/settings/aqpkg/.cvsignore index 751040e..12658fc 100644 --- a/noncore/settings/aqpkg/.cvsignore +++ b/noncore/settings/aqpkg/.cvsignore @@ -2,7 +2,5 @@ Makefile* instoptions.cpp instoptions.h moc* -settings.cpp -settings.h categoryfilter.cpp categoryfilter.h diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro index d3f898b..f66fd95 100644 --- a/noncore/settings/aqpkg/aqpkg.pro +++ b/noncore/settings/aqpkg/aqpkg.pro @@ -32,8 +32,7 @@ SOURCES = mainwin.cpp \ inputdlg.cpp \ version.cpp \ categoryfilterimpl.cpp -INTERFACES = settings.ui \ - instoptions.ui \ +INTERFACES = instoptions.ui \ categoryfilter.ui TARGET = aqpkg INCLUDEPATH += $(OPIEDIR)/include diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 947aace..361946c 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp @@ -345,7 +345,7 @@ void MainWindow :: setDocument( const QString &doc ) void MainWindow :: displaySettings() { SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); - if ( dlg->showDlg( 0 ) ) + if ( dlg->showDlg() ) { stack->raiseWidget( progressWindow ); updateData(); diff --git a/noncore/settings/aqpkg/settings.ui b/noncore/settings/aqpkg/settings.ui deleted file mode 100644 index 2db0768..0000000 --- a/noncore/settings/aqpkg/settings.ui +++ b/dev/null @@ -1,872 +0,0 @@ -<!DOCTYPE UI><UI> -<class>SettingsBase</class> -<widget> - <class>QDialog</class> - <property stdset="1"> - <name>name</name> - <cstring>Settings</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>238</width> - <height>353</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Configuration</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QTabWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>TabWidget</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Servers</string> - </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout2</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>Servers</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Servers</string> - </property> - </widget> - <spacer> - <property> - <name>name</name> - <cstring>Spacer2</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </hbox> - </widget> - <widget row="1" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout8</cstring> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" rowspan="1" colspan="2" > - <class>QListBox</class> - <property stdset="1"> - <name>name</name> - <cstring>servers</cstring> - </property> - <property stdset="1"> - <name>selectionMode</name> - <enum>Extended</enum> - </property> - </widget> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout6</cstring> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="2" column="1" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>active</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Active Server</string> - </property> - </widget> - <widget row="0" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_3</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Name:</string> - </property> - </widget> - <widget row="1" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel2_3</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>URL:</string> - </property> - </widget> - <widget row="0" column="1" > - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>servername</cstring> - </property> - </widget> - <widget row="1" column="1" > - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>serverurl</cstring> - </property> - </widget> - <widget row="3" column="1" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnChangeServer</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Change</string> - </property> - </widget> - </grid> - </widget> - <widget row="1" column="1" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>removeserver</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Remove</string> - </property> - <property stdset="1"> - <name>autoDefault</name> - <bool>false</bool> - </property> - </widget> - <widget row="1" column="0" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>newserver</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>New</string> - </property> - <property stdset="1"> - <name>autoDefault</name> - <bool>false</bool> - </property> - </widget> - </grid> - </widget> - </grid> - </widget> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Destinations</string> - </attribute> - <grid> - <property stdset="1"> - <name>margin</name> - <number>11</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout3</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>Destinations</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Destinations</string> - </property> - </widget> - <spacer> - <property> - <name>name</name> - <cstring>Spacer2_2</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </hbox> - </widget> - <widget row="2" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout5</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>newdestination</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>New</string> - </property> - <property stdset="1"> - <name>autoDefault</name> - <bool>false</bool> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>removedestination</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Remove</string> - </property> - <property stdset="1"> - <name>autoDefault</name> - <bool>false</bool> - </property> - </widget> - </hbox> - </widget> - <spacer row="0" column="0" > - <property> - <name>name</name> - <cstring>Spacer3</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - <widget row="1" column="0" > - <class>QListBox</class> - <property stdset="1"> - <name>name</name> - <cstring>destinations</cstring> - </property> - <property stdset="1"> - <name>selectionMode</name> - <enum>Single</enum> - </property> - </widget> - <widget row="3" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout13</cstring> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="1" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_3_2_2</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>URL:</string> - </property> - </widget> - <widget row="3" column="1" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnChangeDest</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Change</string> - </property> - </widget> - <widget row="0" column="1" > - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>destinationname</cstring> - </property> - </widget> - <widget row="0" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_3_2</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Name:</string> - </property> - </widget> - <widget row="2" column="1" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>linkToRoot</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Link To Root</string> - </property> - <property stdset="1"> - <name>checked</name> - <bool>true</bool> - </property> - </widget> - <widget row="1" column="1" > - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>destinationurl</cstring> - </property> - </widget> - </grid> - </widget> - </grid> - </widget> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>Proxies</string> - </attribute> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1_2</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>1</x> - <y>19</y> - <width>67</width> - <height>22</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>HTTP Proxy</string> - </property> - </widget> - <widget> - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>txtFtpProxy</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>72</y> - <width>110</width> - <height>22</height> - </rect> - </property> - </widget> - <widget> - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>txtHttpProxy</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>19</y> - <width>110</width> - <height>22</height> - </rect> - </property> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel4</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>1</x> - <y>153</y> - <width>67</width> - <height>22</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Password</string> - </property> - </widget> - <widget> - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>txtUsername</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>125</y> - <width>110</width> - <height>22</height> - </rect> - </property> - </widget> - <widget> - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>txtPassword</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>153</y> - <width>110</width> - <height>22</height> - </rect> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>chkFtpProxyEnabled</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>100</y> - <width>110</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Enabled</string> - </property> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel2</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>1</x> - <y>72</y> - <width>67</width> - <height>22</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>FTP Proxy</string> - </property> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel3</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>1</x> - <y>125</y> - <width>67</width> - <height>22</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Username</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>chkHttpProxyEnabled</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>47</y> - <width>110</width> - <height>19</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Enabled</string> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnProxyApply</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>74</x> - <y>181</y> - <width>110</width> - <height>28</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>&Apply</string> - </property> - </widget> - </widget> - <widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>tab</cstring> - </property> - <attribute> - <name>title</name> - <string>General</string> - </attribute> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>TextLabel1</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>20</x> - <y>30</y> - <width>150</width> - <height>20</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>(Will take effect on restart)</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>jumpTo</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>17</x> - <y>14</y> - <width>150</width> - <height>20</height> - </rect> - </property> - <property stdset="1"> - <name>text</name> - <string>Show Jump To Letters</string> - </property> - </widget> - </widget> - </widget> - </grid> -</widget> -<connections> - <connection> - <sender>newserver</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>newServer()</slot> - </connection> - <connection> - <sender>removeserver</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>removeServer()</slot> - </connection> - <connection> - <sender>newdestination</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>newDestination()</slot> - </connection> - <connection> - <sender>removedestination</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>removeDestination()</slot> - </connection> - <connection> - <sender>servers</sender> - <signal>highlighted(int)</signal> - <receiver>Settings</receiver> - <slot>editServer(int)</slot> - </connection> - <connection> - <sender>destinations</sender> - <signal>highlighted(int)</signal> - <receiver>Settings</receiver> - <slot>editDestination(int)</slot> - </connection> - <connection> - <sender>btnChangeServer</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>changeServerDetails()</slot> - </connection> - <connection> - <sender>btnChangeDest</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>changeDestinationDetails()</slot> - </connection> - <connection> - <sender>jumpTo</sender> - <signal>toggled(bool)</signal> - <receiver>Settings</receiver> - <slot>toggleJumpTo(bool)</slot> - </connection> - <connection> - <sender>btnProxyApply</sender> - <signal>clicked()</signal> - <receiver>Settings</receiver> - <slot>proxyApplyChanges()</slot> - </connection> - <slot access="public">activeServerChanged()</slot> - <slot access="public">changeDestinationDetails()</slot> - <slot access="public">changeServerDetails()</slot> - <slot access="public">createLinksToDest()</slot> - <slot access="public">destNameChanged(const QString&)</slot> - <slot access="public">destUrlChanged(const QString&)</slot> - <slot access="public">editDestination(int)</slot> - <slot access="public">editServer(int)</slot> - <slot access="public">installationSettingChange(int)</slot> - <slot access="public">installationSettingSetName(const QString &)</slot> - <slot access="public">linkEnabled(bool)</slot> - <slot access="public">newDestination()</slot> - <slot access="public">newInstallationSetting()</slot> - <slot access="public">newServer()</slot> - <slot access="public">proxyApplyChanges()</slot> - <slot access="public">removeDestination()</slot> - <slot access="public">removeInstallationSetting()</slot> - <slot access="public">removeLinksToDest()</slot> - <slot access="public">removeServer()</slot> - <slot access="public">renameInstallationSetting()</slot> - <slot access="public">serverNameChanged(const QString&)</slot> - <slot access="public">serverUrlChanged(const QString&)</slot> - <slot access="public">toggleJumpTo(bool)</slot> -</connections> -<tabstops> - <tabstop>servers</tabstop> - <tabstop>newserver</tabstop> - <tabstop>removeserver</tabstop> - <tabstop>servername</tabstop> - <tabstop>serverurl</tabstop> - <tabstop>active</tabstop> - <tabstop>btnChangeServer</tabstop> - <tabstop>TabWidget</tabstop> - <tabstop>destinations</tabstop> - <tabstop>newdestination</tabstop> - <tabstop>removedestination</tabstop> - <tabstop>destinationname</tabstop> - <tabstop>destinationurl</tabstop> - <tabstop>linkToRoot</tabstop> - <tabstop>btnChangeDest</tabstop> - <tabstop>jumpTo</tabstop> -</tabstops> -</UI> diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 4bb928a..c5a55d2 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp @@ -19,14 +19,19 @@ #include <algorithm> using namespace std; -#include <qlistbox.h> +#include <qcheckbox.h> +#include <qgroupbox.h> +#include <qlabel.h> +#include <qlayout.h> #include <qlineedit.h> +#include <qlistbox.h> #include <qpushbutton.h> -#include <qtabwidget.h> -#include <qcheckbox.h> + +#include <opie/otabwidget.h> #ifdef QWS #include <qpe/config.h> +#include <qpe/resource.h> #endif #include "settingsimpl.h" @@ -34,10 +39,25 @@ using namespace std; #include "global.h" SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) - : SettingsBase( parent, name, modal, fl ) + : QDialog( parent, name, modal, fl ) { + setCaption( tr( "Configuration" ) ); + + // Setup layout to make everything pretty + QVBoxLayout *layout = new QVBoxLayout( this ); + layout->setMargin( 2 ); + layout->setSpacing( 4 ); + + // Setup tabs for all info + OTabWidget *tabwidget = new OTabWidget( this ); + layout->addWidget( tabwidget ); + + tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); + tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); + tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); + tabwidget->setCurrentTab( tr( "Servers" ) ); + dataMgr = dataManager; - setupData(); changed = false; newserver = false; @@ -49,9 +69,8 @@ SettingsImpl :: ~SettingsImpl() } -bool SettingsImpl :: showDlg( int i ) +bool SettingsImpl :: showDlg() { - TabWidget->setCurrentPage( i ); showMaximized(); exec(); @@ -61,6 +80,177 @@ bool SettingsImpl :: showDlg( int i ) return changed; } +QWidget *SettingsImpl :: initServerTab() +{ + QWidget *control = new QWidget( this ); + + QVBoxLayout *vb = new QVBoxLayout( control ); + + QScrollView *sv = new QScrollView( control ); + vb->addWidget( sv, 0, 0 ); + sv->setResizePolicy( QScrollView::AutoOneFit ); + sv->setFrameStyle( QFrame::NoFrame ); + + QWidget *container = new QWidget( sv->viewport() ); + sv->addChild( container ); + + QGridLayout *layout = new QGridLayout( container ); + layout->setSpacing( 2 ); + layout->setMargin( 4 ); + + servers = new QListBox( container ); + servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); + connect( servers, SIGNAL( highlighted( int ) ), this, SLOT( editServer( int ) ) ); + layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); + + QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); + connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); + layout->addWidget( btn, 1, 0 ); + + btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); + connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); + layout->addWidget( btn, 1, 1 ); + + QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); + + QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); + + QLabel *label = new QLabel( tr( "Name:" ), grpbox ); + grplayout->addWidget( label, 0, 0 ); + servername = new QLineEdit( grpbox ); + grplayout->addWidget( servername, 0, 1 ); + + label = new QLabel( tr( "Address:" ), grpbox ); + grplayout->addWidget( label, 1, 0 ); + serverurl = new QLineEdit( grpbox ); + grplayout->addWidget( serverurl, 1, 1 ); + + active = new QCheckBox( tr( "Active Server" ), grpbox ); + grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); + + btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); + connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); + grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); + + return control; +} + +QWidget *SettingsImpl :: initDestinationTab() +{ + QWidget *control = new QWidget( this ); + + QVBoxLayout *vb = new QVBoxLayout( control ); + + QScrollView *sv = new QScrollView( control ); + vb->addWidget( sv, 0, 0 ); + sv->setResizePolicy( QScrollView::AutoOneFit ); + sv->setFrameStyle( QFrame::NoFrame ); + + QWidget *container = new QWidget( sv->viewport() ); + sv->addChild( container ); + + QGridLayout *layout = new QGridLayout( container ); + layout->setSpacing( 2 ); + layout->setMargin( 4 ); + + destinations = new QListBox( container ); + destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); + connect( destinations, SIGNAL( highlighted( int ) ), this, SLOT( editDestination( int ) ) ); + layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); + + QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); + connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); + layout->addWidget( btn, 1, 0 ); + + btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); + connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); + layout->addWidget( btn, 1, 1 ); + + QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); + + QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); + + QLabel *label = new QLabel( tr( "Name:" ), grpbox ); + grplayout->addWidget( label, 0, 0 ); + destinationname = new QLineEdit( grpbox ); + grplayout->addWidget( destinationname, 0, 1 ); + + label = new QLabel( tr( "Location:" ), grpbox ); + grplayout->addWidget( label, 1, 0 ); + destinationurl = new QLineEdit( grpbox ); + grplayout->addWidget( destinationurl, 1, 1 ); + + linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); + grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); + + btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); + connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); + grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); + + return control; +} + +QWidget *SettingsImpl :: initProxyTab() +{ + QWidget *control = new QWidget( this ); + + QVBoxLayout *vb = new QVBoxLayout( control ); + + QScrollView *sv = new QScrollView( control ); + vb->addWidget( sv, 0, 0 ); + sv->setResizePolicy( QScrollView::AutoOneFit ); + sv->setFrameStyle( QFrame::NoFrame ); + + QWidget *container = new QWidget( sv->viewport() ); + sv->addChild( container ); + + QGridLayout *layout = new QGridLayout( container ); + layout->setSpacing( 2 ); + layout->setMargin( 4 ); + + QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); + QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); + txtHttpProxy = new QLineEdit( grpbox ); + grplayout->addWidget( txtHttpProxy ); + chkHttpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); + grplayout->addWidget( chkHttpProxyEnabled ); + + grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); + grpbox->layout()->setSpacing( 2 ); + grpbox->layout()->setMargin( 4 ); + layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); + grplayout = new QVBoxLayout( grpbox->layout() ); + txtFtpProxy = new QLineEdit( grpbox ); + grplayout->addWidget( txtFtpProxy ); + chkFtpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); + grplayout->addWidget( chkFtpProxyEnabled ); + + QLabel *label = new QLabel( tr( "Username:" ), container ); + layout->addWidget( label, 2, 0 ); + txtUsername = new QLineEdit( container ); + layout->addWidget( txtUsername, 2, 1 ); + + label = new QLabel( tr( "Password:" ), container ); + layout->addWidget( label, 3, 0 ); + txtPassword = new QLineEdit( container ); + layout->addWidget( txtPassword, 3, 1 ); + + QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), container ); + connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); + layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); + + return control; +} + void SettingsImpl :: setupData() { // add servers @@ -73,20 +263,12 @@ void SettingsImpl :: setupData() servers->insertItem( it->getServerName() ); } + // add destinations vector<Destination>::iterator it2; for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) destinations->insertItem( it2->getDestinationName() ); - - // setup general tab -#ifdef QWS - Config cfg( "aqpkg" ); - cfg.setGroup( "settings" ); - jumpTo->setChecked( cfg.readBoolEntry( "showJumpTo", "true" ) ); -#else - jumpTo->setChecked( true ); -#endif - + // setup proxy tab txtHttpProxy->setText( dataMgr->getHttpProxy() ); txtFtpProxy->setText( dataMgr->getFtpProxy() ); @@ -100,7 +282,7 @@ void SettingsImpl :: setupData() void SettingsImpl :: editServer( int sel ) { - currentSelectedServer = sel; + currentSelectedServer = sel; vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); serverName = s->getServerName(); servername->setText( s->getServerName() ); @@ -110,10 +292,10 @@ void SettingsImpl :: editServer( int sel ) void SettingsImpl :: newServer() { - newserver = true; - servername->setText( "" ); - serverurl->setText( "" ); - servername->setFocus(); + newserver = true; + servername->setText( "" ); + serverurl->setText( "" ); + servername->setFocus(); active->setChecked( true ); } @@ -242,17 +424,6 @@ void SettingsImpl :: changeDestinationDetails() } } -//------------------ General tab ---------------------- - -void SettingsImpl :: toggleJumpTo( bool val ) -{ -#ifdef QWS - Config cfg( "aqpkg" ); - cfg.setGroup( "settings" ); - cfg.writeEntry( "showJumpTo", val ); -#endif -} - //------------------ Proxy tab ---------------------- void SettingsImpl :: proxyApplyChanges() { diff --git a/noncore/settings/aqpkg/settingsimpl.h b/noncore/settings/aqpkg/settingsimpl.h index bb027dc..9ffc259 100644 --- a/noncore/settings/aqpkg/settingsimpl.h +++ b/noncore/settings/aqpkg/settingsimpl.h @@ -15,19 +15,39 @@ * * ***************************************************************************/ -#include "settings.h" - #include "datamgr.h" -class SettingsImpl : public SettingsBase +#include <qdialog.h> + +class QCheckBox; +class QLineEdit; +class QListBox; + +class SettingsImpl : public QDialog { + Q_OBJECT public: SettingsImpl( DataManager *dataManager, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~SettingsImpl(); - bool showDlg( int i ); + bool showDlg(); private: + QListBox *servers; + QLineEdit *servername; + QLineEdit *serverurl; + QCheckBox *active; + QListBox *destinations; + QLineEdit *destinationname; + QLineEdit *destinationurl; + QCheckBox *linkToRoot; + QLineEdit *txtHttpProxy; + QCheckBox *chkHttpProxyEnabled; + QLineEdit *txtFtpProxy; + QCheckBox *chkFtpProxyEnabled; + QLineEdit *txtUsername; + QLineEdit *txtPassword; + DataManager *dataMgr; QString serverName; QString destinationName; @@ -37,20 +57,21 @@ private: bool newserver; bool newdestination; + QWidget *initServerTab(); + QWidget *initDestinationTab(); + QWidget *initProxyTab(); + void setupConnections(); void setupData(); +public slots: void editServer( int s ); void changeServerDetails(); - void newServer(); - void removeServer(); - + void newServer(); + void removeServer(); void editDestination( int s ); void changeDestinationDetails(); - void newDestination(); - void removeDestination(); - - void toggleJumpTo( bool val ); - + void newDestination(); + void removeDestination(); void proxyApplyChanges(); }; |