[yast-commit] r52379 - in /trunk/yast2: VERSION library/packages/src/PackagesUI.ycp package/yast2.changes
Author: lslezak Date: Tue Oct 21 10:20:13 2008 New Revision: 52379 URL: http://svn.opensuse.org/viewcvs/yast?rev=52379&view=rev Log: - moved PackagesUI.ycp from yast2-packager, added RunPackageSelector() and RunPatternSelector() functions (bnc#435479) - 2.17.40 Added: trunk/yast2/library/packages/src/PackagesUI.ycp (contents, props changed) - copied, changed from r52364, trunk/packager/src/modules/PackagesUI.ycp Modified: trunk/yast2/VERSION trunk/yast2/package/yast2.changes Modified: trunk/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=52379&r1=52378&r2=52379&view=diff ============================================================================== --- trunk/yast2/VERSION (original) +++ trunk/yast2/VERSION Tue Oct 21 10:20:13 2008 @@ -1 +1 @@ -2.17.39 +2.17.40 Copied: trunk/yast2/library/packages/src/PackagesUI.ycp (from r52364, trunk/packager/src/modules/PackagesUI.ycp) URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/PackagesUI.ycp?p2=trunk/yast2/library/packages/src/PackagesUI.ycp&p1=trunk/packager/src/modules/PackagesUI.ycp&r1=52364&r2=52379&rev=52379&view=diff ============================================================================== --- trunk/packager/src/modules/PackagesUI.ycp (original) +++ trunk/yast2/library/packages/src/PackagesUI.ycp Tue Oct 21 10:20:13 2008 @@ -1,10 +1,11 @@ /** - * Module: PackagesUI.ycp + * Module: PackagesUI.ycp * * Authors: Gabriele Strattner (gs@suse.de) + * Ladislav Slezák <lslezak@novell.com> * - * Purpose: Provides a number of common popups - * for the package installation. + * Purpose: Provides common dialogs related to + * the package management. * * $Id$ */ @@ -12,8 +13,10 @@ { module "PackagesUI"; - textdomain "packager"; + textdomain "base"; + import "Label"; + import "Wizard"; // @@ -106,6 +109,10 @@ if (ui == `help) { ui = nil; + + // TODO FIXME: due to the textfreeze "base" cannot be used now, fix it after the GM is out! + textdomain "packager"; + // help text string help = _("<p><b><big>License Confirmation</big></b><br> The package in the headline of the dialog requires an explicit confirmation @@ -114,6 +121,10 @@ <br> To accept the license of the package, click <b>I Agree</b>. To reject the license of the package, click <b>I Disagree</b></p>."); + + // TODO FIXME: remove this + textdomain "base"; + UI::OpenDialog (`HBox ( `VSpacing (18), `VBox ( @@ -149,4 +160,179 @@ return ret; } + /** + * Run helper function, reads the display_support_status feature from the control file + * @return boolean the read value + */ + boolean ReadSupportStatus() + { + // Load the control file + import "ProductControl"; + import "ProductFeatures"; + + boolean ret = ProductFeatures::GetBooleanFeature("software", "display_support_status"); + y2milestone("Feature display_support_status: %1", ret); + return ret; + } + + /** + * Start the detailed package selection. + * @param options options passed to the widget. All options are optional, + * if an option is missing or is nil the default value will be used. All options: + * $[ "enable_repo_mgr" : boolean // display the repository management menu, + * // default: false (disabled) + * "display_support_status" : boolean // display the support status summary dialog, + * // default: depends on the Product Feature "software", "display_support_status" + * "mode" : symbol // package selector mode, no default value + * ] + * + * @return symbol Returns `accept or `cancel . + */ + global symbol RunPackageSelector(map<string,any> options) + { + y2milestone("Called RunPackageSelector(%1)", options); + + boolean enable_repo_mgr = (boolean)options["enable_repo_mgr"]:nil; + boolean display_support_status = (boolean)options["display_support_status"]:nil; + symbol mode = (symbol)options["mode"]:nil; + + // set the defaults if the option is missing or nil + if (display_support_status == nil) + { + display_support_status = ReadSupportStatus(); + } + + if (enable_repo_mgr == nil) + { + // disable repository management by default + enable_repo_mgr = false; + } + + y2milestone("Running package selection, mode: %1, options: display repo management: %2, display support status: %3", mode, enable_repo_mgr, display_support_status); + + term widget_options = `opt(); + + if (mode != nil) + { + widget_options = add(widget_options, mode); + } + + if (enable_repo_mgr != nil && enable_repo_mgr) + { + widget_options = add(widget_options, `repoMgr); + } + + if (display_support_status != nil && display_support_status) + { + widget_options = add(widget_options, `confirmUnsupported); + } + + y2milestone("Options for the package selector widget: %1", widget_options); + + UI::OpenDialog(`opt(`defaultsize), + // Note: size(`opt()) = 0 !! + size(widget_options) > 1 ? + `PackageSelector(`id(`packages), widget_options, "") + : `PackageSelector(`id(`packages), "") + ); + + symbol result = (symbol) UI::RunPkgSelection(`id(`packages ) ); + + UI::CloseDialog(); + y2milestone("Package selector returned %1", result); + + return result; + } + + + /** + * Start the pattern selection dialog. If the UI does not support the + * PatternSelector, start the detailed selection with "patterns" as the + * initial view. + * @return symbol Return `accept or `cancel + * + **/ + global symbol RunPatternSelector() + { + y2milestone("Running pattern selection dialog"); + + if ( ! UI::HasSpecialWidget(`PatternSelector ) || + UI::WizardCommand(`Ping() ) != true ) + { + return RunPackageSelector($[]); // Fallback: detailed selection + } + + // TODO FIXME: due to the textfreeze "base" cannot be used now, fix it after the GM is out! + textdomain "packager"; + + // Help text for software patterns / selections dialog + string help_text + = _("<p> + This dialog allows you to define this system's tasks and what software to install. + Available tasks and software for this system are shown by category in the left + column. To view a description for an item, select it in the list. + </p>") + + _("<p> + Change the status of an item by clicking its status icon + or right-click any icon for a context menu. + With the context menu, you can also change the status of all items. + </p>") + + _("<p> + <b>Details</b> opens the detailed software package selection + where you can view and select individual software packages. + </p>") + + _("<p> + The disk usage display in the lower right corner shows the remaining disk space + after all requested changes will have been performed. + Hard disk partitions that are full or nearly full can degrade + system performance and in some cases even cause serious problems. + The system needs some available disk space to run properly. + </p>"); + + // bugzilla #298056 + // [ Back ] [ Cancel ] [ Accept ] buttons with [ Back ] disabled + Wizard::OpenNextBackDialog(); + Wizard::SetBackButton (`back, Label::BackButton()); + Wizard::SetAbortButton (`cancel, Label::CancelButton()); + Wizard::SetNextButton (`accept, Label::OKButton()); + Wizard::DisableBackButton(); + + Wizard::SetContents( + // Dialog title + // Hint for German translation: "Softwareauswahl und Einsatzzweck des Systems" + _("Software Selection and System Tasks"), + `PatternSelector(`id(`patterns ) ), + help_text, + false, // has_back + true ); // has_next + + // TODO FIXME: remove this + textdomain "base"; + + Wizard::SetDesktopIcon( "sw_single" ); + + symbol result = nil; + + repeat + { + result = (symbol) UI::RunPkgSelection(`id(`patterns ) ); + y2milestone( "Pattern selector returned %1", result ); + + if ( result == `details ) + { + result = RunPackageSelector($[]); + + if ( result == `cancel ) + // don't get all the way out - the user might just have + // been scared of the gory details. + result = nil; + } + } until ( result == `cancel || result == `accept ); + + Wizard::CloseDialog(); + + y2milestone("Pattern selector returned %1", result); + return result; + } + } Modified: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=52379&r1=52378&r2=52379&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Tue Oct 21 10:20:13 2008 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Oct 20 17:59:57 CEST 2008 - lslezak@suse.cz + +- moved PackagesUI.ycp from yast2-packager, added + RunPackageSelector() and RunPatternSelector() functions + (bnc#435479) +- 2.17.40 + +------------------------------------------------------------------- Mon Oct 20 12:33:54 CEST 2008 - kmachalkova@suse.cz - bash ag_showexports moved from yast2-nfs-client package here -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org