Author: gs Date: Thu Jul 31 10:09:52 2008 New Revision: 49532 URL: http://svn.opensuse.org/viewcvs/yast?rev=49532&view=rev Log: read/write dispatcher settings Modified: trunk/auditd/agents/auditd.scr trunk/auditd/src/complex.ycp trunk/auditd/src/dialogs.ycp trunk/auditd/src/wizards.ycp Modified: trunk/auditd/agents/auditd.scr URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/agents/auditd.scr?rev=49532&r1=49531&r2=49532&view=diff ============================================================================== --- trunk/auditd/agents/auditd.scr (original) +++ trunk/auditd/agents/auditd.scr Thu Jul 31 10:09:52 2008 @@ -28,7 +28,7 @@ `IniAgent( "/etc/audit/auditd.conf", $[ "options" : [ "global_values", "repeat_names", "flat" ], - "comments" : [ "^[ \t]*#.*$", "^[ \t]*$", "^#.*$" ], + "comments" : [ "^[ \t]*#.*$", "^[ \t]*$" ], "params" : [ // Options with one value ('yes' / 'no') $[ "match" : [ "^[ \t]*([^ \t]+)[ \t = ]+([^ \t]+)[ \t]+$", "%s = %s" ]], Modified: trunk/auditd/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/complex.ycp?rev=49532&r1=49531&r2=49532&view=diff ============================================================================== --- trunk/auditd/src/complex.ycp (original) +++ trunk/auditd/src/complex.ycp Thu Jul 31 10:09:52 2008 @@ -107,7 +107,7 @@ string file_name = UI::AskForExistingFile("/var/log/audit", "*.log", _("Select the log file") ); UI::ChangeWidget( `id("log_file"), `Value, file_name ); - y2milestone( "Logfile changed to: %1", file_name ); + y2milestone( "Logfile set to: %1", file_name ); } return nil; } @@ -139,13 +139,44 @@ } void InitDispatcherDialog (string id) { - y2milestone( "Init dispatcher" ); + + // Set all values to values read from /etc/audit/auditd.conf + foreach (string key, ["dispatcher", + "disp_qos" ], { + UI::ChangeWidget(`id(key), `Value, (Auditd::GetAuditdOption(key))); + }); + + y2milestone( "Init dispatcher dialog" ); +} + +symbol HandleDispatcherDialog(string id, map event) { + any action = event["ID"]:nil; + + if ( action == "select_disp" ) + { + string file_name = UI::AskForExistingFile("/sbin", "*", _("Select the dispatcher program") ); + + UI::ChangeWidget( `id("dispatcher"), `Value, file_name ); + y2milestone( "Dispatcher program set to: %1", file_name ); + } + return nil; } void StoreDispatcherDialog (string id, map event) { - y2milestone( "Store dispatcher" ); + + // Store all values in SETTINGS + Auditd::SetAuditdOption( "freq", tostring( (integer)UI::QueryWidget( `id("freq"), `Value ) ) ); + Auditd::SetAuditdOption( "num_logs", tostring( (integer)UI::QueryWidget( `id("num_logs"), `Value ) ) ); + + foreach (string key, ["dispatcher", + "disp_qos"], { + Auditd::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) ); + }); + + y2milestone( "Store dispatcher dialog" ); } + void InitDiskspaceSettingsDialog (string id) { y2milestone( "Init dispatcher" ); } Modified: trunk/auditd/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/dialogs.ycp?rev=49532&r1=49531&r2=49532&view=diff ============================================================================== --- trunk/auditd/src/dialogs.ycp (original) +++ trunk/auditd/src/dialogs.ycp Thu Jul 31 10:09:52 2008 @@ -50,6 +50,7 @@ term LogfileSettingsDialogContent () { return `MarginBox( mbox_x, mbox_y, `VBox( + `VStretch(), `Frame ( _("General Settings"), `VBox ( @@ -90,6 +91,7 @@ ) ) ), + `VStretch(), `Frame ( _("Size and Action"), `HBox ( @@ -108,6 +110,7 @@ `HWeight( 1, `InputField(`id("action_mail_acct"), _("Action Mail Account"))) ) ), + `VStretch(), `Frame( _("Computer Names"), `HBox( @@ -130,15 +133,27 @@ term DispatcherDialogContent () { return `MarginBox( mbox_x, mbox_y, `VBox( - `VSpacing(1.0), + `VSpacing(2.0), `Frame ( - _(""), + _("Dispatcher Settings"), `VBox ( - /* A text entry */ - `Left(`InputField(`id("dispatcher"), _("Dispatcher Name"))), - - `Left(`InputField(`id("max_log_file_action"), _("Action "))) - + `VSquash( + `HBox( + // Label for InputField + `InputField(`id("dispatcher"), `opt(`hstretch), _("Dispatcher Name")), + `HSpacing(2.0), + `VBox( + `VSpacing(), + // Label for PushButton + `Bottom(`PushButton(`id("select_disp"), _("Select Fi&le"))) + ) + ) + ), + `Left(`ComboBox(`id("disp_qos"), _("Communication"), + [`item(`id("lossy"), "lossy", true ), + `item(`id("lossless"), "lossless" ) + ]) + ) ) ), `VStretch() Modified: trunk/auditd/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/wizards.ycp?rev=49532&r1=49531&r2=49532&view=diff ============================================================================== --- trunk/auditd/src/wizards.ycp (original) +++ trunk/auditd/src/wizards.ycp Thu Jul 31 10:09:52 2008 @@ -58,6 +58,7 @@ "widget" : `custom, "help" : HELPS["dispatcher"]:"", "custom_widget" : DispatcherDialogContent(), + "handle" : HandleDispatcherDialog, "init" : InitDispatcherDialog, "store" : StoreDispatcherDialog, ], -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org