summaryrefslogtreecommitdiff
path: root/noncore/settings
Unidiff
Diffstat (limited to 'noncore/settings') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp2
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
@@ -22,97 +22,97 @@
22 #include <qpe/resource.h> 22 #include <qpe/resource.h>
23 #include <qpe/qpeapplication.h> 23 #include <qpe/qpeapplication.h>
24#else 24#else
25 #include <klibloader.h> 25 #include <klibloader.h>
26 #define QLibrary KLibrary 26 #define QLibrary KLibrary
27 #include <kconfig.h> 27 #include <kconfig.h>
28 #define Config KConfig 28 #define Config KConfig
29 #include <kapplication.h> 29 #include <kapplication.h>
30 #include <kstandarddirs.h> 30 #include <kstandarddirs.h>
31 #include <kiconloader.h> 31 #include <kiconloader.h>
32 #define showMaximized show 32 #define showMaximized show
33#endif 33#endif
34 34
35#if QT_VERSION < 300 35#if QT_VERSION < 300
36#include <qlist.h> 36#include <qlist.h>
37#else 37#else
38#include <qptrlist.h> 38#include <qptrlist.h>
39#endif 39#endif
40#include <qdir.h> 40#include <qdir.h>
41#include <qfile.h> 41#include <qfile.h>
42#include <qtextstream.h> 42#include <qtextstream.h>
43#include <qregexp.h> 43#include <qregexp.h>
44 44
45#include <net/if.h> 45#include <net/if.h>
46#include <sys/ioctl.h> 46#include <sys/ioctl.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48 48
49#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" 49#define DEFAULT_SCHEME "/var/lib/pcmcia/scheme"
50#define _PROCNETDEV "/proc/net/dev" 50#define _PROCNETDEV "/proc/net/dev"
51 51
52MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name), advancedUserMode(true), scheme(DEFAULT_SCHEME){ 52MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name), advancedUserMode(true), scheme(DEFAULT_SCHEME){
53 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); 53 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
54 connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); 54 connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked()));
55 connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); 55 connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked()));
56 connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); 56 connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked()));
57 57
58 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); 58 connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile()));
59 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); 59 connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
60 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); 60 connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
61 61
62 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); 62 connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
63 63
64 //FIXME: disable profiles for the moment: 64 //FIXME: disable profiles for the moment:
65// tabWidget->setTabEnabled( tab, false ); 65// tabWidget->setTabEnabled( tab, false );
66 66
67 // Load connections. 67 // Load connections.
68 // /usr/local/kde/lib/libinterfaces.la 68 // /usr/local/kde/lib/libinterfaces.la
69#ifdef QWS 69#ifdef QWS
70 loadModules(QPEApplication::qpeDir() + "/plugins/networksettings"); 70 loadModules(QPEApplication::qpeDir() + "plugins/networksettings");
71#else 71#else
72 loader = KLibLoader::self(); 72 loader = KLibLoader::self();
73 loadModules(QString("/usr/")+KStandardDirs::kde_default("lib")); 73 loadModules(QString("/usr/")+KStandardDirs::kde_default("lib"));
74#endif 74#endif
75 getAllInterfaces(); 75 getAllInterfaces();
76 76
77 Interfaces i; 77 Interfaces i;
78 QStringList list = i.getInterfaceList(); 78 QStringList list = i.getInterfaceList();
79 QMap<QString, Interface*>::Iterator it; 79 QMap<QString, Interface*>::Iterator it;
80 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { 80 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
81 bool found = false; 81 bool found = false;
82 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){ 82 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
83 if(it.key() == (*ni)) 83 if(it.key() == (*ni))
84 found = true; 84 found = true;
85 } 85 }
86 if(!found){ 86 if(!found){
87 if(!(*ni).contains("_")){ 87 if(!(*ni).contains("_")){
88 Interface *i = new Interface(this, *ni, false); 88 Interface *i = new Interface(this, *ni, false);
89 i->setAttached(false); 89 i->setAttached(false);
90 i->setHardwareName(tr("Disconnected")); 90 i->setHardwareName(tr("Disconnected"));
91 interfaceNames.insert(i->getInterfaceName(), i); 91 interfaceNames.insert(i->getInterfaceName(), i);
92 updateInterface(i); 92 updateInterface(i);
93 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 93 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
94 } 94 }
95 } 95 }
96 } 96 }
97 97
98 //getInterfaceList(); 98 //getInterfaceList();
99 connectionList->header()->hide(); 99 connectionList->header()->hide();
100 100
101 Config cfg("NetworkSetup"); 101 Config cfg("NetworkSetup");
102 profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); 102 profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All"));
103 for ( QStringList::Iterator it = profiles.begin(); 103 for ( QStringList::Iterator it = profiles.begin();
104 it != profiles.end(); ++it) 104 it != profiles.end(); ++it)
105 profilesList->insertItem((*it)); 105 profilesList->insertItem((*it));
106 currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); 106 currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All"));
107 advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); 107 advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false);
108 scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); 108 scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME);
109 109
110 QFile file(scheme); 110 QFile file(scheme);
111 if ( file.open(IO_ReadOnly) ) { // file opened successfully 111 if ( file.open(IO_ReadOnly) ) { // file opened successfully
112 QTextStream stream( &file ); // use a text stream 112 QTextStream stream( &file ); // use a text stream
113 while ( !stream.eof() ) { // until end of file... 113 while ( !stream.eof() ) { // until end of file...
114 QString line = stream.readLine(); // line of text excluding '\n' 114 QString line = stream.readLine(); // line of text excluding '\n'
115 if(line.contains("SCHEME")){ 115 if(line.contains("SCHEME")){
116 line = line.mid(7, line.length()); 116 line = line.mid(7, line.length());
117 currentProfileLabel->setText(line); 117 currentProfileLabel->setText(line);
118 break; 118 break;