author | benmeyer <benmeyer> | 2002-10-02 19:23:45 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-02 19:23:45 (UTC) |
commit | 2d0c6327dd40ab6847ce055c40ca59893bc8b9b2 (patch) (side-by-side diff) | |
tree | 260222139bb322f24d058cba10db0f7d1c43858f /noncore/net/networksetup | |
parent | c997983c6917885f6c487b942a9b294fa50ae618 (diff) | |
download | opie-2d0c6327dd40ab6847ce055c40ca59893bc8b9b2.zip opie-2d0c6327dd40ab6847ce055c40ca59893bc8b9b2.tar.gz opie-2d0c6327dd40ab6847ce055c40ca59893bc8b9b2.tar.bz2 |
Fixes
-rw-r--r-- | noncore/net/networksetup/interfaceinformation.ui | 11 | ||||
-rw-r--r-- | noncore/net/networksetup/interfacesetup.ui | 13 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindow.ui | 171 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 23 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.h | 3 | ||||
-rw-r--r-- | noncore/net/networksetup/namedialog.cpp | 61 | ||||
-rw-r--r-- | noncore/net/networksetup/namedialog.h | 36 | ||||
-rw-r--r-- | noncore/net/networksetup/networksetup.pro | 4 | ||||
-rw-r--r-- | noncore/net/networksetup/systemadvanced.ui | 51 |
9 files changed, 157 insertions, 216 deletions
diff --git a/noncore/net/networksetup/interfaceinformation.ui b/noncore/net/networksetup/interfaceinformation.ui index 8b6280d..76af19c 100644 --- a/noncore/net/networksetup/interfaceinformation.ui +++ b/noncore/net/networksetup/interfaceinformation.ui @@ -11,7 +11,7 @@ <rect> <x>0</x> <y>0</y> - <width>203</width> + <width>199</width> <height>244</height> </rect> </property> @@ -333,6 +333,11 @@ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> </image> </images> -<connections> -</connections> +<tabstops> + <tabstop>startButton</tabstop> + <tabstop>stopButton</tabstop> + <tabstop>refreshButton</tabstop> + <tabstop>restartButton</tabstop> + <tabstop>advancedButton</tabstop> +</tabstops> </UI> diff --git a/noncore/net/networksetup/interfacesetup.ui b/noncore/net/networksetup/interfacesetup.ui index d367608..3db9a0b 100644 --- a/noncore/net/networksetup/interfacesetup.ui +++ b/noncore/net/networksetup/interfacesetup.ui @@ -11,7 +11,7 @@ <rect> <x>0</x> <y>0</y> - <width>271</width> + <width>267</width> <height>280</height> </rect> </property> @@ -333,4 +333,15 @@ <slot>setDisabled(bool)</slot> </connection> </connections> +<tabstops> + <tabstop>autoStart</tabstop> + <tabstop>profileCombo</tabstop> + <tabstop>dhcpCheckBox</tabstop> + <tabstop>leaseTime</tabstop> + <tabstop>ipAddressEdit</tabstop> + <tabstop>subnetMaskEdit</tabstop> + <tabstop>gatewayEdit</tabstop> + <tabstop>firstDNSLineEdit</tabstop> + <tabstop>secondDNSLineEdit</tabstop> +</tabstops> </UI> diff --git a/noncore/net/networksetup/mainwindow.ui b/noncore/net/networksetup/mainwindow.ui index 3538aeb..bea999b 100644 --- a/noncore/net/networksetup/mainwindow.ui +++ b/noncore/net/networksetup/mainwindow.ui @@ -11,7 +11,7 @@ <rect> <x>0</x> <y>0</y> - <width>217</width> + <width>230</width> <height>289</height> </rect> </property> @@ -208,28 +208,27 @@ <name>spacing</name> <number>6</number> </property> - <widget row="1" column="0" rowspan="1" colspan="3" > - <class>Line</class> - <property stdset="1"> + <spacer row="7" column="2" > + <property> <name>name</name> - <cstring>Line1</cstring> + <cstring>Spacer16</cstring> </property> <property stdset="1"> <name>orientation</name> - <enum>Horizontal</enum> + <enum>Vertical</enum> </property> - </widget> - <widget row="0" column="0" > - <class>QLabel</class> <property stdset="1"> - <name>name</name> - <cstring>TextLabel1</cstring> + <name>sizeType</name> + <enum>Expanding</enum> </property> - <property stdset="1"> - <name>text</name> - <string>Current Profile</string> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> </property> - </widget> + </spacer> <widget row="0" column="1" > <class>QLabel</class> <property stdset="1"> @@ -249,35 +248,76 @@ <string>All</string> </property> </widget> - <spacer row="0" column="2" > - <property> + <widget row="3" column="2" > + <class>QPushButton</class> + <property stdset="1"> <name>name</name> - <cstring>Spacer2</cstring> + <cstring>setCurrentProfileButton</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>&Set Current</string> + </property> + </widget> + <widget row="5" column="0" rowspan="1" colspan="3" > + <class>Line</class> + <property stdset="1"> + <name>name</name> + <cstring>Line6</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> + </widget> + <widget row="1" column="0" rowspan="1" colspan="3" > + <class>Line</class> <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> + <name>name</name> + <cstring>Line1</cstring> </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> </property> - </spacer> - <spacer row="6" column="2" > + </widget> + <widget row="0" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Current Profile</string> + </property> + </widget> + <widget row="4" column="2" > + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>removeProfileButton</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>&Remove</string> + </property> + </widget> + <widget row="3" column="0" rowspan="2" colspan="2" > + <class>QListBox</class> + <property stdset="1"> + <name>name</name> + <cstring>profilesList</cstring> + </property> + </widget> + <spacer row="0" column="2" > <property> <name>name</name> - <cstring>Spacer16</cstring> + <cstring>Spacer2</cstring> </property> <property stdset="1"> <name>orientation</name> - <enum>Vertical</enum> + <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> @@ -291,57 +331,67 @@ </size> </property> </spacer> - <widget row="5" column="2" > - <class>QPushButton</class> + <widget row="2" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>PushButton7</cstring> + <cstring>TextLabel1_2</cstring> </property> <property stdset="1"> <name>text</name> - <string>&Set Current</string> + <string>Profiles</string> </property> </widget> - <widget row="4" column="2" > - <class>QPushButton</class> + <widget row="6" column="0" rowspan="1" colspan="3" > + <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>removeProfileButton</cstring> + <cstring>Layout6</cstring> </property> + <hbox> <property stdset="1"> - <name>text</name> - <string>&Remove</string> + <name>margin</name> + <number>0</number> </property> - </widget> - <widget row="3" column="2" > - <class>QPushButton</class> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>newProfileButton</cstring> + <cstring>TextLabel1_3</cstring> </property> <property stdset="1"> <name>text</name> - <string>&New</string> + <string>New Profile</string> </property> </widget> - <widget row="2" column="0" > - <class>QLabel</class> + <widget> + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_2</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Profiles</string> + <cstring>newProfile</cstring> </property> </widget> - <widget row="3" column="0" rowspan="3" colspan="2" > - <class>QListBox</class> + <widget> + <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>profilesList</cstring> + <cstring>newProfileButton</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>&Add</string> </property> </widget> + </hbox> + </widget> </grid> </widget> </widget> @@ -369,4 +419,17 @@ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> </image> </images> +<tabstops> + <tabstop>tabWidget</tabstop> + <tabstop>connectionList</tabstop> + <tabstop>informationConnectionButton</tabstop> + <tabstop>configureConnectionButton</tabstop> + <tabstop>addConnectionButton</tabstop> + <tabstop>removeConnectionButton</tabstop> + <tabstop>profilesList</tabstop> + <tabstop>setCurrentProfileButton</tabstop> + <tabstop>removeProfileButton</tabstop> + <tabstop>newProfile</tabstop> + <tabstop>newProfileButton</tabstop> +</tabstops> </UI> diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index e9429e3..e895971 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -5,11 +5,11 @@ #include "module.h"
#include "kprocess.h"
-#include "namedialog.h"
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qlistbox.h>
+#include <qlineedit.h>
#include <qlistview.h>
#include <qheader.h>
#include <qlabel.h>
@@ -37,8 +37,9 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile()));
connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
- connect(profilesList, SIGNAL(highlighted(const QString&)), this, SLOT(changeProfile(const QString&)));
+ connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
+ connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
// Load connections.
loadModules(QDir::homeDirPath() + "/.networksetup/plugins");
getInterfaceList();
@@ -59,6 +60,7 @@ MainWindowImp::~MainWindowImp(){ // Save profiles.
if(profiles.count() > 1){
Config cfg("NetworkSetup");
+ cfg.setGroup("General");
cfg.writeEntry("Profiles", profiles.join(" "));
}
// Delete Modules and Libraries
@@ -372,17 +374,20 @@ void MainWindowImp::updateInterface(Interface *i){ item->setText(3, (i->getStatus()) ? i->getIp() : QString(""));
}
+void MainWindowImp::newProfileChanged(const QString& newText){
+ if(newText.length() > 0)
+ newProfileButton->setEnabled(true);
+ else
+ newProfileButton->setEnabled(false);
+}
+
/**
* Adds a new profile to the list of profiles.
* Don't add profiles that already exists.
* Appends to the list and QStringList
*/
void MainWindowImp::addProfile(){
- NameDialog foo(this, "namedialog", true);
- QString newProfileName = foo.go();
- if(newProfileName.length() == 0)
- return;
-
+ QString newProfileName = newProfile->text();
if(profiles.grep(newProfileName).count() > 0){
QMessageBox::information(this, "Can't Add","Profile already exists.", "Ok");
return;
@@ -414,8 +419,8 @@ void MainWindowImp::removeProfile(){ * A new profile has been selected, change.
* @param newProfile the new profile.
*/
-void MainWindowImp::changeProfile(const QString& newProfile){
- currentProfileLabel->setText(newProfile);
+void MainWindowImp::changeProfile(){
+ currentProfileLabel->setText(profilesList->text(profilesList->currentItem()));
}
// mainwindowimp.cpp
diff --git a/noncore/net/networksetup/mainwindowimp.h b/noncore/net/networksetup/mainwindowimp.h index 629b758..c67c161 100644 --- a/noncore/net/networksetup/mainwindowimp.h +++ b/noncore/net/networksetup/mainwindowimp.h @@ -28,9 +28,10 @@ private slots: void addProfile();
void removeProfile();
- void changeProfile(const QString&);
+ void changeProfile();
void updateInterface(Interface *i);
+ void newProfileChanged(const QString& newText);
private:
void loadModules(QString path);
diff --git a/noncore/net/networksetup/namedialog.cpp b/noncore/net/networksetup/namedialog.cpp deleted file mode 100644 index c5efa37..0000000 --- a/noncore/net/networksetup/namedialog.cpp +++ b/dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'namedialog.ui' -** -** Created: Sat Dec 15 04:36:20 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#include "namedialog.h" - -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qvariant.h> -#include <qtooltip.h> -#include <qwhatsthis.h> - -/* - * Constructs a NameDialog which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' - * - * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. - */ -NameDialog::NameDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) -{ - if ( !name ) - setName( "NameDialog" ); - resize( 176, 65 ); - setCaption( tr( "Enter A Name" ) ); - NameDialogLayout = new QGridLayout( this ); - NameDialogLayout->setSpacing( 6 ); - NameDialogLayout->setMargin( 5 ); - - Name = new QLineEdit( this, "Name" ); - - NameDialogLayout->addMultiCellWidget( Name, 0, 0, 0, 1 ); - - cancel = new QPushButton( this, "Cancel" ); - cancel->setText( tr( "&Cancel" ) ); - - NameDialogLayout->addWidget( cancel, 1, 1 ); - - ok = new QPushButton( this, "ok" ); - ok->setText( tr( "&Ok" ) ); - - NameDialogLayout->addWidget( ok, 1, 0 ); - - connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - connect( Name, SIGNAL(returnPressed () ), this, SLOT(accept() ) ); -} - -QString NameDialog::go(){ - if( exec() ) //pressed OK - return (Name->text()); - else //pressed cancel - return QString(); -} - diff --git a/noncore/net/networksetup/namedialog.h b/noncore/net/networksetup/namedialog.h deleted file mode 100644 index 4c4e149..0000000 --- a/noncore/net/networksetup/namedialog.h +++ b/dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'namedialog.ui' -** -** Created: Sat Dec 15 04:36:14 2001 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ -#ifndef NAMEDIALOG_H -#define NAMEDIALOG_H - -#include <qvariant.h> -#include <qdialog.h> -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QLineEdit; -class QPushButton; - -class NameDialog : public QDialog -{ - Q_OBJECT - -public: - NameDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); - - QLineEdit* Name; - QPushButton* cancel; - QPushButton* ok; - QString go(); - -protected: - QGridLayout* NameDialogLayout; -}; - -#endif // NAMEDIALOG_H diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro index e146eb4..ba70180 100644 --- a/noncore/net/networksetup/networksetup.pro +++ b/noncore/net/networksetup/networksetup.pro @@ -1,8 +1,8 @@ TEMPLATE = app #CONFIG = qt warn_on debug CONFIG = qt warn_on release -HEADERS = mainwindowimp.h addconnectionimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h namedialog.h -SOURCES = main.cpp namedialog.cpp mainwindowimp.cpp addconnectionimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp +HEADERS = mainwindowimp.h addconnectionimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h +SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp #INCLUDEPATH += $(QPEDIR)/include #DEPENDPATH += $(QPEDIR)/include LIBS += -lqpe diff --git a/noncore/net/networksetup/systemadvanced.ui b/noncore/net/networksetup/systemadvanced.ui index 6ea192c..cd7ac61 100644 --- a/noncore/net/networksetup/systemadvanced.ui +++ b/noncore/net/networksetup/systemadvanced.ui @@ -11,7 +11,7 @@ <rect> <x>0</x> <y>0</y> - <width>222</width> + <width>218</width> <height>289</height> </rect> </property> @@ -393,51 +393,4 @@ </property> </widget> <spacer row="2" column="1" > - <property> - <name>name</name> - <cstring>Spacer15</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </grid> - </widget> - </widget> - </vbox> -</widget> -<customwidgets> - <customwidget> - <class>QWidget</class> - <header location="local">qwidget.h</header> - <sizehint> - <width>100</width> - <height>100</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>7</hordata> - <verdata>7</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> -</customwidgets> -<images> - <image> - <name>image0</name> - <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> -</images> -</UI> +
\ No newline at end of file |