author | wimpie <wimpie> | 2004-04-05 01:13:11 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-05 01:13:11 (UTC) |
commit | 6be3d148fc1d610ebfa193012657b3b77d9368e3 (patch) (side-by-side diff) | |
tree | d7bbd308d17ffe7557c7749776f4945e499d7c10 /noncore/settings/networksettings2/main.cpp | |
parent | b0ceb8843ebe9ee3054faa98f08bd255df955aa3 (diff) | |
download | opie-6be3d148fc1d610ebfa193012657b3b77d9368e3.zip opie-6be3d148fc1d610ebfa193012657b3b77d9368e3.tar.gz opie-6be3d148fc1d610ebfa193012657b3b77d9368e3.tar.bz2 |
For usb this seems to be working
Also for non-root users (requires using SUDO)
Diffstat (limited to 'noncore/settings/networksettings2/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/main.cpp | 15 |
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 @@ #include "nsdata.h" #include "activateprofile.h" #include "networksettings.h" + #include <qpe/qpeapplication.h> #include <opie/oapplicationfactory.h> #ifdef GONE OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> ) #else // just standard GUI #define ACT_GUI 0 @@ -67,25 +68,37 @@ int main( int argc, char * argv[] ) { } else { TheApp = new QPEApplication( argc, argv, GuiType ); } #else TheApp = new QApplication( argc, argv, GuiType ); #endif // init qt with app widget switch( Action ) { case ACT_REQUEST : { NetworkSettingsData NS; - NS.canStart( argv[1] ); + if( NS.canStart( argv[1] ) ) { + QString S; + S.sprintf( QPEApplication::qpeDir()+ + "/bin/networksettings2" ); + char * MyArgv[4]; + MyArgv[0] = "networksettings2"; + MyArgv[1] = "--prompt"; + MyArgv[2] = argv[1]; + MyArgv[3] = NULL; + NSResources->system().execAsUser( S, MyArgv ); + // if we come here , failed + printf( "%s-cNN-disallowed", argv[1] ); + } } break; case ACT_REGEN : { NetworkSettingsData NS; // regen returns 0 if OK rv = (NS.regenerate()) ? 1 : 0; } break; case ACT_PROMPT : { ActivateProfile AP(argv[1]); if( AP.exec() == QDialog::Accepted ) { printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() ); |