summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings
Unidiff
Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/TODO10
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp1
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.h12
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp17
-rw-r--r--noncore/settings/networksettings/networksetup.pro4
-rw-r--r--noncore/settings/networksettings/opie-networksettings.control2
-rw-r--r--noncore/settings/networksettings/opie-networksetup.control2
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp4
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.h1
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp1
10 files changed, 30 insertions, 24 deletions
diff --git a/noncore/settings/networksettings/TODO b/noncore/settings/networksettings/TODO
index 0584f81..ec6d2c6 100644
--- a/noncore/settings/networksettings/TODO
+++ b/noncore/settings/networksettings/TODO
@@ -1,16 +1,16 @@
1CLEAN UP 1CLEAN UP
2 2
3Fix Profiles 3Fix Profiles
4 4
5Write dns script 5Write dns script
6 6
7
8WLAN needs to be re-written to not use Config 7WLAN needs to be re-written to not use Config
9WHERE Is DHCP info stored???
10
11PPP module needs to be written
12 8
13Write a class that parses /proc and not ifconfig 9Write a class that parses /proc and not ifconfig
10udchcp needs to output the dhcp information
11
12Possible other modules to write: ppp, ipsec, bluetooth, ipchains
13
14PPP module needs to scan pppd.tdb to see what is currently active
14 15
15Possible other modules: ipsec, bluetooth, ipchains
16 16
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 97c05cc..d42b45d 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -90,12 +90,13 @@ bool InterfaceSetupImp::saveSettings(){
90 * @profile the new profile. 90 * @profile the new profile.
91 */ 91 */
92void InterfaceSetupImp::setProfile(const QString &profile){ 92void InterfaceSetupImp::setProfile(const QString &profile){
93 QString newInterfaceName = interface->getInterfaceName(); 93 QString newInterfaceName = interface->getInterfaceName();
94 if(profile.length() > 0) 94 if(profile.length() > 0)
95 newInterfaceName += "_" + profile; 95 newInterfaceName += "_" + profile;
96 qDebug("InterfaceSetupImp::setProfile");
96 // See if we have to make a interface. 97 // See if we have to make a interface.
97 if(!interfaces->setInterface(newInterfaceName)){ 98 if(!interfaces->setInterface(newInterfaceName)){
98 // Add making for this new interface if need too 99 // Add making for this new interface if need too
99 if(profile != ""){ 100 if(profile != ""){
100 interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); 101 interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName);
101 if(!interfaces->setMapping(interface->getInterfaceName())){ 102 if(!interfaces->setMapping(interface->getInterfaceName())){
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.h b/noncore/settings/networksettings/interfaces/interfacesetupimp.h
index 936f2be..3bbf34e 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.h
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.h
@@ -26,24 +26,30 @@ private:
26 26
27#include <qlayout.h> 27#include <qlayout.h>
28 28
29class InterfaceSetupImpDialog : public QDialog { 29class InterfaceSetupImpDialog : public QDialog {
30Q_OBJECT 30Q_OBJECT
31 31
32 public: 32public:
33 InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){ 33 InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){
34 QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this ); 34 QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this );
35 setCaption("Interface Setup"); 35 setCaption("Interface Setup");
36 interfaceSetup = new InterfaceSetupImp(this, "InterfaceSetup",i,fl); 36 interfaceSetup = new InterfaceSetupImp(this, "InterfaceSetup",i,fl);
37 InterfaceSetupLayout->addWidget( interfaceSetup ); 37 InterfaceSetupLayout->addWidget( interfaceSetup );
38 }; 38 };
39 void setProfile(QString &profile){ interfaceSetup->setProfile(profile);};
39 40
41private:
40 InterfaceSetupImp *interfaceSetup; 42 InterfaceSetupImp *interfaceSetup;
41 43
42 protected slots: 44protected slots:
43 void accept(){ interfaceSetup->saveChanges(); }; 45 void accept(){
46 interfaceSetup->saveChanges();
47 QDialog::accept();
48 };
49
44}; 50};
45 51
46#endif 52#endif
47 53
48// interfacesetupimp.h 54// interfacesetupimp.h
49 55
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index b9fff56..6440bd4 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -227,30 +227,27 @@ void MainWindowImp::configureClicked(){
227 QListViewItem *item = connectionList->currentItem(); 227 QListViewItem *item = connectionList->currentItem();
228 if(!item){ 228 if(!item){
229 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok); 229 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
230 return; 230 return;
231 } 231 }
232 232
233 QString currentProfile = currentProfileLabel->text();
234 if(profilesList->count() <= 1 || currentProfile == "All"){
235 currentProfile = "";
236 }
237
238 Interface *i = interfaceItems[item]; 233 Interface *i = interfaceItems[item];
239 if(i->getModuleOwner()){ 234 if(i->getModuleOwner()){
240 i->getModuleOwner()->setProfile(currentProfile);
241 QWidget *moduleConfigure = i->getModuleOwner()->configure(i); 235 QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
242 if(moduleConfigure != NULL){ 236 if(moduleConfigure != NULL){
243 moduleConfigure->showMaximized(); 237 moduleConfigure->showMaximized();
244 moduleConfigure->show(); 238 moduleConfigure->show();
245 return; 239 return;
246 } 240 }
247 } 241 }
248 242
249 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose); 243 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose);
250 //configure->setProfile(currentProfile); 244 QString currentProfileText = currentProfileLabel->text();
245 if(currentProfileText.upper() == "ALL");
246 currentProfileText = "";
247 configure->setProfile(currentProfileText);
251 configure->showMaximized(); 248 configure->showMaximized();
252 configure->show(); 249 configure->show();
253} 250}
254 251
255/** 252/**
256 * Pull up the information about the currently selected interface. 253 * Pull up the information about the currently selected interface.
@@ -267,17 +264,12 @@ void MainWindowImp::informationClicked(){
267 Interface *i = interfaceItems[item]; 264 Interface *i = interfaceItems[item];
268 if(!i->isAttached()){ 265 if(!i->isAttached()){
269 QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok); 266 QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
270 return; 267 return;
271 } 268 }
272 269
273 QStringList list;
274 for(uint i = 0; i < profilesList->count(); i++){
275 list.append(profilesList->text(i));
276 }
277
278 if(i->getModuleOwner()){ 270 if(i->getModuleOwner()){
279 QWidget *moduleInformation = i->getModuleOwner()->information(i); 271 QWidget *moduleInformation = i->getModuleOwner()->information(i);
280 if(moduleInformation != NULL){ 272 if(moduleInformation != NULL){
281 moduleInformation->showMaximized(); 273 moduleInformation->showMaximized();
282 moduleInformation->show(); 274 moduleInformation->show();
283 return; 275 return;
@@ -535,10 +527,11 @@ void MainWindowImp::changeProfile(){
535 for( it = items.begin(); it != items.end(); ++it ){ 527 for( it = items.begin(); it != items.end(); ++it ){
536 if(it.key()->getStatus() == true) 528 if(it.key()->getStatus() == true)
537 it.key()->restart(); 529 it.key()->restart();
538 } 530 }
539 } 531 }
540 } 532 }
533 // TODO change the profile in the modules
541} 534}
542 535
543// mainwindowimp.cpp 536// mainwindowimp.cpp
544 537
diff --git a/noncore/settings/networksettings/networksetup.pro b/noncore/settings/networksettings/networksetup.pro
index 1719a35..5666a42 100644
--- a/noncore/settings/networksettings/networksetup.pro
+++ b/noncore/settings/networksettings/networksetup.pro
@@ -1,11 +1,11 @@
1DESTDIR = $(OPIEDIR)/bin 1#DESTDIR = $(OPIEDIR)/bin
2TEMPLATE = app 2TEMPLATE = app
3#CONFIG = qt warn_on debug 3#CONFIG = qt warn_on debug
4CONFIG = qt warn_on release 4CONFIG = qt warn_on release
5HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h kprocctrl.h module.h kprocess.h 5HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h kprocctrl.h module.h kprocess.h
6SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp kprocctrl.cpp kprocess.cpp 6SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp kprocctrl.cpp kprocess.cpp
7INCLUDEPATH += $(OPIEDIR)/include interfaces/ 7INCLUDEPATH += $(OPIEDIR)/include interfaces/
8DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan 8DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan
9LIBS += -lqpe -L$(OPIEDIR)/plugins/networksetup -linterfaces 9LIBS += -lqpe -L$(OPIEDIR)/plugins/networksetup -Linterfaces/ -linterfaces
10INTERFACES = mainwindow.ui addconnection.ui 10INTERFACES = mainwindow.ui addconnection.ui
11TARGET = networksetup 11TARGET = networksetup
diff --git a/noncore/settings/networksettings/opie-networksettings.control b/noncore/settings/networksettings/opie-networksettings.control
index 35bac52..d14e2d1 100644
--- a/noncore/settings/networksettings/opie-networksettings.control
+++ b/noncore/settings/networksettings/opie-networksettings.control
@@ -1,7 +1,7 @@
1Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 1Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 $OPIEDIR/bin/changedns.sh $OPIEDIR/bin/getprofile.sh
2Priority: optional 2Priority: optional
3Section: opie/settings 3Section: opie/settings
4Maintainer: Ben Meyer <meyerb@sharpsec.com> 4Maintainer: Ben Meyer <meyerb@sharpsec.com>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
diff --git a/noncore/settings/networksettings/opie-networksetup.control b/noncore/settings/networksettings/opie-networksetup.control
index 35bac52..d14e2d1 100644
--- a/noncore/settings/networksettings/opie-networksetup.control
+++ b/noncore/settings/networksettings/opie-networksetup.control
@@ -1,7 +1,7 @@
1Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 1Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 $OPIEDIR/bin/changedns.sh $OPIEDIR/bin/getprofile.sh
2Priority: optional 2Priority: optional
3Section: opie/settings 3Section: opie/settings
4Maintainer: Ben Meyer <meyerb@sharpsec.com> 4Maintainer: Ben Meyer <meyerb@sharpsec.com>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index a466020..74bf390 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -30,12 +30,16 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W
30} 30}
31 31
32WLANImp::~WLANImp( ){ 32WLANImp::~WLANImp( ){
33 delete config; 33 delete config;
34} 34}
35 35
36void WLANImp::setProfile(QString &profile){
37 interfaceSetup->setProfile(profile);
38}
39
36void WLANImp::readConfig() 40void WLANImp::readConfig()
37{ 41{
38 qWarning( "WLANImp::readConfig() called." ); 42 qWarning( "WLANImp::readConfig() called." );
39 config->setGroup( "Properties" ); 43 config->setGroup( "Properties" );
40 QString ssid = config->readEntry( "SSID", "any" ); 44 QString ssid = config->readEntry( "SSID", "any" );
41 if( ssid == "any" || ssid == "ANY" ){ 45 if( ssid == "any" || ssid == "ANY" ){
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h
index 608d681..faa1674 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.h
+++ b/noncore/settings/networksettings/wlan/wlanimp.h
@@ -10,12 +10,13 @@ class Config;
10class WLANImp : public WLAN { 10class WLANImp : public WLAN {
11 Q_OBJECT 11 Q_OBJECT
12 12
13public: 13public:
14 WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); 14 WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 );
15 ~WLANImp( ); 15 ~WLANImp( );
16 void setProfile(QString &profile);
16 17
17protected: 18protected:
18 void accept(); 19 void accept();
19 20
20private: 21private:
21 void readConfig(); 22 void readConfig();
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index c8becb0..b14fc0a 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -57,12 +57,13 @@ bool WLANModule::isOwner(Interface *i){
57/** 57/**
58 * Create, and return the WLANConfigure Module 58 * Create, and return the WLANConfigure Module
59 * @return QWidget* pointer to this modules configure. 59 * @return QWidget* pointer to this modules configure.
60 */ 60 */
61QWidget *WLANModule::configure(Interface *i){ 61QWidget *WLANModule::configure(Interface *i){
62 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); 62 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose);
63 wlanconfig->setProfile(profile);
63 return wlanconfig; 64 return wlanconfig;
64} 65}
65 66
66/** 67/**
67 * Create, and return the Information Module 68 * Create, and return the Information Module
68 * @return QWidget* pointer to this modules info. 69 * @return QWidget* pointer to this modules info.