From 0784cfdbd261c43856b45be6ab7439841e69b858 Mon Sep 17 00:00:00 2001 From: wimpie Date: Mon, 09 Aug 2004 02:31:25 +0000 Subject: Many changes : bluetooth and usb seems to work added preliminary support for VPN on top of any network This version is still very much crippled yet is does DO some things --- (limited to 'noncore/settings/networksettings2/profile') diff --git a/noncore/settings/networksettings2/profile/profileGUI.ui b/noncore/settings/networksettings2/profile/profileGUI.ui index 365704b..5bf9a9c 100644 --- a/noncore/settings/networksettings2/profile/profileGUI.ui +++ b/noncore/settings/networksettings2/profile/profileGUI.ui @@ -11,8 +11,8 @@ 0 0 - 225 - 301 + 276 + 231 @@ -59,58 +59,128 @@ margin - 2 + 1 spacing - 0 + 2 - QCheckBox - - name - Automatic_CB - - - text - Start automatically - - - - QCheckBox - - name - Confirm_CB - - - enabled - true - - - text - Confirm before start - - - layoutMargin - - - - QCheckBox + QLayoutWidget name - Disabled_CB - - - enabled - true - - - text - Disabled - - - layoutMargin + Layout8 + + + margin + 0 + + + spacing + 6 + + + QGroupBox + + name + GroupBox1 + + + title + Start + + + + margin + 11 + + + spacing + 6 + + + QCheckBox + + name + Automatic_CB + + + text + Automatically + + + + QCheckBox + + name + Confirm_CB + + + enabled + true + + + text + Ask + + + layoutMargin + + + + QCheckBox + + name + Disabled_CB + + + enabled + true + + + text + Disabled + + + layoutMargin + + + + + + QCheckBox + + name + TriggersVPN_CB + + + text + Trigger VPN + + + + + name + Spacer8 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + QLabel diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp index 5b54aa4..cb52b2a 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.cpp +++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp @@ -7,6 +7,7 @@ AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { Data.Confirm = 0; Data.Description = ""; Data.Disabled = 0; + Data.TriggerVPN = 0; GUI = 0; RT = 0; } @@ -19,6 +20,8 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { Data.Confirm = (Value=="yes"); } else if ( Attr == "disabled" ) { Data.Disabled = (Value=="yes"); + } else if ( Attr == "triggervpn" ) { + Data.TriggerVPN = (Value=="yes"); } else if ( Attr == "description" ) { Data.Description = Value; } @@ -28,6 +31,7 @@ void AProfile::saveSpecificAttribute( QTextStream & TS ) { TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; + TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; TS << "description=" << Data.Description << endl; } diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h index b4168e2..246d50c 100644 --- a/noncore/settings/networksettings2/profile/profiledata.h +++ b/noncore/settings/networksettings2/profile/profiledata.h @@ -10,6 +10,7 @@ typedef struct ProfileData { bool Confirm; // Do not bring this connection up bool Disabled; + bool TriggerVPN; } ProfileData_t; #endif diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp index c9fb650..87e503e 100644 --- a/noncore/settings/networksettings2/profile/profileedit.cpp +++ b/noncore/settings/networksettings2/profile/profileedit.cpp @@ -58,6 +58,7 @@ QString ProfileEdit::acceptable( void ) { void ProfileEdit::showData( ProfileData_t & Data ) { Description_LE->setText( Data.Description ); Automatic_CB->setChecked( Data.Automatic ); + TriggersVPN_CB->setChecked( Data.TriggerVPN ); Confirm_CB->setChecked( Data.Confirm ); Disabled_CB->setChecked( Data.Disabled ); } @@ -68,6 +69,7 @@ bool ProfileEdit::commit( ProfileData_t & Data ) { TXTM( Data.Description, Description_LE, SM ); CBM( Data.Automatic, Automatic_CB, SM ); + CBM( Data.TriggerVPN, TriggersVPN_CB, SM ); CBM( Data.Disabled, Disabled_CB, SM ); CBM( Data.Confirm, Confirm_CB, SM ); diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp index 79bb93e..1a5b15b 100644 --- a/noncore/settings/networksettings2/profile/profilerun.cpp +++ b/noncore/settings/networksettings2/profile/profilerun.cpp @@ -4,15 +4,17 @@ void ProfileRun::detectState( NodeCollection * NC ) { if( Data->Disabled ) { + Log(( "%s disabled\n", NC->name().latin1() )); NC->setCurrentState( Disabled ); } else { + Log(( "%s not disabled\n", NC->name().latin1() )); // find next item in connection // convert to runtime and ask to detect the state netNode()->nextNode()->runtime()->detectState( NC ); } } -bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) { +bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool F ) { ANetNodeInstance * NNNI; NNNI = netNode()->nextNode(); @@ -41,7 +43,7 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) { default : break; } - return NNNI->runtime()->setState(NC, A); + return NNNI->runtime()->setState(NC, A, F ); } bool ProfileRun::canSetState( State_t Curr, Action_t A ) { diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h index c8ea063..400b56c 100644 --- a/noncore/settings/networksettings2/profile/profilerun.h +++ b/noncore/settings/networksettings2/profile/profilerun.h @@ -23,6 +23,10 @@ public : virtual AsFullSetup * asFullSetup( void ) { return (AsFullSetup *)this; } + + virtual bool triggersVPN( void ) + { return Data->TriggerVPN; } + private : ProfileData * Data; -- cgit v0.9.0.2