author | benmeyer <benmeyer> | 2002-10-31 20:05:57 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-31 20:05:57 (UTC) |
commit | 16d3fac9169e400f5542ca0e3aa993cc5c5db574 (patch) (unidiff) | |
tree | ac8587cb0faed786bcb362e47949b0ade5d81ada | |
parent | 6f6bf05d544a579d513c476453483ef9bedad49f (diff) | |
download | opie-16d3fac9169e400f5542ca0e3aa993cc5c5db574.zip opie-16d3fac9169e400f5542ca0e3aa993cc5c5db574.tar.gz opie-16d3fac9169e400f5542ca0e3aa993cc5c5db574.tar.bz2 |
Fixed error message and made window stay if error message doesn't go away.
6 files changed, 16 insertions, 12 deletions
diff --git a/noncore/net/networksetup/interfaces/interfacesetupimp.cpp b/noncore/net/networksetup/interfaces/interfacesetupimp.cpp index 550e909..a19aaeb 100644 --- a/noncore/net/networksetup/interfaces/interfacesetupimp.cpp +++ b/noncore/net/networksetup/interfaces/interfacesetupimp.cpp | |||
@@ -36,10 +36,11 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac | |||
36 | /** | 36 | /** |
37 | * Save the current settings, then write out the interfaces file and close. | 37 | * Save the current settings, then write out the interfaces file and close. |
38 | */ | 38 | */ |
39 | void InterfaceSetupImp::saveChanges(){ | 39 | bool InterfaceSetupImp::saveChanges(){ |
40 | if(!saveSettings()) | 40 | if(!saveSettings()) |
41 | return; | 41 | return false; |
42 | interfaces->write(); | 42 | interfaces->write(); |
43 | return true; | ||
43 | } | 44 | } |
44 | 45 | ||
45 | /** | 46 | /** |
@@ -59,7 +60,7 @@ bool InterfaceSetupImp::saveSettings(){ | |||
59 | } | 60 | } |
60 | 61 | ||
61 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ | 62 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ |
62 | QMessageBox::information(this, "Not Saved.", "Please fill in address, subnet,\n and gateway entries.", "Ok"); | 63 | QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", "Ok"); |
63 | return false; | 64 | return false; |
64 | } | 65 | } |
65 | interfaces->removeAllInterfaceOptions(); | 66 | interfaces->removeAllInterfaceOptions(); |
diff --git a/noncore/net/networksetup/interfaces/interfacesetupimp.h b/noncore/net/networksetup/interfaces/interfacesetupimp.h index 3bbf34e..a88e190 100644 --- a/noncore/net/networksetup/interfaces/interfacesetupimp.h +++ b/noncore/net/networksetup/interfaces/interfacesetupimp.h | |||
@@ -12,11 +12,12 @@ class InterfaceSetupImp : public InterfaceSetup { | |||
12 | 12 | ||
13 | public: | 13 | public: |
14 | InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, WFlags fl = 0); | 14 | InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, WFlags fl = 0); |
15 | void saveChanges(); | 15 | bool saveChanges(); |
16 | 16 | ||
17 | public slots: | 17 | public slots: |
18 | void setProfile(const QString &profile); | 18 | void setProfile(const QString &profile); |
19 | bool saveSettings(); | 19 | bool saveSettings(); |
20 | |||
20 | private: | 21 | private: |
21 | Interfaces *interfaces; | 22 | Interfaces *interfaces; |
22 | Interface *interface; | 23 | Interface *interface; |
@@ -43,7 +44,7 @@ private: | |||
43 | 44 | ||
44 | protected slots: | 45 | protected slots: |
45 | void accept(){ | 46 | void accept(){ |
46 | interfaceSetup->saveChanges(); | 47 | if(interfaceSetup->saveChanges()) |
47 | QDialog::accept(); | 48 | QDialog::accept(); |
48 | }; | 49 | }; |
49 | 50 | ||
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 74bf390..01d7e36 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -121,7 +121,7 @@ bool WLANImp::writeConfig() | |||
121 | void WLANImp::accept() | 121 | void WLANImp::accept() |
122 | { | 122 | { |
123 | if ( writeConfig() ){ | 123 | if ( writeConfig() ){ |
124 | interfaceSetup->saveChanges(); | 124 | if(interfaceSetup->saveChanges()) |
125 | QDialog::accept(); | 125 | QDialog::accept(); |
126 | } | 126 | } |
127 | } | 127 | } |
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index 550e909..a19aaeb 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -36,10 +36,11 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac | |||
36 | /** | 36 | /** |
37 | * Save the current settings, then write out the interfaces file and close. | 37 | * Save the current settings, then write out the interfaces file and close. |
38 | */ | 38 | */ |
39 | void InterfaceSetupImp::saveChanges(){ | 39 | bool InterfaceSetupImp::saveChanges(){ |
40 | if(!saveSettings()) | 40 | if(!saveSettings()) |
41 | return; | 41 | return false; |
42 | interfaces->write(); | 42 | interfaces->write(); |
43 | return true; | ||
43 | } | 44 | } |
44 | 45 | ||
45 | /** | 46 | /** |
@@ -59,7 +60,7 @@ bool InterfaceSetupImp::saveSettings(){ | |||
59 | } | 60 | } |
60 | 61 | ||
61 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ | 62 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ |
62 | QMessageBox::information(this, "Not Saved.", "Please fill in address, subnet,\n and gateway entries.", "Ok"); | 63 | QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", "Ok"); |
63 | return false; | 64 | return false; |
64 | } | 65 | } |
65 | interfaces->removeAllInterfaceOptions(); | 66 | interfaces->removeAllInterfaceOptions(); |
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.h b/noncore/settings/networksettings/interfaces/interfacesetupimp.h index 3bbf34e..a88e190 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.h +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.h | |||
@@ -12,11 +12,12 @@ class InterfaceSetupImp : public InterfaceSetup { | |||
12 | 12 | ||
13 | public: | 13 | public: |
14 | InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, WFlags fl = 0); | 14 | InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, WFlags fl = 0); |
15 | void saveChanges(); | 15 | bool saveChanges(); |
16 | 16 | ||
17 | public slots: | 17 | public slots: |
18 | void setProfile(const QString &profile); | 18 | void setProfile(const QString &profile); |
19 | bool saveSettings(); | 19 | bool saveSettings(); |
20 | |||
20 | private: | 21 | private: |
21 | Interfaces *interfaces; | 22 | Interfaces *interfaces; |
22 | Interface *interface; | 23 | Interface *interface; |
@@ -43,7 +44,7 @@ private: | |||
43 | 44 | ||
44 | protected slots: | 45 | protected slots: |
45 | void accept(){ | 46 | void accept(){ |
46 | interfaceSetup->saveChanges(); | 47 | if(interfaceSetup->saveChanges()) |
47 | QDialog::accept(); | 48 | QDialog::accept(); |
48 | }; | 49 | }; |
49 | 50 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 74bf390..01d7e36 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -121,7 +121,7 @@ bool WLANImp::writeConfig() | |||
121 | void WLANImp::accept() | 121 | void WLANImp::accept() |
122 | { | 122 | { |
123 | if ( writeConfig() ){ | 123 | if ( writeConfig() ){ |
124 | interfaceSetup->saveChanges(); | 124 | if(interfaceSetup->saveChanges()) |
125 | QDialog::accept(); | 125 | QDialog::accept(); |
126 | } | 126 | } |
127 | } | 127 | } |