author | benmeyer <benmeyer> | 2003-01-13 19:12:57 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2003-01-13 19:12:57 (UTC) |
commit | b20f74522d02434b4f6aa6dce8079cbdae98765d (patch) (side-by-side diff) | |
tree | 7439f8c6b0263bc184647165ea910cb93bd74c4e | |
parent | 6ea855813c745e139866d05542ec6b8fc5819720 (diff) | |
download | opie-b20f74522d02434b4f6aa6dce8079cbdae98765d.zip opie-b20f74522d02434b4f6aa6dce8079cbdae98765d.tar.gz opie-b20f74522d02434b4f6aa6dce8079cbdae98765d.tar.bz2 |
test
-rw-r--r-- | noncore/settings/networksettings/interfaces/interface.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp index f0d93d6..032819b 100644 --- a/noncore/settings/networksettings/interfaces/interface.cpp +++ b/noncore/settings/networksettings/interfaces/interface.cpp @@ -1,101 +1,101 @@ /** * $Author$ * $Date$ * $Id$ - * $Name$ + * $Source$ */ #include "interface.h" #include <qdatetime.h> #include <qfile.h> #include <qdir.h> #include <qfileinfo.h> #include <qtextstream.h> #define IFCONFIG "/sbin/ifconfig" #define DHCP_INFO_DIR "/etc/dhcpc" #include <stdio.h> #include <stdlib.h> Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), hardwareName("Unknown"), moduleOwner(NULL), status(newSatus), attached(false), dhcp(false), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"){ refresh(); } /** * Set status * @param newStatus - the new status * emit updateInterface */ void Interface::setStatus(bool newStatus){ if(status != newStatus){ status = newStatus; refresh(); } }; /** * Set if attached or not (802.11 card pulled out for example) * @param isAttached - if attached * emit updateInterface */ void Interface::setAttached(bool isAttached){ attached = isAttached; emit(updateInterface(this)); }; /** * Set Hardware name * @param name - the new name * emit updateInterface */ void Interface::setHardwareName(const QString &name){ hardwareName = name; emit(updateInterface(this)); }; /** * Set Module owner * @param owner - the new owner * emit updateInterface */ void Interface::setModuleOwner(Module *owner){ moduleOwner = owner; emit(updateInterface(this)); }; /** * Try to start the interface. */ void Interface::start(){ // check to see if we are already running. if(true == status){ emit (updateMessage("Unable to start interface,\n already started")); return; } int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); // See if it was successfull... if(ret != 0){ emit (updateMessage("Starting interface failed")); return; } status = true; refresh(); emit (updateMessage("Start successfull")); } /** * Try to stop the interface. */ void Interface::stop(){ // check to see if we are already stopped. if(false == status){ emit (updateMessage("Unable to stop interface,\n already stopped")); return; } int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); if(ret != 0){ |