summaryrefslogtreecommitdiff
authorar <ar>2004-02-21 18:32:37 (UTC)
committer ar <ar>2004-02-21 18:32:37 (UTC)
commit536f271b1e6a1d1886e96a28524a3503c4c38c4e (patch) (unidiff)
tree63b3c0ce472a89a0f9731195fececc701bf4ca67
parentdb2afda83e495bff9fc19fa14a30072f1cd4c67a (diff)
downloadopie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.zip
opie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.tar.gz
opie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.tar.bz2
improve support for BigScreen
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp27
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp272
-rw-r--r--noncore/settings/networksettings/ppp/accounts.cpp80
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp62
-rw-r--r--noncore/settings/networksettings/ppp/modeminfo.cpp65
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp103
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp11
7 files changed, 395 insertions, 225 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index 37c3a91..698dfd3 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -1 +1,2 @@
1
1#include "interfaceinformationimp.h" 2#include "interfaceinformationimp.h"
@@ -3,2 +4,7 @@
3 4
5/* OPIE */
6#include <qpe/config.h>
7#include <qpe/qpeapplication.h>
8
9/* QT */
4#include <qcheckbox.h> 10#include <qcheckbox.h>
@@ -9,3 +15,2 @@
9 15
10#include <qpe/config.h>
11 16
@@ -20,3 +25,4 @@
20 */ 25 */
21InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ 26InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i)
27{
22 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 28 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
@@ -46,4 +52,6 @@ InterfaceInformationImp::~InterfaceInformationImp()
46 */ 52 */
47void InterfaceInformationImp::updateInterface(Interface *){ 53void InterfaceInformationImp::updateInterface(Interface *)
48 if(interface->getStatus()){ 54{
55 if(interface->getStatus())
56 {
49 startButton->setEnabled(false); 57 startButton->setEnabled(false);
@@ -52,3 +60,4 @@ void InterfaceInformationImp::updateInterface(Interface *){
52 } 60 }
53 else{ 61 else
62 {
54 startButton->setEnabled(true); 63 startButton->setEnabled(true);
@@ -67,3 +76,4 @@ void InterfaceInformationImp::updateInterface(Interface *){
67 */ 76 */
68void InterfaceInformationImp::advanced(){ 77void InterfaceInformationImp::advanced()
78{
69 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); 79 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
@@ -78,3 +88,3 @@ void InterfaceInformationImp::advanced(){
78 a->dhcpInformation->setEnabled(interface->isDhcp()); 88 a->dhcpInformation->setEnabled(interface->isDhcp());
79 a->showMaximized(); 89 QPEApplication::showWidget( a );
80} 90}
@@ -86,3 +96,4 @@ void InterfaceInformationImp::advanced(){
86 */ 96 */
87void InterfaceInformationImp::showMessage(const QString &message){ 97void InterfaceInformationImp::showMessage(const QString &message)
98{
88 if (CheckBoxSilent->isChecked()) return; 99 if (CheckBoxSilent->isChecked()) return;
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index d9752ce..b0a1dd9 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -1 +1,2 @@
1
1#include "mainwindowimp.h" 2#include "mainwindowimp.h"
@@ -7,2 +8,10 @@
7 8
9/* OPIE */
10#include <qpe/qcopenvelope_qws.h>
11#include <qpe/qpeapplication.h>
12#include <qpe/config.h>
13#include <qpe/qlibrary.h>
14#include <qpe/resource.h>
15
16/* QT */
8#include <qpushbutton.h> 17#include <qpushbutton.h>
@@ -13,23 +22,5 @@
13#include <qlabel.h> 22#include <qlabel.h>
14#include <qpe/qcopenvelope_qws.h>
15#include <qtabwidget.h> // in order to disable the profiles tab 23#include <qtabwidget.h> // in order to disable the profiles tab
16#include <qpe/qpeapplication.h>
17
18#include <qmessagebox.h> 24#include <qmessagebox.h>
19 25
20#ifdef QWS
21 #include <qpe/config.h>
22 #include <qpe/qlibrary.h>
23 #include <qpe/resource.h>
24 #include <qpe/qpeapplication.h>
25#else
26 #include <klibloader.h>
27 #define QLibrary KLibrary
28 #include <kconfig.h>
29 #define Config KConfig
30 #include <kapplication.h>
31 #include <kstandarddirs.h>
32 #include <kiconloader.h>
33 #define showMaximized show
34#endif
35 26
@@ -45,2 +36,3 @@
45 36
37/* STD */
46#include <net/if.h> 38#include <net/if.h>
@@ -52,3 +44,4 @@
52 44
53MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME){ 45MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME)
46{
54 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); 47 connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
@@ -80,3 +73,4 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
80 QMap<QString, Interface*>::Iterator it; 73 QMap<QString, Interface*>::Iterator it;
81 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { 74 for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni )
75 {
82 /* 76 /*
@@ -85,3 +79,4 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
85 */ 79 */
86 if (m_handledIfaces.contains( *ni) ) { 80 if (m_handledIfaces.contains( *ni) )
81 {
87 qDebug("Not up iface handled by module"); 82 qDebug("Not up iface handled by module");
@@ -90,3 +85,4 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
90 bool found = false; 85 bool found = false;
91 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){ 86 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it )
87 {
92 if(it.key() == (*ni)) 88 if(it.key() == (*ni))
@@ -94,4 +90,6 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
94 } 90 }
95 if(!found){ 91 if(!found)
96 if(!(*ni).contains("_")){ 92 {
93 if(!(*ni).contains("_"))
94 {
97 Interface *i = new Interface(this, *ni, false); 95 Interface *i = new Interface(this, *ni, false);
@@ -119,7 +117,10 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
119 QFile file(scheme); 117 QFile file(scheme);
120 if ( file.open(IO_ReadOnly) ) { // file opened successfully 118 if ( file.open(IO_ReadOnly) )
119 { // file opened successfully
121 QTextStream stream( &file ); // use a text stream 120 QTextStream stream( &file ); // use a text stream
122 while ( !stream.eof() ) { // until end of file... 121 while ( !stream.eof() )
122 { // until end of file...
123 QString line = stream.readLine(); // line of text excluding '\n' 123 QString line = stream.readLine(); // line of text excluding '\n'
124 if(line.contains("SCHEME")){ 124 if(line.contains("SCHEME"))
125 {
125 line = line.mid(7, line.length()); 126 line = line.mid(7, line.length());
@@ -137,3 +138,4 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
137 */ 138 */
138MainWindowImp::~MainWindowImp(){ 139MainWindowImp::~MainWindowImp()
140{
139 // Save profiles. 141 // Save profiles.
@@ -145,3 +147,4 @@ MainWindowImp::~MainWindowImp(){
145 QMap<Interface*, QListViewItem*>::Iterator iIt; 147 QMap<Interface*, QListViewItem*>::Iterator iIt;
146 for( iIt = items.begin(); iIt != items.end(); ++iIt ){ 148 for( iIt = items.begin(); iIt != items.end(); ++iIt )
149 {
147 if(iIt.key()->getModuleOwner() == NULL) 150 if(iIt.key()->getModuleOwner() == NULL)
@@ -153,3 +156,4 @@ MainWindowImp::~MainWindowImp(){
153 QMap<Module*, QLibrary*>::Iterator it; 156 QMap<Module*, QLibrary*>::Iterator it;
154 for( it = libraries.begin(); it != libraries.end(); ++it ){ 157 for( it = libraries.begin(); it != libraries.end(); ++it )
158 {
155 delete it.key(); 159 delete it.key();
@@ -167,3 +171,4 @@ MainWindowImp::~MainWindowImp(){
167 */ 171 */
168void MainWindowImp::getAllInterfaces(){ 172void MainWindowImp::getAllInterfaces()
173{
169 int sockfd = socket(PF_INET, SOCK_DGRAM, 0); 174 int sockfd = socket(PF_INET, SOCK_DGRAM, 0);
@@ -178,3 +183,4 @@ void MainWindowImp::getAllInterfaces(){
178 183
179 if (! procFile.exists()) { 184 if (! procFile.exists())
185 {
180 struct ifreq ifrs[100]; 186 struct ifreq ifrs[100];
@@ -185,3 +191,4 @@ void MainWindowImp::getAllInterfaces(){
185 191
186 for (unsigned int i = 0; i < ifc.ifc_len / sizeof(struct ifreq); i++) { 192 for (unsigned int i = 0; i < ifc.ifc_len / sizeof(struct ifreq); i++)
193 {
187 struct ifreq *pifr = &ifrs[i]; 194 struct ifreq *pifr = &ifrs[i];
@@ -190,3 +197,5 @@ void MainWindowImp::getAllInterfaces(){
190 } 197 }
191 } else { 198 }
199 else
200 {
192 procFile.open(IO_ReadOnly); 201 procFile.open(IO_ReadOnly);
@@ -198,4 +207,6 @@ void MainWindowImp::getAllInterfaces(){
198 procTs.readLine(); // eat a line 207 procTs.readLine(); // eat a line
199 while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null) { 208 while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null)
200 if((loc = line.find(":")) != -1) { 209 {
210 if((loc = line.find(":")) != -1)
211 {
201 ifaces += line.left(loc); 212 ifaces += line.left(loc);
@@ -205,5 +216,7 @@ void MainWindowImp::getAllInterfaces(){
205 216
206 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) { 217 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it)
218 {
207 int flags = 0; 219 int flags = 0;
208 if ( m_handledIfaces.contains( (*it) ) ) { 220 if ( m_handledIfaces.contains( (*it) ) )
221 {
209 qDebug(" %s is handled by a module", (*it).latin1() ); 222 qDebug(" %s is handled by a module", (*it).latin1() );
@@ -247,6 +260,9 @@ void MainWindowImp::getAllInterfaces(){
247 QList<Interface> ilist; 260 QList<Interface> ilist;
248 for( it = libraries.begin(); it != libraries.end(); ++it ){ 261 for( it = libraries.begin(); it != libraries.end(); ++it )
249 if(it.key()){ 262 {
263 if(it.key())
264 {
250 ilist = it.key()->getInterfaces(); 265 ilist = it.key()->getInterfaces();
251 for( i = ilist.first(); i != 0; i = ilist.next() ){ 266 for( i = ilist.first(); i != 0; i = ilist.next() )
267 {
252 qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() ); 268 qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() );
@@ -266,3 +282,4 @@ void MainWindowImp::getAllInterfaces(){
266 */ 282 */
267void MainWindowImp::loadModules(const QString &path){ 283void MainWindowImp::loadModules(const QString &path)
284{
268#ifdef DEBUG 285#ifdef DEBUG
@@ -279,7 +296,10 @@ void MainWindowImp::loadModules(const QString &path){
279 QFileInfo *fi; 296 QFileInfo *fi;
280 while ( (fi=it.current()) ) { 297 while ( (fi=it.current()) )
298 {
281#ifdef QWS 299#ifdef QWS
282 if(fi->fileName().contains(".so")){ 300 if(fi->fileName().contains(".so"))
301 {
283#else 302#else
284 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_")){ 303 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_"))
304 {
285#endif 305#endif
@@ -298,3 +318,4 @@ void MainWindowImp::loadModules(const QString &path){
298 */ 318 */
299Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString){ 319Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString)
320{
300#ifdef DEBUG 321#ifdef DEBUG
@@ -305,3 +326,4 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
305 void *functionPointer = lib->resolve(resolveString); 326 void *functionPointer = lib->resolve(resolveString);
306 if( !functionPointer ){ 327 if( !functionPointer )
328 {
307#ifdef DEBUG 329#ifdef DEBUG
@@ -314,3 +336,4 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
314 Module *object = ((Module* (*)()) functionPointer)(); 336 Module *object = ((Module* (*)()) functionPointer)();
315 if(object == NULL){ 337 if(object == NULL)
338 {
316#ifdef DEBUG 339#ifdef DEBUG
@@ -329,3 +352,4 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
329 QLibrary *lib = loader->library(pluginFileName); 352 QLibrary *lib = loader->library(pluginFileName);
330 if( !lib || !lib->hasSymbol(resolveString) ){ 353 if( !lib || !lib->hasSymbol(resolveString) )
354 {
331 qDebug(QString("MainWindowImp::loadPlugin: File: %1 is not a plugin, but though was.").arg(pluginFileName).latin1()); 355 qDebug(QString("MainWindowImp::loadPlugin: File: %1 is not a plugin, but though was.").arg(pluginFileName).latin1());
@@ -335,3 +359,4 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
335 Module *object = ((Module* (*)()) lib->symbol(resolveString))(); 359 Module *object = ((Module* (*)()) lib->symbol(resolveString))();
336 if(object == NULL){ 360 if(object == NULL)
361 {
337#ifdef DEBUG 362#ifdef DEBUG
@@ -354,3 +379,4 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
354 */ 379 */
355void MainWindowImp::addClicked(){ 380void MainWindowImp::addClicked()
381{
356 QMap<Module*, QLibrary*>::Iterator it; 382 QMap<Module*, QLibrary*>::Iterator it;
@@ -359,4 +385,6 @@ void MainWindowImp::addClicked(){
359 385
360 for( it = libraries.begin(); it != libraries.end(); ++it ){ 386 for( it = libraries.begin(); it != libraries.end(); ++it )
361 if(it.key()){ 387 {
388 if(it.key())
389 {
362 (it.key())->possibleNewInterfaces(list); 390 (it.key())->possibleNewInterfaces(list);
@@ -365,3 +393,4 @@ void MainWindowImp::addClicked(){
365 // See if the list has anything that we can add. 393 // See if the list has anything that we can add.
366 if(list.count() == 0){ 394 if(list.count() == 0)
395 {
367 QMessageBox::information(this, "Sorry", "Nothing to add.", QMessageBox::Ok); 396 QMessageBox::information(this, "Sorry", "Nothing to add.", QMessageBox::Ok);
@@ -371,4 +400,4 @@ void MainWindowImp::addClicked(){
371 addNewConnection.addConnections(list); 400 addNewConnection.addConnections(list);
372 addNewConnection.showMaximized(); 401 if( QDialog::Accepted == QPEApplication::execDialog( &addNewConnection ) )
373 if(QDialog::Accepted == addNewConnection.exec()){ 402 {
374 QListViewItem *item = addNewConnection.registeredServicesList->currentItem(); 403 QListViewItem *item = addNewConnection.registeredServicesList->currentItem();
@@ -377,6 +406,9 @@ void MainWindowImp::addClicked(){
377 406
378 for( it = libraries.begin(); it != libraries.end(); ++it ){ 407 for( it = libraries.begin(); it != libraries.end(); ++it )
379 if(it.key()){ 408 {
409 if(it.key())
410 {
380 Interface *i = (it.key())->addNewInterface(item->text(0)); 411 Interface *i = (it.key())->addNewInterface(item->text(0));
381 if(i){ 412 if(i)
413 {
382 qDebug("iface name %s",i->getInterfaceName().latin1()); 414 qDebug("iface name %s",i->getInterfaceName().latin1());
@@ -394,5 +426,7 @@ void MainWindowImp::addClicked(){
394 */ 426 */
395void MainWindowImp::removeClicked(){ 427void MainWindowImp::removeClicked()
428{
396 QListViewItem *item = connectionList->currentItem(); 429 QListViewItem *item = connectionList->currentItem();
397 if(!item) { 430 if(!item)
431 {
398 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); 432 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
@@ -402,9 +436,12 @@ void MainWindowImp::removeClicked(){
402 Interface *i = interfaceItems[item]; 436 Interface *i = interfaceItems[item];
403 if(i->getModuleOwner() == NULL){ 437 if(i->getModuleOwner() == NULL)
438 {
404 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", QMessageBox::Ok); 439 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", QMessageBox::Ok);
405 } 440 }
406 else{ 441 else
442 {
407 if(!i->getModuleOwner()->remove(i)) 443 if(!i->getModuleOwner()->remove(i))
408 QMessageBox::information(this, tr("Error"), tr("Unable to remove."), QMessageBox::Ok); 444 QMessageBox::information(this, tr("Error"), tr("Unable to remove."), QMessageBox::Ok);
409 else{ 445 else
446 {
410 delete item; 447 delete item;
@@ -420,5 +457,7 @@ void MainWindowImp::removeClicked(){
420 */ 457 */
421void MainWindowImp::configureClicked(){ 458void MainWindowImp::configureClicked()
459{
422 QListViewItem *item = connectionList->currentItem(); 460 QListViewItem *item = connectionList->currentItem();
423 if(!item){ 461 if(!item)
462 {
424 QMessageBox::information(this, tr("Sorry"),tr("Please select an interface first."), QMessageBox::Ok); 463 QMessageBox::information(this, tr("Sorry"),tr("Please select an interface first."), QMessageBox::Ok);
@@ -433,7 +472,9 @@ void MainWindowImp::configureClicked(){
433 472
434 if(i->getModuleOwner()){ 473 if(i->getModuleOwner())
474 {
435 QWidget *moduleConfigure = i->getModuleOwner()->configure(i); 475 QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
436 if(moduleConfigure != NULL){ 476 if(moduleConfigure != NULL)
477 {
437 i->getModuleOwner()->setProfile(currentProfileText); 478 i->getModuleOwner()->setProfile(currentProfileText);
438 moduleConfigure->showMaximized(); 479 QPEApplication::showWidget( moduleConfigure );
439 return; 480 return;
@@ -444,3 +485,3 @@ void MainWindowImp::configureClicked(){
444 configure->setProfile(currentProfileText); 485 configure->setProfile(currentProfileText);
445 configure->showMaximized(); 486 QPEApplication::showDialog( configure );
446} 487}
@@ -452,5 +493,7 @@ void MainWindowImp::configureClicked(){
452 */ 493 */
453void MainWindowImp::informationClicked(){ 494void MainWindowImp::informationClicked()
495{
454 QListViewItem *item = connectionList->currentItem(); 496 QListViewItem *item = connectionList->currentItem();
455 if(!item){ 497 if(!item)
498 {
456 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); 499 QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
@@ -465,6 +508,8 @@ void MainWindowImp::informationClicked(){
465 508
466 if(i->getModuleOwner()){ 509 if(i->getModuleOwner())
510 {
467 QWidget *moduleInformation = i->getModuleOwner()->information(i); 511 QWidget *moduleInformation = i->getModuleOwner()->information(i);
468 if(moduleInformation != NULL){ 512 if(moduleInformation != NULL)
469 moduleInformation->showMaximized(); 513 {
514 QPEApplication::showWidget( moduleInformation );
470#ifdef DEBUG 515#ifdef DEBUG
@@ -476,3 +521,3 @@ void MainWindowImp::informationClicked(){
476 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog | Qt::WStyle_ContextHelp); 521 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog | Qt::WStyle_ContextHelp);
477 information->showMaximized(); 522 QPEApplication::showWidget( information );
478} 523}
@@ -483,4 +528,6 @@ void MainWindowImp::informationClicked(){
483 */ 528 */
484void MainWindowImp::updateInterface(Interface *i){ 529void MainWindowImp::updateInterface(Interface *i)
485 if(!advancedUserMode){ 530{
531 if(!advancedUserMode)
532 {
486 if(i->getInterfaceName() == "lo") 533 if(i->getInterfaceName() == "lo")
@@ -492,3 +539,4 @@ void MainWindowImp::updateInterface(Interface *i){
492 // Find the interface, making it if needed. 539 // Find the interface, making it if needed.
493 if(items.find(i) == items.end()){ 540 if(items.find(i) == items.end())
541 {
494 item = new QListViewItem(connectionList, "", "", ""); 542 item = new QListViewItem(connectionList, "", "", "");
@@ -496,3 +544,4 @@ void MainWindowImp::updateInterface(Interface *i){
496 QMap<Module*, QLibrary*>::Iterator it; 544 QMap<Module*, QLibrary*>::Iterator it;
497 for( it = libraries.begin(); it != libraries.end(); ++it ){ 545 for( it = libraries.begin(); it != libraries.end(); ++it )
546 {
498 if(it.key()->isOwner(i)) 547 if(it.key()->isOwner(i))
@@ -539,3 +588,4 @@ void MainWindowImp::updateInterface(Interface *i){
539 588
540void MainWindowImp::newProfileChanged(const QString& newText){ 589void MainWindowImp::newProfileChanged(const QString& newText)
590{
541 if(newText.length() > 0) 591 if(newText.length() > 0)
@@ -551,5 +601,7 @@ void MainWindowImp::newProfileChanged(const QString& newText){
551 */ 601 */
552void MainWindowImp::addProfile(){ 602void MainWindowImp::addProfile()
603{
553 QString newProfileName = newProfile->text(); 604 QString newProfileName = newProfile->text();
554 if(profiles.grep(newProfileName).count() > 0){ 605 if(profiles.grep(newProfileName).count() > 0)
606 {
555 QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); 607 QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok);
@@ -565,4 +617,6 @@ void MainWindowImp::addProfile(){
565 */ 617 */
566void MainWindowImp::removeProfile(){ 618void MainWindowImp::removeProfile()
567 if(profilesList->count() <= 1){ 619{
620 if(profilesList->count() <= 1)
621 {
568 QMessageBox::information(this, "Can't remove.","At least one profile\nis needed.", QMessageBox::Ok); 622 QMessageBox::information(this, "Can't remove.","At least one profile\nis needed.", QMessageBox::Ok);
@@ -571,3 +625,4 @@ void MainWindowImp::removeProfile(){
571 QString profileToRemove = profilesList->currentText(); 625 QString profileToRemove = profilesList->currentText();
572 if(profileToRemove == "All"){ 626 if(profileToRemove == "All")
627 {
573 QMessageBox::information(this, "Can't remove.","Can't remove default.", QMessageBox::Ok); 628 QMessageBox::information(this, "Can't remove.","Can't remove default.", QMessageBox::Ok);
@@ -576,3 +631,4 @@ void MainWindowImp::removeProfile(){
576 // Can't remove the curent profile 631 // Can't remove the curent profile
577 if(profileToRemove == currentProfileLabel->text()){ 632 if(profileToRemove == currentProfileLabel->text())
633 {
578 QMessageBox::information(this, "Can't remove.",QString("%1 is the current profile.").arg(profileToRemove), QMessageBox::Ok); 634 QMessageBox::information(this, "Can't remove.",QString("%1 is the current profile.").arg(profileToRemove), QMessageBox::Ok);
@@ -582,3 +638,4 @@ void MainWindowImp::removeProfile(){
582 638
583 if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok){ 639 if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
640 {
584 profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), "")); 641 profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), ""));
@@ -592,11 +649,15 @@ void MainWindowImp::removeProfile(){
592 QMap<Interface*, QListViewItem*>::Iterator it; 649 QMap<Interface*, QListViewItem*>::Iterator it;
593 for( it = items.begin(); it != items.end(); ++it ){ 650 for( it = items.begin(); it != items.end(); ++it )
651 {
594 QString interfaceName = it.key()->getInterfaceName(); 652 QString interfaceName = it.key()->getInterfaceName();
595 qDebug(interfaceName.latin1()); 653 qDebug(interfaceName.latin1());
596 if(interfaces.setInterface(interfaceName + "_" + profileToRemove)){ 654 if(interfaces.setInterface(interfaceName + "_" + profileToRemove))
655 {
597 interfaces.removeInterface(); 656 interfaces.removeInterface();
598 if(interfaces.setMapping(interfaceName)){ 657 if(interfaces.setMapping(interfaceName))
658 {
599 if(profilesList->count() == 1) 659 if(profilesList->count() == 1)
600 interfaces.removeMapping(); 660 interfaces.removeMapping();
601 else{ 661 else
662 {
602 interfaces.removeMap("map", interfaceName + "_" + profileToRemove); 663 interfaces.removeMap("map", interfaceName + "_" + profileToRemove);
@@ -615,4 +676,6 @@ void MainWindowImp::removeProfile(){
615 */ 676 */
616void MainWindowImp::changeProfile(){ 677void MainWindowImp::changeProfile()
617 if(profilesList->currentItem() == -1){ 678{
679 if(profilesList->currentItem() == -1)
680 {
618 QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok); 681 QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok);
@@ -621,3 +684,4 @@ void MainWindowImp::changeProfile(){
621 QString newProfile = profilesList->text(profilesList->currentItem()); 684 QString newProfile = profilesList->text(profilesList->currentItem());
622 if(newProfile != currentProfileLabel->text()){ 685 if(newProfile != currentProfileLabel->text())
686 {
623 currentProfileLabel->setText(newProfile); 687 currentProfileLabel->setText(newProfile);
@@ -625,3 +689,4 @@ void MainWindowImp::changeProfile(){
625 QFile file(scheme); 689 QFile file(scheme);
626 if ( file.open(IO_ReadWrite) ) { 690 if ( file.open(IO_ReadWrite) )
691 {
627 QTextStream stream( &file ); 692 QTextStream stream( &file );
@@ -631,6 +696,8 @@ void MainWindowImp::changeProfile(){
631 // restart all up devices? 696 // restart all up devices?
632 if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok){ 697 if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok)
698 {
633 // Go through them one by one 699 // Go through them one by one
634 QMap<Interface*, QListViewItem*>::Iterator it; 700 QMap<Interface*, QListViewItem*>::Iterator it;
635 for( it = items.begin(); it != items.end(); ++it ){ 701 for( it = items.begin(); it != items.end(); ++it )
702 {
636 if(it.key()->getStatus() == true) 703 if(it.key()->getStatus() == true)
@@ -655,3 +722,4 @@ void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
655 qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); 722 qDebug("MainWindowImp::receive QCop msg >"+msg+"<");
656 if (msg == "raise") { 723 if (msg == "raise")
724 {
657 raise(); 725 raise();
@@ -666,5 +734,7 @@ void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
666 QMap<Module*, QLibrary*>::Iterator it; 734 QMap<Module*, QLibrary*>::Iterator it;
667 for( it = libraries.begin(); it != libraries.end(); ++it ){ 735 for( it = libraries.begin(); it != libraries.end(); ++it )
736 {
668 qDebug("plugin >%s<", it.key()->type().latin1() ); 737 qDebug("plugin >%s<", it.key()->type().latin1() );
669 if(it.key()->type() == dest){ 738 if(it.key()->type() == dest)
739 {
670 it.key()->receive( param, arg ); 740 it.key()->receive( param, arg );
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp
index 28d8732..b8a1925a 100644
--- a/noncore/settings/networksettings/ppp/accounts.cpp
+++ b/noncore/settings/networksettings/ppp/accounts.cpp
@@ -26,4 +26,12 @@
26 26
27#include "accounts.h"
28#include "authwidget.h"
29#include "pppdata.h"
30#include "edit.h"
31
32/* OPIE */
33#include <qpe/qpeapplication.h>
34
35/* QT */
27#include <qdir.h> 36#include <qdir.h>
28#include <stdlib.h>
29#include <qlayout.h> 37#include <qlayout.h>
@@ -33,3 +41,2 @@
33#include <qmessagebox.h> 41#include <qmessagebox.h>
34
35#include <qapplication.h> 42#include <qapplication.h>
@@ -39,6 +46,4 @@
39 46
40#include "accounts.h" 47/* STD */
41#include "authwidget.h" 48#include <stdlib.h>
42#include "pppdata.h"
43#include "edit.h"
44 49
@@ -70,3 +75,4 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name, WF
70 75
71 for (uint i = 0; i < listListbox->count(); i++){ 76 for (uint i = 0; i < listListbox->count(); i++)
77 {
72 if ( listListbox->text(i) == _pppdata->accname() ) 78 if ( listListbox->text(i) == _pppdata->accname() )
@@ -78,3 +84,4 @@ AccountWidget::AccountWidget( PPPData *pd, QWidget *parent, const char *name, WF
78 84
79void AccountWidget::slotListBoxSelect(int idx) { 85void AccountWidget::slotListBoxSelect(int idx)
86{
80 bool ok = _pppdata->setAccount( listListbox->text(idx) ); 87 bool ok = _pppdata->setAccount( listListbox->text(idx) );
@@ -86,3 +93,4 @@ void AccountWidget::slotListBoxSelect(int idx) {
86 93
87void AccountWidget::edit() { 94void AccountWidget::edit()
95{
88 _pppdata->setAccount(listListbox->text(listListbox->currentItem())); 96 _pppdata->setAccount(listListbox->text(listListbox->currentItem()));
@@ -91,3 +99,4 @@ void AccountWidget::edit() {
91 99
92 if(result == QDialog::Accepted) { 100 if(result == QDialog::Accepted)
101 {
93 listListbox->changeItem(_pppdata->accname(),listListbox->currentItem()); 102 listListbox->changeItem(_pppdata->accname(),listListbox->currentItem());
@@ -99,3 +108,4 @@ void AccountWidget::edit() {
99 108
100void AccountWidget::create() { 109void AccountWidget::create()
110{
101 111
@@ -108,3 +118,4 @@ void AccountWidget::create() {
108 int result; 118 int result;
109 if (_pppdata->newaccount() == -1){ 119 if (_pppdata->newaccount() == -1)
120 {
110 qDebug("_pppdata->newaccount() == -1"); 121 qDebug("_pppdata->newaccount() == -1");
@@ -114,3 +125,4 @@ void AccountWidget::create() {
114 125
115 if(result == QDialog::Accepted) { 126 if(result == QDialog::Accepted)
127 {
116 listListbox->insertItem(_pppdata->accname()); 128 listListbox->insertItem(_pppdata->accname());
@@ -119,3 +131,4 @@ void AccountWidget::create() {
119 _pppdata->save(); 131 _pppdata->save();
120 } else 132 }
133 else
121 _pppdata->deleteAccount(); 134 _pppdata->deleteAccount();
@@ -124,3 +137,4 @@ void AccountWidget::create() {
124 137
125void AccountWidget::copy() { 138void AccountWidget::copy()
139{
126// if(listListbox->count() == MAX_ACCOUNTS) { 140// if(listListbox->count() == MAX_ACCOUNTS) {
@@ -130,3 +144,4 @@ void AccountWidget::copy() {
130 144
131 if(listListbox->currentItem()<0) { 145 if(listListbox->currentItem()<0)
146 {
132 QMessageBox::information(this, "sorry", tr("No account selected.")); 147 QMessageBox::information(this, "sorry", tr("No account selected."));
@@ -143,3 +158,4 @@ void AccountWidget::copy() {
143 158
144void AccountWidget::remove() { 159void AccountWidget::remove()
160{
145 161
@@ -166,3 +182,4 @@ void AccountWidget::remove() {
166 182
167int AccountWidget::doTab(){ 183int AccountWidget::doTab()
184{
168 QDialog *dlg = new QDialog( 0, "newAccount", true, Qt::WStyle_ContextHelp ); 185 QDialog *dlg = new QDialog( 0, "newAccount", true, Qt::WStyle_ContextHelp );
@@ -177,6 +194,9 @@ int AccountWidget::doTab(){
177 194
178 if(_pppdata->accname().isEmpty()) { 195 if(_pppdata->accname().isEmpty())
196 {
179 dlg->setCaption(tr("New Account")); 197 dlg->setCaption(tr("New Account"));
180 isnewaccount = true; 198 isnewaccount = true;
181 } else { 199 }
200 else
201 {
182 QString tit = tr("Edit Account: "); 202 QString tit = tr("Edit Account: ");
@@ -214,14 +234,20 @@ int AccountWidget::doTab(){
214 234
215 while (!ok){ 235 while (!ok)
216 dlg->showMaximized(); 236 {
217 result = dlg->exec(); 237 result = QPEApplication::execDialog( dlg );
218 ok = true; 238 ok = true;
219 239
220 if(result == QDialog::Accepted) { 240 if(result == QDialog::Accepted)
221 if (!auth_w->check()){ 241 {
242 if (!auth_w->check())
243 {
222 ok = false; 244 ok = false;
223 } else if(!dial_w->save()) { 245 }
246 else if(!dial_w->save())
247 {
224 QMessageBox::critical(this, "error", tr( "You must enter a unique account name")); 248 QMessageBox::critical(this, "error", tr( "You must enter a unique account name"));
225 ok = false; 249 ok = false;
226 }else{ 250 }
251 else
252 {
227 ip_w->save(); 253 ip_w->save();
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index 5540946..ff1b11b 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -26,5 +26,13 @@
26 26
27#include <termios.h> 27#include "general.h"
28#include <string.h> 28#include "interfaceppp.h"
29#include "modeminfo.h"
30#include "modemcmds.h"
31#include "pppdata.h"
29 32
33/* OPIE */
34#include <qpe/config.h>
35#include <qpe/qpeapplication.h>
36
37/* QT */
30#include <qcheckbox.h> 38#include <qcheckbox.h>
@@ -37,16 +45,6 @@
37#include <qwhatsthis.h> 45#include <qwhatsthis.h>
38#include <qpe/config.h>
39// #include <qgroupbox.h>
40
41
42#include "general.h"
43#include "interfaceppp.h"
44//#include "miniterm.h"
45#include "modeminfo.h"
46#include "modemcmds.h"
47//#include "devices.h"
48#include "pppdata.h"
49//#include <klocale.h>
50
51 46
47/* STD */
48#include <termios.h>
49#include <string.h>
52 50
@@ -150,3 +148,4 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
150 148
151 static const char *baudrates[] = { 149 static const char *baudrates[] =
150 {
152 151
@@ -172,3 +171,4 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
172 "2400", 171 "2400",
173 0}; 172 0
173 };
174 174
@@ -192,3 +192,4 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
192 192
193 for(int i=0; i <= enter->count()-1; i++) { 193 for(int i=0; i <= enter->count()-1; i++)
194 {
194 if(_pppdata->enter() == enter->text(i)) 195 if(_pppdata->enter() == enter->text(i))
@@ -239,3 +240,4 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
239 //set stuff from gpppdata 240 //set stuff from gpppdata
240 for(int i=0; i <= enter->count()-1; i++) { 241 for(int i=0; i <= enter->count()-1; i++)
242 {
241 if(_pppdata->enter() == enter->text(i)) 243 if(_pppdata->enter() == enter->text(i))
@@ -244,3 +246,4 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
244 246
245 for(int i=0; i <= modemdevice->count()-1; i++) { 247 for(int i=0; i <= modemdevice->count()-1; i++)
248 {
246 if(_pppdata->modemDevice() == modemdevice->text(i)) 249 if(_pppdata->modemDevice() == modemdevice->text(i))
@@ -249,3 +252,4 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name )
249 252
250 for(int i=0; i <= flowcontrol->count()-1; i++) { 253 for(int i=0; i <= flowcontrol->count()-1; i++)
254 {
251 if(_pppdata->flowcontrol() == flowcontrol->text(i)) 255 if(_pppdata->flowcontrol() == flowcontrol->text(i))
@@ -275,5 +279,7 @@ ModemWidget::~ModemWidget()
275 QString edited = modemdevice->currentText(); 279 QString edited = modemdevice->currentText();
276 if ( !( edited ).isEmpty() ) { 280 if ( !( edited ).isEmpty() )
281 {
277 edited.simplifyWhiteSpace(); 282 edited.simplifyWhiteSpace();
278 if ( devs.contains( edited ) == 0 ) { 283 if ( devs.contains( edited ) == 0 )
284 {
279 devs << edited; 285 devs << edited;
@@ -472,6 +478,7 @@ ModemWidget2::ModemWidget2( PPPData *pd, InterfacePPP *ip, QWidget *parent,
472 478
473void ModemWidget2::modemcmdsbutton() { 479void ModemWidget2::modemcmdsbutton()
480{
474 ModemCommands mc(_ifaceppp->data(), this, "commands" , true, Qt::WStyle_ContextHelp); 481 ModemCommands mc(_ifaceppp->data(), this, "commands" , true, Qt::WStyle_ContextHelp);
475 mc.showMaximized(); 482
476 mc.exec(); 483 QPEApplication::execDialog( &mc );
477} 484}
@@ -479,3 +486,4 @@ void ModemWidget2::modemcmdsbutton() {
479 486
480void ModemWidget2::query_modem() { 487void ModemWidget2::query_modem()
488{
481 ModemTransfer mt(_ifaceppp->modem(), this); 489 ModemTransfer mt(_ifaceppp->modem(), this);
diff --git a/noncore/settings/networksettings/ppp/modeminfo.cpp b/noncore/settings/networksettings/ppp/modeminfo.cpp
index dbb26db..df0bf9b 100644
--- a/noncore/settings/networksettings/ppp/modeminfo.cpp
+++ b/noncore/settings/networksettings/ppp/modeminfo.cpp
@@ -26,12 +26,16 @@
26 26
27#include <unistd.h> 27#include "modeminfo.h"
28#include "modem.h"
29
30/* OPIE */
31#include <qpe/qpeapplication.h>
32
33/* QT */
28#include <qregexp.h> 34#include <qregexp.h>
29#include <qlayout.h> 35#include <qlayout.h>
30// #include <kwin.h>
31// #include <kmessagebox.h>
32// #include <kapplication.h>
33#include <qmessagebox.h> 36#include <qmessagebox.h>
34#include <qapplication.h> 37#include <qapplication.h>
35#include "modeminfo.h" 38
36#include "modem.h" 39/* STD */
40#include <unistd.h>
37 41
@@ -95,3 +99,4 @@ ModemTransfer::ModemTransfer(Modem *mo, QWidget *parent, const char *name)
95 99
96void ModemTransfer::ati_done() { 100void ModemTransfer::ati_done()
101{
97 scripttimer->stop(); 102 scripttimer->stop();
@@ -106,4 +111,4 @@ void ModemTransfer::ati_done() {
106 mi->setAtiString(i, ati_query_strings[i]); 111 mi->setAtiString(i, ati_query_strings[i]);
107 mi->showMaximized(); 112
108 mi->exec(); 113 QPEApplication::execDialog( mi );
109 delete mi; 114 delete mi;
@@ -114,3 +119,4 @@ void ModemTransfer::ati_done() {
114 119
115void ModemTransfer::time_out_slot() { 120void ModemTransfer::time_out_slot()
121{
116 timeout_timer->stop(); 122 timeout_timer->stop();
@@ -123,3 +129,4 @@ void ModemTransfer::time_out_slot() {
123 129
124void ModemTransfer::init() { 130void ModemTransfer::init()
131{
125 132
@@ -128,3 +135,4 @@ void ModemTransfer::init() {
128 int lock = _modem->lockdevice(); 135 int lock = _modem->lockdevice();
129 if (lock == 1) { 136 if (lock == 1)
137 {
130 138
@@ -134,3 +142,4 @@ void ModemTransfer::init() {
134 142
135 if (lock == -1) { 143 if (lock == -1)
144 {
136 145
@@ -141,4 +150,6 @@ void ModemTransfer::init() {
141 150
142 if(_modem->opentty()) { 151 if(_modem->opentty())
143 if(_modem->hangup()) { 152 {
153 if(_modem->hangup())
154 {
144 usleep(100000); // wait 0.1 secs 155 usleep(100000); // wait 0.1 secs
@@ -167,3 +178,4 @@ void ModemTransfer::init() {
167 178
168void ModemTransfer::do_script() { 179void ModemTransfer::do_script()
180{
169 QString msg; 181 QString msg;
@@ -171,3 +183,4 @@ void ModemTransfer::do_script() {
171 183
172 switch(step) { 184 switch(step)
185 {
173 case 0: 186 case 0:
@@ -201,3 +214,4 @@ void ModemTransfer::do_script() {
201 214
202void ModemTransfer::readChar(unsigned char c) { 215void ModemTransfer::readChar(unsigned char c)
216{
203 if(readbuffer.length() < 255) 217 if(readbuffer.length() < 255)
@@ -206,3 +220,4 @@ void ModemTransfer::readChar(unsigned char c) {
206 220
207void ModemTransfer::readtty() { 221void ModemTransfer::readtty()
222{
208 223
@@ -222,3 +237,4 @@ void ModemTransfer::readtty() {
222 237
223void ModemTransfer::cancelbutton() { 238void ModemTransfer::cancelbutton()
239{
224 scripttimer->stop(); 240 scripttimer->stop();
@@ -238,3 +254,4 @@ void ModemTransfer::cancelbutton() {
238 254
239void ModemTransfer::closeEvent( QCloseEvent *e ) { 255void ModemTransfer::closeEvent( QCloseEvent *e )
256{
240 cancelbutton(); 257 cancelbutton();
@@ -256,3 +273,4 @@ ModemInfo::ModemInfo(QWidget *parent, const char* name)
256 tl->addLayout(l1, 1); 273 tl->addLayout(l1, 1);
257 for(int i = 0 ; i < NUM_OF_ATI ; i++) { 274 for(int i = 0 ; i < NUM_OF_ATI ; i++)
275 {
258 276
@@ -288,3 +306,4 @@ ModemInfo::ModemInfo(QWidget *parent, const char* name)
288 306
289void ModemInfo::setAtiString(int i, QString s) { 307void ModemInfo::setAtiString(int i, QString s)
308{
290 if(i < NUM_OF_ATI) 309 if(i < NUM_OF_ATI)
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index f7dacf6..a7caffe 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,6 +1 @@
1#include <errno.h>
2#include <signal.h>
3
4
5#include <qpe/config.h>
6
@@ -13,4 +8,15 @@
13 8
9/* OPIE */
10#include <qpe/config.h>
11#include <qpe/qpeapplication.h>
12
13/* QT */
14
15/* STD */
16#include <errno.h>
17#include <signal.h>
18
14// don't polute global namespace 19// don't polute global namespace
15namespace { 20namespace
21{
16 /* 22 /*
@@ -20,3 +26,4 @@ namespace {
20 */ 26 */
21 struct Connection { 27 struct Connection
28 {
22 pid_t pid; 29 pid_t pid;
@@ -25,3 +32,4 @@ namespace {
25 }; 32 };
26 class InterfaceKeeper { 33 class InterfaceKeeper
34 {
27 public: 35 public:
@@ -55,3 +63,4 @@ PPPModule::PPPModule() : Module()
55 qDebug("getting interfaces"); 63 qDebug("getting interfaces");
56 for( it = ifaces.begin(); it != ifaces.end(); ++it ){ 64 for( it = ifaces.begin(); it != ifaces.end(); ++it )
65 {
57 qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() ); 66 qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() );
@@ -62,3 +71,4 @@ PPPModule::PPPModule() : Module()
62 // check if (*it) is one of the running ifaces 71 // check if (*it) is one of the running ifaces
63 if ( running.contains( it.data() ) ) { 72 if ( running.contains( it.data() ) )
73 {
64 qDebug("iface is running %s", it.key().latin1() ); 74 qDebug("iface is running %s", it.key().latin1() );
@@ -78,3 +88,4 @@ PPPModule::PPPModule() : Module()
78 */ 88 */
79PPPModule::~PPPModule(){ 89PPPModule::~PPPModule()
90{
80 qDebug("PPPModule::~PPPModule() " ); 91 qDebug("PPPModule::~PPPModule() " );
@@ -83,5 +94,7 @@ PPPModule::~PPPModule(){
83 Interface *i; 94 Interface *i;
84 for ( i=list.first(); i != 0; i=list.next() ){ 95 for ( i=list.first(); i != 0; i=list.next() )
96 {
85 /* if online save the state */ 97 /* if online save the state */
86 if ( i->getStatus() ) { 98 if ( i->getStatus() )
99 {
87 qDebug("Iface %s is still up", i->getHardwareName().latin1() ); 100 qDebug("Iface %s is still up", i->getHardwareName().latin1() );
@@ -99,3 +112,4 @@ PPPModule::~PPPModule(){
99 */ 112 */
100void PPPModule::setProfile(const QString &newProfile){ 113void PPPModule::setProfile(const QString &newProfile)
114{
101 profile = newProfile; 115 profile = newProfile;
@@ -108,3 +122,4 @@ void PPPModule::setProfile(const QString &newProfile){
108 */ 122 */
109QString PPPModule::getPixmapName(Interface* ){ 123QString PPPModule::getPixmapName(Interface* )
124{
110 return "ppp"; 125 return "ppp";
@@ -117,3 +132,4 @@ QString PPPModule::getPixmapName(Interface* ){
117 */ 132 */
118bool PPPModule::isOwner(Interface *i){ 133bool PPPModule::isOwner(Interface *i)
134{
119 return list.find( i ) != -1; 135 return list.find( i ) != -1;
@@ -125,3 +141,4 @@ bool PPPModule::isOwner(Interface *i){
125 */ 141 */
126QWidget *PPPModule::configure(Interface *i){ 142QWidget *PPPModule::configure(Interface *i)
143{
127 qDebug("return ModemWidget"); 144 qDebug("return ModemWidget");
@@ -137,3 +154,4 @@ QWidget *PPPModule::configure(Interface *i){
137 */ 154 */
138QWidget *PPPModule::information(Interface *i){ 155QWidget *PPPModule::information(Interface *i)
156{
139 // We don't have any advanced pppd information widget yet :-D 157 // We don't have any advanced pppd information widget yet :-D
@@ -149,3 +167,4 @@ QWidget *PPPModule::information(Interface *i){
149 */ 167 */
150QList<Interface> PPPModule::getInterfaces(){ 168QList<Interface> PPPModule::getInterfaces()
169{
151 // List all of the files in the peer directory 170 // List all of the files in the peer directory
@@ -161,3 +180,4 @@ QList<Interface> PPPModule::getInterfaces(){
161 */ 180 */
162Interface *PPPModule::addNewInterface(const QString &newInterface){ 181Interface *PPPModule::addNewInterface(const QString &newInterface)
182{
163 183
@@ -167,4 +187,5 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){
167 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true); 187 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true);
168 imp.showMaximized(); 188
169 if(imp.exec() == QDialog::Accepted ){ 189 if( QPEApplication::execDialog( &imp ) == QDialog::Accepted )
190 {
170 iface = (InterfacePPP*) ifaceppp; 191 iface = (InterfacePPP*) ifaceppp;
@@ -173,3 +194,5 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){
173 return iface; 194 return iface;
174 }else { 195 }
196 else
197 {
175 delete ifaceppp; 198 delete ifaceppp;
@@ -184,3 +207,4 @@ Interface *PPPModule::addNewInterface(const QString &newInterface){
184 */ 207 */
185bool PPPModule::remove(Interface *i){ 208bool PPPModule::remove(Interface *i)
209{
186 return list.remove(i); 210 return list.remove(i);
@@ -196,9 +220,12 @@ void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
196 220
197namespace { 221namespace
198 InterfaceKeeper::InterfaceKeeper( ) { 222{
199 } 223 InterfaceKeeper::InterfaceKeeper( )
200 InterfaceKeeper::~InterfaceKeeper() { 224 {}
225 InterfaceKeeper::~InterfaceKeeper()
226 {
201 Config cfg("ppp_plugin_keeper"); 227 Config cfg("ppp_plugin_keeper");
202 QStringList lst = cfg.groupList(); 228 QStringList lst = cfg.groupList();
203 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 229 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
230 {
204 Connection con; 231 Connection con;
@@ -208,3 +235,4 @@ namespace {
208 235
209 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it ) { 236 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it )
237 {
210 Connection con = it.data(); 238 Connection con = it.data();
@@ -215,3 +243,4 @@ namespace {
215 } 243 }
216 void InterfaceKeeper::addInterface(pid_t pid, const QString& dev, const QString& name ) { 244 void InterfaceKeeper::addInterface(pid_t pid, const QString& dev, const QString& name )
245 {
217 Connection con; 246 Connection con;
@@ -222,3 +251,4 @@ namespace {
222 } 251 }
223 QMap<QString, Connection> InterfaceKeeper::interfaces()const { 252 QMap<QString, Connection> InterfaceKeeper::interfaces()const
253 {
224 Config cfg("ppp_plugin_keeper"); 254 Config cfg("ppp_plugin_keeper");
@@ -226,3 +256,4 @@ namespace {
226 QStringList lst = cfg.groupList(); 256 QStringList lst = cfg.groupList();
227 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 257 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
258 {
228 Connection con; 259 Connection con;
@@ -239,4 +270,6 @@ namespace {
239 } 270 }
240 bool InterfaceKeeper::isAvailable( pid_t p)const { 271 bool InterfaceKeeper::isAvailable( pid_t p)const
241 if (::kill(p, 0 ) == 0 || errno != ESRCH ) { 272 {
273 if (::kill(p, 0 ) == 0 || errno != ESRCH )
274 {
242 qDebug("isAvailable %d", p); 275 qDebug("isAvailable %d", p);
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 07bf73f..74d7f8e 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1 +1,2 @@
1
1#include "wlanmodule.h" 2#include "wlanmodule.h"
@@ -6,2 +7,6 @@
6 7
8/* OPIE */
9#include <qpe/qpeapplication.h>
10
11/* QT */
7#include <qcheckbox.h> 12#include <qcheckbox.h>
@@ -15,4 +20,2 @@
15 20
16
17
18/** 21/**
@@ -174,3 +177,3 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
174 QWidget *info = getInfo( ifa ); 177 QWidget *info = getInfo( ifa );
175 info->showMaximized(); 178 QPEApplication::showWidget( info );
176 179
@@ -192,3 +195,3 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
192 } 195 }
193 wlanconfigWiget->showMaximized(); 196 QPEApplication::showWidget( wlanconfigWiget );
194 stream >> value; 197 stream >> value;