summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/pppmodule.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index 7cbccc2..95df068 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,24 +1,25 @@
1
1#include "pppconfig.h" 2#include "pppconfig.h"
2#include "pppmodule.h" 3#include "pppmodule.h"
3#include "pppdata.h" 4#include "pppdata.h"
4#include "kpppwidget.h" 5#include "interfaceinformationppp.h"
5#include "interfaceinformationimp.h" 6#include "interfaceppp.h"
6//#include "devices.h" 7
7 8
8/** 9/**
9 * Constructor, find all of the possible interfaces 10 * Constructor, find all of the possible interfaces
10 */ 11 */
11PPPModule::PPPModule() : Module() 12PPPModule::PPPModule() : Module()
12{ 13{
13 QMap<QString,QString> ifaces = PPPData::data()->getConfiguredInterfaces(); 14 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces();
14 QMap<QString,QString>::Iterator it; 15 QMap<QString,QString>::Iterator it;
15 Interface *iface; 16 InterfacePPP *iface;
16 qDebug("getting interfaces"); 17 qDebug("getting interfaces");
17 for( it = ifaces.begin(); it != ifaces.end(); ++it ){ 18 for( it = ifaces.begin(); it != ifaces.end(); ++it ){
18 qDebug("ifaces %s", it.key().latin1()); 19 qDebug("ifaces %s", it.key().latin1());
19 iface = new Interface( 0, it.key() ); 20 iface = new InterfacePPP( 0, it.key() );
20 iface->setHardwareName( it.data() ); 21 iface->setHardwareName( it.data() );
21 list.append( iface ); 22 list.append( (Interface*)iface );
22 } 23 }
23} 24}
24 25
@@ -32,8 +33,7 @@ PPPModule::~PPPModule(){
32 ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); 33 ifaces.insert( i->getInterfaceName(), i->getHardwareName() );
33 delete i; 34 delete i;
34 } 35 }
35 PPPData::data()->setConfiguredInterfaces( ifaces ); 36 PPPData::setConfiguredInterfaces( ifaces );
36 PPPData::data()->save();
37} 37}
38 38
39/** 39/**
@@ -67,8 +67,8 @@ bool PPPModule::isOwner(Interface *i){
67 */ 67 */
68QWidget *PPPModule::configure(Interface *i){ 68QWidget *PPPModule::configure(Interface *i){
69 qDebug("return ModemWidget"); 69 qDebug("return ModemWidget");
70 PPPConfigWidget *pppconfig = new PPPConfigWidget( i, 0, "PPPConfig", 70 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i,
71 false, 71 0, "PPPConfig", false,
72 Qt::WDestructiveClose ); 72 Qt::WDestructiveClose );
73 return pppconfig; 73 return pppconfig;
74} 74}
@@ -81,7 +81,8 @@ QWidget *PPPModule::information(Interface *i){
81 // We don't have any advanced pppd information widget yet :-D 81 // We don't have any advanced pppd information widget yet :-D
82 // TODO ^ 82 // TODO ^
83 qDebug("return PPPModule::information"); 83 qDebug("return PPPModule::information");
84 InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i); 84// InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i);
85 InterfaceInformationPPP *information = new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i );
85 return information; 86 return information;
86} 87}
87 88
@@ -106,12 +107,14 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){
106 107
107 qDebug("try to add iface %s",newInterface.latin1()); 108 qDebug("try to add iface %s",newInterface.latin1());
108 109
110 InterfacePPP *ifaceppp;
109 Interface *iface; 111 Interface *iface;
110 iface = new Interface(); 112 ifaceppp = new InterfacePPP();
111 PPPConfigWidget imp(iface, 0, "PPPConfigImp", true); 113 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true);
112 imp.showMaximized(); 114 imp.showMaximized();
113 if(imp.exec() == QDialog::Accepted ){ 115 if(imp.exec() == QDialog::Accepted ){
114 iface->setModuleOwner( this ); 116 iface->setModuleOwner( this );
117 iface = ifaceppp;
115 list.append( iface ); 118 list.append( iface );
116 return iface; 119 return iface;
117 }else { 120 }else {