summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-17 22:50:20 (UTC)
committer andyq <andyq>2002-10-17 22:50:20 (UTC)
commitb61a21e46590228b6c5800d168fc57789ce733f6 (patch) (side-by-side diff)
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
@@ -12,6 +12,6 @@
<x>0</x>
<y>0</y>
- <width>331</width>
- <height>456</height>
+ <width>247</width>
+ <height>390</height>
</rect>
</property>
@@ -70,5 +70,5 @@
<number>6</number>
</property>
- <widget row="0" column="0" rowspan="1" colspan="2" >
+ <widget row="0" column="0" >
<class>QLayoutWidget</class>
<property stdset="1">
@@ -119,5 +119,20 @@
</hbox>
</widget>
- <widget row="1" column="0" rowspan="1" colspan="2" >
+ <widget row="1" column="0" >
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout8</cstring>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="0" column="0" rowspan="1" colspan="2" >
<class>QListBox</class>
<property stdset="1">
@@ -130,57 +145,59 @@
</property>
</widget>
- <widget row="2" column="1" >
- <class>QPushButton</class>
+ <widget row="2" column="0" rowspan="1" colspan="2" >
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>removeserver</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>true</bool>
+ <cstring>Layout6</cstring>
</property>
+ <grid>
<property stdset="1">
- <name>text</name>
- <string>Remove</string>
+ <name>margin</name>
+ <number>0</number>
</property>
<property stdset="1">
- <name>autoDefault</name>
- <bool>false</bool>
+ <name>spacing</name>
+ <number>6</number>
</property>
- </widget>
- <widget row="2" column="0" >
- <class>QPushButton</class>
+ <widget row="2" column="1" >
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>newserver</cstring>
+ <cstring>active</cstring>
</property>
<property stdset="1">
- <name>enabled</name>
- <bool>true</bool>
+ <name>text</name>
+ <string>Active Server</string>
</property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
<property stdset="1">
- <name>text</name>
- <string>New</string>
+ <name>name</name>
+ <cstring>TextLabel1_3</cstring>
</property>
<property stdset="1">
- <name>autoDefault</name>
- <bool>false</bool>
+ <name>text</name>
+ <string>Name:</string>
</property>
</widget>
- <widget row="3" column="0" rowspan="1" colspan="2" >
- <class>QLayoutWidget</class>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout10</cstring>
+ <cstring>TextLabel2_3</cstring>
</property>
- <grid>
<property stdset="1">
- <name>margin</name>
- <number>0</number>
+ <name>text</name>
+ <string>URL:</string>
</property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
<property stdset="1">
- <name>spacing</name>
- <number>6</number>
+ <name>name</name>
+ <cstring>servername</cstring>
</property>
+ </widget>
<widget row="1" column="1" >
<class>QLineEdit</class>
@@ -190,42 +207,53 @@
</property>
</widget>
- <widget row="1" column="0" >
- <class>QLabel</class>
+ <widget row="3" column="1" >
+ <class>QPushButton</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel2_3</cstring>
+ <cstring>btnChangeServer</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>URL:</string>
+ <string>Change</string>
</property>
</widget>
- <widget row="0" column="1" >
- <class>QLineEdit</class>
+ </grid>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QPushButton</class>
<property stdset="1">
<name>name</name>
- <cstring>servername</cstring>
+ <cstring>removeserver</cstring>
</property>
- </widget>
- <widget row="0" column="0" >
- <class>QLabel</class>
<property stdset="1">
- <name>name</name>
- <cstring>TextLabel1_3</cstring>
+ <name>enabled</name>
+ <bool>true</bool>
</property>
<property stdset="1">
<name>text</name>
- <string>Name:</string>
+ <string>Remove</string>
+ </property>
+ <property stdset="1">
+ <name>autoDefault</name>
+ <bool>false</bool>
</property>
</widget>
- <widget row="2" column="1" >
+ <widget row="1" column="0" >
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
- <cstring>btnChangeServer</cstring>
+ <cstring>newserver</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
</property>
<property stdset="1">
<name>text</name>
- <string>Change</string>
+ <string>New</string>
+ </property>
+ <property stdset="1">
+ <name>autoDefault</name>
+ <bool>false</bool>
</property>
</widget>
@@ -393,5 +421,5 @@
<property stdset="1">
<name>name</name>
- <cstring>Layout8</cstring>
+ <cstring>Layout13</cstring>
</property>
<grid>
@@ -404,19 +432,16 @@
<number>6</number>
</property>
- <widget row="0" column="1" >
- <class>QLineEdit</class>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>destinationname</cstring>
+ <cstring>TextLabel1_3_2_2</cstring>
</property>
- </widget>
- <widget row="1" column="1" >
- <class>QLineEdit</class>
<property stdset="1">
- <name>name</name>
- <cstring>destinationurl</cstring>
+ <name>text</name>
+ <string>URL:</string>
</property>
</widget>
- <widget row="2" column="1" >
+ <widget row="3" column="1" >
<class>QPushButton</class>
<property stdset="1">
@@ -429,4 +454,11 @@
</property>
</widget>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>destinationname</cstring>
+ </property>
+ </widget>
<widget row="0" column="0" >
<class>QLabel</class>
@@ -440,13 +472,24 @@
</property>
</widget>
- <widget row="1" column="0" >
- <class>QLabel</class>
+ <widget row="2" column="1" >
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1_3_2_2</cstring>
+ <cstring>linkToRoot</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>URL:</string>
+ <string>LinkToRoot</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>destinationurl</cstring>
</property>
</widget>
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
@@ -23,4 +23,9 @@ using namespace std;
#include <qpushbutton.h>
#include <qtabwidget.h>
+#include <qcheckbox.h>
+
+#ifdef QWS
+#include <qpe/config.h>
+#endif
#include "settingsimpl.h"
@@ -84,4 +89,5 @@ void SettingsImpl :: editServer( int sel )
servername->setText( s->getServerName() );
serverurl->setText( s->getServerUrl() );
+ active->setChecked( s->isServerActive() );
}
@@ -92,4 +98,5 @@ void SettingsImpl :: newServer()
serverurl->setText( "" );
servername->setFocus();
+ active->setChecked( true );
}
@@ -113,4 +120,6 @@ 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
@@ -121,6 +130,6 @@ void SettingsImpl :: changeServerDetails()
// 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
@@ -130,5 +139,7 @@ void SettingsImpl :: changeServerDetails()
else
{
+ 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() );
@@ -142,8 +153,9 @@ 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() );
}
@@ -154,4 +166,5 @@ void SettingsImpl :: newDestination()
destinationurl->setText( "" );
destinationname->setFocus();
+ linkToRoot->setChecked( true );
}
@@ -168,4 +181,9 @@ void SettingsImpl :: changeDestinationDetails()
changed = true;
+#ifdef QWS
+ Config cfg( "aqpkg" );
+ cfg.setGroup( "destinations" );
+#endif
+
QString newName = destinationname->text();
if ( !newdestination )
@@ -175,4 +193,5 @@ void SettingsImpl :: changeDestinationDetails()
// 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
@@ -185,4 +204,10 @@ void SettingsImpl :: changeDestinationDetails()
destinations->changeItem( newName, currentSelectedDestination );
}
+#ifdef QWS
+ QString key = newName;
+ key += "_linkToRoot";
+ int val = d->linkToRoot();
+ cfg.writeEntry( key, val );
+#endif
}
else
@@ -192,4 +217,10 @@ void SettingsImpl :: changeDestinationDetails()
destinations->setCurrentItem( destinations->count() );
newdestination = false;
+
+#ifdef QWS
+ QString key = newName;
+ key += "_linkToRoot";
+ cfg.writeEntry( key, true );
+#endif
}
}