From b61a21e46590228b6c5800d168fc57789ce733f6 Mon Sep 17 00:00:00 2001 From: andyq Date: Thu, 17 Oct 2002 22:50:20 +0000 Subject: Changed dlg to add linkToRoot checkbox to destinations tab --- (limited to 'noncore') 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,531 +1,574 @@ - -SettingsBase - - QDialog - - name - Settings - - - geometry - - 0 - 0 - 331 - 456 - - - - caption - Package Servers - - - layoutMargin - - - layoutSpacing - - - - margin - 11 - - - spacing - 6 - - - QTabWidget - - name - TabWidget - - - enabled - true - - - layoutMargin - - - layoutSpacing - - - QWidget - - name - tab - - - title - Servers - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout2 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - Servers - - - text - Servers - - - - - name - Spacer2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QListBox - - name - servers - - - selectionMode - Extended - - - - QPushButton - - name - removeserver - - - enabled - true - - - text - Remove - - - autoDefault - false - - - - QPushButton - - name - newserver - - - enabled - true - - - text - New - - - autoDefault - false - - - - QLayoutWidget - - name - Layout10 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - serverurl - - - - QLabel - - name - TextLabel2_3 - - - text - URL: - - - - QLineEdit - - name - servername - - - - QLabel - - name - TextLabel1_3 - - - text - Name: - - - - QPushButton - - name - btnChangeServer - - - text - Change - - - - - - - - QWidget - - name - tab - - - title - Destinations - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout3 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - Destinations - - - text - Destinations - - - - - name - Spacer2_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QLayoutWidget - - name - Layout5 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - newdestination - - - enabled - true - - - text - New - - - autoDefault - false - - - - QPushButton - - name - removedestination - - - enabled - true - - - text - Remove - - - autoDefault - false - - - - - - - name - Spacer3 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QListBox - - name - destinations - - - selectionMode - Single - - - - QLayoutWidget - - name - Layout8 - - - - margin - 0 - - - spacing - 6 - - - QLineEdit - - name - destinationname - - - - QLineEdit - - name - destinationurl - - - - QPushButton - - name - btnChangeDest - - - text - Change - - - - QLabel - - name - TextLabel1_3_2 - - - text - Name: - - - - QLabel - - name - TextLabel1_3_2_2 - - - text - URL: - - - - - - - - - - - - newserver - clicked() - Settings - newServer() - - - removeserver - clicked() - Settings - removeServer() - - - newdestination - clicked() - Settings - newDestination() - - - removedestination - clicked() - Settings - removeDestination() - - - servers - highlighted(int) - Settings - editServer(int) - - - destinations - highlighted(int) - Settings - editDestination(int) - - - btnChangeServer - clicked() - Settings - changeServerDetails() - - - btnChangeDest - clicked() - Settings - changeDestinationDetails() - - activeServerChanged() - changeServerDetails() - createLinksToDest() - destNameChanged(const QString&) - destUrlChanged(const QString&) - editDestination(int) - editServer(int) - installationSettingChange(int) - installationSettingSetName(const QString &) - linkEnabled(bool) - newDestination() - newInstallationSetting() - newServer() - changeDestinationDetails() - removeDestination() - removeInstallationSetting() - removeLinksToDest() - removeServer() - renameInstallationSetting() - serverNameChanged(const QString&) - serverUrlChanged(const QString&) - - + +SettingsBase + + QDialog + + name + Settings + + + geometry + + 0 + 0 + 247 + 390 + + + + caption + Package Servers + + + layoutMargin + + + layoutSpacing + + + + margin + 11 + + + spacing + 6 + + + QTabWidget + + name + TabWidget + + + enabled + true + + + layoutMargin + + + layoutSpacing + + + QWidget + + name + tab + + + title + Servers + + + + margin + 11 + + + spacing + 6 + + + QLayoutWidget + + name + Layout2 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + Servers + + + text + Servers + + + + + name + Spacer2 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + QLayoutWidget + + name + Layout8 + + + + margin + 0 + + + spacing + 6 + + + QListBox + + name + servers + + + selectionMode + Extended + + + + QLayoutWidget + + name + Layout6 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + active + + + text + Active Server + + + + QLabel + + name + TextLabel1_3 + + + text + Name: + + + + QLabel + + name + TextLabel2_3 + + + text + URL: + + + + QLineEdit + + name + servername + + + + QLineEdit + + name + serverurl + + + + QPushButton + + name + btnChangeServer + + + text + Change + + + + + + QPushButton + + name + removeserver + + + enabled + true + + + text + Remove + + + autoDefault + false + + + + QPushButton + + name + newserver + + + enabled + true + + + text + New + + + autoDefault + false + + + + + + + + QWidget + + name + tab + + + title + Destinations + + + + margin + 11 + + + spacing + 6 + + + QLayoutWidget + + name + Layout3 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + Destinations + + + text + Destinations + + + + + name + Spacer2_2 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QPushButton + + name + newdestination + + + enabled + true + + + text + New + + + autoDefault + false + + + + QPushButton + + name + removedestination + + + enabled + true + + + text + Remove + + + autoDefault + false + + + + + + + name + Spacer3 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QListBox + + name + destinations + + + selectionMode + Single + + + + QLayoutWidget + + name + Layout13 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel1_3_2_2 + + + text + URL: + + + + QPushButton + + name + btnChangeDest + + + text + Change + + + + QLineEdit + + name + destinationname + + + + QLabel + + name + TextLabel1_3_2 + + + text + Name: + + + + QCheckBox + + name + linkToRoot + + + text + LinkToRoot + + + checked + true + + + + QLineEdit + + name + destinationurl + + + + + + + + + + + + newserver + clicked() + Settings + newServer() + + + removeserver + clicked() + Settings + removeServer() + + + newdestination + clicked() + Settings + newDestination() + + + removedestination + clicked() + Settings + removeDestination() + + + servers + highlighted(int) + Settings + editServer(int) + + + destinations + highlighted(int) + Settings + editDestination(int) + + + btnChangeServer + clicked() + Settings + changeServerDetails() + + + btnChangeDest + clicked() + Settings + changeDestinationDetails() + + activeServerChanged() + changeServerDetails() + createLinksToDest() + destNameChanged(const QString&) + destUrlChanged(const QString&) + editDestination(int) + editServer(int) + installationSettingChange(int) + installationSettingSetName(const QString &) + linkEnabled(bool) + newDestination() + newInstallationSetting() + newServer() + changeDestinationDetails() + removeDestination() + removeInstallationSetting() + removeLinksToDest() + removeServer() + renameInstallationSetting() + serverNameChanged(const QString&) + serverUrlChanged(const QString&) + + 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; #include #include #include +#include + +#ifdef QWS +#include +#endif #include "settingsimpl.h" @@ -83,6 +88,7 @@ void SettingsImpl :: editServer( int sel ) serverName = s->getServerName(); servername->setText( s->getServerName() ); serverurl->setText( s->getServerUrl() ); + active->setChecked( s->isServerActive() ); } void SettingsImpl :: newServer() @@ -91,6 +97,7 @@ void SettingsImpl :: newServer() servername->setText( "" ); serverurl->setText( "" ); servername->setFocus(); + active->setChecked( true ); } void SettingsImpl :: removeServer() @@ -112,6 +119,8 @@ void SettingsImpl :: changeServerDetails() // 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 ) @@ -120,8 +129,8 @@ void SettingsImpl :: changeServerDetails() 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 ); @@ -129,7 +138,9 @@ void SettingsImpl :: changeServerDetails() } 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; @@ -141,10 +152,11 @@ 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() @@ -153,6 +165,7 @@ void SettingsImpl :: newDestination() destinationname->setText( "" ); destinationurl->setText( "" ); destinationname->setFocus(); + linkToRoot->setChecked( true ); } void SettingsImpl :: removeDestination() @@ -167,13 +180,19 @@ 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 ) @@ -184,6 +203,12 @@ 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 { @@ -191,5 +216,11 @@ void SettingsImpl :: changeDestinationDetails() destinations->insertItem( newName ); destinations->setCurrentItem( destinations->count() ); newdestination = false; + +#ifdef QWS + QString key = newName; + key += "_linkToRoot"; + cfg.writeEntry( key, true ); +#endif } } -- cgit v0.9.0.2