[yast-commit] r49832 - in /trunk/auditd/src: complex.ycp dialogs.ycp
Author: gs Date: Thu Aug 7 16:42:05 2008 New Revision: 49832 URL: http://svn.opensuse.org/viewcvs/yast?rev=49832&view=rev Log: set correct initial value of enabled flag Modified: trunk/auditd/src/complex.ycp trunk/auditd/src/dialogs.ycp Modified: trunk/auditd/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/complex.ycp?rev=49832&r1=49831&r2=49832&view=diff ============================================================================== --- trunk/auditd/src/complex.ycp (original) +++ trunk/auditd/src/complex.ycp Thu Aug 7 16:42:05 2008 @@ -184,8 +184,27 @@ } void InitRulesDialog( string id ) { - - UI::ChangeWidget( `id( "rules"), `Value, Auditd::GetRules() ); + string rules = Auditd::GetRules(); + string combo_box_id = "disabled"; + + UI::ChangeWidget( `id( "rules"), `Value, rules ); + list <string> rules_list = splitstring( rules, "\n" ); + + foreach ( string rule, rules_list, { + if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) ) + { + combo_box_id = "locked"; + } + else if ( regexpmatch( rule, "^[ /t]*-e[ /t]*1" ) ) + { + combo_box_id = "enabled"; + } + else if ( regexpmatch( rule, "^[ /t]*-e[ /t]*0" ) ) + { + combo_box_id = "disabled"; + } + } ); + UI::ChangeWidget( `id( "audit_enabled"), `Value, combo_box_id ); y2milestone ( "Init rules dialog" ); } @@ -204,15 +223,15 @@ switch ( value ) { - case "lock": { + case "locked": { rule = "-e 2"; break; } - case "enable": { + case "enabled": { rule = "-e 1"; break; } - case "disable": { + case "disabled": { rule = "-e 0"; break; } Modified: trunk/auditd/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/dialogs.ycp?rev=49832&r1=49831&r2=49832&view=diff ============================================================================== --- trunk/auditd/src/dialogs.ycp (original) +++ trunk/auditd/src/dialogs.ycp Thu Aug 7 16:42:05 2008 @@ -186,10 +186,10 @@ `VBox( `VWeight( 20, `Frame( _("" ), `VBox( - `Left(`ComboBox( `id("audit_enabled"), `opt(`notify), _("Configure Enabled Flag"), - [`item(`id("enable"), _("Enable Auditing"), true ), // -e 1 - `item(`id("disable"), _("Disable Auditing") ), // -e 0 - `item(`id("lock"), _("Lock Rules (until next boot)")) // -e 2 + `Left(`ComboBox( `id("audit_enabled"), `opt(`notify), _("Set Enabled Flag"), + [`item(`id("enabled"), _("Auditing enabled"), true ), // -e 1 + `item(`id("disabled"), _("Auditing disabled") ), // -e 0 + `item(`id("locked"), _("Rules are locked (until next boot)")) // -e 2 ] )), `VStretch() @@ -207,7 +207,7 @@ `HSpacing(2.0), `PushButton( `id( "reset" ), _("Restore and Reset") ), `HSpacing(2.0), - `PushButton( `id( "load" ), _("Load Example") ) + `PushButton( `id( "load" ), _("Load ") ) ) ), `VStretch() -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
gs@svn.opensuse.org