summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interfaces/interfacesetupimp.cpp7
-rw-r--r--noncore/net/networksetup/interfaces/interfacesetupimp.h7
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.cpp4
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp7
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.h7
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp4
6 files changed, 20 insertions, 16 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
@@ -35,12 +35,13 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac
/**
* Save the current settings, then write out the interfaces file and close.
*/
-void InterfaceSetupImp::saveChanges(){
+bool InterfaceSetupImp::saveChanges(){
if(!saveSettings())
- return;
+ return false;
interfaces->write();
+ return true;
}
/**
* Save the settings for the current Interface.
@@ -58,9 +59,9 @@ bool InterfaceSetupImp::saveSettings(){
return true;
}
if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){
- QMessageBox::information(this, "Not Saved.", "Please fill in address, subnet,\n and gateway entries.", "Ok");
+ QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", "Ok");
return false;
}
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
@@ -11,13 +11,14 @@ class InterfaceSetupImp : public InterfaceSetup {
Q_OBJECT
public:
InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, WFlags fl = 0);
- void saveChanges();
+ bool saveChanges();
public slots:
void setProfile(const QString &profile);
bool saveSettings();
+
private:
Interfaces *interfaces;
Interface *interface;
@@ -42,10 +43,10 @@ private:
InterfaceSetupImp *interfaceSetup;
protected slots:
void accept(){
- interfaceSetup->saveChanges();
- QDialog::accept();
+ if(interfaceSetup->saveChanges())
+ QDialog::accept();
};
};
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
@@ -120,10 +120,10 @@ bool WLANImp::writeConfig()
*/
void WLANImp::accept()
{
if ( writeConfig() ){
- interfaceSetup->saveChanges();
- QDialog::accept();
+ if(interfaceSetup->saveChanges())
+ QDialog::accept();
}
}
bool WLANImp::writeWirelessOpts( QString scheme )
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
@@ -35,12 +35,13 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac
/**
* Save the current settings, then write out the interfaces file and close.
*/
-void InterfaceSetupImp::saveChanges(){
+bool InterfaceSetupImp::saveChanges(){
if(!saveSettings())
- return;
+ return false;
interfaces->write();
+ return true;
}
/**
* Save the settings for the current Interface.
@@ -58,9 +59,9 @@ bool InterfaceSetupImp::saveSettings(){
return true;
}
if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){
- QMessageBox::information(this, "Not Saved.", "Please fill in address, subnet,\n and gateway entries.", "Ok");
+ QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", "Ok");
return false;
}
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
@@ -11,13 +11,14 @@ class InterfaceSetupImp : public InterfaceSetup {
Q_OBJECT
public:
InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, WFlags fl = 0);
- void saveChanges();
+ bool saveChanges();
public slots:
void setProfile(const QString &profile);
bool saveSettings();
+
private:
Interfaces *interfaces;
Interface *interface;
@@ -42,10 +43,10 @@ private:
InterfaceSetupImp *interfaceSetup;
protected slots:
void accept(){
- interfaceSetup->saveChanges();
- QDialog::accept();
+ if(interfaceSetup->saveChanges())
+ QDialog::accept();
};
};
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
@@ -120,10 +120,10 @@ bool WLANImp::writeConfig()
*/
void WLANImp::accept()
{
if ( writeConfig() ){
- interfaceSetup->saveChanges();
- QDialog::accept();
+ if(interfaceSetup->saveChanges())
+ QDialog::accept();
}
}
bool WLANImp::writeWirelessOpts( QString scheme )