Diffstat (limited to 'noncore/settings/networksettings/ppp/pppmodule.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppmodule.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp index 95df068..8c401a9 100644 --- a/noncore/settings/networksettings/ppp/pppmodule.cpp +++ b/noncore/settings/networksettings/ppp/pppmodule.cpp | |||
@@ -84,59 +84,56 @@ QWidget *PPPModule::information(Interface *i){ | |||
84 | // InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i); | 84 | // InterfaceInformationImp *information = new InterfaceInformationImp( 0, "InterfaceSetupImp", i); |
85 | InterfaceInformationPPP *information = new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); | 85 | InterfaceInformationPPP *information = new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); |
86 | return information; | 86 | return information; |
87 | } | 87 | } |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * Get all active (up or down) interfaces | 90 | * Get all active (up or down) interfaces |
91 | * @return QList<Interface> A list of interfaces that exsist that havn't | 91 | * @return QList<Interface> A list of interfaces that exsist that havn't |
92 | * been called by isOwner() | 92 | * been called by isOwner() |
93 | */ | 93 | */ |
94 | QList<Interface> PPPModule::getInterfaces(){ | 94 | QList<Interface> PPPModule::getInterfaces(){ |
95 | // List all of the files in the peer directory | 95 | // List all of the files in the peer directory |
96 | qDebug("PPPModule::getInterfaces"); | 96 | qDebug("PPPModule::getInterfaces"); |
97 | return list; | 97 | return list; |
98 | } | 98 | } |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * Attempt to add a new interface as defined by name | 101 | * Attempt to add a new interface as defined by name |
102 | * @param name the name of the type of interface that should be created given | 102 | * @param name the name of the type of interface that should be created given |
103 | * by possibleNewInterfaces(); | 103 | * by possibleNewInterfaces(); |
104 | * @return Interface* NULL if it was unable to be created. | 104 | * @return Interface* NULL if it was unable to be created. |
105 | */ | 105 | */ |
106 | Interface *PPPModule::addNewInterface(const QString &newInterface){ | 106 | Interface *PPPModule::addNewInterface(const QString &newInterface){ |
107 | 107 | ||
108 | qDebug("try to add iface %s",newInterface.latin1()); | ||
109 | |||
110 | InterfacePPP *ifaceppp; | 108 | InterfacePPP *ifaceppp; |
111 | Interface *iface; | 109 | Interface *iface; |
112 | ifaceppp = new InterfacePPP(); | 110 | ifaceppp = new InterfacePPP(); |
113 | PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true); | 111 | PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true); |
114 | imp.showMaximized(); | 112 | imp.showMaximized(); |
115 | if(imp.exec() == QDialog::Accepted ){ | 113 | if(imp.exec() == QDialog::Accepted ){ |
114 | iface = (InterfacePPP*) ifaceppp; | ||
116 | iface->setModuleOwner( this ); | 115 | iface->setModuleOwner( this ); |
117 | iface = ifaceppp; | ||
118 | list.append( iface ); | 116 | list.append( iface ); |
119 | return iface; | 117 | return iface; |
120 | }else { | 118 | }else { |
121 | delete iface; | 119 | delete ifaceppp; |
122 | iface = NULL; | 120 | iface = NULL; |
123 | } | 121 | } |
124 | return iface; | 122 | return iface; |
125 | } | 123 | } |
126 | 124 | ||
127 | /** | 125 | /** |
128 | * Attempts to remove the interface, doesn't delete i | 126 | * Attempts to remove the interface, doesn't delete i |
129 | * @return bool true if successfull, false otherwise. | 127 | * @return bool true if successfull, false otherwise. |
130 | */ | 128 | */ |
131 | bool PPPModule::remove(Interface*){ | 129 | bool PPPModule::remove(Interface *i){ |
132 | // Can't remove a hardware device, you can stop it though. | 130 | return list.remove(i); |
133 | return false; | ||
134 | } | 131 | } |
135 | 132 | ||
136 | void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) | 133 | void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) |
137 | { | 134 | { |
138 | newIfaces.insert(QObject::tr("PPP") , | 135 | newIfaces.insert(QObject::tr("PPP") , |
139 | QObject::tr("generic ppp device")); | 136 | QObject::tr("generic ppp device")); |
140 | } | 137 | } |
141 | 138 | ||
142 | 139 | ||