summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-04-14 23:26:44 (UTC)
committer kergoth <kergoth>2003-04-14 23:26:44 (UTC)
commit9c0ba9922e12081ba87cce6583fe413ab5794cf6 (patch) (unidiff)
tree274472a08b80971045ad54a49b126f7b19454483
parent4c0ff8a1bdc4750ee36c713392d0842e9eb9eeb3 (diff)
downloadopie-9c0ba9922e12081ba87cce6583fe413ab5794cf6.zip
opie-9c0ba9922e12081ba87cce6583fe413ab5794cf6.tar.gz
opie-9c0ba9922e12081ba87cce6583fe413ab5794cf6.tar.bz2
Correct the constructor, and ensure it does not remove all interface options, as that interferes with the new wireless module.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp18
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.h3
2 files changed, 9 insertions, 12 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 2a5520d..fc65c5f 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -11,28 +11,26 @@
11 11
12#define DNSSCRIPT "changedns" 12#define DNSSCRIPT "changedns"
13 13
14/** 14/**
15 * Constuctor. Set up the connection. A profile must be set. 15 * Constuctor. Set up the connection. A profile must be set.
16 */ 16 */
17InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interfaces(j), interface(i), delInterfaces(false){ 17InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){
18} 18 if (j == 0) {
19 19 delInterfaces = true;
20/** 20 interfaces = new Interfaces;
21 * Constuctor. Set up the connection. A profile must be set. 21 }
22 */
23InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), delInterfaces(true){
24 interfaces = new Interfaces;
25} 22}
26 23
27/** 24/**
28 * Destructor 25 * Destructor
29 */ 26 */
30InterfaceSetupImp::~InterfaceSetupImp(){ 27InterfaceSetupImp::~InterfaceSetupImp(){
31 if(delInterfaces) 28 if(delInterfaces) {
32 delete interfaces; 29 delete interfaces;
30 }
33} 31}
34 32
35/** 33/**
36 * Save the current settings, then write out the interfaces file and close. 34 * Save the current settings, then write out the interfaces file and close.
37 */ 35 */
38bool InterfaceSetupImp::saveChanges(){ 36bool InterfaceSetupImp::saveChanges(){
@@ -59,13 +57,13 @@ bool InterfaceSetupImp::saveSettings(){
59 } 57 }
60 58
61 if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ 59 if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){
62 QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); 60 QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok);
63 return false; 61 return false;
64 } 62 }
65 interfaces->removeAllInterfaceOptions(); 63 //interfaces.removeAllInterfaceOptions();
66 64
67 // DHCP 65 // DHCP
68 if(dhcpCheckBox->isChecked()) 66 if(dhcpCheckBox->isChecked())
69 interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP); 67 interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP);
70 else{ 68 else{
71 interfaces->setInterfaceMethod("static"); 69 interfaces->setInterfaceMethod("static");
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.h b/noncore/settings/networksettings/interfaces/interfacesetupimp.h
index c4ace77..172da6a 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.h
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.h
@@ -8,13 +8,12 @@
8class Interface; 8class Interface;
9 9
10class InterfaceSetupImp : public InterfaceSetup { 10class InterfaceSetupImp : public InterfaceSetup {
11 Q_OBJECT 11 Q_OBJECT
12 12
13public: 13public:
14 InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i = 0, WFlags fl = 0);
15 InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i = 0, Interfaces *j = 0, WFlags fl = 0); 14 InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i = 0, Interfaces *j = 0, WFlags fl = 0);
16 ~InterfaceSetupImp(); 15 ~InterfaceSetupImp();
17 bool saveChanges(); 16 bool saveChanges();
18 17
19public slots: 18public slots:
20 void setProfile(const QString &profile); 19 void setProfile(const QString &profile);
@@ -34,13 +33,13 @@ class InterfaceSetupImpDialog : public QDialog {
34Q_OBJECT 33Q_OBJECT
35 34
36public: 35public:
37 InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){ 36 InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){
38 QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this ); 37 QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this );
39 setCaption("Interface Setup"); 38 setCaption("Interface Setup");
40 interfaceSetup = new InterfaceSetupImp(this, "InterfaceSetup",i,fl); 39 interfaceSetup = new InterfaceSetupImp(this, "InterfaceSetup",i);
41 InterfaceSetupLayout->addWidget( interfaceSetup ); 40 InterfaceSetupLayout->addWidget( interfaceSetup );
42 }; 41 };
43 void setProfile(QString &profile){ interfaceSetup->setProfile(profile);}; 42 void setProfile(QString &profile){ interfaceSetup->setProfile(profile);};
44 43
45private: 44private:
46 InterfaceSetupImp *interfaceSetup; 45 InterfaceSetupImp *interfaceSetup;