[yast-commit] r47575 - /trunk/ycp-ui-bindings/examples/PatternSelector-wizard-with-packages.ycp
Author: dmacvicar Date: Thu May 15 14:07:52 2008 New Revision: 47575 URL: http://svn.opensuse.org/viewcvs/yast?rev=47575&view=rev Log: for coolo Added: trunk/ycp-ui-bindings/examples/PatternSelector-wizard-with-packages.ycp Added: trunk/ycp-ui-bindings/examples/PatternSelector-wizard-with-packages.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ycp-ui-bindings/examples/PatternSelector-wizard-with-packages.ycp?rev=47575&view=auto ============================================================================== --- trunk/ycp-ui-bindings/examples/PatternSelector-wizard-with-packages.ycp (added) +++ trunk/ycp-ui-bindings/examples/PatternSelector-wizard-with-packages.ycp Thu May 15 14:07:52 2008 @@ -0,0 +1,89 @@ +// Full-fledged pattern selection +{ + textdomain "bogus"; + + // Pkg::SourceCreate( "http://dist.suse.de/install/SLP/SUSE-10.1-Beta3/i386/CD1/", "" ); +// Pkg::SourceCreate( "file:/srv/sles-10-i386/CD1/", "" ); + Pkg::SourceStartManager(true); + Pkg::TargetInit("/", false); + + void detailedSelection() + { + // Open empty dialog for instant feedback + + UI::OpenDialog(`opt(`defaultsize), + `ReplacePoint(`id( `rep), + `Label( "Reading package database..." ) + ) + ); + + // This will take a while: Detailed package data are retrieved + // while the package manager is initialized + UI::ReplaceWidget(`rep, `PackageSelector(`id(`packages ), "/dev/fd0" ) ); + + symbol input = (symbol) UI::RunPkgSelection(`id(`packages ) ); + y2milestone( "Package selector returned %1", input ); + UI::CloseDialog(); + + } + + + + if ( ! UI::HasSpecialWidget(`PatternSelector ) ) + { + detailedSelection(); // Fallback: Do detailed selection right away + return; + } + + + UI::OpenDialog(`opt(`defaultsize ), + `Wizard(`back, "", + `cancel, "&Cancel", + `ok, "&OK" ) ); + + string help_text + = _( "<p>" + "The available software for this system is 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 items by clicking on their status icon " + "or right-click on 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 <b>disk usage</b> display in the lower right corner shows the remaining disk space " + "after all requested changes will have been performed. " + "Please notice that 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>" ); + + UI::WizardCommand(`SetDialogIcon( "/usr/share/YaST2/theme/current/icons/22x22/apps/YaST.png" ) ); + UI::WizardCommand(`SetDialogHeading( "Software Selection" ) ); + UI::WizardCommand(`SetHelpText( help_text ) ); + + Pkg::TargetInit( "/", // installed system + false ); // don't create a new RPM database + + UI::ReplaceWidget(`id(`contents), `PatternSelector(`id(`patterns ) ) ); + + + symbol button = nil; + + repeat + { + button = (symbol) UI::RunPkgSelection(`id(`patterns ) ); + y2milestone( "Pattern selector returned %1", button ); + + if ( button == `details ) + detailedSelection(); + + } until ( button == `cancel || button == `accept ); + + UI::CloseDialog(); +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org