4 files changed, 7 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp index d2b106a..46f3e19 100644 --- a/noncore/settings/networksettings/interfaces/interface.cpp +++ b/noncore/settings/networksettings/interfaces/interface.cpp @@ -1,54 +1,57 @@ /** * $Author$ * $Date$ */ #include "interface.h" + +#include <opie2/odebug.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)); }; diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp index e283926..5ce4b58 100644 --- a/noncore/settings/networksettings/interfaces/interfaces.cpp +++ b/noncore/settings/networksettings/interfaces/interfaces.cpp @@ -1,50 +1,52 @@ #include "interfaces.h" +#include <opie2/odebug.h> + #include <qcheckbox.h> #include <qfile.h> #include <qtextstream.h> #include <qregexp.h> // The three stanza's #define AUTO "auto" #define IFACE "iface" #define MAPPING "mapping" /** * Constructor. Reads in the interfaces file and then split the file up by * the \n for interfaces variable. * @param useInterfacesFile if an interface file other then the default is * desired to be used it should be passed in. */ Interfaces::Interfaces(QString useInterfacesFile){ acceptedFamily.append(INTERFACES_FAMILY_INET); acceptedFamily.append(INTERFACES_FAMILY_IPX); acceptedFamily.append(INTERFACES_FAMILY_INET6); interfacesFile = useInterfacesFile; QFile file(interfacesFile); if (!file.open(IO_ReadOnly)){ odebug << "Interfaces: Can't open file: " << interfacesFile.latin1() << " for reading." << oendl; currentIface = interfaces.end(); currentMapping = interfaces.end(); return; } QTextStream stream( &file ); QString line; while ( !stream.eof() ) { line += stream.readLine(); line += "\n"; } file.close(); interfaces = QStringList::split("\n", line, true); currentIface = interfaces.end(); currentMapping = interfaces.end(); } /** * Get a list of all interfaces in the interface file. Useful for * hardware that is not currently connected such as an 802.11b card * not plugged in, but configured for when it is plugged in. * @return Return string list of interfaces. diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index ec3bad3..8498759 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp @@ -1,63 +1,64 @@ #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 <opie2/odebug.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); odebug << "InterfaceSetupImp::saveChanges saves interface " << iface.latin1() << "" << oendl; if(!saveSettings()) return false; interfaces->write(); if (interface->getStatus()) { QString ifup; ifup += "ifdown "; ifup += iface; ifup += "; ifup "; ifup += iface; ifup += ";"; OProcess restart; diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 3e1a650..5184630 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -1,57 +1,58 @@ #include "mainwindowimp.h" #include "addconnectionimp.h" #include "interfaceinformationimp.h" #include "interfacesetupimp.h" #include "interfaces.h" #include "module.h" /* OPIE */ +#include <opie2/odebug.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/qlibrary.h> #include <qpe/resource.h> /* QT */ #include <qpushbutton.h> #include <qlistbox.h> #include <qlineedit.h> #include <qlistview.h> #include <qheader.h> #include <qlabel.h> #include <qtabwidget.h> // in order to disable the profiles tab #include <qmessagebox.h> #if QT_VERSION < 300 #include <qlist.h> #else #include <qptrlist.h> #endif #include <qdir.h> #include <qfile.h> #include <qtextstream.h> #include <qregexp.h> /* STD */ #include <net/if.h> #include <sys/ioctl.h> #include <sys/socket.h> #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" #define _PROCNETDEV "/proc/net/dev" MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME) { connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); |