summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/pppmodule.cpp
authortille <tille>2003-05-24 23:34:09 (UTC)
committer tille <tille>2003-05-24 23:34:09 (UTC)
commitd1c32c127b4dabb716064a790da6be7c24975a92 (patch) (unidiff)
treeaa8a7865d4cccbc696c534d8de3ef3b139777c34 /noncore/settings/networksettings/ppp/pppmodule.cpp
parent58947769d80d49faaccac1703da0e66c90158957 (diff)
downloadopie-d1c32c127b4dabb716064a790da6be7c24975a92.zip
opie-d1c32c127b4dabb716064a790da6be7c24975a92.tar.gz
opie-d1c32c127b4dabb716064a790da6be7c24975a92.tar.bz2
pppd stuff
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index da17e26..e13f8c8 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -5,13 +5,18 @@
5#include "interfaceinformationimp.h" 5#include "interfaceinformationimp.h"
6//#include "devices.h" 6//#include "devices.h"
7 7
8/** 8/**
9 * Constructor, find all of the possible interfaces 9 * Constructor, find all of the possible interfaces
10 */ 10 */
11PPPModule::PPPModule() : Module() { 11PPPModule::PPPModule() : Module()
12{
13 Interface *iface;
14 iface = new Interface( 0, "device" );
15 iface->setHardwareName( "account" );
16 list.append( iface );
12} 17}
13 18
14/** 19/**
15 * Delete any interfaces that we own. 20 * Delete any interfaces that we own.
16 */ 21 */
17PPPModule::~PPPModule(){ 22PPPModule::~PPPModule(){
@@ -39,28 +44,23 @@ QString PPPModule::getPixmapName(Interface* ){
39/** 44/**
40 * Check to see if the interface i is owned by this module. 45 * Check to see if the interface i is owned by this module.
41 * @param Interface* interface to check against 46 * @param Interface* interface to check against
42 * @return bool true if i is owned by this module, false otherwise. 47 * @return bool true if i is owned by this module, false otherwise.
43 */ 48 */
44bool PPPModule::isOwner(Interface *i){ 49bool PPPModule::isOwner(Interface *i){
45 if(!i->getInterfaceName().upper().contains("PPP")) 50 return list.find( i ) != -1;
46 return false;
47
48 i->setHardwareName("PPP");
49 list.append(i);
50 return true;
51} 51}
52 52
53/** 53/**
54 * Create, and return the WLANConfigure Module 54 * Create, and return the WLANConfigure Module
55 * @return QWidget* pointer to this modules configure. 55 * @return QWidget* pointer to this modules configure.
56 */ 56 */
57QWidget *PPPModule::configure(Interface *i){ 57QWidget *PPPModule::configure(Interface *i){
58 qDebug("return ModemWidget"); 58 qDebug("return ModemWidget");
59 PPPConfigWidget *pppconfig = new PPPConfigWidget( 0, "PPPConfig", false, Qt::WDestructiveClose ); 59 PPPConfigWidget *pppconfig = new PPPConfigWidget( 0, "PPPConfig", false,
60// pppconfig->setProfile(profile); 60 Qt::WDestructiveClose );
61 return pppconfig; 61 return pppconfig;
62} 62}
63 63
64/** 64/**
65 * Create, and return the Information Module 65 * Create, and return the Information Module
66 * @return QWidget* pointer to this modules info. 66 * @return QWidget* pointer to this modules info.
@@ -94,14 +94,18 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){
94 qDebug("try to add iface %s",newInterface.latin1()); 94 qDebug("try to add iface %s",newInterface.latin1());
95 95
96 PPPConfigWidget imp(0, "PPPConfigImp", true); 96 PPPConfigWidget imp(0, "PPPConfigImp", true);
97 imp.showMaximized(); 97 imp.showMaximized();
98 if(imp.exec() == QDialog::Accepted ){ 98 if(imp.exec() == QDialog::Accepted ){
99 qDebug("ACCEPTED"); 99 qDebug("ACCEPTED");
100 return new Interface( 0, newInterface );
101 PPPData::data()->save(); 100 PPPData::data()->save();
101 Interface *iface;
102 iface = new Interface( 0, PPPData::data()->modemDevice() );
103 iface->setHardwareName( PPPData::data()->accname() );
104 list.append( iface );
105 return iface;
102 } 106 }
103 return NULL; 107 return NULL;
104} 108}
105 109
106/** 110/**
107 * Attempts to remove the interface, doesn't delete i 111 * Attempts to remove the interface, doesn't delete i
@@ -111,11 +115,11 @@ bool PPPModule::remove(Interface*){
111 // Can't remove a hardware device, you can stop it though. 115 // Can't remove a hardware device, you can stop it though.
112 return false; 116 return false;
113} 117}
114 118
115void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) 119void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
116{ 120{
117 qDebug("here"); 121 newIfaces.insert(QObject::tr("PPP") ,
118 newIfaces.insert(QObject::tr("PPP") ,QObject::tr("generic ppp device")); 122 QObject::tr("generic ppp device"));
119} 123}
120 124
121 125