Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index fb2f3e5..3a97535 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp | |||
@@ -47,74 +47,76 @@ QString PPPModule::getPixmapName(Interface* ){ | |||
47 | * @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. |
48 | */ | 48 | */ |
49 | bool PPPModule::isOwner(Interface *i){ | 49 | bool PPPModule::isOwner(Interface *i){ |
50 | return list.find( i ) != -1; | 50 | return list.find( i ) != -1; |
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 | */ |
57 | QWidget *PPPModule::configure(Interface *i){ | 57 | QWidget *PPPModule::configure(Interface *i){ |
58 | qDebug("return ModemWidget"); | 58 | qDebug("return ModemWidget"); |
59 | PPPConfigWidget *pppconfig = new PPPConfigWidget( 0, "PPPConfig", false, | 59 | PPPConfigWidget *pppconfig = new PPPConfigWidget( i, 0, "PPPConfig", |
60 | false, | ||
60 | Qt::WDestructiveClose ); | 61 | Qt::WDestructiveClose ); |
61 | return pppconfig; | 62 | return pppconfig; |
62 | } | 63 | } |
63 | 64 | ||
64 | /** | 65 | /** |
65 | * Create, and return the Information Module | 66 | * Create, and return the Information Module |
66 | * @return QWidget* pointer to this modules info. | 67 | * @return QWidget* pointer to this modules info. |
67 | */ | 68 | */ |
68 | QWidget *PPPModule::information(Interface *i){ | 69 | QWidget *PPPModule::information(Interface *i){ |
69 | // We don't have any advanced pppd information widget yet :-D | 70 | // We don't have any advanced pppd information widget yet :-D |
70 | // TODO ^ | 71 | // TODO ^ |
71 | qDebug("return PPPModule::information"); | 72 | qDebug("return PPPModule::information"); |
72 | InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i); | 73 | InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i); |
73 | return information; | 74 | return information; |
74 | } | 75 | } |
75 | 76 | ||
76 | /** | 77 | /** |
77 | * Get all active (up or down) interfaces | 78 | * Get all active (up or down) interfaces |
78 | * @return QList<Interface> A list of interfaces that exsist that havn't | 79 | * @return QList<Interface> A list of interfaces that exsist that havn't |
79 | * been called by isOwner() | 80 | * been called by isOwner() |
80 | */ | 81 | */ |
81 | QList<Interface> PPPModule::getInterfaces(){ | 82 | QList<Interface> PPPModule::getInterfaces(){ |
82 | // List all of the files in the peer directory | 83 | // List all of the files in the peer directory |
83 | qDebug("PPPModule::getInterfaces"); | 84 | qDebug("PPPModule::getInterfaces"); |
84 | return list; | 85 | return list; |
85 | } | 86 | } |
86 | 87 | ||
87 | /** | 88 | /** |
88 | * Attempt to add a new interface as defined by name | 89 | * Attempt to add a new interface as defined by name |
89 | * @param name the name of the type of interface that should be created given | 90 | * @param name the name of the type of interface that should be created given |
90 | * by possibleNewInterfaces(); | 91 | * by possibleNewInterfaces(); |
91 | * @return Interface* NULL if it was unable to be created. | 92 | * @return Interface* NULL if it was unable to be created. |
92 | */ | 93 | */ |
93 | Interface *PPPModule::addNewInterface(const QString &newInterface){ | 94 | Interface *PPPModule::addNewInterface(const QString &newInterface){ |
94 | 95 | ||
95 | qDebug("try to add iface %s",newInterface.latin1()); | 96 | qDebug("try to add iface %s",newInterface.latin1()); |
96 | 97 | ||
97 | PPPConfigWidget imp(0, "PPPConfigImp", true); | 98 | Interface *iface; |
99 | iface = new Interface(); | ||
100 | PPPConfigWidget imp(iface, 0, "PPPConfigImp", true); | ||
98 | imp.showMaximized(); | 101 | imp.showMaximized(); |
99 | if(imp.exec() == QDialog::Accepted ){ | 102 | if(imp.exec() == QDialog::Accepted ){ |
100 | qDebug("ACCEPTED"); | 103 | iface->setModuleOwner( this ); |
101 | PPPData::data()->save(); | 104 | list.append( iface ); |
102 | Interface *iface; | 105 | return iface; |
103 | iface = new Interface( 0, PPPData::data()->modemDevice() ); | 106 | }else { |
104 | iface->setHardwareName( PPPData::data()->accname() ); | 107 | delete iface; |
105 | list.append( iface ); | 108 | iface = NULL; |
106 | return iface; | ||
107 | } | 109 | } |
108 | return NULL; | 110 | return iface; |
109 | } | 111 | } |
110 | 112 | ||
111 | /** | 113 | /** |
112 | * Attempts to remove the interface, doesn't delete i | 114 | * Attempts to remove the interface, doesn't delete i |
113 | * @return bool true if successfull, false otherwise. | 115 | * @return bool true if successfull, false otherwise. |
114 | */ | 116 | */ |
115 | bool PPPModule::remove(Interface*){ | 117 | bool PPPModule::remove(Interface*){ |
116 | // Can't remove a hardware device, you can stop it though. | 118 | // Can't remove a hardware device, you can stop it though. |
117 | return false; | 119 | return false; |
118 | } | 120 | } |
119 | 121 | ||
120 | void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) | 122 | void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) |