-rw-r--r-- | noncore/settings/aqpkg/settings.ui | 169 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 43 |
2 files changed, 143 insertions, 69 deletions
diff --git a/noncore/settings/aqpkg/settings.ui b/noncore/settings/aqpkg/settings.ui index eb99cf7..6b3cfd4 100644 --- a/noncore/settings/aqpkg/settings.ui +++ b/noncore/settings/aqpkg/settings.ui | |||
@@ -1,39 +1,39 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>SettingsBase</class> | 2 | <class>SettingsBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>Settings</cstring> | 7 | <cstring>Settings</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>331</width> | 14 | <width>247</width> |
15 | <height>456</height> | 15 | <height>390</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Package Servers</string> | 20 | <string>Package Servers</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>11</number> | 31 | <number>11</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>6</number> | 35 | <number>6</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
@@ -48,206 +48,234 @@ | |||
48 | <name>layoutMargin</name> | 48 | <name>layoutMargin</name> |
49 | </property> | 49 | </property> |
50 | <property> | 50 | <property> |
51 | <name>layoutSpacing</name> | 51 | <name>layoutSpacing</name> |
52 | </property> | 52 | </property> |
53 | <widget> | 53 | <widget> |
54 | <class>QWidget</class> | 54 | <class>QWidget</class> |
55 | <property stdset="1"> | 55 | <property stdset="1"> |
56 | <name>name</name> | 56 | <name>name</name> |
57 | <cstring>tab</cstring> | 57 | <cstring>tab</cstring> |
58 | </property> | 58 | </property> |
59 | <attribute> | 59 | <attribute> |
60 | <name>title</name> | 60 | <name>title</name> |
61 | <string>Servers</string> | 61 | <string>Servers</string> |
62 | </attribute> | 62 | </attribute> |
63 | <grid> | 63 | <grid> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>margin</name> | 65 | <name>margin</name> |
66 | <number>11</number> | 66 | <number>11</number> |
67 | </property> | 67 | </property> |
68 | <property stdset="1"> | 68 | <property stdset="1"> |
69 | <name>spacing</name> | 69 | <name>spacing</name> |
70 | <number>6</number> | 70 | <number>6</number> |
71 | </property> | 71 | </property> |
72 | <widget row="0" column="0" rowspan="1" colspan="2" > | 72 | <widget row="0" column="0" > |
73 | <class>QLayoutWidget</class> | 73 | <class>QLayoutWidget</class> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>name</name> | 75 | <name>name</name> |
76 | <cstring>Layout2</cstring> | 76 | <cstring>Layout2</cstring> |
77 | </property> | 77 | </property> |
78 | <hbox> | 78 | <hbox> |
79 | <property stdset="1"> | 79 | <property stdset="1"> |
80 | <name>margin</name> | 80 | <name>margin</name> |
81 | <number>0</number> | 81 | <number>0</number> |
82 | </property> | 82 | </property> |
83 | <property stdset="1"> | 83 | <property stdset="1"> |
84 | <name>spacing</name> | 84 | <name>spacing</name> |
85 | <number>6</number> | 85 | <number>6</number> |
86 | </property> | 86 | </property> |
87 | <widget> | 87 | <widget> |
88 | <class>QLabel</class> | 88 | <class>QLabel</class> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>name</name> | 90 | <name>name</name> |
91 | <cstring>Servers</cstring> | 91 | <cstring>Servers</cstring> |
92 | </property> | 92 | </property> |
93 | <property stdset="1"> | 93 | <property stdset="1"> |
94 | <name>text</name> | 94 | <name>text</name> |
95 | <string>Servers</string> | 95 | <string>Servers</string> |
96 | </property> | 96 | </property> |
97 | </widget> | 97 | </widget> |
98 | <spacer> | 98 | <spacer> |
99 | <property> | 99 | <property> |
100 | <name>name</name> | 100 | <name>name</name> |
101 | <cstring>Spacer2</cstring> | 101 | <cstring>Spacer2</cstring> |
102 | </property> | 102 | </property> |
103 | <property stdset="1"> | 103 | <property stdset="1"> |
104 | <name>orientation</name> | 104 | <name>orientation</name> |
105 | <enum>Horizontal</enum> | 105 | <enum>Horizontal</enum> |
106 | </property> | 106 | </property> |
107 | <property stdset="1"> | 107 | <property stdset="1"> |
108 | <name>sizeType</name> | 108 | <name>sizeType</name> |
109 | <enum>Expanding</enum> | 109 | <enum>Expanding</enum> |
110 | </property> | 110 | </property> |
111 | <property> | 111 | <property> |
112 | <name>sizeHint</name> | 112 | <name>sizeHint</name> |
113 | <size> | 113 | <size> |
114 | <width>20</width> | 114 | <width>20</width> |
115 | <height>20</height> | 115 | <height>20</height> |
116 | </size> | 116 | </size> |
117 | </property> | 117 | </property> |
118 | </spacer> | 118 | </spacer> |
119 | </hbox> | 119 | </hbox> |
120 | </widget> | 120 | </widget> |
121 | <widget row="1" column="0" rowspan="1" colspan="2" > | 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" > | ||
122 | <class>QListBox</class> | 137 | <class>QListBox</class> |
123 | <property stdset="1"> | 138 | <property stdset="1"> |
124 | <name>name</name> | 139 | <name>name</name> |
125 | <cstring>servers</cstring> | 140 | <cstring>servers</cstring> |
126 | </property> | 141 | </property> |
127 | <property stdset="1"> | 142 | <property stdset="1"> |
128 | <name>selectionMode</name> | 143 | <name>selectionMode</name> |
129 | <enum>Extended</enum> | 144 | <enum>Extended</enum> |
130 | </property> | 145 | </property> |
131 | </widget> | 146 | </widget> |
132 | <widget row="2" column="1" > | 147 | <widget row="2" column="0" rowspan="1" colspan="2" > |
133 | <class>QPushButton</class> | 148 | <class>QLayoutWidget</class> |
134 | <property stdset="1"> | 149 | <property stdset="1"> |
135 | <name>name</name> | 150 | <name>name</name> |
136 | <cstring>removeserver</cstring> | 151 | <cstring>Layout6</cstring> |
137 | </property> | ||
138 | <property stdset="1"> | ||
139 | <name>enabled</name> | ||
140 | <bool>true</bool> | ||
141 | </property> | 152 | </property> |
153 | <grid> | ||
142 | <property stdset="1"> | 154 | <property stdset="1"> |
143 | <name>text</name> | 155 | <name>margin</name> |
144 | <string>Remove</string> | 156 | <number>0</number> |
145 | </property> | 157 | </property> |
146 | <property stdset="1"> | 158 | <property stdset="1"> |
147 | <name>autoDefault</name> | 159 | <name>spacing</name> |
148 | <bool>false</bool> | 160 | <number>6</number> |
149 | </property> | 161 | </property> |
150 | </widget> | 162 | <widget row="2" column="1" > |
151 | <widget row="2" column="0" > | 163 | <class>QCheckBox</class> |
152 | <class>QPushButton</class> | ||
153 | <property stdset="1"> | 164 | <property stdset="1"> |
154 | <name>name</name> | 165 | <name>name</name> |
155 | <cstring>newserver</cstring> | 166 | <cstring>active</cstring> |
156 | </property> | 167 | </property> |
157 | <property stdset="1"> | 168 | <property stdset="1"> |
158 | <name>enabled</name> | 169 | <name>text</name> |
159 | <bool>true</bool> | 170 | <string>Active Server</string> |
160 | </property> | 171 | </property> |
172 | </widget> | ||
173 | <widget row="0" column="0" > | ||
174 | <class>QLabel</class> | ||
161 | <property stdset="1"> | 175 | <property stdset="1"> |
162 | <name>text</name> | 176 | <name>name</name> |
163 | <string>New</string> | 177 | <cstring>TextLabel1_3</cstring> |
164 | </property> | 178 | </property> |
165 | <property stdset="1"> | 179 | <property stdset="1"> |
166 | <name>autoDefault</name> | 180 | <name>text</name> |
167 | <bool>false</bool> | 181 | <string>Name:</string> |
168 | </property> | 182 | </property> |
169 | </widget> | 183 | </widget> |
170 | <widget row="3" column="0" rowspan="1" colspan="2" > | 184 | <widget row="1" column="0" > |
171 | <class>QLayoutWidget</class> | 185 | <class>QLabel</class> |
172 | <property stdset="1"> | 186 | <property stdset="1"> |
173 | <name>name</name> | 187 | <name>name</name> |
174 | <cstring>Layout10</cstring> | 188 | <cstring>TextLabel2_3</cstring> |
175 | </property> | 189 | </property> |
176 | <grid> | ||
177 | <property stdset="1"> | 190 | <property stdset="1"> |
178 | <name>margin</name> | 191 | <name>text</name> |
179 | <number>0</number> | 192 | <string>URL:</string> |
180 | </property> | 193 | </property> |
194 | </widget> | ||
195 | <widget row="0" column="1" > | ||
196 | <class>QLineEdit</class> | ||
181 | <property stdset="1"> | 197 | <property stdset="1"> |
182 | <name>spacing</name> | 198 | <name>name</name> |
183 | <number>6</number> | 199 | <cstring>servername</cstring> |
184 | </property> | 200 | </property> |
201 | </widget> | ||
185 | <widget row="1" column="1" > | 202 | <widget row="1" column="1" > |
186 | <class>QLineEdit</class> | 203 | <class>QLineEdit</class> |
187 | <property stdset="1"> | 204 | <property stdset="1"> |
188 | <name>name</name> | 205 | <name>name</name> |
189 | <cstring>serverurl</cstring> | 206 | <cstring>serverurl</cstring> |
190 | </property> | 207 | </property> |
191 | </widget> | 208 | </widget> |
192 | <widget row="1" column="0" > | 209 | <widget row="3" column="1" > |
193 | <class>QLabel</class> | 210 | <class>QPushButton</class> |
194 | <property stdset="1"> | 211 | <property stdset="1"> |
195 | <name>name</name> | 212 | <name>name</name> |
196 | <cstring>TextLabel2_3</cstring> | 213 | <cstring>btnChangeServer</cstring> |
197 | </property> | 214 | </property> |
198 | <property stdset="1"> | 215 | <property stdset="1"> |
199 | <name>text</name> | 216 | <name>text</name> |
200 | <string>URL:</string> | 217 | <string>Change</string> |
201 | </property> | 218 | </property> |
202 | </widget> | 219 | </widget> |
203 | <widget row="0" column="1" > | 220 | </grid> |
204 | <class>QLineEdit</class> | 221 | </widget> |
222 | <widget row="1" column="1" > | ||
223 | <class>QPushButton</class> | ||
205 | <property stdset="1"> | 224 | <property stdset="1"> |
206 | <name>name</name> | 225 | <name>name</name> |
207 | <cstring>servername</cstring> | 226 | <cstring>removeserver</cstring> |
208 | </property> | 227 | </property> |
209 | </widget> | ||
210 | <widget row="0" column="0" > | ||
211 | <class>QLabel</class> | ||
212 | <property stdset="1"> | 228 | <property stdset="1"> |
213 | <name>name</name> | 229 | <name>enabled</name> |
214 | <cstring>TextLabel1_3</cstring> | 230 | <bool>true</bool> |
215 | </property> | 231 | </property> |
216 | <property stdset="1"> | 232 | <property stdset="1"> |
217 | <name>text</name> | 233 | <name>text</name> |
218 | <string>Name:</string> | 234 | <string>Remove</string> |
235 | </property> | ||
236 | <property stdset="1"> | ||
237 | <name>autoDefault</name> | ||
238 | <bool>false</bool> | ||
219 | </property> | 239 | </property> |
220 | </widget> | 240 | </widget> |
221 | <widget row="2" column="1" > | 241 | <widget row="1" column="0" > |
222 | <class>QPushButton</class> | 242 | <class>QPushButton</class> |
223 | <property stdset="1"> | 243 | <property stdset="1"> |
224 | <name>name</name> | 244 | <name>name</name> |
225 | <cstring>btnChangeServer</cstring> | 245 | <cstring>newserver</cstring> |
246 | </property> | ||
247 | <property stdset="1"> | ||
248 | <name>enabled</name> | ||
249 | <bool>true</bool> | ||
226 | </property> | 250 | </property> |
227 | <property stdset="1"> | 251 | <property stdset="1"> |
228 | <name>text</name> | 252 | <name>text</name> |
229 | <string>Change</string> | 253 | <string>New</string> |
254 | </property> | ||
255 | <property stdset="1"> | ||
256 | <name>autoDefault</name> | ||
257 | <bool>false</bool> | ||
230 | </property> | 258 | </property> |
231 | </widget> | 259 | </widget> |
232 | </grid> | 260 | </grid> |
233 | </widget> | 261 | </widget> |
234 | </grid> | 262 | </grid> |
235 | </widget> | 263 | </widget> |
236 | <widget> | 264 | <widget> |
237 | <class>QWidget</class> | 265 | <class>QWidget</class> |
238 | <property stdset="1"> | 266 | <property stdset="1"> |
239 | <name>name</name> | 267 | <name>name</name> |
240 | <cstring>tab</cstring> | 268 | <cstring>tab</cstring> |
241 | </property> | 269 | </property> |
242 | <attribute> | 270 | <attribute> |
243 | <name>title</name> | 271 | <name>title</name> |
244 | <string>Destinations</string> | 272 | <string>Destinations</string> |
245 | </attribute> | 273 | </attribute> |
246 | <grid> | 274 | <grid> |
247 | <property stdset="1"> | 275 | <property stdset="1"> |
248 | <name>margin</name> | 276 | <name>margin</name> |
249 | <number>11</number> | 277 | <number>11</number> |
250 | </property> | 278 | </property> |
251 | <property stdset="1"> | 279 | <property stdset="1"> |
252 | <name>spacing</name> | 280 | <name>spacing</name> |
253 | <number>6</number> | 281 | <number>6</number> |
@@ -371,104 +399,119 @@ | |||
371 | </property> | 399 | </property> |
372 | <property> | 400 | <property> |
373 | <name>sizeHint</name> | 401 | <name>sizeHint</name> |
374 | <size> | 402 | <size> |
375 | <width>20</width> | 403 | <width>20</width> |
376 | <height>20</height> | 404 | <height>20</height> |
377 | </size> | 405 | </size> |
378 | </property> | 406 | </property> |
379 | </spacer> | 407 | </spacer> |
380 | <widget row="1" column="0" > | 408 | <widget row="1" column="0" > |
381 | <class>QListBox</class> | 409 | <class>QListBox</class> |
382 | <property stdset="1"> | 410 | <property stdset="1"> |
383 | <name>name</name> | 411 | <name>name</name> |
384 | <cstring>destinations</cstring> | 412 | <cstring>destinations</cstring> |
385 | </property> | 413 | </property> |
386 | <property stdset="1"> | 414 | <property stdset="1"> |
387 | <name>selectionMode</name> | 415 | <name>selectionMode</name> |
388 | <enum>Single</enum> | 416 | <enum>Single</enum> |
389 | </property> | 417 | </property> |
390 | </widget> | 418 | </widget> |
391 | <widget row="3" column="0" > | 419 | <widget row="3" column="0" > |
392 | <class>QLayoutWidget</class> | 420 | <class>QLayoutWidget</class> |
393 | <property stdset="1"> | 421 | <property stdset="1"> |
394 | <name>name</name> | 422 | <name>name</name> |
395 | <cstring>Layout8</cstring> | 423 | <cstring>Layout13</cstring> |
396 | </property> | 424 | </property> |
397 | <grid> | 425 | <grid> |
398 | <property stdset="1"> | 426 | <property stdset="1"> |
399 | <name>margin</name> | 427 | <name>margin</name> |
400 | <number>0</number> | 428 | <number>0</number> |
401 | </property> | 429 | </property> |
402 | <property stdset="1"> | 430 | <property stdset="1"> |
403 | <name>spacing</name> | 431 | <name>spacing</name> |
404 | <number>6</number> | 432 | <number>6</number> |
405 | </property> | 433 | </property> |
406 | <widget row="0" column="1" > | 434 | <widget row="1" column="0" > |
407 | <class>QLineEdit</class> | 435 | <class>QLabel</class> |
408 | <property stdset="1"> | 436 | <property stdset="1"> |
409 | <name>name</name> | 437 | <name>name</name> |
410 | <cstring>destinationname</cstring> | 438 | <cstring>TextLabel1_3_2_2</cstring> |
411 | </property> | 439 | </property> |
412 | </widget> | ||
413 | <widget row="1" column="1" > | ||
414 | <class>QLineEdit</class> | ||
415 | <property stdset="1"> | 440 | <property stdset="1"> |
416 | <name>name</name> | 441 | <name>text</name> |
417 | <cstring>destinationurl</cstring> | 442 | <string>URL:</string> |
418 | </property> | 443 | </property> |
419 | </widget> | 444 | </widget> |
420 | <widget row="2" column="1" > | 445 | <widget row="3" column="1" > |
421 | <class>QPushButton</class> | 446 | <class>QPushButton</class> |
422 | <property stdset="1"> | 447 | <property stdset="1"> |
423 | <name>name</name> | 448 | <name>name</name> |
424 | <cstring>btnChangeDest</cstring> | 449 | <cstring>btnChangeDest</cstring> |
425 | </property> | 450 | </property> |
426 | <property stdset="1"> | 451 | <property stdset="1"> |
427 | <name>text</name> | 452 | <name>text</name> |
428 | <string>Change</string> | 453 | <string>Change</string> |
429 | </property> | 454 | </property> |
430 | </widget> | 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> | ||
431 | <widget row="0" column="0" > | 463 | <widget row="0" column="0" > |
432 | <class>QLabel</class> | 464 | <class>QLabel</class> |
433 | <property stdset="1"> | 465 | <property stdset="1"> |
434 | <name>name</name> | 466 | <name>name</name> |
435 | <cstring>TextLabel1_3_2</cstring> | 467 | <cstring>TextLabel1_3_2</cstring> |
436 | </property> | 468 | </property> |
437 | <property stdset="1"> | 469 | <property stdset="1"> |
438 | <name>text</name> | 470 | <name>text</name> |
439 | <string>Name:</string> | 471 | <string>Name:</string> |
440 | </property> | 472 | </property> |
441 | </widget> | 473 | </widget> |
442 | <widget row="1" column="0" > | 474 | <widget row="2" column="1" > |
443 | <class>QLabel</class> | 475 | <class>QCheckBox</class> |
444 | <property stdset="1"> | 476 | <property stdset="1"> |
445 | <name>name</name> | 477 | <name>name</name> |
446 | <cstring>TextLabel1_3_2_2</cstring> | 478 | <cstring>linkToRoot</cstring> |
447 | </property> | 479 | </property> |
448 | <property stdset="1"> | 480 | <property stdset="1"> |
449 | <name>text</name> | 481 | <name>text</name> |
450 | <string>URL:</string> | 482 | <string>LinkToRoot</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> | ||
451 | </property> | 494 | </property> |
452 | </widget> | 495 | </widget> |
453 | </grid> | 496 | </grid> |
454 | </widget> | 497 | </widget> |
455 | </grid> | 498 | </grid> |
456 | </widget> | 499 | </widget> |
457 | </widget> | 500 | </widget> |
458 | </grid> | 501 | </grid> |
459 | </widget> | 502 | </widget> |
460 | <connections> | 503 | <connections> |
461 | <connection> | 504 | <connection> |
462 | <sender>newserver</sender> | 505 | <sender>newserver</sender> |
463 | <signal>clicked()</signal> | 506 | <signal>clicked()</signal> |
464 | <receiver>Settings</receiver> | 507 | <receiver>Settings</receiver> |
465 | <slot>newServer()</slot> | 508 | <slot>newServer()</slot> |
466 | </connection> | 509 | </connection> |
467 | <connection> | 510 | <connection> |
468 | <sender>removeserver</sender> | 511 | <sender>removeserver</sender> |
469 | <signal>clicked()</signal> | 512 | <signal>clicked()</signal> |
470 | <receiver>Settings</receiver> | 513 | <receiver>Settings</receiver> |
471 | <slot>removeServer()</slot> | 514 | <slot>removeServer()</slot> |
472 | </connection> | 515 | </connection> |
473 | <connection> | 516 | <connection> |
474 | <sender>newdestination</sender> | 517 | <sender>newdestination</sender> |
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 81e89ed..9ee3a33 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp | |||
@@ -1,48 +1,53 @@ | |||
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 | using namespace std; | 19 | using namespace std; |
20 | 20 | ||
21 | #include <qlistbox.h> | 21 | #include <qlistbox.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
24 | #include <qtabwidget.h> | 24 | #include <qtabwidget.h> |
25 | #include <qcheckbox.h> | ||
26 | |||
27 | #ifdef QWS | ||
28 | #include <qpe/config.h> | ||
29 | #endif | ||
25 | 30 | ||
26 | #include "settingsimpl.h" | 31 | #include "settingsimpl.h" |
27 | 32 | ||
28 | #include "global.h" | 33 | #include "global.h" |
29 | 34 | ||
30 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 35 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
31 | : SettingsBase( parent, name, modal, fl ) | 36 | : SettingsBase( parent, name, modal, fl ) |
32 | { | 37 | { |
33 | dataMgr = dataManager; | 38 | dataMgr = dataManager; |
34 | 39 | ||
35 | setupData(); | 40 | setupData(); |
36 | changed = false; | 41 | changed = false; |
37 | newserver = false; | 42 | newserver = false; |
38 | newdestination = false; | 43 | newdestination = false; |
39 | } | 44 | } |
40 | 45 | ||
41 | SettingsImpl :: ~SettingsImpl() | 46 | SettingsImpl :: ~SettingsImpl() |
42 | { | 47 | { |
43 | 48 | ||
44 | } | 49 | } |
45 | 50 | ||
46 | bool SettingsImpl :: showDlg( int i ) | 51 | bool SettingsImpl :: showDlg( int i ) |
47 | { | 52 | { |
48 | TabWidget->setCurrentPage( i ); | 53 | TabWidget->setCurrentPage( i ); |
@@ -62,134 +67,160 @@ void SettingsImpl :: setupData() | |||
62 | for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it ) | 67 | for ( it = dataMgr->getServerList().begin() ; it != dataMgr->getServerList().end() ; ++it ) |
63 | { | 68 | { |
64 | if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) | 69 | if ( it->getServerName() == LOCAL_SERVER || it->getServerName() == LOCAL_IPKGS ) |
65 | continue; | 70 | continue; |
66 | 71 | ||
67 | servers->insertItem( it->getServerName() ); | 72 | servers->insertItem( it->getServerName() ); |
68 | } | 73 | } |
69 | 74 | ||
70 | // add destinations | 75 | // add destinations |
71 | vector<Destination>::iterator it2; | 76 | vector<Destination>::iterator it2; |
72 | for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) | 77 | for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 ) |
73 | destinations->insertItem( it2->getDestinationName() ); | 78 | destinations->insertItem( it2->getDestinationName() ); |
74 | 79 | ||
75 | } | 80 | } |
76 | 81 | ||
77 | //------------------ Servers tab ---------------------- | 82 | //------------------ Servers tab ---------------------- |
78 | 83 | ||
79 | void SettingsImpl :: editServer( int sel ) | 84 | void SettingsImpl :: editServer( int sel ) |
80 | { | 85 | { |
81 | currentSelectedServer = sel; | 86 | currentSelectedServer = sel; |
82 | Server *s = dataMgr->getServer( servers->currentText() ); | 87 | Server *s = dataMgr->getServer( servers->currentText() ); |
83 | serverName = s->getServerName(); | 88 | serverName = s->getServerName(); |
84 | servername->setText( s->getServerName() ); | 89 | servername->setText( s->getServerName() ); |
85 | serverurl->setText( s->getServerUrl() ); | 90 | serverurl->setText( s->getServerUrl() ); |
91 | active->setChecked( s->isServerActive() ); | ||
86 | } | 92 | } |
87 | 93 | ||
88 | void SettingsImpl :: newServer() | 94 | void SettingsImpl :: newServer() |
89 | { | 95 | { |
90 | newserver = true; | 96 | newserver = true; |
91 | servername->setText( "" ); | 97 | servername->setText( "" ); |
92 | serverurl->setText( "" ); | 98 | serverurl->setText( "" ); |
93 | servername->setFocus(); | 99 | servername->setFocus(); |
100 | active->setChecked( true ); | ||
94 | } | 101 | } |
95 | 102 | ||
96 | void SettingsImpl :: removeServer() | 103 | void SettingsImpl :: removeServer() |
97 | { | 104 | { |
98 | changed = true; | 105 | changed = true; |
99 | Server *s = dataMgr->getServer( servers->currentText() ); | 106 | Server *s = dataMgr->getServer( servers->currentText() ); |
100 | dataMgr->getServerList().erase( s ); | 107 | dataMgr->getServerList().erase( s ); |
101 | servers->removeItem( currentSelectedServer ); | 108 | servers->removeItem( currentSelectedServer ); |
102 | } | 109 | } |
103 | 110 | ||
104 | void SettingsImpl :: changeServerDetails() | 111 | void SettingsImpl :: changeServerDetails() |
105 | { | 112 | { |
106 | changed = true; | 113 | changed = true; |
107 | 114 | ||
108 | QString newName = servername->text(); | 115 | QString newName = servername->text(); |
109 | if ( !newserver ) | 116 | if ( !newserver ) |
110 | { | 117 | { |
111 | Server *s = dataMgr->getServer( serverName ); | 118 | Server *s = dataMgr->getServer( serverName ); |
112 | 119 | ||
113 | // Update url | 120 | // Update url |
114 | s->setServerUrl( serverurl->text() ); | 121 | s->setServerUrl( serverurl->text() ); |
122 | s->setActive( active->isChecked() ); | ||
123 | |||
115 | 124 | ||
116 | // Check if server name has changed, if it has then we need to replace the key in the map | 125 | // Check if server name has changed, if it has then we need to replace the key in the map |
117 | if ( serverName != newName ) | 126 | if ( serverName != newName ) |
118 | { | 127 | { |
119 | // Update server name | 128 | // Update server name |
120 | s->setServerName( newName ); | 129 | s->setServerName( newName ); |
121 | 130 | ||
122 | // See if this server is the active server | 131 | // See if this server is the active server |
123 | if ( dataMgr->getActiveServer() == serverName ) | 132 | // if ( dataMgr->getActiveServer() == serverName ) |
124 | dataMgr->setActiveServer( newName ); | 133 | // dataMgr->setActiveServer( newName ); |
125 | 134 | ||
126 | // Update list box | 135 | // Update list box |
127 | servers->changeItem( newName, currentSelectedServer ); | 136 | servers->changeItem( newName, currentSelectedServer ); |
128 | } | 137 | } |
129 | } | 138 | } |
130 | else | 139 | else |
131 | { | 140 | { |
141 | Server s( newName, serverurl->text() ); | ||
132 | dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); | 142 | dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); |
143 | dataMgr->getServerList().end()->setActive( active->isChecked() ); | ||
133 | servers->insertItem( newName ); | 144 | servers->insertItem( newName ); |
134 | servers->setCurrentItem( servers->count() ); | 145 | servers->setCurrentItem( servers->count() ); |
135 | newserver = false; | 146 | newserver = false; |
136 | } | 147 | } |
137 | } | 148 | } |
138 | 149 | ||
139 | //------------------ Destinations tab ---------------------- | 150 | //------------------ Destinations tab ---------------------- |
140 | 151 | ||
141 | void SettingsImpl :: editDestination( int sel ) | 152 | void SettingsImpl :: editDestination( int sel ) |
142 | { | 153 | { |
143 | currentSelectedDestination = sel; | 154 | currentSelectedDestination = sel; |
144 | Destination *s = dataMgr->getDestination( destinations->currentText() ); | 155 | Destination *d = dataMgr->getDestination( destinations->currentText() ); |
145 | destinationName = s->getDestinationName(); | 156 | destinationName = d->getDestinationName(); |
146 | destinationname->setText( s->getDestinationName() ); | 157 | destinationname->setText( d->getDestinationName() ); |
147 | destinationurl->setText( s->getDestinationPath() ); | 158 | destinationurl->setText( d->getDestinationPath() ); |
159 | linkToRoot->setChecked( d->linkToRoot() ); | ||
148 | } | 160 | } |
149 | 161 | ||
150 | void SettingsImpl :: newDestination() | 162 | void SettingsImpl :: newDestination() |
151 | { | 163 | { |
152 | newdestination = true; | 164 | newdestination = true; |
153 | destinationname->setText( "" ); | 165 | destinationname->setText( "" ); |
154 | destinationurl->setText( "" ); | 166 | destinationurl->setText( "" ); |
155 | destinationname->setFocus(); | 167 | destinationname->setFocus(); |
168 | linkToRoot->setChecked( true ); | ||
156 | } | 169 | } |
157 | 170 | ||
158 | void SettingsImpl :: removeDestination() | 171 | void SettingsImpl :: removeDestination() |
159 | { | 172 | { |
160 | changed = true; | 173 | changed = true; |
161 | Destination *d = dataMgr->getDestination( destinations->currentText() ); | 174 | Destination *d = dataMgr->getDestination( destinations->currentText() ); |
162 | dataMgr->getDestinationList().erase( d ); | 175 | dataMgr->getDestinationList().erase( d ); |
163 | destinations->removeItem( currentSelectedDestination ); | 176 | destinations->removeItem( currentSelectedDestination ); |
164 | } | 177 | } |
165 | 178 | ||
166 | void SettingsImpl :: changeDestinationDetails() | 179 | void SettingsImpl :: changeDestinationDetails() |
167 | { | 180 | { |
168 | changed = true; | 181 | changed = true; |
169 | 182 | ||
183 | #ifdef QWS | ||
184 | Config cfg( "aqpkg" ); | ||
185 | cfg.setGroup( "destinations" ); | ||
186 | #endif | ||
187 | |||
170 | QString newName = destinationname->text(); | 188 | QString newName = destinationname->text(); |
171 | if ( !newdestination ) | 189 | if ( !newdestination ) |
172 | { | 190 | { |
173 | Destination *d = dataMgr->getDestination( destinationName ); | 191 | Destination *d = dataMgr->getDestination( destinationName ); |
174 | 192 | ||
175 | // Update url | 193 | // Update url |
176 | d->setDestinationPath( destinationurl->text() ); | 194 | d->setDestinationPath( destinationurl->text() ); |
195 | d->linkToRoot( linkToRoot->isChecked() ); | ||
177 | 196 | ||
178 | // Check if server name has changed, if it has then we need to replace the key in the map | 197 | // Check if server name has changed, if it has then we need to replace the key in the map |
179 | if ( destinationName != newName ) | 198 | if ( destinationName != newName ) |
180 | { | 199 | { |
181 | // Update server name | 200 | // Update server name |
182 | d->setDestinationName( newName ); | 201 | d->setDestinationName( newName ); |
183 | 202 | ||
184 | // Update list box | 203 | // Update list box |
185 | destinations->changeItem( newName, currentSelectedDestination ); | 204 | destinations->changeItem( newName, currentSelectedDestination ); |
186 | } | 205 | } |
206 | #ifdef QWS | ||
207 | QString key = newName; | ||
208 | key += "_linkToRoot"; | ||
209 | int val = d->linkToRoot(); | ||
210 | cfg.writeEntry( key, val ); | ||
211 | #endif | ||
187 | } | 212 | } |
188 | else | 213 | else |
189 | { | 214 | { |
190 | dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); | 215 | dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); |
191 | destinations->insertItem( newName ); | 216 | destinations->insertItem( newName ); |
192 | destinations->setCurrentItem( destinations->count() ); | 217 | destinations->setCurrentItem( destinations->count() ); |
193 | newdestination = false; | 218 | newdestination = false; |
219 | |||
220 | #ifdef QWS | ||
221 | QString key = newName; | ||
222 | key += "_linkToRoot"; | ||
223 | cfg.writeEntry( key, true ); | ||
224 | #endif | ||
194 | } | 225 | } |
195 | } | 226 | } |