author | drw <drw> | 2003-02-04 17:52:14 (UTC) |
---|---|---|
committer | drw <drw> | 2003-02-04 17:52:14 (UTC) |
commit | 294f0a9b5e5678a6eba1fb77943201fac804049f (patch) (unidiff) | |
tree | b37638264f6bd22bb0894025ea70037294f15c9d | |
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 | |||
@@ -1,8 +1,6 @@ | |||
1 | Makefile* | 1 | Makefile* |
2 | instoptions.cpp | 2 | instoptions.cpp |
3 | instoptions.h | 3 | instoptions.h |
4 | moc* | 4 | moc* |
5 | settings.cpp | ||
6 | settings.h | ||
7 | categoryfilter.cpp | 5 | categoryfilter.cpp |
8 | categoryfilter.h | 6 | 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 | |||
@@ -1,63 +1,62 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | HEADERS = global.h \ | 3 | HEADERS = global.h \ |
4 | mainwin.h \ | 4 | mainwin.h \ |
5 | datamgr.h \ | 5 | datamgr.h \ |
6 | settingsimpl.h \ | 6 | settingsimpl.h \ |
7 | ipkg.h \ | 7 | ipkg.h \ |
8 | package.h \ | 8 | package.h \ |
9 | installdlgimpl.h \ | 9 | installdlgimpl.h \ |
10 | instoptionsimpl.h \ | 10 | instoptionsimpl.h \ |
11 | destination.h \ | 11 | destination.h \ |
12 | utils.h \ | 12 | utils.h \ |
13 | server.h \ | 13 | server.h \ |
14 | helpwindow.h \ | 14 | helpwindow.h \ |
15 | letterpushbutton.h \ | 15 | letterpushbutton.h \ |
16 | inputdlg.h \ | 16 | inputdlg.h \ |
17 | categoryfilterimpl.h | 17 | categoryfilterimpl.h |
18 | SOURCES = mainwin.cpp \ | 18 | SOURCES = mainwin.cpp \ |
19 | datamgr.cpp \ | 19 | datamgr.cpp \ |
20 | mem.cpp \ | 20 | mem.cpp \ |
21 | settingsimpl.cpp \ | 21 | settingsimpl.cpp \ |
22 | ipkg.cpp \ | 22 | ipkg.cpp \ |
23 | main.cpp \ | 23 | main.cpp \ |
24 | package.cpp \ | 24 | package.cpp \ |
25 | installdlgimpl.cpp \ | 25 | installdlgimpl.cpp \ |
26 | instoptionsimpl.cpp \ | 26 | instoptionsimpl.cpp \ |
27 | destination.cpp \ | 27 | destination.cpp \ |
28 | utils.cpp \ | 28 | utils.cpp \ |
29 | server.cpp \ | 29 | server.cpp \ |
30 | helpwindow.cpp \ | 30 | helpwindow.cpp \ |
31 | letterpushbutton.cpp \ | 31 | letterpushbutton.cpp \ |
32 | inputdlg.cpp \ | 32 | inputdlg.cpp \ |
33 | version.cpp \ | 33 | version.cpp \ |
34 | categoryfilterimpl.cpp | 34 | categoryfilterimpl.cpp |
35 | INTERFACES= settings.ui \ | 35 | INTERFACES= instoptions.ui \ |
36 | instoptions.ui \ | ||
37 | categoryfilter.ui | 36 | categoryfilter.ui |
38 | TARGET = aqpkg | 37 | TARGET = aqpkg |
39 | INCLUDEPATH += $(OPIEDIR)/include | 38 | INCLUDEPATH += $(OPIEDIR)/include |
40 | DEPENDPATH += $(OPIEDIR)/include | 39 | DEPENDPATH += $(OPIEDIR)/include |
41 | LIBS += -lqpe -lopie -lstdc++ | 40 | LIBS += -lqpe -lopie -lstdc++ |
42 | DESTDIR = $(OPIEDIR)/bin | 41 | DESTDIR = $(OPIEDIR)/bin |
43 | 42 | ||
44 | TRANSLATIONS = ../../../i18n/de/aqpkg.ts \ | 43 | TRANSLATIONS = ../../../i18n/de/aqpkg.ts \ |
45 | ../../../i18n/xx/aqpkg.ts \ | 44 | ../../../i18n/xx/aqpkg.ts \ |
46 | ../../../i18n/en/aqpkg.ts \ | 45 | ../../../i18n/en/aqpkg.ts \ |
47 | ../../../i18n/es/aqpkg.ts \ | 46 | ../../../i18n/es/aqpkg.ts \ |
48 | ../../../i18n/fr/aqpkg.ts \ | 47 | ../../../i18n/fr/aqpkg.ts \ |
49 | ../../../i18n/hu/aqpkg.ts \ | 48 | ../../../i18n/hu/aqpkg.ts \ |
50 | ../../../i18n/ja/aqpkg.ts \ | 49 | ../../../i18n/ja/aqpkg.ts \ |
51 | ../../../i18n/ko/aqpkg.ts \ | 50 | ../../../i18n/ko/aqpkg.ts \ |
52 | ../../../i18n/no/aqpkg.ts \ | 51 | ../../../i18n/no/aqpkg.ts \ |
53 | ../../../i18n/pl/aqpkg.ts \ | 52 | ../../../i18n/pl/aqpkg.ts \ |
54 | ../../../i18n/pt/aqpkg.ts \ | 53 | ../../../i18n/pt/aqpkg.ts \ |
55 | ../../../i18n/pt_BR/aqpkg.ts \ | 54 | ../../../i18n/pt_BR/aqpkg.ts \ |
56 | ../../../i18n/sl/aqpkg.ts \ | 55 | ../../../i18n/sl/aqpkg.ts \ |
57 | ../../../i18n/zh_CN/aqpkg.ts \ | 56 | ../../../i18n/zh_CN/aqpkg.ts \ |
58 | ../../../i18n/zh_TW/aqpkg.ts \ | 57 | ../../../i18n/zh_TW/aqpkg.ts \ |
59 | ../../../i18n/it/aqpkg.ts \ | 58 | ../../../i18n/it/aqpkg.ts \ |
60 | ../../../i18n/da/aqpkg.ts | 59 | ../../../i18n/da/aqpkg.ts |
61 | 60 | ||
62 | 61 | ||
63 | include ( $(OPIEDIR)/include.pro ) | 62 | include ( $(OPIEDIR)/include.pro ) |
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 | |||
@@ -92,513 +92,513 @@ MainWindow :: MainWindow() | |||
92 | 92 | ||
93 | char text[2]; | 93 | char text[2]; |
94 | text[1] = '\0'; | 94 | text[1] = '\0'; |
95 | for ( int i = 0 ; i < 26 ; ++i ) | 95 | for ( int i = 0 ; i < 26 ; ++i ) |
96 | { | 96 | { |
97 | text[0] = 'A' + i; | 97 | text[0] = 'A' + i; |
98 | LetterPushButton *b = new LetterPushButton( text, w ); | 98 | LetterPushButton *b = new LetterPushButton( text, w ); |
99 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); | 99 | connect( b, SIGNAL( released( QString ) ), this, SLOT( letterPushed( QString ) ) ); |
100 | layout->addWidget( b, i / 13, i % 13); | 100 | layout->addWidget( b, i / 13, i % 13); |
101 | } | 101 | } |
102 | 102 | ||
103 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); | 103 | QAction *a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, w, 0 ); |
104 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); | 104 | a->setWhatsThis( tr( "Click here to hide the Quick Jump toolbar." ) ); |
105 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); | 105 | connect( a, SIGNAL( activated() ), this, SLOT( hideJumpBar() ) ); |
106 | a->addTo( jumpBar ); | 106 | a->addTo( jumpBar ); |
107 | jumpBar->hide(); | 107 | jumpBar->hide(); |
108 | 108 | ||
109 | // Packages menu | 109 | // Packages menu |
110 | QPopupMenu *popup = new QPopupMenu( this ); | 110 | QPopupMenu *popup = new QPopupMenu( this ); |
111 | 111 | ||
112 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); | 112 | a = new QAction( tr( "Update lists" ), Resource::loadPixmap( "aqpkg/update" ), QString::null, 0, this, 0 ); |
113 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); | 113 | a->setWhatsThis( tr( "Click here to update package lists from servers." ) ); |
114 | connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); | 114 | connect( a, SIGNAL( activated() ), this, SLOT( updateServer() ) ); |
115 | a->addTo( popup ); | 115 | a->addTo( popup ); |
116 | a->addTo( bar ); | 116 | a->addTo( bar ); |
117 | 117 | ||
118 | actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); | 118 | actionUpgrade = new QAction( tr( "Upgrade" ), Resource::loadPixmap( "aqpkg/upgrade" ), QString::null, 0, this, 0 ); |
119 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); | 119 | actionUpgrade->setWhatsThis( tr( "Click here to upgrade all installed packages if a newer version is available." ) ); |
120 | connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) ); | 120 | connect( actionUpgrade, SIGNAL( activated() ), this, SLOT( upgradePackages() ) ); |
121 | actionUpgrade->addTo( popup ); | 121 | actionUpgrade->addTo( popup ); |
122 | actionUpgrade->addTo( bar ); | 122 | actionUpgrade->addTo( bar ); |
123 | 123 | ||
124 | iconDownload = Resource::loadPixmap( "aqpkg/download" ); | 124 | iconDownload = Resource::loadPixmap( "aqpkg/download" ); |
125 | iconRemove = Resource::loadPixmap( "aqpkg/remove" ); | 125 | iconRemove = Resource::loadPixmap( "aqpkg/remove" ); |
126 | actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); | 126 | actionDownload = new QAction( tr( "Download" ), iconDownload, QString::null, 0, this, 0 ); |
127 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); | 127 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); |
128 | connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) ); | 128 | connect( actionDownload, SIGNAL( activated() ), this, SLOT( downloadPackage() ) ); |
129 | actionDownload->addTo( popup ); | 129 | actionDownload->addTo( popup ); |
130 | actionDownload->addTo( bar ); | 130 | actionDownload->addTo( bar ); |
131 | 131 | ||
132 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); | 132 | a = new QAction( tr( "Apply changes" ), Resource::loadPixmap( "aqpkg/apply" ), QString::null, 0, this, 0 ); |
133 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); | 133 | a->setWhatsThis( tr( "Click here to install, remove or upgrade currently selected package(s)." ) ); |
134 | connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) ); | 134 | connect( a, SIGNAL( activated() ), this, SLOT( applyChanges() ) ); |
135 | a->addTo( popup ); | 135 | a->addTo( popup ); |
136 | a->addTo( bar ); | 136 | a->addTo( bar ); |
137 | 137 | ||
138 | mb->insertItem( tr( "Actions" ), popup ); | 138 | mb->insertItem( tr( "Actions" ), popup ); |
139 | 139 | ||
140 | // View menu | 140 | // View menu |
141 | popup = new QPopupMenu( this ); | 141 | popup = new QPopupMenu( this ); |
142 | 142 | ||
143 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); | 143 | actionUninstalled = new QAction( tr( "Show packages not installed" ), QString::null, 0, this, 0 ); |
144 | actionUninstalled->setToggleAction( TRUE ); | 144 | actionUninstalled->setToggleAction( TRUE ); |
145 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); | 145 | actionUninstalled->setWhatsThis( tr( "Click here to show packages available which have not been installed." ) ); |
146 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); | 146 | connect( actionUninstalled, SIGNAL( activated() ), this, SLOT( filterUninstalledPackages() ) ); |
147 | actionUninstalled->addTo( popup ); | 147 | actionUninstalled->addTo( popup ); |
148 | 148 | ||
149 | actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); | 149 | actionInstalled = new QAction( tr( "Show installed packages" ), QString::null, 0, this, 0 ); |
150 | actionInstalled->setToggleAction( TRUE ); | 150 | actionInstalled->setToggleAction( TRUE ); |
151 | actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); | 151 | actionInstalled->setWhatsThis( tr( "Click here to show packages currently installed on this device." ) ); |
152 | connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); | 152 | connect( actionInstalled, SIGNAL( activated() ), this, SLOT( filterInstalledPackages() ) ); |
153 | actionInstalled->addTo( popup ); | 153 | actionInstalled->addTo( popup ); |
154 | 154 | ||
155 | actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); | 155 | actionUpdated = new QAction( tr( "Show updated packages" ), QString::null, 0, this, 0 ); |
156 | actionUpdated->setToggleAction( TRUE ); | 156 | actionUpdated->setToggleAction( TRUE ); |
157 | actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); | 157 | actionUpdated->setWhatsThis( tr( "Click here to show packages currently installed on this device which have a newer version available." ) ); |
158 | connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); | 158 | connect( actionUpdated, SIGNAL( activated() ), this, SLOT( filterUpgradedPackages() ) ); |
159 | actionUpdated->addTo( popup ); | 159 | actionUpdated->addTo( popup ); |
160 | 160 | ||
161 | popup->insertSeparator(); | 161 | popup->insertSeparator(); |
162 | 162 | ||
163 | actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); | 163 | actionFilter = new QAction( tr( "Filter by category" ), Resource::loadPixmap( "aqpkg/filter" ), QString::null, 0, this, 0 ); |
164 | actionFilter->setToggleAction( TRUE ); | 164 | actionFilter->setToggleAction( TRUE ); |
165 | actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); | 165 | actionFilter->setWhatsThis( tr( "Click here to list packages belonging to one category." ) ); |
166 | connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); | 166 | connect( actionFilter, SIGNAL( activated() ), this, SLOT( filterCategory() ) ); |
167 | actionFilter->addTo( popup ); | 167 | actionFilter->addTo( popup ); |
168 | 168 | ||
169 | a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); | 169 | a = new QAction( tr( "Set filter category" ), QString::null, 0, this, 0 ); |
170 | a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); | 170 | a->setWhatsThis( tr( "Click here to change package category to used filter." ) ); |
171 | connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); | 171 | connect( a, SIGNAL( activated() ), this, SLOT( setFilterCategory() ) ); |
172 | a->addTo( popup ); | 172 | a->addTo( popup ); |
173 | 173 | ||
174 | popup->insertSeparator(); | 174 | popup->insertSeparator(); |
175 | 175 | ||
176 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 176 | a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
177 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); | 177 | a->setWhatsThis( tr( "Click here to search for text in package names." ) ); |
178 | connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) ); | 178 | connect( a, SIGNAL( activated() ), this, SLOT( displayFindBar() ) ); |
179 | a->addTo( popup ); | 179 | a->addTo( popup ); |
180 | 180 | ||
181 | actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); | 181 | actionFindNext = new QAction( tr( "Find next" ), Resource::loadIconSet( "next" ), QString::null, 0, this, 0 ); |
182 | actionFindNext->setEnabled( FALSE ); | 182 | actionFindNext->setEnabled( FALSE ); |
183 | actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); | 183 | actionFindNext->setWhatsThis( tr( "Click here to find the next package name containing the text you are searching for." ) ); |
184 | connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) ); | 184 | connect( actionFindNext, SIGNAL( activated() ), this, SLOT( repeatFind() ) ); |
185 | actionFindNext->addTo( popup ); | 185 | actionFindNext->addTo( popup ); |
186 | actionFindNext->addTo( findBar ); | 186 | actionFindNext->addTo( findBar ); |
187 | 187 | ||
188 | 188 | ||
189 | popup->insertSeparator(); | 189 | popup->insertSeparator(); |
190 | 190 | ||
191 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); | 191 | a = new QAction( tr( "Quick Jump keypad" ), Resource::loadPixmap( "aqpkg/keyboard" ), QString::null, 0, this, 0 ); |
192 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); | 192 | a->setWhatsThis( tr( "Click here to display/hide keypad to allow quick movement through the package list." ) ); |
193 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); | 193 | connect( a, SIGNAL( activated() ), this, SLOT( displayJumpBar() ) ); |
194 | a->addTo( popup ); | 194 | a->addTo( popup ); |
195 | 195 | ||
196 | mb->insertItem( tr( "View" ), popup ); | 196 | mb->insertItem( tr( "View" ), popup ); |
197 | 197 | ||
198 | 198 | ||
199 | // Options menu | 199 | // Options menu |
200 | popup = new QPopupMenu( this ); | 200 | popup = new QPopupMenu( this ); |
201 | 201 | ||
202 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "aqpkg/config" ), QString::null, 0, this, 0 ); | 202 | a = new QAction( tr( "Configure" ), Resource::loadPixmap( "aqpkg/config" ), QString::null, 0, this, 0 ); |
203 | a->setWhatsThis( tr( "Click here to configure this application." ) ); | 203 | a->setWhatsThis( tr( "Click here to configure this application." ) ); |
204 | connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); | 204 | connect( a, SIGNAL( activated() ), this, SLOT( displaySettings() ) ); |
205 | a->addTo( popup ); | 205 | a->addTo( popup ); |
206 | 206 | ||
207 | popup->insertSeparator(); | 207 | popup->insertSeparator(); |
208 | 208 | ||
209 | a = new QAction( tr( "Help" ), Resource::loadPixmap( "help_icon" ), QString::null, 0, this, 0 ); | 209 | a = new QAction( tr( "Help" ), Resource::loadPixmap( "help_icon" ), QString::null, 0, this, 0 ); |
210 | a->setWhatsThis( tr( "Click here for help." ) ); | 210 | a->setWhatsThis( tr( "Click here for help." ) ); |
211 | connect( a, SIGNAL( activated() ), this, SLOT( displayHelp() ) ); | 211 | connect( a, SIGNAL( activated() ), this, SLOT( displayHelp() ) ); |
212 | a->addTo( popup ); | 212 | a->addTo( popup ); |
213 | 213 | ||
214 | a = new QAction( tr( "About" ), Resource::loadPixmap( "UtilsIcon" ), QString::null, 0, this, 0 ); | 214 | a = new QAction( tr( "About" ), Resource::loadPixmap( "UtilsIcon" ), QString::null, 0, this, 0 ); |
215 | a->setWhatsThis( tr( "Click here for software version information." ) ); | 215 | a->setWhatsThis( tr( "Click here for software version information." ) ); |
216 | connect( a, SIGNAL( activated() ), this, SLOT( displayAbout() ) ); | 216 | connect( a, SIGNAL( activated() ), this, SLOT( displayAbout() ) ); |
217 | a->addTo( popup ); | 217 | a->addTo( popup ); |
218 | 218 | ||
219 | mb->insertItem( tr( "Options" ), popup ); | 219 | mb->insertItem( tr( "Options" ), popup ); |
220 | 220 | ||
221 | // Finish find toolbar creation | 221 | // Finish find toolbar creation |
222 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 222 | a = new QAction( QString::null, Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
223 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); | 223 | a->setWhatsThis( tr( "Click here to hide the find toolbar." ) ); |
224 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); | 224 | connect( a, SIGNAL( activated() ), this, SLOT( hideFindBar() ) ); |
225 | a->addTo( findBar ); | 225 | a->addTo( findBar ); |
226 | findBar->hide(); | 226 | findBar->hide(); |
227 | 227 | ||
228 | // Create widget stack and add UI widgets | 228 | // Create widget stack and add UI widgets |
229 | stack = new QWidgetStack( this ); | 229 | stack = new QWidgetStack( this ); |
230 | stack->addWidget( progressWindow, 2 ); | 230 | stack->addWidget( progressWindow, 2 ); |
231 | stack->addWidget( networkPkgWindow, 1 ); | 231 | stack->addWidget( networkPkgWindow, 1 ); |
232 | setCentralWidget( stack ); | 232 | setCentralWidget( stack ); |
233 | stack->raiseWidget( progressWindow ); | 233 | stack->raiseWidget( progressWindow ); |
234 | 234 | ||
235 | // Delayed call to finish initialization | 235 | // Delayed call to finish initialization |
236 | QTimer::singleShot( 100, this, SLOT( init() ) ); | 236 | QTimer::singleShot( 100, this, SLOT( init() ) ); |
237 | } | 237 | } |
238 | 238 | ||
239 | MainWindow :: ~MainWindow() | 239 | MainWindow :: ~MainWindow() |
240 | { | 240 | { |
241 | delete mgr; | 241 | delete mgr; |
242 | } | 242 | } |
243 | 243 | ||
244 | void MainWindow :: initMainWidget() | 244 | void MainWindow :: initMainWidget() |
245 | { | 245 | { |
246 | networkPkgWindow = new QWidget( this ); | 246 | networkPkgWindow = new QWidget( this ); |
247 | 247 | ||
248 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); | 248 | QLabel *l = new QLabel( tr( "Servers:" ), networkPkgWindow ); |
249 | 249 | ||
250 | serversList = new QComboBox( networkPkgWindow ); | 250 | serversList = new QComboBox( networkPkgWindow ); |
251 | connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); | 251 | connect( serversList, SIGNAL( activated( int ) ), this, SLOT( serverSelected( int ) ) ); |
252 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); | 252 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); |
253 | 253 | ||
254 | installedIcon = Resource::loadPixmap( "aqpkg/installed" ); | 254 | installedIcon = Resource::loadPixmap( "aqpkg/installed" ); |
255 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); | 255 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); |
256 | 256 | ||
257 | packagesList = new QListView( networkPkgWindow ); | 257 | packagesList = new QListView( networkPkgWindow ); |
258 | packagesList->addColumn( tr( "Packages" ), 225 ); | 258 | packagesList->addColumn( tr( "Packages" ), 225 ); |
259 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); | 259 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); |
260 | 260 | ||
261 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); | 261 | QVBoxLayout *vbox = new QVBoxLayout( networkPkgWindow, 0, -1 ); |
262 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); | 262 | QHBoxLayout *hbox1 = new QHBoxLayout( vbox, -1 ); |
263 | hbox1->addWidget( l ); | 263 | hbox1->addWidget( l ); |
264 | hbox1->addWidget( serversList ); | 264 | hbox1->addWidget( serversList ); |
265 | 265 | ||
266 | vbox->addWidget( packagesList ); | 266 | vbox->addWidget( packagesList ); |
267 | 267 | ||
268 | downloadEnabled = TRUE; | 268 | downloadEnabled = TRUE; |
269 | } | 269 | } |
270 | 270 | ||
271 | void MainWindow :: initProgressWidget() | 271 | void MainWindow :: initProgressWidget() |
272 | { | 272 | { |
273 | progressWindow = new QWidget( this ); | 273 | progressWindow = new QWidget( this ); |
274 | 274 | ||
275 | QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 ); | 275 | QVBoxLayout *layout = new QVBoxLayout( progressWindow, 4, 4 ); |
276 | 276 | ||
277 | m_status = new QLabel( progressWindow ); | 277 | m_status = new QLabel( progressWindow ); |
278 | m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); | 278 | m_status->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); |
279 | layout->addWidget( m_status ); | 279 | layout->addWidget( m_status ); |
280 | 280 | ||
281 | m_progress = new QProgressBar( progressWindow ); | 281 | m_progress = new QProgressBar( progressWindow ); |
282 | layout->addWidget( m_progress ); | 282 | layout->addWidget( m_progress ); |
283 | } | 283 | } |
284 | 284 | ||
285 | void MainWindow :: init() | 285 | void MainWindow :: init() |
286 | { | 286 | { |
287 | #ifdef QWS | 287 | #ifdef QWS |
288 | // read download directory from config file | 288 | // read download directory from config file |
289 | Config cfg( "aqpkg" ); | 289 | Config cfg( "aqpkg" ); |
290 | cfg.setGroup( "settings" ); | 290 | cfg.setGroup( "settings" ); |
291 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); | 291 | currentlySelectedServer = cfg.readEntry( "selectedServer", "local" ); |
292 | // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); | 292 | // showJumpTo = cfg.readBoolEntry( "showJumpTo", "true" ); |
293 | 293 | ||
294 | #endif | 294 | #endif |
295 | 295 | ||
296 | stack->raiseWidget( progressWindow ); | 296 | stack->raiseWidget( progressWindow ); |
297 | 297 | ||
298 | mgr = new DataManager(); | 298 | mgr = new DataManager(); |
299 | connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); | 299 | connect( mgr, SIGNAL( progressSetSteps( int ) ), this, SLOT( setProgressSteps( int ) ) ); |
300 | connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), | 300 | connect( mgr, SIGNAL( progressSetMessage( const QString & ) ), |
301 | this, SLOT( setProgressMessage( const QString & ) ) ); | 301 | this, SLOT( setProgressMessage( const QString & ) ) ); |
302 | connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); | 302 | connect( mgr, SIGNAL( progressUpdate( int ) ), this, SLOT( updateProgress( int ) ) ); |
303 | mgr->loadServers(); | 303 | mgr->loadServers(); |
304 | 304 | ||
305 | showUninstalledPkgs = false; | 305 | showUninstalledPkgs = false; |
306 | showInstalledPkgs = false; | 306 | showInstalledPkgs = false; |
307 | showUpgradedPkgs = false; | 307 | showUpgradedPkgs = false; |
308 | categoryFilterEnabled = false; | 308 | categoryFilterEnabled = false; |
309 | 309 | ||
310 | updateData(); | 310 | updateData(); |
311 | 311 | ||
312 | stack->raiseWidget( networkPkgWindow ); | 312 | stack->raiseWidget( networkPkgWindow ); |
313 | } | 313 | } |
314 | /* | 314 | /* |
315 | void MainWindow :: setDocument( const QString &doc ) | 315 | void MainWindow :: setDocument( const QString &doc ) |
316 | { | 316 | { |
317 | // Remove path from package | 317 | // Remove path from package |
318 | QString package = Utils::getPackageNameFromIpkFilename( doc ); | 318 | QString package = Utils::getPackageNameFromIpkFilename( doc ); |
319 | // std::cout << "Selecting package " << package << std::endl; | 319 | // std::cout << "Selecting package " << package << std::endl; |
320 | 320 | ||
321 | // First select local server | 321 | // First select local server |
322 | for ( int i = 0 ; i < serversList->count() ; ++i ) | 322 | for ( int i = 0 ; i < serversList->count() ; ++i ) |
323 | { | 323 | { |
324 | if ( serversList->text( i ) == LOCAL_IPKGS ) | 324 | if ( serversList->text( i ) == LOCAL_IPKGS ) |
325 | { | 325 | { |
326 | serversList->setCurrentItem( i ); | 326 | serversList->setCurrentItem( i ); |
327 | break; | 327 | break; |
328 | } | 328 | } |
329 | } | 329 | } |
330 | serverSelected( 0 ); | 330 | serverSelected( 0 ); |
331 | 331 | ||
332 | // Now set the check box of the selected package | 332 | // Now set the check box of the selected package |
333 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); | 333 | for ( QCheckListItem *item = (QCheckListItem *)packagesList->firstChild(); |
334 | item != 0 ; | 334 | item != 0 ; |
335 | item = (QCheckListItem *)item->nextSibling() ) | 335 | item = (QCheckListItem *)item->nextSibling() ) |
336 | { | 336 | { |
337 | if ( item->text().startsWith( package ) ) | 337 | if ( item->text().startsWith( package ) ) |
338 | { | 338 | { |
339 | item->setOn( true ); | 339 | item->setOn( true ); |
340 | break; | 340 | break; |
341 | } | 341 | } |
342 | } | 342 | } |
343 | } | 343 | } |
344 | */ | 344 | */ |
345 | void MainWindow :: displaySettings() | 345 | void MainWindow :: displaySettings() |
346 | { | 346 | { |
347 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); | 347 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); |
348 | if ( dlg->showDlg( 0 ) ) | 348 | if ( dlg->showDlg() ) |
349 | { | 349 | { |
350 | stack->raiseWidget( progressWindow ); | 350 | stack->raiseWidget( progressWindow ); |
351 | updateData(); | 351 | updateData(); |
352 | stack->raiseWidget( networkPkgWindow ); | 352 | stack->raiseWidget( networkPkgWindow ); |
353 | } | 353 | } |
354 | delete dlg; | 354 | delete dlg; |
355 | } | 355 | } |
356 | 356 | ||
357 | void MainWindow :: displayHelp() | 357 | void MainWindow :: displayHelp() |
358 | { | 358 | { |
359 | HelpWindow *dlg = new HelpWindow( this ); | 359 | HelpWindow *dlg = new HelpWindow( this ); |
360 | dlg->exec(); | 360 | dlg->exec(); |
361 | delete dlg; | 361 | delete dlg; |
362 | } | 362 | } |
363 | 363 | ||
364 | void MainWindow :: displayFindBar() | 364 | void MainWindow :: displayFindBar() |
365 | { | 365 | { |
366 | findBar->show(); | 366 | findBar->show(); |
367 | findEdit->setFocus(); | 367 | findEdit->setFocus(); |
368 | } | 368 | } |
369 | 369 | ||
370 | void MainWindow :: displayJumpBar() | 370 | void MainWindow :: displayJumpBar() |
371 | { | 371 | { |
372 | jumpBar->show(); | 372 | jumpBar->show(); |
373 | } | 373 | } |
374 | 374 | ||
375 | void MainWindow :: repeatFind() | 375 | void MainWindow :: repeatFind() |
376 | { | 376 | { |
377 | searchForPackage( findEdit->text() ); | 377 | searchForPackage( findEdit->text() ); |
378 | } | 378 | } |
379 | 379 | ||
380 | void MainWindow :: findPackage( const QString &text ) | 380 | void MainWindow :: findPackage( const QString &text ) |
381 | { | 381 | { |
382 | actionFindNext->setEnabled( !text.isEmpty() ); | 382 | actionFindNext->setEnabled( !text.isEmpty() ); |
383 | searchForPackage( text ); | 383 | searchForPackage( text ); |
384 | } | 384 | } |
385 | 385 | ||
386 | void MainWindow :: hideFindBar() | 386 | void MainWindow :: hideFindBar() |
387 | { | 387 | { |
388 | findBar->hide(); | 388 | findBar->hide(); |
389 | } | 389 | } |
390 | 390 | ||
391 | void MainWindow :: hideJumpBar() | 391 | void MainWindow :: hideJumpBar() |
392 | { | 392 | { |
393 | jumpBar->hide(); | 393 | jumpBar->hide(); |
394 | } | 394 | } |
395 | 395 | ||
396 | void MainWindow :: displayAbout() | 396 | void MainWindow :: displayAbout() |
397 | { | 397 | { |
398 | QMessageBox::about( this, tr( "About AQPkg" ), tr( VERSION_TEXT ) ); | 398 | QMessageBox::about( this, tr( "About AQPkg" ), tr( VERSION_TEXT ) ); |
399 | } | 399 | } |
400 | 400 | ||
401 | void MainWindow :: filterUninstalledPackages() | 401 | void MainWindow :: filterUninstalledPackages() |
402 | { | 402 | { |
403 | showUninstalledPkgs = actionUninstalled->isOn(); | 403 | showUninstalledPkgs = actionUninstalled->isOn(); |
404 | if ( showUninstalledPkgs ) | 404 | if ( showUninstalledPkgs ) |
405 | { | 405 | { |
406 | showInstalledPkgs = FALSE; | 406 | showInstalledPkgs = FALSE; |
407 | showUpgradedPkgs = FALSE; | 407 | showUpgradedPkgs = FALSE; |
408 | } | 408 | } |
409 | serverSelected( -1 ); | 409 | serverSelected( -1 ); |
410 | 410 | ||
411 | actionInstalled->setOn( FALSE ); | 411 | actionInstalled->setOn( FALSE ); |
412 | actionUpdated->setOn( FALSE ); | 412 | actionUpdated->setOn( FALSE ); |
413 | } | 413 | } |
414 | 414 | ||
415 | void MainWindow :: filterInstalledPackages() | 415 | void MainWindow :: filterInstalledPackages() |
416 | { | 416 | { |
417 | showInstalledPkgs = actionInstalled->isOn(); | 417 | showInstalledPkgs = actionInstalled->isOn(); |
418 | if ( showInstalledPkgs ) | 418 | if ( showInstalledPkgs ) |
419 | { | 419 | { |
420 | showUninstalledPkgs = FALSE; | 420 | showUninstalledPkgs = FALSE; |
421 | showUpgradedPkgs = FALSE; | 421 | showUpgradedPkgs = FALSE; |
422 | } | 422 | } |
423 | serverSelected( -1 ); | 423 | serverSelected( -1 ); |
424 | 424 | ||
425 | actionUninstalled->setOn( FALSE ); | 425 | actionUninstalled->setOn( FALSE ); |
426 | actionUpdated->setOn( FALSE ); | 426 | actionUpdated->setOn( FALSE ); |
427 | } | 427 | } |
428 | 428 | ||
429 | void MainWindow :: filterUpgradedPackages() | 429 | void MainWindow :: filterUpgradedPackages() |
430 | { | 430 | { |
431 | showUpgradedPkgs = actionUpdated->isOn(); | 431 | showUpgradedPkgs = actionUpdated->isOn(); |
432 | if ( showUpgradedPkgs ) | 432 | if ( showUpgradedPkgs ) |
433 | { | 433 | { |
434 | showUninstalledPkgs = FALSE; | 434 | showUninstalledPkgs = FALSE; |
435 | showInstalledPkgs = FALSE; | 435 | showInstalledPkgs = FALSE; |
436 | } | 436 | } |
437 | serverSelected( -1 ); | 437 | serverSelected( -1 ); |
438 | 438 | ||
439 | actionUninstalled->setOn( FALSE ); | 439 | actionUninstalled->setOn( FALSE ); |
440 | actionInstalled->setOn( FALSE ); | 440 | actionInstalled->setOn( FALSE ); |
441 | } | 441 | } |
442 | 442 | ||
443 | bool MainWindow :: setFilterCategory() | 443 | bool MainWindow :: setFilterCategory() |
444 | { | 444 | { |
445 | // Get categories; | 445 | // Get categories; |
446 | CategoryFilterImpl dlg( DataManager::getAvailableCategories(), categoryFilter, this ); | 446 | CategoryFilterImpl dlg( DataManager::getAvailableCategories(), categoryFilter, this ); |
447 | if ( dlg.exec() == QDialog::Accepted ) | 447 | if ( dlg.exec() == QDialog::Accepted ) |
448 | { | 448 | { |
449 | categoryFilter = dlg.getSelectedFilter(); | 449 | categoryFilter = dlg.getSelectedFilter(); |
450 | 450 | ||
451 | if ( categoryFilter == "" ) | 451 | if ( categoryFilter == "" ) |
452 | return false; | 452 | return false; |
453 | 453 | ||
454 | categoryFilterEnabled = true; | 454 | categoryFilterEnabled = true; |
455 | serverSelected( -1 ); | 455 | serverSelected( -1 ); |
456 | actionFilter->setOn( TRUE ); | 456 | actionFilter->setOn( TRUE ); |
457 | return true; | 457 | return true; |
458 | } | 458 | } |
459 | 459 | ||
460 | return false; | 460 | return false; |
461 | } | 461 | } |
462 | 462 | ||
463 | void MainWindow :: filterCategory() | 463 | void MainWindow :: filterCategory() |
464 | { | 464 | { |
465 | if ( !actionFilter->isOn() ) | 465 | if ( !actionFilter->isOn() ) |
466 | { | 466 | { |
467 | filterByCategory( FALSE ); | 467 | filterByCategory( FALSE ); |
468 | } | 468 | } |
469 | else | 469 | else |
470 | { | 470 | { |
471 | actionFilter->setOn( filterByCategory( TRUE ) ); | 471 | actionFilter->setOn( filterByCategory( TRUE ) ); |
472 | } | 472 | } |
473 | } | 473 | } |
474 | 474 | ||
475 | bool MainWindow :: filterByCategory( bool val ) | 475 | bool MainWindow :: filterByCategory( bool val ) |
476 | { | 476 | { |
477 | if ( val ) | 477 | if ( val ) |
478 | { | 478 | { |
479 | if ( categoryFilter == "" ) | 479 | if ( categoryFilter == "" ) |
480 | { | 480 | { |
481 | if ( !setFilterCategory() ) | 481 | if ( !setFilterCategory() ) |
482 | return false; | 482 | return false; |
483 | } | 483 | } |
484 | 484 | ||
485 | categoryFilterEnabled = true; | 485 | categoryFilterEnabled = true; |
486 | serverSelected( -1 ); | 486 | serverSelected( -1 ); |
487 | return true; | 487 | return true; |
488 | } | 488 | } |
489 | else | 489 | else |
490 | { | 490 | { |
491 | // Turn off filter | 491 | // Turn off filter |
492 | categoryFilterEnabled = false; | 492 | categoryFilterEnabled = false; |
493 | serverSelected( -1 ); | 493 | serverSelected( -1 ); |
494 | return false; | 494 | return false; |
495 | } | 495 | } |
496 | } | 496 | } |
497 | 497 | ||
498 | void MainWindow :: raiseMainWidget() | 498 | void MainWindow :: raiseMainWidget() |
499 | { | 499 | { |
500 | stack->raiseWidget( networkPkgWindow ); | 500 | stack->raiseWidget( networkPkgWindow ); |
501 | } | 501 | } |
502 | 502 | ||
503 | void MainWindow :: raiseProgressWidget() | 503 | void MainWindow :: raiseProgressWidget() |
504 | { | 504 | { |
505 | stack->raiseWidget( progressWindow ); | 505 | stack->raiseWidget( progressWindow ); |
506 | } | 506 | } |
507 | 507 | ||
508 | void MainWindow :: enableUpgrade( bool enabled ) | 508 | void MainWindow :: enableUpgrade( bool enabled ) |
509 | { | 509 | { |
510 | actionUpgrade->setEnabled( enabled ); | 510 | actionUpgrade->setEnabled( enabled ); |
511 | } | 511 | } |
512 | 512 | ||
513 | void MainWindow :: enableDownload( bool enabled ) | 513 | void MainWindow :: enableDownload( bool enabled ) |
514 | { | 514 | { |
515 | if ( enabled ) | 515 | if ( enabled ) |
516 | { | 516 | { |
517 | actionDownload->setIconSet( iconDownload ); | 517 | actionDownload->setIconSet( iconDownload ); |
518 | actionDownload->setText( tr( "Download" ) ); | 518 | actionDownload->setText( tr( "Download" ) ); |
519 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); | 519 | actionDownload->setWhatsThis( tr( "Click here to download the currently selected package(s)." ) ); |
520 | } | 520 | } |
521 | else | 521 | else |
522 | { | 522 | { |
523 | actionDownload->setIconSet( iconRemove ); | 523 | actionDownload->setIconSet( iconRemove ); |
524 | actionDownload->setText( tr( "Remove" ) ); | 524 | actionDownload->setText( tr( "Remove" ) ); |
525 | actionDownload->setWhatsThis( tr( "Click here to uninstall the currently selected package(s)." ) ); | 525 | actionDownload->setWhatsThis( tr( "Click here to uninstall the currently selected package(s)." ) ); |
526 | } | 526 | } |
527 | } | 527 | } |
528 | 528 | ||
529 | void MainWindow :: setProgressSteps( int numsteps ) | 529 | void MainWindow :: setProgressSteps( int numsteps ) |
530 | { | 530 | { |
531 | m_progress->setTotalSteps( numsteps ); | 531 | m_progress->setTotalSteps( numsteps ); |
532 | } | 532 | } |
533 | 533 | ||
534 | void MainWindow :: setProgressMessage( const QString &msg ) | 534 | void MainWindow :: setProgressMessage( const QString &msg ) |
535 | { | 535 | { |
536 | m_status->setText( msg ); | 536 | m_status->setText( msg ); |
537 | } | 537 | } |
538 | 538 | ||
539 | void MainWindow :: updateProgress( int progress ) | 539 | void MainWindow :: updateProgress( int progress ) |
540 | { | 540 | { |
541 | m_progress->setProgress( progress ); | 541 | m_progress->setProgress( progress ); |
542 | } | 542 | } |
543 | 543 | ||
544 | void MainWindow :: updateData() | 544 | void MainWindow :: updateData() |
545 | { | 545 | { |
546 | m_progress->setTotalSteps( mgr->getServerList().size() ); | 546 | m_progress->setTotalSteps( mgr->getServerList().size() ); |
547 | 547 | ||
548 | serversList->clear(); | 548 | serversList->clear(); |
549 | packagesList->clear(); | 549 | packagesList->clear(); |
550 | 550 | ||
551 | vector<Server>::iterator it; | 551 | vector<Server>::iterator it; |
552 | int activeItem = -1; | 552 | int activeItem = -1; |
553 | int i; | 553 | int i; |
554 | QString serverName; | 554 | QString serverName; |
555 | for ( i = 0, it = mgr->getServerList().begin() ; it != mgr->getServerList().end() ; ++it, ++i ) | 555 | for ( i = 0, it = mgr->getServerList().begin() ; it != mgr->getServerList().end() ; ++it, ++i ) |
556 | { | 556 | { |
557 | serverName = it->getServerName(); | 557 | serverName = it->getServerName(); |
558 | m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) ); | 558 | m_status->setText( tr( "Building server list:\n\t%1" ).arg( serverName ) ); |
559 | m_progress->setProgress( i ); | 559 | m_progress->setProgress( i ); |
560 | qApp->processEvents(); | 560 | qApp->processEvents(); |
561 | 561 | ||
562 | // cout << "Adding " << it->getServerName() << " to combobox" << endl; | 562 | // cout << "Adding " << it->getServerName() << " to combobox" << endl; |
563 | if ( !it->isServerActive() ) | 563 | if ( !it->isServerActive() ) |
564 | { | 564 | { |
565 | // cout << serverName << " is not active" << endl; | 565 | // cout << serverName << " is not active" << endl; |
566 | i--; | 566 | i--; |
567 | continue; | 567 | continue; |
568 | } | 568 | } |
569 | 569 | ||
570 | serversList->insertItem( serverName ); | 570 | serversList->insertItem( serverName ); |
571 | if ( serverName == currentlySelectedServer ) | 571 | if ( serverName == currentlySelectedServer ) |
572 | activeItem = i; | 572 | activeItem = i; |
573 | } | 573 | } |
574 | 574 | ||
575 | // set selected server to be active server | 575 | // set selected server to be active server |
576 | if ( activeItem != -1 ) | 576 | if ( activeItem != -1 ) |
577 | serversList->setCurrentItem( activeItem ); | 577 | serversList->setCurrentItem( activeItem ); |
578 | serverSelected( 0, FALSE ); | 578 | serverSelected( 0, FALSE ); |
579 | } | 579 | } |
580 | 580 | ||
581 | void MainWindow :: serverSelected( int index ) | 581 | void MainWindow :: serverSelected( int index ) |
582 | { | 582 | { |
583 | serverSelected( index, TRUE ); | 583 | serverSelected( index, TRUE ); |
584 | } | 584 | } |
585 | 585 | ||
586 | void MainWindow :: serverSelected( int, bool raiseProgress ) | 586 | void MainWindow :: serverSelected( int, bool raiseProgress ) |
587 | { | 587 | { |
588 | QPixmap nullIcon( installedIcon.size() ); | 588 | QPixmap nullIcon( installedIcon.size() ); |
589 | nullIcon.fill( colorGroup().base() ); | 589 | nullIcon.fill( colorGroup().base() ); |
590 | 590 | ||
591 | // display packages | 591 | // display packages |
592 | QString serverName = serversList->currentText(); | 592 | QString serverName = serversList->currentText(); |
593 | currentlySelectedServer = serverName; | 593 | currentlySelectedServer = serverName; |
594 | 594 | ||
595 | vector<Server>::iterator s = mgr->getServer( serverName ); | 595 | vector<Server>::iterator s = mgr->getServer( serverName ); |
596 | 596 | ||
597 | vector<Package> &list = s->getPackageList(); | 597 | vector<Package> &list = s->getPackageList(); |
598 | vector<Package>::iterator it; | 598 | vector<Package>::iterator it; |
599 | 599 | ||
600 | // Display progress widget while loading list | 600 | // Display progress widget while loading list |
601 | bool doProgress = ( list.size() > 200 ); | 601 | bool doProgress = ( list.size() > 200 ); |
602 | if ( doProgress ) | 602 | if ( doProgress ) |
603 | { | 603 | { |
604 | if ( raiseProgress ) | 604 | if ( raiseProgress ) |
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 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>SettingsBase</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>Settings</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>238</width> | ||
15 | <height>353</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Configuration</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <grid> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>11</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>6</number> | ||
36 | </property> | ||
37 | <widget row="0" column="0" > | ||
38 | <class>QTabWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>TabWidget</cstring> | ||
42 | </property> | ||
43 | <property stdset="1"> | ||
44 | <name>enabled</name> | ||
45 | <bool>true</bool> | ||
46 | </property> | ||
47 | <property> | ||
48 | <name>layoutMargin</name> | ||
49 | </property> | ||
50 | <property> | ||
51 | <name>layoutSpacing</name> | ||
52 | </property> | ||
53 | <widget> | ||
54 | <class>QWidget</class> | ||
55 | <property stdset="1"> | ||
56 | <name>name</name> | ||
57 | <cstring>tab</cstring> | ||
58 | </property> | ||
59 | <attribute> | ||
60 | <name>title</name> | ||
61 | <string>Servers</string> | ||
62 | </attribute> | ||
63 | <grid> | ||
64 | <property stdset="1"> | ||
65 | <name>margin</name> | ||
66 | <number>11</number> | ||
67 | </property> | ||
68 | <property stdset="1"> | ||
69 | <name>spacing</name> | ||
70 | <number>6</number> | ||
71 | </property> | ||
72 | <widget row="0" column="0" > | ||
73 | <class>QLayoutWidget</class> | ||
74 | <property stdset="1"> | ||
75 | <name>name</name> | ||
76 | <cstring>Layout2</cstring> | ||
77 | </property> | ||
78 | <hbox> | ||
79 | <property stdset="1"> | ||
80 | <name>margin</name> | ||
81 | <number>0</number> | ||
82 | </property> | ||
83 | <property stdset="1"> | ||
84 | <name>spacing</name> | ||
85 | <number>6</number> | ||
86 | </property> | ||
87 | <widget> | ||
88 | <class>QLabel</class> | ||
89 | <property stdset="1"> | ||
90 | <name>name</name> | ||
91 | <cstring>Servers</cstring> | ||
92 | </property> | ||
93 | <property stdset="1"> | ||
94 | <name>text</name> | ||
95 | <string>Servers</string> | ||
96 | </property> | ||
97 | </widget> | ||
98 | <spacer> | ||
99 | <property> | ||
100 | <name>name</name> | ||
101 | <cstring>Spacer2</cstring> | ||
102 | </property> | ||
103 | <property stdset="1"> | ||
104 | <name>orientation</name> | ||
105 | <enum>Horizontal</enum> | ||
106 | </property> | ||
107 | <property stdset="1"> | ||
108 | <name>sizeType</name> | ||
109 | <enum>Expanding</enum> | ||
110 | </property> | ||
111 | <property> | ||
112 | <name>sizeHint</name> | ||
113 | <size> | ||
114 | <width>20</width> | ||
115 | <height>20</height> | ||
116 | </size> | ||
117 | </property> | ||
118 | </spacer> | ||
119 | </hbox> | ||
120 | </widget> | ||
121 | <widget row="1" column="0" > | ||
122 | <class>QLayoutWidget</class> | ||
123 | <property stdset="1"> | ||
124 | <name>name</name> | ||
125 | <cstring>Layout8</cstring> | ||
126 | </property> | ||
127 | <grid> | ||
128 | <property stdset="1"> | ||
129 | <name>margin</name> | ||
130 | <number>0</number> | ||
131 | </property> | ||
132 | <property stdset="1"> | ||
133 | <name>spacing</name> | ||
134 | <number>6</number> | ||
135 | </property> | ||
136 | <widget row="0" column="0" rowspan="1" colspan="2" > | ||
137 | <class>QListBox</class> | ||
138 | <property stdset="1"> | ||
139 | <name>name</name> | ||
140 | <cstring>servers</cstring> | ||
141 | </property> | ||
142 | <property stdset="1"> | ||
143 | <name>selectionMode</name> | ||
144 | <enum>Extended</enum> | ||
145 | </property> | ||
146 | </widget> | ||
147 | <widget row="2" column="0" rowspan="1" colspan="2" > | ||
148 | <class>QLayoutWidget</class> | ||
149 | <property stdset="1"> | ||
150 | <name>name</name> | ||
151 | <cstring>Layout6</cstring> | ||
152 | </property> | ||
153 | <grid> | ||
154 | <property stdset="1"> | ||
155 | <name>margin</name> | ||
156 | <number>0</number> | ||
157 | </property> | ||
158 | <property stdset="1"> | ||
159 | <name>spacing</name> | ||
160 | <number>6</number> | ||
161 | </property> | ||
162 | <widget row="2" column="1" > | ||
163 | <class>QCheckBox</class> | ||
164 | <property stdset="1"> | ||
165 | <name>name</name> | ||
166 | <cstring>active</cstring> | ||
167 | </property> | ||
168 | <property stdset="1"> | ||
169 | <name>text</name> | ||
170 | <string>Active Server</string> | ||
171 | </property> | ||
172 | </widget> | ||
173 | <widget row="0" column="0" > | ||
174 | <class>QLabel</class> | ||
175 | <property stdset="1"> | ||
176 | <name>name</name> | ||
177 | <cstring>TextLabel1_3</cstring> | ||
178 | </property> | ||
179 | <property stdset="1"> | ||
180 | <name>text</name> | ||
181 | <string>Name:</string> | ||
182 | </property> | ||
183 | </widget> | ||
184 | <widget row="1" column="0" > | ||
185 | <class>QLabel</class> | ||
186 | <property stdset="1"> | ||
187 | <name>name</name> | ||
188 | <cstring>TextLabel2_3</cstring> | ||
189 | </property> | ||
190 | <property stdset="1"> | ||
191 | <name>text</name> | ||
192 | <string>URL:</string> | ||
193 | </property> | ||
194 | </widget> | ||
195 | <widget row="0" column="1" > | ||
196 | <class>QLineEdit</class> | ||
197 | <property stdset="1"> | ||
198 | <name>name</name> | ||
199 | <cstring>servername</cstring> | ||
200 | </property> | ||
201 | </widget> | ||
202 | <widget row="1" column="1" > | ||
203 | <class>QLineEdit</class> | ||
204 | <property stdset="1"> | ||
205 | <name>name</name> | ||
206 | <cstring>serverurl</cstring> | ||
207 | </property> | ||
208 | </widget> | ||
209 | <widget row="3" column="1" > | ||
210 | <class>QPushButton</class> | ||
211 | <property stdset="1"> | ||
212 | <name>name</name> | ||
213 | <cstring>btnChangeServer</cstring> | ||
214 | </property> | ||
215 | <property stdset="1"> | ||
216 | <name>text</name> | ||
217 | <string>Change</string> | ||
218 | </property> | ||
219 | </widget> | ||
220 | </grid> | ||
221 | </widget> | ||
222 | <widget row="1" column="1" > | ||
223 | <class>QPushButton</class> | ||
224 | <property stdset="1"> | ||
225 | <name>name</name> | ||
226 | <cstring>removeserver</cstring> | ||
227 | </property> | ||
228 | <property stdset="1"> | ||
229 | <name>enabled</name> | ||
230 | <bool>true</bool> | ||
231 | </property> | ||
232 | <property stdset="1"> | ||
233 | <name>text</name> | ||
234 | <string>Remove</string> | ||
235 | </property> | ||
236 | <property stdset="1"> | ||
237 | <name>autoDefault</name> | ||
238 | <bool>false</bool> | ||
239 | </property> | ||
240 | </widget> | ||
241 | <widget row="1" column="0" > | ||
242 | <class>QPushButton</class> | ||
243 | <property stdset="1"> | ||
244 | <name>name</name> | ||
245 | <cstring>newserver</cstring> | ||
246 | </property> | ||
247 | <property stdset="1"> | ||
248 | <name>enabled</name> | ||
249 | <bool>true</bool> | ||
250 | </property> | ||
251 | <property stdset="1"> | ||
252 | <name>text</name> | ||
253 | <string>New</string> | ||
254 | </property> | ||
255 | <property stdset="1"> | ||
256 | <name>autoDefault</name> | ||
257 | <bool>false</bool> | ||
258 | </property> | ||
259 | </widget> | ||
260 | </grid> | ||
261 | </widget> | ||
262 | </grid> | ||
263 | </widget> | ||
264 | <widget> | ||
265 | <class>QWidget</class> | ||
266 | <property stdset="1"> | ||
267 | <name>name</name> | ||
268 | <cstring>tab</cstring> | ||
269 | </property> | ||
270 | <attribute> | ||
271 | <name>title</name> | ||
272 | <string>Destinations</string> | ||
273 | </attribute> | ||
274 | <grid> | ||
275 | <property stdset="1"> | ||
276 | <name>margin</name> | ||
277 | <number>11</number> | ||
278 | </property> | ||
279 | <property stdset="1"> | ||
280 | <name>spacing</name> | ||
281 | <number>6</number> | ||
282 | </property> | ||
283 | <widget row="0" column="0" > | ||
284 | <class>QLayoutWidget</class> | ||
285 | <property stdset="1"> | ||
286 | <name>name</name> | ||
287 | <cstring>Layout3</cstring> | ||
288 | </property> | ||
289 | <hbox> | ||
290 | <property stdset="1"> | ||
291 | <name>margin</name> | ||
292 | <number>0</number> | ||
293 | </property> | ||
294 | <property stdset="1"> | ||
295 | <name>spacing</name> | ||
296 | <number>6</number> | ||
297 | </property> | ||
298 | <widget> | ||
299 | <class>QLabel</class> | ||
300 | <property stdset="1"> | ||
301 | <name>name</name> | ||
302 | <cstring>Destinations</cstring> | ||
303 | </property> | ||
304 | <property stdset="1"> | ||
305 | <name>text</name> | ||
306 | <string>Destinations</string> | ||
307 | </property> | ||
308 | </widget> | ||
309 | <spacer> | ||
310 | <property> | ||
311 | <name>name</name> | ||
312 | <cstring>Spacer2_2</cstring> | ||
313 | </property> | ||
314 | <property stdset="1"> | ||
315 | <name>orientation</name> | ||
316 | <enum>Horizontal</enum> | ||
317 | </property> | ||
318 | <property stdset="1"> | ||
319 | <name>sizeType</name> | ||
320 | <enum>Expanding</enum> | ||
321 | </property> | ||
322 | <property> | ||
323 | <name>sizeHint</name> | ||
324 | <size> | ||
325 | <width>20</width> | ||
326 | <height>20</height> | ||
327 | </size> | ||
328 | </property> | ||
329 | </spacer> | ||
330 | </hbox> | ||
331 | </widget> | ||
332 | <widget row="2" column="0" > | ||
333 | <class>QLayoutWidget</class> | ||
334 | <property stdset="1"> | ||
335 | <name>name</name> | ||
336 | <cstring>Layout5</cstring> | ||
337 | </property> | ||
338 | <hbox> | ||
339 | <property stdset="1"> | ||
340 | <name>margin</name> | ||
341 | <number>0</number> | ||
342 | </property> | ||
343 | <property stdset="1"> | ||
344 | <name>spacing</name> | ||
345 | <number>6</number> | ||
346 | </property> | ||
347 | <widget> | ||
348 | <class>QPushButton</class> | ||
349 | <property stdset="1"> | ||
350 | <name>name</name> | ||
351 | <cstring>newdestination</cstring> | ||
352 | </property> | ||
353 | <property stdset="1"> | ||
354 | <name>enabled</name> | ||
355 | <bool>true</bool> | ||
356 | </property> | ||
357 | <property stdset="1"> | ||
358 | <name>text</name> | ||
359 | <string>New</string> | ||
360 | </property> | ||
361 | <property stdset="1"> | ||
362 | <name>autoDefault</name> | ||
363 | <bool>false</bool> | ||
364 | </property> | ||
365 | </widget> | ||
366 | <widget> | ||
367 | <class>QPushButton</class> | ||
368 | <property stdset="1"> | ||
369 | <name>name</name> | ||
370 | <cstring>removedestination</cstring> | ||
371 | </property> | ||
372 | <property stdset="1"> | ||
373 | <name>enabled</name> | ||
374 | <bool>true</bool> | ||
375 | </property> | ||
376 | <property stdset="1"> | ||
377 | <name>text</name> | ||
378 | <string>Remove</string> | ||
379 | </property> | ||
380 | <property stdset="1"> | ||
381 | <name>autoDefault</name> | ||
382 | <bool>false</bool> | ||
383 | </property> | ||
384 | </widget> | ||
385 | </hbox> | ||
386 | </widget> | ||
387 | <spacer row="0" column="0" > | ||
388 | <property> | ||
389 | <name>name</name> | ||
390 | <cstring>Spacer3</cstring> | ||
391 | </property> | ||
392 | <property stdset="1"> | ||
393 | <name>orientation</name> | ||
394 | <enum>Horizontal</enum> | ||
395 | </property> | ||
396 | <property stdset="1"> | ||
397 | <name>sizeType</name> | ||
398 | <enum>Expanding</enum> | ||
399 | </property> | ||
400 | <property> | ||
401 | <name>sizeHint</name> | ||
402 | <size> | ||
403 | <width>20</width> | ||
404 | <height>20</height> | ||
405 | </size> | ||
406 | </property> | ||
407 | </spacer> | ||
408 | <widget row="1" column="0" > | ||
409 | <class>QListBox</class> | ||
410 | <property stdset="1"> | ||
411 | <name>name</name> | ||
412 | <cstring>destinations</cstring> | ||
413 | </property> | ||
414 | <property stdset="1"> | ||
415 | <name>selectionMode</name> | ||
416 | <enum>Single</enum> | ||
417 | </property> | ||
418 | </widget> | ||
419 | <widget row="3" column="0" > | ||
420 | <class>QLayoutWidget</class> | ||
421 | <property stdset="1"> | ||
422 | <name>name</name> | ||
423 | <cstring>Layout13</cstring> | ||
424 | </property> | ||
425 | <grid> | ||
426 | <property stdset="1"> | ||
427 | <name>margin</name> | ||
428 | <number>0</number> | ||
429 | </property> | ||
430 | <property stdset="1"> | ||
431 | <name>spacing</name> | ||
432 | <number>6</number> | ||
433 | </property> | ||
434 | <widget row="1" column="0" > | ||
435 | <class>QLabel</class> | ||
436 | <property stdset="1"> | ||
437 | <name>name</name> | ||
438 | <cstring>TextLabel1_3_2_2</cstring> | ||
439 | </property> | ||
440 | <property stdset="1"> | ||
441 | <name>text</name> | ||
442 | <string>URL:</string> | ||
443 | </property> | ||
444 | </widget> | ||
445 | <widget row="3" column="1" > | ||
446 | <class>QPushButton</class> | ||
447 | <property stdset="1"> | ||
448 | <name>name</name> | ||
449 | <cstring>btnChangeDest</cstring> | ||
450 | </property> | ||
451 | <property stdset="1"> | ||
452 | <name>text</name> | ||
453 | <string>Change</string> | ||
454 | </property> | ||
455 | </widget> | ||
456 | <widget row="0" column="1" > | ||
457 | <class>QLineEdit</class> | ||
458 | <property stdset="1"> | ||
459 | <name>name</name> | ||
460 | <cstring>destinationname</cstring> | ||
461 | </property> | ||
462 | </widget> | ||
463 | <widget row="0" column="0" > | ||
464 | <class>QLabel</class> | ||
465 | <property stdset="1"> | ||
466 | <name>name</name> | ||
467 | <cstring>TextLabel1_3_2</cstring> | ||
468 | </property> | ||
469 | <property stdset="1"> | ||
470 | <name>text</name> | ||
471 | <string>Name:</string> | ||
472 | </property> | ||
473 | </widget> | ||
474 | <widget row="2" column="1" > | ||
475 | <class>QCheckBox</class> | ||
476 | <property stdset="1"> | ||
477 | <name>name</name> | ||
478 | <cstring>linkToRoot</cstring> | ||
479 | </property> | ||
480 | <property stdset="1"> | ||
481 | <name>text</name> | ||
482 | <string>Link To Root</string> | ||
483 | </property> | ||
484 | <property stdset="1"> | ||
485 | <name>checked</name> | ||
486 | <bool>true</bool> | ||
487 | </property> | ||
488 | </widget> | ||
489 | <widget row="1" column="1" > | ||
490 | <class>QLineEdit</class> | ||
491 | <property stdset="1"> | ||
492 | <name>name</name> | ||
493 | <cstring>destinationurl</cstring> | ||
494 | </property> | ||
495 | </widget> | ||
496 | </grid> | ||
497 | </widget> | ||
498 | </grid> | ||
499 | </widget> | ||
500 | <widget> | ||
501 | <class>QWidget</class> | ||
502 | <property stdset="1"> | ||
503 | <name>name</name> | ||
504 | <cstring>tab</cstring> | ||
505 | </property> | ||
506 | <attribute> | ||
507 | <name>title</name> | ||
508 | <string>Proxies</string> | ||
509 | </attribute> | ||
510 | <widget> | ||
511 | <class>QLabel</class> | ||
512 | <property stdset="1"> | ||
513 | <name>name</name> | ||
514 | <cstring>TextLabel1_2</cstring> | ||
515 | </property> | ||
516 | <property stdset="1"> | ||
517 | <name>geometry</name> | ||
518 | <rect> | ||
519 | <x>1</x> | ||
520 | <y>19</y> | ||
521 | <width>67</width> | ||
522 | <height>22</height> | ||
523 | </rect> | ||
524 | </property> | ||
525 | <property stdset="1"> | ||
526 | <name>text</name> | ||
527 | <string>HTTP Proxy</string> | ||
528 | </property> | ||
529 | </widget> | ||
530 | <widget> | ||
531 | <class>QLineEdit</class> | ||
532 | <property stdset="1"> | ||
533 | <name>name</name> | ||
534 | <cstring>txtFtpProxy</cstring> | ||
535 | </property> | ||
536 | <property stdset="1"> | ||
537 | <name>geometry</name> | ||
538 | <rect> | ||
539 | <x>74</x> | ||
540 | <y>72</y> | ||
541 | <width>110</width> | ||
542 | <height>22</height> | ||
543 | </rect> | ||
544 | </property> | ||
545 | </widget> | ||
546 | <widget> | ||
547 | <class>QLineEdit</class> | ||
548 | <property stdset="1"> | ||
549 | <name>name</name> | ||
550 | <cstring>txtHttpProxy</cstring> | ||
551 | </property> | ||
552 | <property stdset="1"> | ||
553 | <name>geometry</name> | ||
554 | <rect> | ||
555 | <x>74</x> | ||
556 | <y>19</y> | ||
557 | <width>110</width> | ||
558 | <height>22</height> | ||
559 | </rect> | ||
560 | </property> | ||
561 | </widget> | ||
562 | <widget> | ||
563 | <class>QLabel</class> | ||
564 | <property stdset="1"> | ||
565 | <name>name</name> | ||
566 | <cstring>TextLabel4</cstring> | ||
567 | </property> | ||
568 | <property stdset="1"> | ||
569 | <name>geometry</name> | ||
570 | <rect> | ||
571 | <x>1</x> | ||
572 | <y>153</y> | ||
573 | <width>67</width> | ||
574 | <height>22</height> | ||
575 | </rect> | ||
576 | </property> | ||
577 | <property stdset="1"> | ||
578 | <name>text</name> | ||
579 | <string>Password</string> | ||
580 | </property> | ||
581 | </widget> | ||
582 | <widget> | ||
583 | <class>QLineEdit</class> | ||
584 | <property stdset="1"> | ||
585 | <name>name</name> | ||
586 | <cstring>txtUsername</cstring> | ||
587 | </property> | ||
588 | <property stdset="1"> | ||
589 | <name>geometry</name> | ||
590 | <rect> | ||
591 | <x>74</x> | ||
592 | <y>125</y> | ||
593 | <width>110</width> | ||
594 | <height>22</height> | ||
595 | </rect> | ||
596 | </property> | ||
597 | </widget> | ||
598 | <widget> | ||
599 | <class>QLineEdit</class> | ||
600 | <property stdset="1"> | ||
601 | <name>name</name> | ||
602 | <cstring>txtPassword</cstring> | ||
603 | </property> | ||
604 | <property stdset="1"> | ||
605 | <name>geometry</name> | ||
606 | <rect> | ||
607 | <x>74</x> | ||
608 | <y>153</y> | ||
609 | <width>110</width> | ||
610 | <height>22</height> | ||
611 | </rect> | ||
612 | </property> | ||
613 | </widget> | ||
614 | <widget> | ||
615 | <class>QCheckBox</class> | ||
616 | <property stdset="1"> | ||
617 | <name>name</name> | ||
618 | <cstring>chkFtpProxyEnabled</cstring> | ||
619 | </property> | ||
620 | <property stdset="1"> | ||
621 | <name>geometry</name> | ||
622 | <rect> | ||
623 | <x>74</x> | ||
624 | <y>100</y> | ||
625 | <width>110</width> | ||
626 | <height>19</height> | ||
627 | </rect> | ||
628 | </property> | ||
629 | <property stdset="1"> | ||
630 | <name>text</name> | ||
631 | <string>Enabled</string> | ||
632 | </property> | ||
633 | </widget> | ||
634 | <widget> | ||
635 | <class>QLabel</class> | ||
636 | <property stdset="1"> | ||
637 | <name>name</name> | ||
638 | <cstring>TextLabel2</cstring> | ||
639 | </property> | ||
640 | <property stdset="1"> | ||
641 | <name>geometry</name> | ||
642 | <rect> | ||
643 | <x>1</x> | ||
644 | <y>72</y> | ||
645 | <width>67</width> | ||
646 | <height>22</height> | ||
647 | </rect> | ||
648 | </property> | ||
649 | <property stdset="1"> | ||
650 | <name>text</name> | ||
651 | <string>FTP Proxy</string> | ||
652 | </property> | ||
653 | </widget> | ||
654 | <widget> | ||
655 | <class>QLabel</class> | ||
656 | <property stdset="1"> | ||
657 | <name>name</name> | ||
658 | <cstring>TextLabel3</cstring> | ||
659 | </property> | ||
660 | <property stdset="1"> | ||
661 | <name>geometry</name> | ||
662 | <rect> | ||
663 | <x>1</x> | ||
664 | <y>125</y> | ||
665 | <width>67</width> | ||
666 | <height>22</height> | ||
667 | </rect> | ||
668 | </property> | ||
669 | <property stdset="1"> | ||
670 | <name>text</name> | ||
671 | <string>Username</string> | ||
672 | </property> | ||
673 | </widget> | ||
674 | <widget> | ||
675 | <class>QCheckBox</class> | ||
676 | <property stdset="1"> | ||
677 | <name>name</name> | ||
678 | <cstring>chkHttpProxyEnabled</cstring> | ||
679 | </property> | ||
680 | <property stdset="1"> | ||
681 | <name>geometry</name> | ||
682 | <rect> | ||
683 | <x>74</x> | ||
684 | <y>47</y> | ||
685 | <width>110</width> | ||
686 | <height>19</height> | ||
687 | </rect> | ||
688 | </property> | ||
689 | <property stdset="1"> | ||
690 | <name>text</name> | ||
691 | <string>Enabled</string> | ||
692 | </property> | ||
693 | </widget> | ||
694 | <widget> | ||
695 | <class>QPushButton</class> | ||
696 | <property stdset="1"> | ||
697 | <name>name</name> | ||
698 | <cstring>btnProxyApply</cstring> | ||
699 | </property> | ||
700 | <property stdset="1"> | ||
701 | <name>geometry</name> | ||
702 | <rect> | ||
703 | <x>74</x> | ||
704 | <y>181</y> | ||
705 | <width>110</width> | ||
706 | <height>28</height> | ||
707 | </rect> | ||
708 | </property> | ||
709 | <property stdset="1"> | ||
710 | <name>text</name> | ||
711 | <string>&Apply</string> | ||
712 | </property> | ||
713 | </widget> | ||
714 | </widget> | ||
715 | <widget> | ||
716 | <class>QWidget</class> | ||
717 | <property stdset="1"> | ||
718 | <name>name</name> | ||
719 | <cstring>tab</cstring> | ||
720 | </property> | ||
721 | <attribute> | ||
722 | <name>title</name> | ||
723 | <string>General</string> | ||
724 | </attribute> | ||
725 | <widget> | ||
726 | <class>QLabel</class> | ||
727 | <property stdset="1"> | ||
728 | <name>name</name> | ||
729 | <cstring>TextLabel1</cstring> | ||
730 | </property> | ||
731 | <property stdset="1"> | ||
732 | <name>geometry</name> | ||
733 | <rect> | ||
734 | <x>20</x> | ||
735 | <y>30</y> | ||
736 | <width>150</width> | ||
737 | <height>20</height> | ||
738 | </rect> | ||
739 | </property> | ||
740 | <property stdset="1"> | ||
741 | <name>text</name> | ||
742 | <string>(Will take effect on restart)</string> | ||
743 | </property> | ||
744 | </widget> | ||
745 | <widget> | ||
746 | <class>QCheckBox</class> | ||
747 | <property stdset="1"> | ||
748 | <name>name</name> | ||
749 | <cstring>jumpTo</cstring> | ||
750 | </property> | ||
751 | <property stdset="1"> | ||
752 | <name>geometry</name> | ||
753 | <rect> | ||
754 | <x>17</x> | ||
755 | <y>14</y> | ||
756 | <width>150</width> | ||
757 | <height>20</height> | ||
758 | </rect> | ||
759 | </property> | ||
760 | <property stdset="1"> | ||
761 | <name>text</name> | ||
762 | <string>Show Jump To Letters</string> | ||
763 | </property> | ||
764 | </widget> | ||
765 | </widget> | ||
766 | </widget> | ||
767 | </grid> | ||
768 | </widget> | ||
769 | <connections> | ||
770 | <connection> | ||
771 | <sender>newserver</sender> | ||
772 | <signal>clicked()</signal> | ||
773 | <receiver>Settings</receiver> | ||
774 | <slot>newServer()</slot> | ||
775 | </connection> | ||
776 | <connection> | ||
777 | <sender>removeserver</sender> | ||
778 | <signal>clicked()</signal> | ||
779 | <receiver>Settings</receiver> | ||
780 | <slot>removeServer()</slot> | ||
781 | </connection> | ||
782 | <connection> | ||
783 | <sender>newdestination</sender> | ||
784 | <signal>clicked()</signal> | ||
785 | <receiver>Settings</receiver> | ||
786 | <slot>newDestination()</slot> | ||
787 | </connection> | ||
788 | <connection> | ||
789 | <sender>removedestination</sender> | ||
790 | <signal>clicked()</signal> | ||
791 | <receiver>Settings</receiver> | ||
792 | <slot>removeDestination()</slot> | ||
793 | </connection> | ||
794 | <connection> | ||
795 | <sender>servers</sender> | ||
796 | <signal>highlighted(int)</signal> | ||
797 | <receiver>Settings</receiver> | ||
798 | <slot>editServer(int)</slot> | ||
799 | </connection> | ||
800 | <connection> | ||
801 | <sender>destinations</sender> | ||
802 | <signal>highlighted(int)</signal> | ||
803 | <receiver>Settings</receiver> | ||
804 | <slot>editDestination(int)</slot> | ||
805 | </connection> | ||
806 | <connection> | ||
807 | <sender>btnChangeServer</sender> | ||
808 | <signal>clicked()</signal> | ||
809 | <receiver>Settings</receiver> | ||
810 | <slot>changeServerDetails()</slot> | ||
811 | </connection> | ||
812 | <connection> | ||
813 | <sender>btnChangeDest</sender> | ||
814 | <signal>clicked()</signal> | ||
815 | <receiver>Settings</receiver> | ||
816 | <slot>changeDestinationDetails()</slot> | ||
817 | </connection> | ||
818 | <connection> | ||
819 | <sender>jumpTo</sender> | ||
820 | <signal>toggled(bool)</signal> | ||
821 | <receiver>Settings</receiver> | ||
822 | <slot>toggleJumpTo(bool)</slot> | ||
823 | </connection> | ||
824 | <connection> | ||
825 | <sender>btnProxyApply</sender> | ||
826 | <signal>clicked()</signal> | ||
827 | <receiver>Settings</receiver> | ||
828 | <slot>proxyApplyChanges()</slot> | ||
829 | </connection> | ||
830 | <slot access="public">activeServerChanged()</slot> | ||
831 | <slot access="public">changeDestinationDetails()</slot> | ||
832 | <slot access="public">changeServerDetails()</slot> | ||
833 | <slot access="public">createLinksToDest()</slot> | ||
834 | <slot access="public">destNameChanged(const QString&)</slot> | ||
835 | <slot access="public">destUrlChanged(const QString&)</slot> | ||
836 | <slot access="public">editDestination(int)</slot> | ||
837 | <slot access="public">editServer(int)</slot> | ||
838 | <slot access="public">installationSettingChange(int)</slot> | ||
839 | <slot access="public">installationSettingSetName(const QString &)</slot> | ||
840 | <slot access="public">linkEnabled(bool)</slot> | ||
841 | <slot access="public">newDestination()</slot> | ||
842 | <slot access="public">newInstallationSetting()</slot> | ||
843 | <slot access="public">newServer()</slot> | ||
844 | <slot access="public">proxyApplyChanges()</slot> | ||
845 | <slot access="public">removeDestination()</slot> | ||
846 | <slot access="public">removeInstallationSetting()</slot> | ||
847 | <slot access="public">removeLinksToDest()</slot> | ||
848 | <slot access="public">removeServer()</slot> | ||
849 | <slot access="public">renameInstallationSetting()</slot> | ||
850 | <slot access="public">serverNameChanged(const QString&)</slot> | ||
851 | <slot access="public">serverUrlChanged(const QString&)</slot> | ||
852 | <slot access="public">toggleJumpTo(bool)</slot> | ||
853 | </connections> | ||
854 | <tabstops> | ||
855 | <tabstop>servers</tabstop> | ||
856 | <tabstop>newserver</tabstop> | ||
857 | <tabstop>removeserver</tabstop> | ||
858 | <tabstop>servername</tabstop> | ||
859 | <tabstop>serverurl</tabstop> | ||
860 | <tabstop>active</tabstop> | ||
861 | <tabstop>btnChangeServer</tabstop> | ||
862 | <tabstop>TabWidget</tabstop> | ||
863 | <tabstop>destinations</tabstop> | ||
864 | <tabstop>newdestination</tabstop> | ||
865 | <tabstop>removedestination</tabstop> | ||
866 | <tabstop>destinationname</tabstop> | ||
867 | <tabstop>destinationurl</tabstop> | ||
868 | <tabstop>linkToRoot</tabstop> | ||
869 | <tabstop>btnChangeDest</tabstop> | ||
870 | <tabstop>jumpTo</tabstop> | ||
871 | </tabstops> | ||
872 | </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 | |||
@@ -1,267 +1,438 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | settingsimpl.cpp - description | 2 | settingsimpl.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Thu Aug 29 2002 | 4 | begin : Thu Aug 29 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include <fstream> | 18 | #include <fstream> |
19 | #include <algorithm> | 19 | #include <algorithm> |
20 | using namespace std; | 20 | using namespace std; |
21 | 21 | ||
22 | #include <qlistbox.h> | 22 | #include <qcheckbox.h> |
23 | #include <qgroupbox.h> | ||
24 | #include <qlabel.h> | ||
25 | #include <qlayout.h> | ||
23 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | #include <qlistbox.h> | ||
24 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
25 | #include <qtabwidget.h> | 29 | |
26 | #include <qcheckbox.h> | 30 | #include <opie/otabwidget.h> |
27 | 31 | ||
28 | #ifdef QWS | 32 | #ifdef QWS |
29 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/resource.h> | ||
30 | #endif | 35 | #endif |
31 | 36 | ||
32 | #include "settingsimpl.h" | 37 | #include "settingsimpl.h" |
33 | 38 | ||
34 | #include "global.h" | 39 | #include "global.h" |
35 | 40 | ||
36 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 41 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
37 | : SettingsBase( parent, name, modal, fl ) | 42 | : QDialog( parent, name, modal, fl ) |
38 | { | 43 | { |
44 | setCaption( tr( "Configuration" ) ); | ||
45 | |||
46 | // Setup layout to make everything pretty | ||
47 | QVBoxLayout *layout = new QVBoxLayout( this ); | ||
48 | layout->setMargin( 2 ); | ||
49 | layout->setSpacing( 4 ); | ||
50 | |||
51 | // Setup tabs for all info | ||
52 | OTabWidget *tabwidget = new OTabWidget( this ); | ||
53 | layout->addWidget( tabwidget ); | ||
54 | |||
55 | tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); | ||
56 | tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); | ||
57 | tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); | ||
58 | tabwidget->setCurrentTab( tr( "Servers" ) ); | ||
59 | |||
39 | dataMgr = dataManager; | 60 | dataMgr = dataManager; |
40 | |||
41 | setupData(); | 61 | setupData(); |
42 | changed = false; | 62 | changed = false; |
43 | newserver = false; | 63 | newserver = false; |
44 | newdestination = false; | 64 | newdestination = false; |
45 | } | 65 | } |
46 | 66 | ||
47 | SettingsImpl :: ~SettingsImpl() | 67 | SettingsImpl :: ~SettingsImpl() |
48 | { | 68 | { |
49 | 69 | ||
50 | } | 70 | } |
51 | 71 | ||
52 | bool SettingsImpl :: showDlg( int i ) | 72 | bool SettingsImpl :: showDlg() |
53 | { | 73 | { |
54 | TabWidget->setCurrentPage( i ); | ||
55 | showMaximized(); | 74 | showMaximized(); |
56 | exec(); | 75 | exec(); |
57 | 76 | ||
58 | if ( changed ) | 77 | if ( changed ) |
59 | dataMgr->writeOutIpkgConf(); | 78 | dataMgr->writeOutIpkgConf(); |
60 | 79 | ||
61 | return changed; | 80 | return changed; |
62 | } | 81 | } |
63 | 82 | ||
83 | QWidget *SettingsImpl :: initServerTab() | ||
84 | { | ||
85 | QWidget *control = new QWidget( this ); | ||
86 | |||
87 | QVBoxLayout *vb = new QVBoxLayout( control ); | ||
88 | |||
89 | QScrollView *sv = new QScrollView( control ); | ||
90 | vb->addWidget( sv, 0, 0 ); | ||
91 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
92 | sv->setFrameStyle( QFrame::NoFrame ); | ||
93 | |||
94 | QWidget *container = new QWidget( sv->viewport() ); | ||
95 | sv->addChild( container ); | ||
96 | |||
97 | QGridLayout *layout = new QGridLayout( container ); | ||
98 | layout->setSpacing( 2 ); | ||
99 | layout->setMargin( 4 ); | ||
100 | |||
101 | servers = new QListBox( container ); | ||
102 | servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | ||
103 | connect( servers, SIGNAL( highlighted( int ) ), this, SLOT( editServer( int ) ) ); | ||
104 | layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); | ||
105 | |||
106 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | ||
107 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); | ||
108 | layout->addWidget( btn, 1, 0 ); | ||
109 | |||
110 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | ||
111 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); | ||
112 | layout->addWidget( btn, 1, 1 ); | ||
113 | |||
114 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | ||
115 | grpbox->layout()->setSpacing( 2 ); | ||
116 | grpbox->layout()->setMargin( 4 ); | ||
117 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | ||
118 | |||
119 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | ||
120 | |||
121 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | ||
122 | grplayout->addWidget( label, 0, 0 ); | ||
123 | servername = new QLineEdit( grpbox ); | ||
124 | grplayout->addWidget( servername, 0, 1 ); | ||
125 | |||
126 | label = new QLabel( tr( "Address:" ), grpbox ); | ||
127 | grplayout->addWidget( label, 1, 0 ); | ||
128 | serverurl = new QLineEdit( grpbox ); | ||
129 | grplayout->addWidget( serverurl, 1, 1 ); | ||
130 | |||
131 | active = new QCheckBox( tr( "Active Server" ), grpbox ); | ||
132 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); | ||
133 | |||
134 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | ||
135 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); | ||
136 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | ||
137 | |||
138 | return control; | ||
139 | } | ||
140 | |||
141 | QWidget *SettingsImpl :: initDestinationTab() | ||
142 | { | ||
143 | QWidget *control = new QWidget( this ); | ||
144 | |||
145 | QVBoxLayout *vb = new QVBoxLayout( control ); | ||
146 | |||
147 | QScrollView *sv = new QScrollView( control ); | ||
148 | vb->addWidget( sv, 0, 0 ); | ||
149 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
150 | sv->setFrameStyle( QFrame::NoFrame ); | ||
151 | |||
152 | QWidget *container = new QWidget( sv->viewport() ); | ||
153 | sv->addChild( container ); | ||
154 | |||
155 | QGridLayout *layout = new QGridLayout( container ); | ||
156 | layout->setSpacing( 2 ); | ||
157 | layout->setMargin( 4 ); | ||
158 | |||
159 | destinations = new QListBox( container ); | ||
160 | destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | ||
161 | connect( destinations, SIGNAL( highlighted( int ) ), this, SLOT( editDestination( int ) ) ); | ||
162 | layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); | ||
163 | |||
164 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | ||
165 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); | ||
166 | layout->addWidget( btn, 1, 0 ); | ||
167 | |||
168 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | ||
169 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); | ||
170 | layout->addWidget( btn, 1, 1 ); | ||
171 | |||
172 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Destination" ), container ); | ||
173 | grpbox->layout()->setSpacing( 2 ); | ||
174 | grpbox->layout()->setMargin( 4 ); | ||
175 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | ||
176 | |||
177 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | ||
178 | |||
179 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | ||
180 | grplayout->addWidget( label, 0, 0 ); | ||
181 | destinationname = new QLineEdit( grpbox ); | ||
182 | grplayout->addWidget( destinationname, 0, 1 ); | ||
183 | |||
184 | label = new QLabel( tr( "Location:" ), grpbox ); | ||
185 | grplayout->addWidget( label, 1, 0 ); | ||
186 | destinationurl = new QLineEdit( grpbox ); | ||
187 | grplayout->addWidget( destinationurl, 1, 1 ); | ||
188 | |||
189 | linkToRoot = new QCheckBox( tr( "Link to root" ), grpbox ); | ||
190 | grplayout->addMultiCellWidget( linkToRoot, 2, 2, 0, 1 ); | ||
191 | |||
192 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | ||
193 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeDestinationDetails() ) ); | ||
194 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | ||
195 | |||
196 | return control; | ||
197 | } | ||
198 | |||
199 | QWidget *SettingsImpl :: initProxyTab() | ||
200 | { | ||
201 | QWidget *control = new QWidget( this ); | ||
202 | |||
203 | QVBoxLayout *vb = new QVBoxLayout( control ); | ||
204 | |||
205 | QScrollView *sv = new QScrollView( control ); | ||
206 | vb->addWidget( sv, 0, 0 ); | ||
207 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
208 | sv->setFrameStyle( QFrame::NoFrame ); | ||
209 | |||
210 | QWidget *container = new QWidget( sv->viewport() ); | ||
211 | sv->addChild( container ); | ||
212 | |||
213 | QGridLayout *layout = new QGridLayout( container ); | ||
214 | layout->setSpacing( 2 ); | ||
215 | layout->setMargin( 4 ); | ||
216 | |||
217 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "HTTP Proxy" ), container ); | ||
218 | grpbox->layout()->setSpacing( 2 ); | ||
219 | grpbox->layout()->setMargin( 4 ); | ||
220 | layout->addMultiCellWidget( grpbox, 0, 0, 0, 1 ); | ||
221 | QVBoxLayout *grplayout = new QVBoxLayout( grpbox->layout() ); | ||
222 | txtHttpProxy = new QLineEdit( grpbox ); | ||
223 | grplayout->addWidget( txtHttpProxy ); | ||
224 | chkHttpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); | ||
225 | grplayout->addWidget( chkHttpProxyEnabled ); | ||
226 | |||
227 | grpbox = new QGroupBox( 0, Qt::Vertical, tr( "FTP Proxy" ), container ); | ||
228 | grpbox->layout()->setSpacing( 2 ); | ||
229 | grpbox->layout()->setMargin( 4 ); | ||
230 | layout->addMultiCellWidget( grpbox, 1, 1, 0, 1 ); | ||
231 | grplayout = new QVBoxLayout( grpbox->layout() ); | ||
232 | txtFtpProxy = new QLineEdit( grpbox ); | ||
233 | grplayout->addWidget( txtFtpProxy ); | ||
234 | chkFtpProxyEnabled = new QCheckBox( tr( "Enabled" ), grpbox ); | ||
235 | grplayout->addWidget( chkFtpProxyEnabled ); | ||
236 | |||
237 | QLabel *label = new QLabel( tr( "Username:" ), container ); | ||
238 | layout->addWidget( label, 2, 0 ); | ||
239 | txtUsername = new QLineEdit( container ); | ||
240 | layout->addWidget( txtUsername, 2, 1 ); | ||
241 | |||
242 | label = new QLabel( tr( "Password:" ), container ); | ||
243 | layout->addWidget( label, 3, 0 ); | ||
244 | txtPassword = new QLineEdit( container ); | ||
245 | layout->addWidget( txtPassword, 3, 1 ); | ||
246 | |||
247 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), container ); | ||
248 | connect( btn, SIGNAL( clicked() ), this, SLOT( proxyApplyChanges() ) ); | ||
249 | layout->addMultiCellWidget( btn, 4, 4, 0, 1 ); | ||
250 | |||
251 | return control; | ||
252 | } | ||
253 | |||
64 | void SettingsImpl :: setupData() | 254 | void SettingsImpl :: setupData() |
65 | { | 255 | { |
66 | // add servers | 256 | // add servers |
67 | vector<Server>::iterator it; | 257 | vector<Server>::iterator it; |
68 | for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it ) | 258 | for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it ) |
69 | { | 259 | { |
70 | if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) | 260 | if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) |
71 | continue; | 261 | continue; |
72 | 262 | ||
73 | servers->insertItem( it->getServerName() ); | 263 | servers->insertItem( it->getServerName() ); |
74 | } | 264 | } |
75 | 265 | ||
266 | |||
76 | // add destinations | 267 | // add destinations |
77 | vector<Destination>::iterator it2; | 268 | vector<Destination>::iterator it2; |
78 | for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) | 269 | for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) |
79 | destinations->insertItem( it2->getDestinationName() ); | 270 | destinations->insertItem( it2->getDestinationName() ); |
80 | 271 | ||
81 | // setup general tab | ||
82 | #ifdef QWS | ||
83 | Config cfg( "aqpkg" ); | ||
84 | cfg.setGroup( "settings" ); | ||
85 | jumpTo->setChecked( cfg.readBoolEntry( "showJumpTo", "true" ) ); | ||
86 | #else | ||
87 | jumpTo->setChecked( true ); | ||
88 | #endif | ||
89 | |||
90 | // setup proxy tab | 272 | // setup proxy tab |
91 | txtHttpProxy->setText( dataMgr->getHttpProxy() ); | 273 | txtHttpProxy->setText( dataMgr->getHttpProxy() ); |
92 | txtFtpProxy->setText( dataMgr->getFtpProxy() ); | 274 | txtFtpProxy->setText( dataMgr->getFtpProxy() ); |
93 | txtUsername->setText( dataMgr->getProxyUsername() ); | 275 | txtUsername->setText( dataMgr->getProxyUsername() ); |
94 | txtPassword->setText( dataMgr->getProxyPassword() ); | 276 | txtPassword->setText( dataMgr->getProxyPassword() ); |
95 | chkHttpProxyEnabled->setChecked( dataMgr->getHttpProxyEnabled() ); | 277 | chkHttpProxyEnabled->setChecked( dataMgr->getHttpProxyEnabled() ); |
96 | chkFtpProxyEnabled->setChecked( dataMgr->getFtpProxyEnabled() ); | 278 | chkFtpProxyEnabled->setChecked( dataMgr->getFtpProxyEnabled() ); |
97 | } | 279 | } |
98 | 280 | ||
99 | //------------------ Servers tab ---------------------- | 281 | //------------------ Servers tab ---------------------- |
100 | 282 | ||
101 | void SettingsImpl :: editServer( int sel ) | 283 | void SettingsImpl :: editServer( int sel ) |
102 | { | 284 | { |
103 | currentSelectedServer = sel; | 285 | currentSelectedServer = sel; |
104 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 286 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); |
105 | serverName = s->getServerName(); | 287 | serverName = s->getServerName(); |
106 | servername->setText( s->getServerName() ); | 288 | servername->setText( s->getServerName() ); |
107 | serverurl->setText( s->getServerUrl() ); | 289 | serverurl->setText( s->getServerUrl() ); |
108 | active->setChecked( s->isServerActive() ); | 290 | active->setChecked( s->isServerActive() ); |
109 | } | 291 | } |
110 | 292 | ||
111 | void SettingsImpl :: newServer() | 293 | void SettingsImpl :: newServer() |
112 | { | 294 | { |
113 | newserver = true; | 295 | newserver = true; |
114 | servername->setText( "" ); | 296 | servername->setText( "" ); |
115 | serverurl->setText( "" ); | 297 | serverurl->setText( "" ); |
116 | servername->setFocus(); | 298 | servername->setFocus(); |
117 | active->setChecked( true ); | 299 | active->setChecked( true ); |
118 | } | 300 | } |
119 | 301 | ||
120 | void SettingsImpl :: removeServer() | 302 | void SettingsImpl :: removeServer() |
121 | { | 303 | { |
122 | changed = true; | 304 | changed = true; |
123 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 305 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); |
124 | dataMgr->getServerList().erase( s ); | 306 | dataMgr->getServerList().erase( s ); |
125 | servers->removeItem( currentSelectedServer ); | 307 | servers->removeItem( currentSelectedServer ); |
126 | } | 308 | } |
127 | 309 | ||
128 | void SettingsImpl :: changeServerDetails() | 310 | void SettingsImpl :: changeServerDetails() |
129 | { | 311 | { |
130 | changed = true; | 312 | changed = true; |
131 | 313 | ||
132 | QString newName = servername->text(); | 314 | QString newName = servername->text(); |
133 | if ( !newserver ) | 315 | if ( !newserver ) |
134 | { | 316 | { |
135 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); | 317 | vector<Server>::iterator s = dataMgr->getServer( servers->currentText() ); |
136 | 318 | ||
137 | // Update url | 319 | // Update url |
138 | s->setServerUrl( serverurl->text() ); | 320 | s->setServerUrl( serverurl->text() ); |
139 | s->setActive( active->isChecked() ); | 321 | s->setActive( active->isChecked() ); |
140 | 322 | ||
141 | 323 | ||
142 | // Check if server name has changed, if it has then we need to replace the key in the map | 324 | // Check if server name has changed, if it has then we need to replace the key in the map |
143 | if ( serverName != newName ) | 325 | if ( serverName != newName ) |
144 | { | 326 | { |
145 | // Update server name | 327 | // Update server name |
146 | s->setServerName( newName ); | 328 | s->setServerName( newName ); |
147 | 329 | ||
148 | // See if this server is the active server | 330 | // See if this server is the active server |
149 | // if ( dataMgr->getActiveServer() == serverName ) | 331 | // if ( dataMgr->getActiveServer() == serverName ) |
150 | // dataMgr->setActiveServer( newName ); | 332 | // dataMgr->setActiveServer( newName ); |
151 | 333 | ||
152 | // Update list box | 334 | // Update list box |
153 | servers->changeItem( newName, currentSelectedServer ); | 335 | servers->changeItem( newName, currentSelectedServer ); |
154 | } | 336 | } |
155 | } | 337 | } |
156 | else | 338 | else |
157 | { | 339 | { |
158 | Server s( newName, serverurl->text() ); | 340 | Server s( newName, serverurl->text() ); |
159 | dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); | 341 | dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); |
160 | dataMgr->getServerList().end()->setActive( active->isChecked() ); | 342 | dataMgr->getServerList().end()->setActive( active->isChecked() ); |
161 | servers->insertItem( newName ); | 343 | servers->insertItem( newName ); |
162 | servers->setCurrentItem( servers->count() ); | 344 | servers->setCurrentItem( servers->count() ); |
163 | newserver = false; | 345 | newserver = false; |
164 | } | 346 | } |
165 | } | 347 | } |
166 | 348 | ||
167 | //------------------ Destinations tab ---------------------- | 349 | //------------------ Destinations tab ---------------------- |
168 | 350 | ||
169 | void SettingsImpl :: editDestination( int sel ) | 351 | void SettingsImpl :: editDestination( int sel ) |
170 | { | 352 | { |
171 | currentSelectedDestination = sel; | 353 | currentSelectedDestination = sel; |
172 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); | 354 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); |
173 | destinationName = d->getDestinationName(); | 355 | destinationName = d->getDestinationName(); |
174 | destinationname->setText( d->getDestinationName() ); | 356 | destinationname->setText( d->getDestinationName() ); |
175 | destinationurl->setText( d->getDestinationPath() ); | 357 | destinationurl->setText( d->getDestinationPath() ); |
176 | linkToRoot->setChecked( d->linkToRoot() ); | 358 | linkToRoot->setChecked( d->linkToRoot() ); |
177 | } | 359 | } |
178 | 360 | ||
179 | void SettingsImpl :: newDestination() | 361 | void SettingsImpl :: newDestination() |
180 | { | 362 | { |
181 | newdestination = true; | 363 | newdestination = true; |
182 | destinationname->setText( "" ); | 364 | destinationname->setText( "" ); |
183 | destinationurl->setText( "" ); | 365 | destinationurl->setText( "" ); |
184 | destinationname->setFocus(); | 366 | destinationname->setFocus(); |
185 | linkToRoot->setChecked( true ); | 367 | linkToRoot->setChecked( true ); |
186 | } | 368 | } |
187 | 369 | ||
188 | void SettingsImpl :: removeDestination() | 370 | void SettingsImpl :: removeDestination() |
189 | { | 371 | { |
190 | changed = true; | 372 | changed = true; |
191 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); | 373 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); |
192 | dataMgr->getDestinationList().erase( d ); | 374 | dataMgr->getDestinationList().erase( d ); |
193 | destinations->removeItem( currentSelectedDestination ); | 375 | destinations->removeItem( currentSelectedDestination ); |
194 | } | 376 | } |
195 | 377 | ||
196 | void SettingsImpl :: changeDestinationDetails() | 378 | void SettingsImpl :: changeDestinationDetails() |
197 | { | 379 | { |
198 | changed = true; | 380 | changed = true; |
199 | 381 | ||
200 | #ifdef QWS | 382 | #ifdef QWS |
201 | Config cfg( "aqpkg" ); | 383 | Config cfg( "aqpkg" ); |
202 | cfg.setGroup( "destinations" ); | 384 | cfg.setGroup( "destinations" ); |
203 | #endif | 385 | #endif |
204 | 386 | ||
205 | QString newName = destinationname->text(); | 387 | QString newName = destinationname->text(); |
206 | if ( !newdestination ) | 388 | if ( !newdestination ) |
207 | { | 389 | { |
208 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); | 390 | vector<Destination>::iterator d = dataMgr->getDestination( destinations->currentText() ); |
209 | 391 | ||
210 | // Update url | 392 | // Update url |
211 | d->setDestinationPath( destinationurl->text() ); | 393 | d->setDestinationPath( destinationurl->text() ); |
212 | d->linkToRoot( linkToRoot->isChecked() ); | 394 | d->linkToRoot( linkToRoot->isChecked() ); |
213 | 395 | ||
214 | // Check if server name has changed, if it has then we need to replace the key in the map | 396 | // Check if server name has changed, if it has then we need to replace the key in the map |
215 | if ( destinationName != newName ) | 397 | if ( destinationName != newName ) |
216 | { | 398 | { |
217 | // Update server name | 399 | // Update server name |
218 | d->setDestinationName( newName ); | 400 | d->setDestinationName( newName ); |
219 | 401 | ||
220 | // Update list box | 402 | // Update list box |
221 | destinations->changeItem( newName, currentSelectedDestination ); | 403 | destinations->changeItem( newName, currentSelectedDestination ); |
222 | } | 404 | } |
223 | #ifdef QWS | 405 | #ifdef QWS |
224 | QString key = newName; | 406 | QString key = newName; |
225 | key += "_linkToRoot"; | 407 | key += "_linkToRoot"; |
226 | int val = d->linkToRoot(); | 408 | int val = d->linkToRoot(); |
227 | cfg.writeEntry( key, val ); | 409 | cfg.writeEntry( key, val ); |
228 | #endif | 410 | #endif |
229 | } | 411 | } |
230 | else | 412 | else |
231 | { | 413 | { |
232 | dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); | 414 | dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); |
233 | destinations->insertItem( newName ); | 415 | destinations->insertItem( newName ); |
234 | destinations->setCurrentItem( destinations->count() ); | 416 | destinations->setCurrentItem( destinations->count() ); |
235 | newdestination = false; | 417 | newdestination = false; |
236 | 418 | ||
237 | #ifdef QWS | 419 | #ifdef QWS |
238 | QString key = newName; | 420 | QString key = newName; |
239 | key += "_linkToRoot"; | 421 | key += "_linkToRoot"; |
240 | cfg.writeEntry( key, true ); | 422 | cfg.writeEntry( key, true ); |
241 | #endif | 423 | #endif |
242 | } | 424 | } |
243 | } | 425 | } |
244 | 426 | ||
245 | //------------------ General tab ---------------------- | ||
246 | |||
247 | void SettingsImpl :: toggleJumpTo( bool val ) | ||
248 | { | ||
249 | #ifdef QWS | ||
250 | Config cfg( "aqpkg" ); | ||
251 | cfg.setGroup( "settings" ); | ||
252 | cfg.writeEntry( "showJumpTo", val ); | ||
253 | #endif | ||
254 | } | ||
255 | |||
256 | //------------------ Proxy tab ---------------------- | 427 | //------------------ Proxy tab ---------------------- |
257 | void SettingsImpl :: proxyApplyChanges() | 428 | void SettingsImpl :: proxyApplyChanges() |
258 | { | 429 | { |
259 | changed = true; | 430 | changed = true; |
260 | dataMgr->setHttpProxy( txtHttpProxy->text() ); | 431 | dataMgr->setHttpProxy( txtHttpProxy->text() ); |
261 | dataMgr->setFtpProxy( txtFtpProxy->text() ); | 432 | dataMgr->setFtpProxy( txtFtpProxy->text() ); |
262 | dataMgr->setProxyUsername( txtUsername->text() ); | 433 | dataMgr->setProxyUsername( txtUsername->text() ); |
263 | dataMgr->setProxyPassword( txtPassword->text() ); | 434 | dataMgr->setProxyPassword( txtPassword->text() ); |
264 | 435 | ||
265 | dataMgr->setHttpProxyEnabled( chkHttpProxyEnabled->isChecked() ); | 436 | dataMgr->setHttpProxyEnabled( chkHttpProxyEnabled->isChecked() ); |
266 | dataMgr->setFtpProxyEnabled( chkFtpProxyEnabled->isChecked() ); | 437 | dataMgr->setFtpProxyEnabled( chkFtpProxyEnabled->isChecked() ); |
267 | } | 438 | } |
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 | |||
@@ -1,56 +1,77 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | settingsimpl.h - description | 2 | settingsimpl.h - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Thu Aug 29 2002 | 4 | begin : Thu Aug 29 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include "settings.h" | ||
19 | |||
20 | #include "datamgr.h" | 18 | #include "datamgr.h" |
21 | 19 | ||
22 | class SettingsImpl : public SettingsBase | 20 | #include <qdialog.h> |
21 | |||
22 | class QCheckBox; | ||
23 | class QLineEdit; | ||
24 | class QListBox; | ||
25 | |||
26 | class SettingsImpl : public QDialog | ||
23 | { | 27 | { |
28 | Q_OBJECT | ||
24 | public: | 29 | public: |
25 | SettingsImpl( DataManager *dataManager, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 30 | SettingsImpl( DataManager *dataManager, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
26 | ~SettingsImpl(); | 31 | ~SettingsImpl(); |
27 | 32 | ||
28 | bool showDlg( int i ); | 33 | bool showDlg(); |
29 | 34 | ||
30 | private: | 35 | private: |
36 | QListBox *servers; | ||
37 | QLineEdit *servername; | ||
38 | QLineEdit *serverurl; | ||
39 | QCheckBox *active; | ||
40 | QListBox *destinations; | ||
41 | QLineEdit *destinationname; | ||
42 | QLineEdit *destinationurl; | ||
43 | QCheckBox *linkToRoot; | ||
44 | QLineEdit *txtHttpProxy; | ||
45 | QCheckBox *chkHttpProxyEnabled; | ||
46 | QLineEdit *txtFtpProxy; | ||
47 | QCheckBox *chkFtpProxyEnabled; | ||
48 | QLineEdit *txtUsername; | ||
49 | QLineEdit *txtPassword; | ||
50 | |||
31 | DataManager *dataMgr; | 51 | DataManager *dataMgr; |
32 | QString serverName; | 52 | QString serverName; |
33 | QString destinationName; | 53 | QString destinationName; |
34 | int currentSelectedServer; | 54 | int currentSelectedServer; |
35 | int currentSelectedDestination; | 55 | int currentSelectedDestination; |
36 | bool changed; | 56 | bool changed; |
37 | bool newserver; | 57 | bool newserver; |
38 | bool newdestination; | 58 | bool newdestination; |
39 | 59 | ||
60 | QWidget *initServerTab(); | ||
61 | QWidget *initDestinationTab(); | ||
62 | QWidget *initProxyTab(); | ||
63 | |||
40 | void setupConnections(); | 64 | void setupConnections(); |
41 | void setupData(); | 65 | void setupData(); |
42 | 66 | ||
67 | public slots: | ||
43 | void editServer( int s ); | 68 | void editServer( int s ); |
44 | void changeServerDetails(); | 69 | void changeServerDetails(); |
45 | void newServer(); | 70 | void newServer(); |
46 | void removeServer(); | 71 | void removeServer(); |
47 | |||
48 | void editDestination( int s ); | 72 | void editDestination( int s ); |
49 | void changeDestinationDetails(); | 73 | void changeDestinationDetails(); |
50 | void newDestination(); | 74 | void newDestination(); |
51 | void removeDestination(); | 75 | void removeDestination(); |
52 | |||
53 | void toggleJumpTo( bool val ); | ||
54 | |||
55 | void proxyApplyChanges(); | 76 | void proxyApplyChanges(); |
56 | }; | 77 | }; |