summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/main.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/main.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp
index 7ec26a7..e2c00f6 100644
--- a/noncore/settings/networksettings2/main.cpp
+++ b/noncore/settings/networksettings2/main.cpp
@@ -1,15 +1,16 @@
1#include "nsdata.h" 1#include "nsdata.h"
2#include "activateprofile.h" 2#include "activateprofile.h"
3#include "networksettings.h" 3#include "networksettings.h"
4
4#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
5 6
6#include <opie/oapplicationfactory.h> 7#include <opie/oapplicationfactory.h>
7 8
8#ifdef GONE 9#ifdef GONE
9 10
10OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> ) 11OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> )
11 12
12#else 13#else
13 14
14// just standard GUI 15// just standard GUI
15#define ACT_GUI 0 16#define ACT_GUI 0
@@ -67,25 +68,37 @@ int main( int argc, char * argv[] ) {
67 } else { 68 } else {
68 TheApp = new QPEApplication( argc, argv, GuiType ); 69 TheApp = new QPEApplication( argc, argv, GuiType );
69 } 70 }
70#else 71#else
71 TheApp = new QApplication( argc, argv, GuiType ); 72 TheApp = new QApplication( argc, argv, GuiType );
72#endif 73#endif
73 74
74 // init qt with app widget 75 // init qt with app widget
75 76
76 switch( Action ) { 77 switch( Action ) {
77 case ACT_REQUEST : 78 case ACT_REQUEST :
78 { NetworkSettingsData NS; 79 { NetworkSettingsData NS;
79 NS.canStart( argv[1] ); 80 if( NS.canStart( argv[1] ) ) {
81 QString S;
82 S.sprintf( QPEApplication::qpeDir()+
83 "/bin/networksettings2" );
84 char * MyArgv[4];
85 MyArgv[0] = "networksettings2";
86 MyArgv[1] = "--prompt";
87 MyArgv[2] = argv[1];
88 MyArgv[3] = NULL;
89 NSResources->system().execAsUser( S, MyArgv );
90 // if we come here , failed
91 printf( "%s-cNN-disallowed", argv[1] );
92 }
80 } 93 }
81 break; 94 break;
82 case ACT_REGEN : 95 case ACT_REGEN :
83 { NetworkSettingsData NS; 96 { NetworkSettingsData NS;
84 // regen returns 0 if OK 97 // regen returns 0 if OK
85 rv = (NS.regenerate()) ? 1 : 0; 98 rv = (NS.regenerate()) ? 1 : 0;
86 } 99 }
87 break; 100 break;
88 case ACT_PROMPT : 101 case ACT_PROMPT :
89 { ActivateProfile AP(argv[1]); 102 { ActivateProfile AP(argv[1]);
90 if( AP.exec() == QDialog::Accepted ) { 103 if( AP.exec() == QDialog::Accepted ) {
91 printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() ); 104 printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() );