home *** CD-ROM | disk | FTP | other *** search
- /**
- * File: DefaultDesktop.ycp
- * Package: Handling of default desktop selection
- * Authors: Jiri Srain <jsrain@suse.cz>
- *
- * $Id: Packages.ycp 31512 2006-06-19 11:14:09Z jsrain $
- */
-
- {
-
- module "DefaultDesktop";
-
- textdomain "packager";
-
- import "ProductFeatures";
-
- /**
- * Desktop which was selected in the desktop selection dialog
- * "kde", "gnome", "min_x11", "text"
- */
- string desktop = nil;
-
- /**
- * Window manager to be set according to selected desktop
- */
- map<string,string> desktop2wm = $[
- "gnome" : "gnome",
- "kde" : "kde",
- "min_x11" : "twm",
- "text" : "twm",
- ];
-
- /**
- * 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
- */
- global string Desktop () {
- return desktop;
- }
-
- /**
- * Set the default desktop
- * @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))
- y2error ("Attempting to set desktop to unknown %1", new_desktop);
- else
- desktop = new_desktop;
- }
-
- /**
- * Get preffered window/desktop manager for the selected desktop
- * @return string preffered window/desktop manager, empty if no one
- */
- global string PrefferedWindowManager () {
- return desktop2wm[desktop]:"";
- }
-
- /**
- * Get patterns which should be selected for currently selected desktop
- * @return a list of patterns
- */
- global list<string> PatternsToSelect () {
- return patterns_to_select[desktop]:[];
- }
-
- /**
- * Get patterns which should be NOT selected for currently selected desktop
- * @return a list of patterns
- */
- global list<string> PatternsToDeselect () {
- return patterns_to_deselect[desktop]:[];
- }
-
- /**
- * Get the description of the currently selected desktop for the summary
- * @return string the description of the desktop
- */
- global string Description () {
- return desktop_descr[desktop]:"";
- }
-
- /**
- * Initialize default desktop from control file if specified there
- */
- global void Init () {
- string default_desktop = ProductFeatures::GetStringFeature
- ("software", "default_desktop");
- if (default_desktop == "")
- default_desktop = nil;
- desktop = default_desktop;
- }
-
- /* EOF */
- }
-