Author: jsuchome
Date: Fri Apr 20 12:50:34 2012
New Revision: 67972
URL: http://svn.opensuse.org/viewcvs/yast?rev=67972&view=rev
Log:
- read bridges id's
- explicit buttons for Create/Start/Destroy
- 2.17.1
Modified:
branches/SuSE-Code-11-SP2-Branch/lxc/VERSION
branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes
branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp
Modified: branches/SuSE-Code-11-SP2-Branch/lxc/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/VERSION?rev=67972&r1=67971&r2=67972&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/VERSION Fri Apr 20 12:50:34 2012
@@ -1 +1 @@
-2.17.0
+2.17.1
Modified: branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes?rev=67972&r1=67971&r2=67972&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes Fri Apr 20 12:50:34 2012
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Apr 20 12:38:23 CEST 2012 - jsuchome@suse.cz
+
+- read bridges id's
+- explicit buttons for Create/Start/Destroy
+- 2.17.1
+
+-------------------------------------------------------------------
Fri Apr 13 13:01:03 2012 - jsuchome@suse.cz
- initial version
Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp?rev=67972&r1=67971&r2=67972&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp Fri Apr 20 12:50:34 2012
@@ -71,6 +71,18 @@
return crypt (pw);
}
+list<string> read_bridges_ids () {
+
+ map out = (map) SCR::Execute (.target.bash_output, "brctl show | tail -n +2 | cut -f 1");
+ list<string> ret = [];
+
+ if (out["stdout"]:"" != "")
+ {
+ ret = maplist (string line, splitstring (out["stdout"]:"", "\n"), ``(line));
+ }
+ return ret;
+}
+
/**
* Configure1 dialog
* @return dialog result
@@ -87,28 +99,41 @@
/* Lxc configure1 dialog caption */
string caption = _("LXC Configuration");
- list<string> bridge_items = [ "br0", "br1" ];
list<term> template_items = read_templates ();
term contents = `HBox (`HSpacing (), `VBox (
`VSpacing (),
- // text entry
- `Left (`TextEntry (`id (`name), _("Container Name"))),
- // combo box label
- `Left (`ComboBox (`id (`template), `opt (`hstretch), _("Template"), template_items)),
+ // frame label
+ `Frame (_("New Container"), `HBox (
+ `HSpacing (0.5),
+ // text entry
+ `Left (`TextEntry (`id (`name), _("Name"))),
+ // combo box label
+ `ComboBox (`id (`template), _("Template"), template_items)
+ )),
`VSpacing (),
// frame label
`Frame (_("Network Settings"), `HBox (
`HSpacing (0.5), `VBox (
- `VSpacing (0.5),
`HBox (
+ // text entry label
`TextEntry (`id (`ip), _("IP Address")),
- `TextEntry (`id (`subnet), _("Subnet"), "/24")
+ // text entry label
+ `TextEntry (`id (`subnet), _("Subnet"), "/24"),
+ `ReplacePoint (`id (`rp_lan),
+ // combo box label
+ `ComboBox (`id (`bridge), _("Bridge"), read_bridges_ids ())
+ )
),
- `Left (`ComboBox (`id (`bridge), _("Bridge"), bridge_items))
+ `VSpacing (0.5),
+ `Right (
+ // push button label
+ `PushButton (`id (`lan), _("Configure Network..."))
+ )
),
`HSpacing (0.5)
)),
+ `VSpacing (),
// frame label
`Frame (_("Password Settings"), `HBox (
`HSpacing (0.5),
@@ -119,9 +144,19 @@
`HSpacing (0.5)
)),
`VSpacing (2),
- `ReplacePoint (`id (`rpbutton),
+ `ReplacePoint (`id (`rp_status),
+ `Label (`id (`status), "")
+ ),
+ `VSpacing (),
+ `HBox (
+ // button label
+ `PushButton (`id (`create), _("Create")),
+ `ReplacePoint (`id (`rpbutton),
+ // button label
+ `PushButton (`id (`start), _("Start"))
+ ),
// button label
- `PushButton (`id (`start), _("Create New Container"))
+ `PushButton (`id (`destroy), _("Destroy"))
)
), `HSpacing ());
@@ -135,6 +170,10 @@
UI::ChangeWidget (`id (`ip), `ValidChars, IP::ValidChars4);
+ foreach (any b, [ `start, `destroy ], {
+ UI::ChangeWidget (`id (b), `Enabled, false);
+ });
+
any ret = nil;
while(true) {
@@ -144,6 +183,19 @@
break;
}
+ if (ret == `lan)
+ {
+ any lan_ret = WFM::CallFunction ("lan");
+ if (lan_ret == `next || lan_ret == `finish)
+ {
+ UI::ReplaceWidget (`id (`rp_lan),
+ // combo box label
+ `ComboBox (`id (`bridge), _("Bridge"), read_bridges_ids ())
+ );
+ }
+ continue;
+ }
+
string name = (string) UI::QueryWidget (`id (`name), `Value);
string ip = (string) UI::QueryWidget (`id (`ip), `Value);
string subnet = (string) UI::QueryWidget (`id (`subnet), `Value);
@@ -174,10 +226,10 @@
continue;
}
- if (ret == `start)
+ if (ret == `create)
{
// busy message
- Popup::ShowFeedback ("", "Creating Configuration...");
+ Popup::ShowFeedback ("", _("Creating Configuration..."));
// lxc-createconfig -n <name> [-i