author | andyq <andyq> | 2002-10-17 22:50:20 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-17 22:50:20 (UTC) |
commit | b61a21e46590228b6c5800d168fc57789ce733f6 (patch) (side-by-side diff) | |
tree | da0732436919ccb19167eb124898615d499e5914 /noncore/settings/aqpkg/settingsimpl.cpp | |
parent | 51dbf76486cb81a7cb34c07483b344c8ea7a8a24 (diff) | |
download | opie-b61a21e46590228b6c5800d168fc57789ce733f6.zip opie-b61a21e46590228b6c5800d168fc57789ce733f6.tar.gz opie-b61a21e46590228b6c5800d168fc57789ce733f6.tar.bz2 |
Changed dlg to add linkToRoot checkbox to destinations tab
Diffstat (limited to 'noncore/settings/aqpkg/settingsimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 47 |
1 files changed, 39 insertions, 8 deletions
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 @@ -21,8 +21,13 @@ using namespace std; #include <qlistbox.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qtabwidget.h> +#include <qcheckbox.h> + +#ifdef QWS +#include <qpe/config.h> +#endif #include "settingsimpl.h" #include "global.h" @@ -82,16 +87,18 @@ void SettingsImpl :: editServer( int sel ) Server *s = dataMgr->getServer( servers->currentText() ); serverName = s->getServerName(); servername->setText( s->getServerName() ); serverurl->setText( s->getServerUrl() ); + active->setChecked( s->isServerActive() ); } void SettingsImpl :: newServer() { newserver = true; servername->setText( "" ); serverurl->setText( "" ); servername->setFocus(); + active->setChecked( true ); } void SettingsImpl :: removeServer() { @@ -111,26 +118,30 @@ void SettingsImpl :: changeServerDetails() Server *s = dataMgr->getServer( serverName ); // Update url s->setServerUrl( serverurl->text() ); + s->setActive( active->isChecked() ); + // Check if server name has changed, if it has then we need to replace the key in the map if ( serverName != newName ) { // Update server name s->setServerName( newName ); // See if this server is the active server - if ( dataMgr->getActiveServer() == serverName ) - dataMgr->setActiveServer( newName ); +// if ( dataMgr->getActiveServer() == serverName ) +// dataMgr->setActiveServer( newName ); // Update list box servers->changeItem( newName, currentSelectedServer ); } } else { - dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); + Server s( newName, serverurl->text() ); + dataMgr->getServerList().push_back( Server( newName, serverurl->text() ) ); + dataMgr->getServerList().end()->setActive( active->isChecked() ); servers->insertItem( newName ); servers->setCurrentItem( servers->count() ); newserver = false; } @@ -140,20 +151,22 @@ void SettingsImpl :: changeServerDetails() void SettingsImpl :: editDestination( int sel ) { currentSelectedDestination = sel; - Destination *s = dataMgr->getDestination( destinations->currentText() ); - destinationName = s->getDestinationName(); - destinationname->setText( s->getDestinationName() ); - destinationurl->setText( s->getDestinationPath() ); + Destination *d = dataMgr->getDestination( destinations->currentText() ); + destinationName = d->getDestinationName(); + destinationname->setText( d->getDestinationName() ); + destinationurl->setText( d->getDestinationPath() ); + linkToRoot->setChecked( d->linkToRoot() ); } void SettingsImpl :: newDestination() { newdestination = true; destinationname->setText( "" ); destinationurl->setText( "" ); destinationname->setFocus(); + linkToRoot->setChecked( true ); } void SettingsImpl :: removeDestination() { @@ -166,15 +179,21 @@ void SettingsImpl :: removeDestination() void SettingsImpl :: changeDestinationDetails() { changed = true; - QString newName = destinationname->text(); +#ifdef QWS + Config cfg( "aqpkg" ); + cfg.setGroup( "destinations" ); +#endif + + QString newName = destinationname->text(); if ( !newdestination ) { Destination *d = dataMgr->getDestination( destinationName ); // Update url d->setDestinationPath( destinationurl->text() ); + d->linkToRoot( linkToRoot->isChecked() ); // Check if server name has changed, if it has then we need to replace the key in the map if ( destinationName != newName ) { @@ -183,13 +202,25 @@ void SettingsImpl :: changeDestinationDetails() // Update list box destinations->changeItem( newName, currentSelectedDestination ); } +#ifdef QWS + QString key = newName; + key += "_linkToRoot"; + int val = d->linkToRoot(); + cfg.writeEntry( key, val ); +#endif } else { dataMgr->getDestinationList().push_back( Destination( newName, destinationurl->text() ) ); destinations->insertItem( newName ); destinations->setCurrentItem( destinations->count() ); newdestination = false; + +#ifdef QWS + QString key = newName; + key += "_linkToRoot"; + cfg.writeEntry( key, true ); +#endif } } |