summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfacesetupimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 05340e4..7c2f85c 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -1,72 +1,74 @@
#include "interfacesetupimp.h"
#include "interface.h"
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <opie2/oprocess.h>
#ifdef QWS
#include <opie2/owait.h>
#include <qpe/global.h>
#include <qapplication.h>
#endif
#define DNSSCRIPT "changedns"
/**
* Constuctor. Set up the connection. A profile must be set.
*/
+using namespace Opie::Ui;
+using namespace Opie::Core;
InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){
if (j == 0) {
delInterfaces = true;
interfaces = new Interfaces;
}
}
/**
* Destructor
*/
InterfaceSetupImp::~InterfaceSetupImp(){
if(delInterfaces) {
delete interfaces;
}
}
/**
* Save the current settings, then write out the interfaces file and close.
*/
bool InterfaceSetupImp::saveChanges(){
bool error;
QString iface = interfaces->getInterfaceName(error);
qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() );
if(!saveSettings())
return false;
interfaces->write();
if (interface->getStatus()) {
QString ifup;
ifup += "ifdown ";
ifup += iface;
ifup += "; ifup ";
ifup += iface;
ifup += ";";
OProcess restart;
restart << "sh";
restart << "-c";
restart << ifup;
OWait *owait = new OWait();
Global::statusMessage( tr( "Restarting interface" ) );
owait->show();
qApp->processEvents();
if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) {