Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index 72cd45e..40d2455 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp | |||
@@ -2,8 +2,9 @@ | |||
2 | #include "pppimp.h" | 2 | #include "pppimp.h" |
3 | #include "interfaceinformationimp.h" | 3 | #include "interfaceinformationimp.h" |
4 | //#include "devices.h" | ||
4 | 5 | ||
5 | /** | 6 | /** |
6 | * Constructor, find all of the possible interfaces | 7 | * Constructor, find all of the possible interfaces |
7 | */ | 8 | */ |
8 | PPPModule::PPPModule() : Module() { | 9 | PPPModule::PPPModule() : Module() { |
9 | } | 10 | } |
@@ -11,5 +12,5 @@ PPPModule::PPPModule() : Module() { | |||
11 | /** | 12 | /** |
12 | * Delete any interfaces that we own. | 13 | * Delete any interfaces that we own. |
13 | */ | 14 | */ |
14 | PPPModule::~PPPModule(){ | 15 | PPPModule::~PPPModule(){ |
15 | Interface *i; | 16 | Interface *i; |
@@ -20,5 +21,5 @@ PPPModule::~PPPModule(){ | |||
20 | /** | 21 | /** |
21 | * Change the current profile | 22 | * Change the current profile |
22 | */ | 23 | */ |
23 | void PPPModule::setProfile(const QString &newProfile){ | 24 | void PPPModule::setProfile(const QString &newProfile){ |
24 | profile = newProfile; | 25 | profile = newProfile; |
@@ -28,6 +29,6 @@ void PPPModule::setProfile(const QString &newProfile){ | |||
28 | * get the icon name for this device. | 29 | * get the icon name for this device. |
29 | * @param Interface* can be used in determining the icon. | 30 | * @param Interface* can be used in determining the icon. |
30 | * @return QString the icon name (minus .png, .gif etc) | 31 | * @return QString the icon name (minus .png, .gif etc) |
31 | */ | 32 | */ |
32 | QString PPPModule::getPixmapName(Interface* ){ | 33 | QString PPPModule::getPixmapName(Interface* ){ |
33 | return "ppp"; | 34 | return "ppp"; |
@@ -38,9 +39,9 @@ QString PPPModule::getPixmapName(Interface* ){ | |||
38 | * @param Interface* interface to check against | 39 | * @param Interface* interface to check against |
39 | * @return bool true if i is owned by this module, false otherwise. | 40 | * @return bool true if i is owned by this module, false otherwise. |
40 | */ | 41 | */ |
41 | bool PPPModule::isOwner(Interface *i){ | 42 | bool PPPModule::isOwner(Interface *i){ |
42 | if(!i->getInterfaceName().upper().contains("PPP")) | 43 | if(!i->getInterfaceName().upper().contains("PPP")) |
43 | return false; | 44 | return false; |
44 | 45 | ||
45 | i->setHardwareName("PPP"); | 46 | i->setHardwareName("PPP"); |
46 | list.append(i); | 47 | list.append(i); |
@@ -51,10 +52,9 @@ bool PPPModule::isOwner(Interface *i){ | |||
51 | * Create, and return the WLANConfigure Module | 52 | * Create, and return the WLANConfigure Module |
52 | * @return QWidget* pointer to this modules configure. | 53 | * @return QWidget* pointer to this modules configure. |
53 | */ | 54 | */ |
54 | QWidget *PPPModule::configure(Interface *i){ | 55 | QWidget *PPPModule::configure(Interface *i){ |
55 | return NULL; | 56 | PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", /* i,*/ false, Qt::WDestructiveClose); |
56 | //PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", i, false, Qt::WDestructiveClose); | 57 | // pppconfig->setProfile(profile); |
57 | //pppconfig->setProfile(profile); | 58 | return pppconfig; |
58 | //return wlanconfig; | ||
59 | } | 59 | } |
60 | 60 | ||
@@ -62,5 +62,5 @@ QWidget *PPPModule::configure(Interface *i){ | |||
62 | * Create, and return the Information Module | 62 | * Create, and return the Information Module |
63 | * @return QWidget* pointer to this modules info. | 63 | * @return QWidget* pointer to this modules info. |
64 | */ | 64 | */ |
65 | QWidget *PPPModule::information(Interface *i){ | 65 | QWidget *PPPModule::information(Interface *i){ |
66 | // We don't have any advanced pppd information widget yet :-D | 66 | // We don't have any advanced pppd information widget yet :-D |
@@ -85,12 +85,15 @@ QList<Interface> PPPModule::getInterfaces(){ | |||
85 | * by possibleNewInterfaces(); | 85 | * by possibleNewInterfaces(); |
86 | * @return Interface* NULL if it was unable to be created. | 86 | * @return Interface* NULL if it was unable to be created. |
87 | */ | 87 | */ |
88 | Interface *PPPModule::addNewInterface(const QString &newInterface){ | 88 | Interface *PPPModule::addNewInterface(const QString &newInterface){ |
89 | // If the | 89 | // If the |
90 | qDebug("try to add iface %s",newInterface.latin1()); | ||
90 | PPPConfigureImp imp(0, "PPPConfigImp"); | 91 | PPPConfigureImp imp(0, "PPPConfigImp"); |
92 | imp.showMaximized(); | ||
91 | if(imp.exec() == QDialog::Accepted ){ | 93 | if(imp.exec() == QDialog::Accepted ){ |
92 | 94 | qDebug("ACCEPTED"); | |
95 | return new Interface( 0, newInterface ); | ||
93 | } | 96 | } |
94 | return NULL; | 97 | return NULL; |
95 | } | 98 | } |
96 | 99 | ||
@@ -98,10 +101,15 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){ | |||
98 | * Attempts to remove the interface, doesn't delete i | 101 | * Attempts to remove the interface, doesn't delete i |
99 | * @return bool true if successfull, false otherwise. | 102 | * @return bool true if successfull, false otherwise. |
100 | */ | 103 | */ |
101 | bool PPPModule::remove(Interface*){ | 104 | bool PPPModule::remove(Interface*){ |
102 | // Can't remove a hardware device, you can stop it though. | 105 | // Can't remove a hardware device, you can stop it though. |
103 | return false; | 106 | return false; |
107 | } | ||
108 | |||
109 | void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) | ||
110 | { | ||
111 | qDebug("here"); | ||
112 | newIfaces.insert(QObject::tr("PPP") ,QObject::tr("generic ppp device")); | ||
104 | } | 113 | } |
105 | 114 | ||
106 | // pppmodule.cpp | ||
107 | 115 | ||