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 | |||
@@ -1,70 +1,70 @@ | |||
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 | */ |
8 | PPPModule::PPPModule() : Module() { | 9 | PPPModule::PPPModule() : Module() { |
9 | } | 10 | } |
10 | 11 | ||
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; |
16 | for ( i=list.first(); i != 0; i=list.next() ) | 17 | for ( i=list.first(); i != 0; i=list.next() ) |
17 | delete i; | 18 | delete i; |
18 | } | 19 | } |
19 | 20 | ||
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; |
25 | } | 26 | } |
26 | 27 | ||
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 | */ |
32 | QString PPPModule::getPixmapName(Interface* ){ | 33 | QString PPPModule::getPixmapName(Interface* ){ |
33 | return "ppp"; | 34 | return "ppp"; |
34 | } | 35 | } |
35 | 36 | ||
36 | /** | 37 | /** |
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 | */ |
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); |
47 | return true; | 48 | return true; |
48 | } | 49 | } |
49 | 50 | ||
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 | */ |
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 | ||
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 | */ |
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 |
67 | // TODO ^ | 67 | // TODO ^ |
68 | InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); | 68 | InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); |
69 | return information; | 69 | return information; |
70 | } | 70 | } |
@@ -81,27 +81,35 @@ QList<Interface> PPPModule::getInterfaces(){ | |||
81 | 81 | ||
82 | /** | 82 | /** |
83 | * Attempt to add a new interface as defined by name | 83 | * Attempt to add a new interface as defined by name |
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 | */ |
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 | ||
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 | */ |
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 | ||