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
@@ -1,23 +1,28 @@
1#include "pppconfig.h" 1#include "pppconfig.h"
2#include "pppmodule.h" 2#include "pppmodule.h"
3#include "pppdata.h" 3#include "pppdata.h"
4#include "kpppwidget.h" 4#include "kpppwidget.h"
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(){
18 Interface *i; 23 Interface *i;
19 for ( i=list.first(); i != 0; i=list.next() ) 24 for ( i=list.first(); i != 0; i=list.next() )
20 delete i; 25 delete i;
21} 26}
22 27
23/** 28/**
@@ -33,40 +38,35 @@ void PPPModule::setProfile(const QString &newProfile){
33 * @return QString the icon name (minus .png, .gif etc) 38 * @return QString the icon name (minus .png, .gif etc)
34 */ 39 */
35QString PPPModule::getPixmapName(Interface* ){ 40QString PPPModule::getPixmapName(Interface* ){
36 return "ppp"; 41 return "ppp";
37} 42}
38 43
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.
67 */ 67 */
68QWidget *PPPModule::information(Interface *i){ 68QWidget *PPPModule::information(Interface *i){
69 // We don't have any advanced pppd information widget yet :-D 69 // We don't have any advanced pppd information widget yet :-D
70 // TODO ^ 70 // TODO ^
71 qDebug("return PPPModule::information"); 71 qDebug("return PPPModule::information");
72 InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); 72 InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i);
@@ -88,34 +88,38 @@ QList<Interface> PPPModule::getInterfaces(){
88 * @param name the name of the type of interface that should be created given 88 * @param name the name of the type of interface that should be created given
89 * by possibleNewInterfaces(); 89 * by possibleNewInterfaces();
90 * @return Interface* NULL if it was unable to be created. 90 * @return Interface* NULL if it was unable to be created.
91 */ 91 */
92Interface *PPPModule::addNewInterface(const QString &newInterface){ 92Interface *PPPModule::addNewInterface(const QString &newInterface){
93 93
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
108 * @return bool true if successfull, false otherwise. 112 * @return bool true if successfull, false otherwise.
109 */ 113 */
110bool PPPModule::remove(Interface*){ 114bool 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