-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 544498f..8ea241d 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -6,129 +6,129 @@ #include "module.h" #include <qpushbutton.h> #include <qlistbox.h> #include <qlineedit.h> #include <qlistview.h> #include <qheader.h> #include <qlabel.h> #include <qpe/qcopenvelope_qws.h> #include <qtabwidget.h> // in order to disable the profiles tab #include <qmessagebox.h> #ifdef QWS #include <qpe/config.h> #include <qpe/qlibrary.h> #include <qpe/resource.h> #include <qpe/qpeapplication.h> #else #include <klibloader.h> #define QLibrary KLibrary #include <kconfig.h> #define Config KConfig #include <kapplication.h> #include <kstandarddirs.h> #include <kiconloader.h> #define showMaximized show #endif #if QT_VERSION < 300 #include <qlist.h> #else #include <qptrlist.h> #endif #include <qdir.h> #include <qfile.h> #include <qtextstream.h> #include <qregexp.h> #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) : MainWindow(parent, name), 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&))); //FIXME: disable profiles for the moment: // tabWidget->setTabEnabled( tab, false ); // Load connections. // /usr/local/kde/lib/libinterfaces.la #ifdef QWS - loadModules(QPEApplication::qpeDir() + "/plugins/networksettings"); + loadModules(QPEApplication::qpeDir() + "plugins/networksettings"); #else loader = KLibLoader::self(); loadModules(QString("/usr/")+KStandardDirs::kde_default("lib")); #endif getAllInterfaces(); Interfaces i; QStringList list = i.getInterfaceList(); QMap<QString, Interface*>::Iterator it; for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { bool found = false; for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){ if(it.key() == (*ni)) found = true; } if(!found){ if(!(*ni).contains("_")){ Interface *i = new Interface(this, *ni, false); i->setAttached(false); i->setHardwareName(tr("Disconnected")); interfaceNames.insert(i->getInterfaceName(), i); updateInterface(i); connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); } } } //getInterfaceList(); connectionList->header()->hide(); Config cfg("NetworkSetup"); profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); for ( QStringList::Iterator it = profiles.begin(); it != profiles.end(); ++it) profilesList->insertItem((*it)); currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); QFile file(scheme); if ( file.open(IO_ReadOnly) ) { // file opened successfully QTextStream stream( &file ); // use a text stream while ( !stream.eof() ) { // until end of file... QString line = stream.readLine(); // line of text excluding '\n' if(line.contains("SCHEME")){ line = line.mid(7, line.length()); currentProfileLabel->setText(line); break; } } file.close(); } makeChannel(); } /** * Deconstructor. Save profiles. Delete loaded libraries. */ MainWindowImp::~MainWindowImp(){ // Save profiles. Config cfg("NetworkSetup"); cfg.setGroup("General"); cfg.writeEntry("Profiles", profiles.join(" ")); |