Author: locilka
Date: Fri Apr 25 18:17:12 2008
New Revision: 47084
URL: http://svn.opensuse.org/viewcvs/yast?rev=47084&view=rev
Log:
- New desktop selection dialog (bnc #379157).
- 2.16.40
Added:
trunk/installation/src/clients/inst_new_desktop.ycp
Modified:
trunk/installation/VERSION
trunk/installation/control/control.openSUSE.xml
trunk/installation/package/yast2-installation.changes
Modified: trunk/installation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/VERSION?rev=47084&r1=47083&r2=47084&view=diff
==============================================================================
--- trunk/installation/VERSION (original)
+++ trunk/installation/VERSION Fri Apr 25 18:17:12 2008
@@ -1 +1 @@
-2.16.39
+2.16.40
Modified: trunk/installation/control/control.openSUSE.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/control/control.openSUSE.xml?rev=47084&r1=47083&r2=47084&view=diff
==============================================================================
--- trunk/installation/control/control.openSUSE.xml (original)
+++ trunk/installation/control/control.openSUSE.xml Fri Apr 25 18:17:12 2008
@@ -356,8 +356,8 @@
yes
</module>
<module>
- <label>Software Selection</label>
- <name>software_selection</name>
+ <label>Desktop Selection</label>
+ <name>new_desktop</name>
</module>
<module>
<label>Disk</label>
Modified: trunk/installation/package/yast2-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=47084&r1=47083&r2=47084&view=diff
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Fri Apr 25 18:17:12 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Apr 25 18:15:09 CEST 2008 - locilka@suse.cz
+
+- New desktop selection dialog (bnc #379157).
+- 2.16.40
+
+-------------------------------------------------------------------
Thu Apr 24 14:54:53 CEST 2008 - locilka@suse.cz
- New better shiny unified progress for image deployment.
Added: trunk/installation/src/clients/inst_new_desktop.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_new_desktop.ycp?rev=47084&view=auto
==============================================================================
--- trunk/installation/src/clients/inst_new_desktop.ycp (added)
+++ trunk/installation/src/clients/inst_new_desktop.ycp Fri Apr 25 18:17:12 2008
@@ -0,0 +1,289 @@
+/**
+ * File: clients/inst_software_selection.ycp
+ * Package: Installation
+ * Summary: New Desktop Selection (bnc #379157)
+ * Authors: Lukas Ocilka
+ * Stephan Kulow
+ *
+ * $Id$
+ *
+ */
+
+{
+
+textdomain "installation";
+
+import "ProductFeatures";
+import "InstData";
+import "GetInstArgs";
+import "DefaultDesktop";
+import "Wizard";
+import "Packages";
+import "Popup";
+import "Stage";
+import "Directory";
+import "Icon";
+
+// do not offer the dialog if base selection is fixed
+if (ProductFeatures::GetFeature ("software", "selection_type") == `fixed)
+ return `auto;
+
+boolean text_mode = UI::GetDisplayInfo()["TextMode"]:false;
+
+// TRANSLATORS: help text, part 1
+string help = _("<p>At Linux <b>choice</b> is a top priority. <i>openSUSE</i> offers a number
+of different desktop environments. Below you see a list of the 2 major ones
+<b>GNOME</b> and <b>KDE</b> (in two different versions). Both provide an easy to use desktop
+with a large number of desktop applications such as email, file browser, games and many others.</p>") +
+
+// TRANSLATORS: help text, part 3
+_("Additionally, not only desktop but you can also chose a minimalistic
+installation that could fit your needs better.");
+
+if (DefaultDesktop::Desktop() == nil || DefaultDesktop::Desktop() == "") {
+ DefaultDesktop::Init();
+}
+
+map all_desktops = DefaultDesktop::GetAllDesktopsMap();
+
+void SelectSoftwareNow () {
+ y2milestone ("Selected desktop: %1", DefaultDesktop::Desktop());
+ DefaultDesktop::SetDesktop (DefaultDesktop::Desktop());
+
+ Packages::ForceFullRepropose();
+ Packages::Reset ([`product]);
+
+ foreach (string one_pattern, (list <string>) all_desktops[DefaultDesktop::Desktop(), "patterns"]:[], {
+ y2milestone ("Marking desktop pattern to be installed: %1", one_pattern);
+ Pkg::ResolvableInstall (one_pattern, `pattern);
+ });
+}
+
+string GetDesktopRadioButtonId (string desktop_name) {
+ if (desktop_name == nil || desktop_name == "") {
+ y2warning ("Wrong desktop name: %1", desktop_name);
+ return "";
+ }
+
+ return sformat ("selected_desktop_%1", desktop_name);
+}
+
+string GetDesktopDescriptionId (string desktop_name) {
+ if (desktop_name == nil || desktop_name == "") {
+ y2warning ("Wrong desktop name: %1", desktop_name);
+ return "";
+ }
+
+ return sformat ("desktop_description_%1", desktop_name);
+}
+
+list <string> other_desktops = [];
+
+term GetDesktops (string desktops, boolean show_descr) {
+ list <string> sort_order = maplist (string desktop_name, map one_desktop, all_desktops, {
+ return desktop_name;
+ });
+
+ sort_order = sort (string x, string y, sort_order, ``(all_desktops[x,"order"]:99 < all_desktops[y,"order"]:99));
+
+ if (desktops == "major") {
+ sort_order = filter (string desktop_name, sort_order, {
+ return (all_desktops[desktop_name,"order"]:99 == 1);
+ });
+ } else if (desktops == "minor") {
+ sort_order = filter (string desktop_name, sort_order, {
+ return (all_desktops[desktop_name,"order"]:99 > 1);
+ });
+ other_desktops = sort_order;
+ }
+
+ term ret = `VBox ();
+
+ integer counter = -1;
+ integer last_desktop_order = -1;
+
+ foreach (string desktop_name, sort_order, {
+ counter = counter + 1;
+
+ if (counter != 0 && desktops == "major") {
+ ret[counter] = `VSpacing (1);
+ counter = counter + 1;
+ }
+
+ integer desktop_order = all_desktops[desktop_name,"order"]:99;
+
+ term radio_opt = `opt (`notify, `boldFont);
+ if (desktops == "minor")
+ radio_opt = `opt (`notify);
+
+ ret[counter] =
+ `Left (`HBox (
+ `HSpacing ((desktops == "major" ? 2:8)),
+ `VBox (
+ `Left (`RadioButton (
+ `id (GetDesktopRadioButtonId (desktop_name)),
+ radio_opt,
+ all_desktops[desktop_name,"label"]:""
+ )),
+ (desktops == "major" && show_descr ?
+
+ `ReplacePoint (`id (GetDesktopDescriptionId (desktop_name)), `HBox (
+ `HSpacing ((text_mode ? 4:2)),
+ `Left (`Label (all_desktops[desktop_name,"description"]:"")),
+ `HSpacing (1)
+ ))
+ :
+ `Empty()
+ )
+ ),
+ (desktops == "major" ?
+
+ `Image (Directory::themedir + "/current/icons/64x64/apps/" + all_desktops[desktop_name,"icon"]:"yast" + ".png")
+ :
+ `Empty()
+ )
+ ));
+
+ last_desktop_order = desktop_order;
+ });
+
+ if (desktops == "major") {
+ counter = counter + 1;
+
+ if (counter != 0) {
+ ret[counter] = `VSpacing (1);
+ counter = counter + 1;
+ }
+
+ ret[counter] =
+ `Left (`HBox (
+ `HSpacing (2),
+ `VBox (
+ `Left (`RadioButton (
+ `id ("__other__"),
+ `opt (`notify, `boldFont),
+ _("Other")
+ ))
+ )
+ ));
+ }
+
+ return ret;
+}
+
+term major_desktops = GetDesktops ("major", true);
+term major_no_descr = GetDesktops ("major", false);
+term minor_desktops = GetDesktops ("minor", true);
+
+boolean current_minor_d_status = false;
+
+void ShowHideOther (boolean show) {
+ string currently_selected = (string) UI::QueryWidget (`id ("selected_desktop"), `Value);
+
+ if (show == true && current_minor_d_status == false) {
+ if (text_mode) UI::ReplaceWidget (`id ("major_options"), major_no_descr);
+ UI::ReplaceWidget (`id ("other_options"), minor_desktops);
+ current_minor_d_status = true;
+ } else if (show == false && current_minor_d_status == true) {
+ if (text_mode) UI::ReplaceWidget (`id ("major_options"), major_desktops);
+ UI::ReplaceWidget (`id ("other_options"), `Empty());
+ current_minor_d_status = false;
+ }
+
+ UI::ChangeWidget (`id ("selected_desktop"), `Value, currently_selected);
+ UI::SetFocus (`id (currently_selected));
+}
+
+term default_ui_minor = `Empty();
+
+string default_desktop = DefaultDesktop::Desktop();
+if (default_desktop != nil && default_desktop != "" && contains (other_desktops, default_desktop)) {
+ default_ui_minor = minor_desktops;
+ current_minor_d_status = true;
+}
+
+term contents = `Left (`HBox (
+ `HSquash (
+ `VBox (
+ `Label (_("openSUSE offers you a choice of user interfaces. The two major complete
+desktops are KDE and GNOME. Both provide an easy-to-use desktop with a full
+suite of applications including email, a file manager, games and utilities.
+
+As desktop selection is a matter of taste, we do not give a recommendation.")),
+ `VWeight (3, `VStretch()),
+ `RadioButtonGroup (
+ `id ("selected_desktop"),
+ `opt (`hstretch),
+ `VBox (
+ `ReplacePoint (`id ("major_options"), major_desktops),
+ `ReplacePoint (`id ("other_options"), default_ui_minor)
+ )
+ ),
+ `VWeight (5, `VStretch())
+ )
+ )
+));
+
+// TRANSLATORS: dialog caption
+string caption = _("Desktop Selection");
+
+// Set UI
+Wizard::SetContents (caption, contents, help,
+ Stage::initial() ? GetInstArgs::enable_back():true,
+ Stage::initial() ? GetInstArgs::enable_next():true
+);
+Wizard::SetTitleIcon ("yast-desktop-select");
+
+// Adjust default values
+if (! UI::WidgetExists (`id ("selected_desktop"))) {
+ y2error (-1, "Widget selected_desktop does not exist");
+} else if (default_desktop != nil && default_desktop != "") {
+ y2milestone ("Already selected desktop: %1", DefaultDesktop::Desktop());
+ UI::ChangeWidget (`id ("selected_desktop"), `Value, GetDesktopRadioButtonId (DefaultDesktop::Desktop()));
+}
+
+// UI wait loop
+any ret = nil;
+while (true) {
+ ret = UI::UserInput();
+
+ if (is (ret, string) && regexpmatch (tostring (ret), "^selected_desktop_.*")) {
+ string currently_selected = regexpsub (tostring (ret), "^selected_desktop_(.*)", "\\1");
+ if (! contains (other_desktops, currently_selected)) {
+ ShowHideOther (false);
+ }
+ } else if (ret == `next) {
+ string currently_selected = (string) UI::QueryWidget (`id ("selected_desktop"), `Value);
+ if (currently_selected == "__other__") {
+ Popup::Message (_("No system type was selected.
+Select the default type."));
+ continue;
+ }
+ DefaultDesktop::SetDesktop (regexpsub (tostring (currently_selected), "^selected_desktop_(.*)", "\\1"));
+
+ if (DefaultDesktop::Desktop() != nil && haskey (all_desktops, DefaultDesktop::Desktop())) {
+ SelectSoftwareNow ();
+ break;
+ }
+ Popup::Message (_("No system type was selected.
+Select the default type."));
+ continue;
+ } else if (ret == `abort || ret == `cancel) {
+ if (Popup::ConfirmAbort (Stage::initial () ? `painless : `incomplete)) {
+ ret = `abort;
+ break;
+ }
+ continue;
+ } else if (ret == `back) {
+ break;
+ } else if (ret == "__other__") {
+ ShowHideOther (true);
+ } else {
+ y2error ("Input %1 not handled", ret);
+ }
+}
+
+return (symbol) ret;
+
+/* EOF */
+}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org