summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-17 22:50:20 (UTC)
committer andyq <andyq>2002-10-17 22:50:20 (UTC)
commitb61a21e46590228b6c5800d168fc57789ce733f6 (patch) (unidiff)
treeda0732436919ccb19167eb124898615d499e5914
parent51dbf76486cb81a7cb34c07483b344c8ea7a8a24 (diff)
downloadopie-b61a21e46590228b6c5800d168fc57789ce733f6.zip
opie-b61a21e46590228b6c5800d168fc57789ce733f6.tar.gz
opie-b61a21e46590228b6c5800d168fc57789ce733f6.tar.bz2
Changed dlg to add linkToRoot checkbox to destinations tab
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/settings.ui169
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp43
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
@@ -11,8 +11,8 @@
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">
@@ -69,7 +69,7 @@
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>
@@ -118,7 +118,22 @@
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>
@@ -129,59 +144,61 @@
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">
@@ -189,44 +206,55 @@
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>
@@ -392,7 +420,7 @@
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">
@@ -403,21 +431,18 @@
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>
@@ -428,6 +453,13 @@
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">
@@ -439,15 +471,26 @@
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>
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
@@ -22,6 +22,11 @@ using namespace std;
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
@@ -83,6 +88,7 @@ void SettingsImpl :: editServer( int sel )
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
88void SettingsImpl :: newServer() 94void SettingsImpl :: newServer()
@@ -91,6 +97,7 @@ void SettingsImpl :: newServer()
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
96void SettingsImpl :: removeServer() 103void SettingsImpl :: removeServer()
@@ -112,6 +119,8 @@ void SettingsImpl :: changeServerDetails()
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 )
@@ -120,8 +129,8 @@ void SettingsImpl :: changeServerDetails()
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 );
@@ -129,7 +138,9 @@ void SettingsImpl :: changeServerDetails()
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;
@@ -141,10 +152,11 @@ void SettingsImpl :: changeServerDetails()
141void SettingsImpl :: editDestination( int sel ) 152void 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
150void SettingsImpl :: newDestination() 162void SettingsImpl :: newDestination()
@@ -153,6 +165,7 @@ void SettingsImpl :: newDestination()
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
158void SettingsImpl :: removeDestination() 171void SettingsImpl :: removeDestination()
@@ -167,6 +180,11 @@ 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 {
@@ -174,6 +192,7 @@ void SettingsImpl :: changeDestinationDetails()
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 )
@@ -184,6 +203,12 @@ void SettingsImpl :: changeDestinationDetails()
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 {
@@ -191,5 +216,11 @@ void SettingsImpl :: changeDestinationDetails()
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}