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.cpp48
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
@@ -1,16 +1,17 @@
1#include "pppmodule.h" 1#include "pppmodule.h"
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 */
8PPPModule::PPPModule() : Module() { 9PPPModule::PPPModule() : Module() {
9} 10}
10 11
11/** 12/**
12 * Delete any interfaces that we own. 13 * Delete any interfaces that we own.
13 */ 14 */
14PPPModule::~PPPModule(){ 15PPPModule::~PPPModule(){
15 Interface *i; 16 Interface *i;
16 for ( i=list.first(); i != 0; i=list.next() ) 17 for ( i=list.first(); i != 0; i=list.next() )
@@ -19,7 +20,7 @@ PPPModule::~PPPModule(){
19 20
20/** 21/**
21 * Change the current profile 22 * Change the current profile
22 */ 23 */
23void PPPModule::setProfile(const QString &newProfile){ 24void PPPModule::setProfile(const QString &newProfile){
24 profile = newProfile; 25 profile = newProfile;
25} 26}
@@ -27,8 +28,8 @@ void PPPModule::setProfile(const QString &newProfile){
27/** 28/**
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 */
32QString PPPModule::getPixmapName(Interface* ){ 33QString PPPModule::getPixmapName(Interface* ){
33 return "ppp"; 34 return "ppp";
34} 35}
@@ -37,11 +38,11 @@ QString PPPModule::getPixmapName(Interface* ){
37 * Check to see if the interface i is owned by this module. 38 * Check to see if the interface i is owned by this module.
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 */
41bool PPPModule::isOwner(Interface *i){ 42bool 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);
47 return true; 48 return true;
@@ -50,18 +51,17 @@ bool PPPModule::isOwner(Interface *i){
50/** 51/**
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 */
54QWidget *PPPModule::configure(Interface *i){ 55QWidget *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
61/** 61/**
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 */
65QWidget *PPPModule::information(Interface *i){ 65QWidget *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
67 // TODO ^ 67 // TODO ^
@@ -84,24 +84,32 @@ QList<Interface> PPPModule::getInterfaces(){
84 * @param name the name of the type of interface that should be created given 84 * @param name the name of the type of interface that should be created given
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 */
88Interface *PPPModule::addNewInterface(const QString &newInterface){ 88Interface *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
97/** 100/**
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 */
101bool PPPModule::remove(Interface*){ 104bool 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
109void 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