summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 8d78828..49a47ae 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -46,38 +46,38 @@ bool InterfaceSetupImp::saveChanges(){
46 QString iface = interfaces->getInterfaceName(error); 46 QString iface = interfaces->getInterfaceName(error);
47 if(!saveSettings()) 47 if(!saveSettings())
48 return false; 48 return false;
49 49
50 qWarning("restarting interface %s\n", iface.latin1());
51 interfaces->write(); 50 interfaces->write();
52 51
53 QString ifup; 52 if (interface->getStatus()) {
54 ifup += "ifdown "; 53 QString ifup;
55 ifup += iface; 54 ifup += "ifdown ";
56 ifup += "; ifup "; 55 ifup += iface;
57 ifup += iface; 56 ifup += "; ifup ";
58 ifup += ";"; 57 ifup += iface;
59 58 ifup += ";";
60 OProcess restart; 59
61 restart << "sh"; 60 OProcess restart;
62 restart << "-c"; 61 restart << "sh";
63 restart << ifup; 62 restart << "-c";
64 63 restart << ifup;
65 OWait *owait = new OWait(); 64
66 Global::statusMessage( tr( "Restarting interface" ) ); 65 OWait *owait = new OWait();
67 66 Global::statusMessage( tr( "Restarting interface" ) );
68 owait->show(); 67
69 qApp->processEvents(); 68 owait->show();
70 69 qApp->processEvents();
71 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { 70
72 qWarning("unstable to spawn ifdown/ifup"); 71 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) {
72 qWarning("unstable to spawn ifdown/ifup");
73 }
74
75 owait->hide();
76 delete owait;
77
78 interface->refresh();
73 } 79 }
74
75 owait->hide();
76 delete owait;
77
78 interface->refresh();
79
80 return true; 80 return true;
81} 81}
82 82
83/** 83/**