summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/main.cpp
authorwimpie <wimpie>2005-01-11 15:35:46 (UTC)
committer wimpie <wimpie>2005-01-11 15:35:46 (UTC)
commit4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9 (patch) (side-by-side diff)
tree0e8adcc616a1d20b637aad3de568dcb45af05f71 /noncore/settings/networksettings2/main.cpp
parent32e8aa951218c0bd6118ee04bb22ef83b3b7ec2e (diff)
downloadopie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.zip
opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.tar.gz
opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.tar.bz2
vpn should now work IF only the vpn plugin would do something.
shortened logical interface names (busybox only supports 10 characters and then ONLY if you recompile it with mappings enabled) Other small fixes
Diffstat (limited to 'noncore/settings/networksettings2/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/main.cpp48
1 files changed, 32 insertions, 16 deletions
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp
index 973b4b7..2243826 100644
--- a/noncore/settings/networksettings2/main.cpp
+++ b/noncore/settings/networksettings2/main.cpp
@@ -25,6 +25,8 @@ OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> )
#define ACT_PROMPT 3
-// used by interfaces to trigger VPN
-#define ACT_VPN 4
+// used by interfaces to trigger VPN prompting
+#define ACT_TRIGGERVPN 4
// activate opietooth
#define ACT_OT 5
+// prompt for VPN networks
+#define ACT_PROMPTVPN 6
@@ -58,3 +60,7 @@ int main( int argc, char * argv[] ) {
} else if( strcmp( argv[i], "--triggervpn" ) == 0 ) {
- Action = ACT_VPN;
+ GuiType = QApplication::Tty;
+ Action = ACT_TRIGGERVPN;
+ rmv = 1;
+ } else if( strcmp( argv[i], "--promptvpn" ) == 0 ) {
+ Action = ACT_PROMPTVPN;
rmv = 1;
@@ -97,11 +103,20 @@ int main( int argc, char * argv[] ) {
if( NS.canStart( argv[1] ) ) {
+ QStringList SL;
+ SL << QPEApplication::qpeDir() + "bin/networksettings2"
+ << "--prompt"
+ << argv[1];
+ // exec synchronous -> blocks
+ NSResources->system().execAsUser( SL, 1 );
+ }
+ }
+ break;
+ case ACT_TRIGGERVPN :
+ { NetworkSettingsData NS;
+ if( NS.couldBeTriggered( argv[1] ) ) {
+ // there are VPNS that can be triggered
QStringList S;
- S << QPEApplication::qpeDir() + "/bin/networksettings2";
- S << "networksettings2";
- S << "--prompt";
+ S << QPEApplication::qpeDir() + "bin/networksettings2";
+ S << "--promptvpn";
S << argv[1];
NSResources->system().execAsUser( S );
- Log(("FAILED %s-cNN-allowed\n", argv[1] ));
- // if we come here , failed
- printf( "%s-cNN-disallowed", argv[1] );
}
@@ -119,8 +134,8 @@ int main( int argc, char * argv[] ) {
if( AP.exec() == QDialog::Accepted ) {
- Log(("%s-c%ld-allowed\n",
- argv[1], AP.selectedProfile() ));
- printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() );
+ Log(("allow profile %ld for %s\n",
+ AP.selectedProfile(), argv[1] ));
+ printf( "A%ld%s\n", AP.selectedProfile(), argv[1] );
} else {
- Log(("%s-c%NN-disallowed\n", argv[1] ));
- printf( "%s-cNN-disallowed", argv[1] );
+ Log(("disallow %s\n", argv[1] ));
+ printf( "D-%s\n", argv[1] );
}
@@ -128,4 +143,5 @@ int main( int argc, char * argv[] ) {
break;
- case ACT_VPN :
- { ActivateVPN AVPN;
+ case ACT_PROMPTVPN :
+ { ActivateVPN AVPN( argv[1] );
+ Log(("Trigger vpns on interface %s\n", argv[1] ));
AVPN.exec();