Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] r58784 - /trunk/network/src/clients/firewall_stage1_proposal.ycp
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Fri, 25 Sep 2009 15:49:46 -0000
  • Message-id: <E1MrD3K-00012c-5A@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Fri Sep 25 17:49:45 2009
New Revision: 58784

URL: http://svn.opensuse.org/viewcvs/yast?rev=58784&view=rev
Log:
Do something after clicking on Firewall header
(bnc#539289)

Modified:
trunk/network/src/clients/firewall_stage1_proposal.ycp

Modified: trunk/network/src/clients/firewall_stage1_proposal.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/clients/firewall_stage1_proposal.ycp?rev=58784&r1=58783&r2=58784&view=diff
==============================================================================
--- trunk/network/src/clients/firewall_stage1_proposal.ycp (original)
+++ trunk/network/src/clients/firewall_stage1_proposal.ycp Fri Sep 25 17:49:45
2009
@@ -28,15 +28,88 @@
{
textdomain "network";

+ import "Label";
import "Linuxrc";
import "PackagesProposal";
import "ProductControl";
import "ProductFeatures";
import "SuSEFirewall4Network";
import "SuSEFirewallProposal";
+ import "Wizard";

string proposal_id = "fw_1ststage";

+ symbol FirewallDialogSimple() {
+ string title = _("Basic Firewall and SSH Configuration");
+
+ term contents = `VBox (
+ `Frame (
+ // frame label
+ _("Firewall and SSH service"),
+ `HSquash (
+ `MarginBox (
+ 0.5, 0.5,
+ `VBox(
+ `Left(`CheckBox(`id("enable_fw"),`opt(`notify),
+ _("Enable Firewall"),
SuSEFirewall4Network::Enabled1stStage())),
+ `Left(`CheckBox(`id("open_port"),
+ _("Open SSH Port and Enable SSH Service"),
SuSEFirewall4Network::EnabledSsh1stStage()))
+ )
+ )
+ )
+ )
+ );
+
+ string help = _("<p><b><big>Firewall and SSH</big></b><br>
+Firewall is a defensive mechanism that protects your computer from network
attacks.
+SSH is a service that allows logging into this computer remotely via dedicated
+SSH client</p>") +
+
+_("<p>Here you can choose whether the firewall will be enabled or disabled
after
+the installation. It is recommended to keep it enabled.</p>") +
+
+_("<p>With enabled firewall, you can decide whether to open firewall port for
SSH
+service and allow remote SSH logins. This will also enable SSH service (i.e. it
+will be started on computer boot).</p>");
+
+
+ Wizard::CreateDialog ();
+ Wizard::SetTitleIcon ("yast-firewall");
+
+ Wizard::SetContentsButtons (title, contents, help, Label::BackButton(),
Label::OKButton());
+ Wizard::SetAbortButton (`cancel, Label::CancelButton());
+ Wizard::HideBackButton();
+
+ UI::ChangeWidget(`id("open_port"),`Enabled,
SuSEFirewall4Network::Enabled1stStage());
+
+ any dialog_ret = nil;
+
+ while (true) {
+ dialog_ret = UI::UserInput();
+ boolean enable = (boolean) UI::QueryWidget(`id("enable_fw"),`Value);
+
+ if (dialog_ret == "enable_fw") {
+ UI::ChangeWidget(`id("open_port"),`Enabled, enable);
+ continue;
+ }
+ else if( dialog_ret == `next || dialog_ret == `ok) {
+ boolean open = (boolean)
UI::QueryWidget(`id("open_port"),`Value);
+ boolean can_be_opened = (boolean)
UI::QueryWidget(`id("open_port"),`Enabled);
+
+ SuSEFirewall4Network::SetEnabled1stStage(enable);
+ if (can_be_opened)
+ SuSEFirewall4Network::SetSshEnabled1stStage(open);
+ break;
+ }
+ else
+ break;
+ }
+
+ Wizard::CloseDialog();
+ return (symbol) dialog_ret;
+
+ }
+
// run this only once
if (!SuSEFirewallProposal::GetProposalInitialized()) {

@@ -98,6 +171,7 @@
}
else if ( func == "AskUser" ) {
any chosen_link = param["chosen_id"]:nil;
+ symbol result = `next;
y2milestone("User clicked %1", chosen_link);

if (chosen_link == "firewall--enable_firewall_in_proposal")
@@ -122,6 +196,11 @@
y2milestone("Disabling SSH");
SuSEFirewall4Network::SetSshEnabled1stStage( false );
}
+ else if (chosen_link == "firewall_stage1")
+ {
+ result = FirewallDialogSimple();
+ }
+
SuSEFirewallProposal::SetChangedByUser(true);

//Disable one of the AC steps (see control.$product.xml for appropriate
unique IDs)
@@ -131,7 +210,7 @@
else
ProductControl::DisableSubProposal("network_continue", "firewall");

- ret = $[ "workflow_sequence" : `next ];
+ ret = $[ "workflow_sequence" : result ];
}
else if ( func == "Description" )
{

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages