summaryrefslogtreecommitdiff
authorkergoth <kergoth>2003-03-27 21:01:33 (UTC)
committer kergoth <kergoth>2003-03-27 21:01:33 (UTC)
commitf196ea87989e6f51463a5beb5a37139d6e019a74 (patch) (side-by-side diff)
tree16fc44e33be1e678c736db4f660784df79b5fc00
parentbff145f5cced95c742deefcd607932a9f3728dd3 (diff)
downloadopie-f196ea87989e6f51463a5beb5a37139d6e019a74.zip
opie-f196ea87989e6f51463a5beb5a37139d6e019a74.tar.gz
opie-f196ea87989e6f51463a5beb5a37139d6e019a74.tar.bz2
Switch from 1) calling /etc/init.d/pcmcia to calling cardctl eject, cardctl insert..
and 2) OProcess instead of system()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 1782c22..db03266 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -1,33 +1,34 @@
#include "wlanimp.h"
#include "interfacesetupimp.h"
#include <qfile.h>
#include <qdir.h>
#include <qtextstream.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qtabwidget.h>
#include <qcombobox.h>
/* system() */
-#include <stdlib.h>
+//#include <stdlib.h>
+#include <opie/oprocess.h>
#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
/**
* Constructor, read in the wireless.opts file for parsing later.
*/
WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") {
interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);
tabWidget->insertTab(interfaceSetup, "TCP/IP");
// Read in the config file.
QString wlanFile = WIRELESS_OPTS;
QFile file(wlanFile);
if (file.open(IO_ReadOnly)){
QTextStream stream( &file );
QString line = "";
@@ -212,36 +213,36 @@ void WLANImp::accept(){
return;
}
}
if(essAny->isChecked() && essSpecificLineEdit->text().isEmpty()){
QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok);
return;
}
// Ok settings are good here, save
changeAndSaveSettingFile();
// Try to save the interfaces settings.
if(!interfaceSetup->saveChanges())
return;
- // Restart the device now that the settings have changed
- QString initpath;
- if( QDir("/etc/rc.d/init.d").exists() )
- initpath = "/etc/rc.d/init.d";
- else if( QDir("/etc/init.d").exists() )
- initpath = "/etc/init.d";
+ OProcess insert;
+// OProcess eject;
- // It would be kinda cool if we didn't have to do this and could just to ifup/down
-
- if( initpath )
- system(QString("%1/pcmcia stop").arg(initpath));
- if( initpath )
- system(QString("%1/pcmcia start").arg(initpath));
+ insert << "sh -c \"cardctl insert && cardctl eject\"";
+// eject << "cardctl eject";
+
+// if (!eject.start(OProcess::Block, OProcess::NoCommunication) ) {
+// qWarning("could not start cardctl eject");
+// }
+
+ if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) {
+ qWarning("could not start cardctl insert");
+ }
// Close out the dialog
QDialog::accept();
}
// wlanimp.cpp