Author: locilka Date: Tue Jan 29 14:17:41 2008 New Revision: 43967 URL: http://svn.opensuse.org/viewcvs/yast?rev=43967&view=rev Log: - Unified DefaultDesktop module and software/desktop selection dialog in installation. - 2.16.17 Modified: trunk/packager/VERSION trunk/packager/package/yast2-packager.changes trunk/packager/src/modules/DefaultDesktop.ycp trunk/packager/src/modules/Packages.ycp Modified: trunk/packager/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=43967&r1=43966&r2=43967&view=diff ============================================================================== --- trunk/packager/VERSION (original) +++ trunk/packager/VERSION Tue Jan 29 14:17:41 2008 @@ -1 +1 @@ -2.16.16 +2.16.17 Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=43967&r1=43966&r2=43967&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Tue Jan 29 14:17:41 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Jan 29 20:14:27 CET 2008 - locilka@suse.cz + +- Unified DefaultDesktop module and software/desktop selection + dialog in installation. +- 2.16.17 + +------------------------------------------------------------------- Sun Jan 27 20:58:18 CET 2008 - coolo@suse.de - fixing changelog order Modified: trunk/packager/src/modules/DefaultDesktop.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/DefaultDesktop.ycp?rev=43967&r1=43966&r2=43967&view=diff ============================================================================== --- trunk/packager/src/modules/DefaultDesktop.ycp (original) +++ trunk/packager/src/modules/DefaultDesktop.ycp Tue Jan 29 14:17:41 2008 @@ -14,6 +14,66 @@ import "ProductFeatures"; + +// Could be defined in control file +// @see GetAllDesktopsMap +map <string, map> all_desktops = $[ + "gnome" : $[ + "order" : 1, + // TRANSLATORS: Dialog label + "label" : _("GNOME Desktop"), + "patterns" : ["gnome", "x11", "base"], + "icon" : "pattern-gnome", + ], + "kde" : $[ + "order" : 1, + // TRANSLATORS: Dialog label + "label" : _("KDE Desktop"), + "patterns" : ["kde", "x11", "base"], + "icon" : "pattern-kde", + ], + "xfce" : $[ + "order" : 4, + // TRANSLATORS: Dialog label + "label" : _("XFCE Desktop"), + "patterns" : ["xfce", "x11", "base"], + "icon" : "yast-tv", + ], + "min_x" : $[ + "order" : 6, + // TRANSLATORS: Dialog label + "label" : _("Minimal X-Windows"), + "patterns" : ["x11", "base"], + "icon" : "yast-x11", + ], + "textmode" : $[ + "order" : 8, + // TRANSLATORS: Dialog label + "label" : _("Minimal Server Selection (Text Mode)"), + "patterns" : ["base"], + "icon" : "yast-sshd", + ], +]; + +/** + * Returns map of pre-defined default system tasks + * + * @return map <string, map> all_system_tasks + * + * @struct $[ + * "desktop ID" : $[ + * "order" : integer, + * "label" : _("Desktop Name Visible in Dialog"), + * "description" : _("Description text of the desktop"), + * "patterns" : ["list", "of", "related", "patterns"], + * "icon" : "some-icon", // filename from the 32x32 directory of the current theme (without .png suffix) + * ], + * ] + */ +global map <string, map> GetAllDesktopsMap () { + return all_desktops; +} + /** * Desktop which was selected in the desktop selection dialog * "kde", "gnome", "min_x11", "text" @@ -31,37 +91,6 @@ ]; /** - * Patterns to be preselected according to selected desktop - */ -map<string,list<string> > patterns_to_select = $[ - "gnome" : [ "gnome", "x11", "base" ], - "kde" : [ "kde", "x11", "base" ], - "min_x11" : [ "x11", "base" ], - "text" : [ "base" ], -]; - -/** - * Patterns NOT to be preselected according to selected desktop - */ -map<string,list<string> > patterns_to_deselect = $[ - "gnome" : [ "kde" ], - "kde" : [ "gnome" ], - "min_x11" : [ "kde, gnome" ], - "text" : [ "kde, gnome", "x11" ], -]; - -/** - * Map of desktop descriptions - */ -map<string,string> desktop_descr = $[ - "kde" : _("KDE"), - "gnome" : _("GNOME"), - "min_x11" : _("Minimal Graphical System"), - "text" : _("Text Mode"), -]; - - -/** * Get the currently set default desktop, nil if none set * @return string "kde", "gnome", "min_x11", "text", nil */ @@ -74,7 +103,7 @@ * @param desktop a string, one of "kde", "gnome", "min_x11", "text" or nil */ global void SetDesktop (string new_desktop) { - if (new_desktop != nil && ! haskey (desktop2wm, new_desktop)) + if (new_desktop != nil && ! haskey (all_desktops, new_desktop)) y2error ("Attempting to set desktop to unknown %1", new_desktop); else desktop = new_desktop; @@ -93,7 +122,7 @@ * @return a list of patterns */ global list<string> PatternsToSelect () { - return patterns_to_select[desktop]:[]; + return all_desktops[desktop, "patterns"]:[]; } /** @@ -101,7 +130,25 @@ * @return a list of patterns */ global list<string> PatternsToDeselect () { - return patterns_to_deselect[desktop]:[]; + // patterns which must be selected + list <string> patterns_to_select = PatternsToSelect(); + + list <string> patterns_to_deselect = []; + + // go through all known system task definitions + foreach (string one_desktop, map desktop_descr, all_desktops, { + // all patterns required by a system type + foreach (string one_pattern, desktop_descr["patterns"]:[], { + // if not required, add it to 'to deselect' + if (one_pattern != nil && ! contains (patterns_to_select, one_pattern)) { + patterns_to_deselect = add (patterns_to_deselect, one_pattern); + } + }); + }); + + y2milestone ("Patterns to deselect '%1' -> %2", desktop, patterns_to_deselect); + + return patterns_to_deselect; } /** @@ -109,7 +156,8 @@ * @return string the description of the desktop */ global string Description () { - return desktop_descr[desktop]:""; + // TRANSLATORS: dialog label + return all_desktops[desktop, "label"]:_("No system type selected"); } /** Modified: trunk/packager/src/modules/Packages.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.ycp?rev=43967&r1=43966&r2=43967&view=diff ============================================================================== --- trunk/packager/src/modules/Packages.ycp (original) +++ trunk/packager/src/modules/Packages.ycp Tue Jan 29 14:17:41 2008 @@ -270,8 +270,8 @@ // (e.g. openSUSE 10.3, SUSE Linux Enterprise ...) output = (list<string>)merge (output, ListSelected (`product, _("Product: %1"))); if (contains (flags, `desktop)) - // installation proposal - SW summary, %1 is name of the selected desktop (e.g. KDE) - output = (list<string>)add (output, sformat(_("Desktop: %1"), DefaultDesktop::Description ())); + // installation proposal - SW summary, %1 is name of the selected desktop or system type (e.g. KDE) + output = (list<string>)add (output, sformat(_("System Type: %1"), DefaultDesktop::Description ())); if (contains (flags, `pattern)) output = (list<string>) merge (output, ListSelected (`pattern, "+ %1")); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org