author | wimpie <wimpie> | 2004-08-12 12:46:55 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-08-12 12:46:55 (UTC) |
commit | 8f215ba9ceb395f262517855a99d7d2d303ca760 (patch) (side-by-side diff) | |
tree | aa5f9b14c249217b4d3fc30f4771bdaf1c3545d3 /noncore/settings/networksettings2/main.cpp | |
parent | ef64880308b5035cc8ca2e4e79325db613af525b (diff) | |
download | opie-8f215ba9ceb395f262517855a99d7d2d303ca760.zip opie-8f215ba9ceb395f262517855a99d7d2d303ca760.tar.gz opie-8f215ba9ceb395f262517855a99d7d2d303ca760.tar.bz2 |
MANY changes
- now generates peers/pap-chap secrets files
(no chatscript yet)
(not all usefull ppp options included yet)
- still not ready for prime time yet
Diffstat (limited to 'noncore/settings/networksettings2/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/main.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp index 6c969fc..b32b323 100644 --- a/noncore/settings/networksettings2/main.cpp +++ b/noncore/settings/networksettings2/main.cpp @@ -1,8 +1,9 @@ #include "nsdata.h" #include "activateprofile.h" +#include "activatevpn.h" #include "networksettings.h" #include <qpe/qpeapplication.h> #include <opie2/oapplicationfactory.h> using namespace Opie::Core; @@ -18,12 +19,14 @@ OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> ) // used by interfaces to request for allow of up/down #define ACT_REQUEST 1 // regenerate config files #define ACT_REGEN 2 // used by interfaces to request user prompt #define ACT_PROMPT 3 +// used by interfaces to trigger VPN +#define ACT_VPN 4 int main( int argc, char * argv[] ) { int rv = 0; int Action = ACT_GUI; // could be overruled by -qws QApplication::Type GuiType = QApplication::GuiClient; @@ -41,12 +44,15 @@ int main( int argc, char * argv[] ) { Action = ACT_REGEN; GuiType = QApplication::Tty; rmv = 1; } else if( strcmp( argv[i], "--prompt" ) == 0 ) { Action = ACT_PROMPT; rmv = 1; + } else if( strcmp( argv[i], "--triggervpn" ) == 0 ) { + Action = ACT_VPN; + rmv = 1; } if( rmv ) { memmove( argv+i, argv+i+rmv, sizeof( char * ) * (argc-i-rmv) ); i --; argc -= rmv; @@ -75,16 +81,14 @@ int main( int argc, char * argv[] ) { // init qt with app widget switch( Action ) { case ACT_REQUEST : { NetworkSettingsData NS; - Log(("ACT_REQUEST\n")); if( NS.canStart( argv[1] ) ) { QString S; - Log(("NEED FOR PROMPT\n" )); S.sprintf( QPEApplication::qpeDir()+ "/bin/networksettings2" ); char * MyArgv[4]; MyArgv[0] = "networksettings2"; MyArgv[1] = "--prompt"; MyArgv[2] = argv[1]; @@ -94,30 +98,32 @@ int main( int argc, char * argv[] ) { printf( "%s-cNN-disallowed", argv[1] ); } } break; case ACT_REGEN : { NetworkSettingsData NS; - Log(("REGEN\n" )); // regen returns 0 if OK rv = (NS.regenerate()) ? 1 : 0; } break; case ACT_PROMPT : { ActivateProfile AP(argv[1]); - Log(("PROMPT\n" )); if( AP.exec() == QDialog::Accepted ) { printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() ); } else { printf( "%s-cNN-disallowed", argv[1] ); } } break; + case ACT_VPN : + { ActivateVPN AVPN; + AVPN.exec(); + } + break; case ACT_GUI : { QWidget * W = new NetworkSettings(0); - Log(("GUI\n" )); TheApp->setMainWidget( W ); W->show(); #ifdef _WS_QWS_ W->showMaximized(); #else W->resize( W->sizeHint() ); |