summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings
Unidiff
Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index b102a10..fb279ee 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,39 +1,40 @@
1 1
2#include "modem.h" 2#include "modem.h"
3#include "pppconfig.h" 3#include "pppconfig.h"
4#include "pppmodule.h" 4#include "pppmodule.h"
5#include "pppdata.h" 5#include "pppdata.h"
6#include "interfaceinformationppp.h" 6#include "interfaceinformationppp.h"
7#include "interfaceppp.h" 7#include "interfaceppp.h"
8 8
9/* OPIE */ 9/* OPIE */
10#include <opie2/odebug.h> 10#include <opie2/odebug.h>
11#include <qpe/config.h> 11#include <qpe/config.h>
12#include <qpe/qpeapplication.h> 12#include <qpe/qpeapplication.h>
13using namespace Opie::Core; 13using namespace Opie::Core;
14 14
15/* QT */ 15/* QT */
16#include <qt.h>
16 17
17/* STD */ 18/* STD */
18#include <errno.h> 19#include <errno.h>
19#include <signal.h> 20#include <signal.h>
20 21
21// don't polute global namespace 22// don't polute global namespace
22namespace 23namespace
23{ 24{
24 /* 25 /*
25 * If network settings is qutting and we've ppp 26 * If network settings is qutting and we've ppp
26 * devices open we need to save the pid_t the PPData 27 * devices open we need to save the pid_t the PPData
27 * and the interface number 28 * and the interface number
28 */ 29 */
29 struct Connection 30 struct Connection
30 { 31 {
31 pid_t pid; 32 pid_t pid;
32 QString device; 33 QString device;
33 QString name; 34 QString name;
34 }; 35 };
35 class InterfaceKeeper 36 class InterfaceKeeper
36 { 37 {
37 public: 38 public:
38 InterfaceKeeper(); 39 InterfaceKeeper();
39 ~InterfaceKeeper(); 40 ~InterfaceKeeper();
@@ -125,49 +126,49 @@ void PPPModule::setProfile(const QString &newProfile)
125QString PPPModule::getPixmapName(Interface* ) 126QString PPPModule::getPixmapName(Interface* )
126{ 127{
127 return "ppp"; 128 return "ppp";
128} 129}
129 130
130/** 131/**
131 * Check to see if the interface i is owned by this module. 132 * Check to see if the interface i is owned by this module.
132 * @param Interface* interface to check against 133 * @param Interface* interface to check against
133 * @return bool true if i is owned by this module, false otherwise. 134 * @return bool true if i is owned by this module, false otherwise.
134 */ 135 */
135bool PPPModule::isOwner(Interface *i) 136bool PPPModule::isOwner(Interface *i)
136{ 137{
137 return list.find( i ) != -1; 138 return list.find( i ) != -1;
138} 139}
139 140
140/** 141/**
141 * Create, and return the WLANConfigure Module 142 * Create, and return the WLANConfigure Module
142 * @return QWidget* pointer to this modules configure. 143 * @return QWidget* pointer to this modules configure.
143 */ 144 */
144QWidget *PPPModule::configure(Interface *i) 145QWidget *PPPModule::configure(Interface *i)
145{ 146{
146 odebug << "return ModemWidget" << oendl; 147 odebug << "return ModemWidget" << oendl;
147 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, 148 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i,
148 0, "PPPConfig", false, 149 0, "PPPConfig", false,
149 (Qt::WDestructiveClose | Qt::WStyle_ContextHelp)); 150 ::Qt::WDestructiveClose | ::Qt::WStyle_ContextHelp);
150 return pppconfig; 151 return pppconfig;
151} 152}
152 153
153/** 154/**
154 * Create, and return the Information Module 155 * Create, and return the Information Module
155 * @return QWidget* pointer to this modules info. 156 * @return QWidget* pointer to this modules info.
156 */ 157 */
157QWidget *PPPModule::information(Interface *i) 158QWidget *PPPModule::information(Interface *i)
158{ 159{
159 // We don't have any advanced pppd information widget yet :-D 160 // We don't have any advanced pppd information widget yet :-D
160 // TODO ^ 161 // TODO ^
161 162
162 return new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); 163 return new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i );
163} 164}
164 165
165/** 166/**
166 * Get all active (up or down) interfaces 167 * Get all active (up or down) interfaces
167 * @return QList<Interface> A list of interfaces that exsist that havn't 168 * @return QList<Interface> A list of interfaces that exsist that havn't
168 * been called by isOwner() 169 * been called by isOwner()
169 */ 170 */
170QList<Interface> PPPModule::getInterfaces() 171QList<Interface> PPPModule::getInterfaces()
171{ 172{
172 // List all of the files in the peer directory 173 // List all of the files in the peer directory
173 odebug << "PPPModule::getInterfaces" << oendl; 174 odebug << "PPPModule::getInterfaces" << oendl;
@@ -193,50 +194,50 @@ Interface *PPPModule::addNewInterface(const QString &newInterface)
193 iface = (InterfacePPP*) ifaceppp; 194 iface = (InterfacePPP*) ifaceppp;
194 iface->setModuleOwner( this ); 195 iface->setModuleOwner( this );
195 list.append( iface ); 196 list.append( iface );
196 return iface; 197 return iface;
197 } 198 }
198 else 199 else
199 { 200 {
200 delete ifaceppp; 201 delete ifaceppp;
201 iface = NULL; 202 iface = NULL;
202 } 203 }
203 return iface; 204 return iface;
204} 205}
205 206
206/** 207/**
207 * Attempts to remove the interface, doesn't delete i 208 * Attempts to remove the interface, doesn't delete i
208 * @return bool true if successful, false otherwise. 209 * @return bool true if successful, false otherwise.
209 */ 210 */
210bool PPPModule::remove(Interface *i) 211bool PPPModule::remove(Interface *i)
211{ 212{
212 return list.remove(i); 213 return list.remove(i);
213} 214}
214 215
215void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) 216void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
216{ 217{
217 newIfaces.insert(QObject::tr("PPP") , 218 newIfaces.insert(::QObject::tr("PPP") ,
218 QObject::tr("generic ppp device")); 219 ::QObject::tr("generic ppp device"));
219} 220}
220 221
221 222
222 223
223namespace 224namespace
224{ 225{
225 InterfaceKeeper::InterfaceKeeper( ) 226 InterfaceKeeper::InterfaceKeeper( )
226 {} 227 {}
227 InterfaceKeeper::~InterfaceKeeper() 228 InterfaceKeeper::~InterfaceKeeper()
228 { 229 {
229 Config cfg("ppp_plugin_keeper"); 230 Config cfg("ppp_plugin_keeper");
230 QStringList lst = cfg.groupList(); 231 QStringList lst = cfg.groupList();
231 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) 232 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
232 { 233 {
233 Connection con; 234 Connection con;
234 cfg.setGroup( (*it) ); 235 cfg.setGroup( (*it) );
235 cfg.clearGroup(); 236 cfg.clearGroup();
236 } 237 }
237 238
238 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it ) 239 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it )
239 { 240 {
240 Connection con = it.data(); 241 Connection con = it.data();
241 cfg.setGroup( con.name ); 242 cfg.setGroup( con.name );
242 cfg.writeEntry( "pid", con.pid ); 243 cfg.writeEntry( "pid", con.pid );