Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
6 files changed, 131 insertions, 48 deletions
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 @@ -10,10 +10,10 @@ <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>225</width> - <height>301</height> + <width>276</width> + <height>231</height> </rect> </property> <property stdset="1"> <name>caption</name> @@ -58,60 +58,130 @@ </attribute> <vbox> <property stdset="1"> <name>margin</name> - <number>2</number> + <number>1</number> </property> <property stdset="1"> <name>spacing</name> - <number>0</number> + <number>2</number> </property> <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>Automatic_CB</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Start automatically</string> - </property> - </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>Confirm_CB</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Confirm before start</string> - </property> - <property> - <name>layoutMargin</name> - </property> - </widget> - <widget> - <class>QCheckBox</class> + <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Disabled_CB</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Disabled</string> - </property> - <property> - <name>layoutMargin</name> + <cstring>Layout8</cstring> </property> + <grid> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget row="0" column="0" rowspan="2" colspan="1" > + <class>QGroupBox</class> + <property stdset="1"> + <name>name</name> + <cstring>GroupBox1</cstring> + </property> + <property stdset="1"> + <name>title</name> + <string>Start</string> + </property> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>11</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>Automatic_CB</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Automatically</string> + </property> + </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>Confirm_CB</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Ask</string> + </property> + <property> + <name>layoutMargin</name> + </property> + </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>Disabled_CB</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Disabled</string> + </property> + <property> + <name>layoutMargin</name> + </property> + </widget> + </vbox> + </widget> + <widget row="0" column="1" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>TriggersVPN_CB</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Trigger VPN</string> + </property> + </widget> + <spacer row="1" column="1" > + <property> + <name>name</name> + <cstring>Spacer8</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> </widget> <widget> <class>QLabel</class> <property stdset="1"> 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 @@ -6,8 +6,9 @@ AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { Data.Automatic = 1; Data.Confirm = 0; Data.Description = ""; Data.Disabled = 0; + Data.TriggerVPN = 0; GUI = 0; RT = 0; } @@ -18,8 +19,10 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { } else if ( Attr == "preconfirm" ) { 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; } } @@ -27,8 +30,9 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { 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; } QWidget * AProfile::edit( QWidget * parent ) { 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 @@ -9,7 +9,8 @@ typedef struct ProfileData { // if started up automatically, ask user for confirmation 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 @@ -57,8 +57,9 @@ 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 ); } @@ -67,8 +68,9 @@ bool ProfileEdit::commit( ProfileData_t & Data ) { bool SM = 0; 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 ); return 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 @@ -3,17 +3,19 @@ #include "profilerun.h" 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(); switch ( A ) { @@ -40,9 +42,9 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) { return 1; default : break; } - return NNNI->runtime()->setState(NC, A); + return NNNI->runtime()->setState(NC, A, F ); } bool ProfileRun::canSetState( State_t Curr, Action_t A ) { RuntimeInfo * RI; 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 @@ -22,8 +22,12 @@ public : { return Data->Description; } virtual AsFullSetup * asFullSetup( void ) { return (AsFullSetup *)this; } + + virtual bool triggersVPN( void ) + { return Data->TriggerVPN; } + private : ProfileData * Data; |