Author: jsmeix Date: Thu Nov 13 14:45:13 2008 New Revision: 53275 URL: http://svn.opensuse.org/viewcvs/yast?rev=53275&view=rev Log: - Fixed removal of the "Cancel" button from the Overview dialog so that also in ncurses mode the other dialogs in the DialogTree get the button with the "cancel" functionality re-enabled. - Avoid unexpected side-effects of Package::Remove. - Fixed "Trigger Automatic Configuration" in Autoconfig dialog by enabling the automatic configuration if the trigger is "on". - 2.17.38 Modified: trunk/printer/VERSION trunk/printer/package/yast2-printer.changes trunk/printer/src/Printerlib.ycp trunk/printer/src/autoconfig.ycp trunk/printer/src/driveradd.ycp trunk/printer/src/overview.ycp trunk/printer/src/sharing.ycp Modified: trunk/printer/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/VERSION (original) +++ trunk/printer/VERSION Thu Nov 13 14:45:13 2008 @@ -1 +1 @@ -2.17.37 +2.17.38 Modified: trunk/printer/package/yast2-printer.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/package/yast2-printer.changes (original) +++ trunk/printer/package/yast2-printer.changes Thu Nov 13 14:45:13 2008 @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Thu Nov 13 14:27:52 CET 2008 - jsmeix@suse.de + +- Fixed removal of the "Cancel" button from the Overview dialog + so that also in ncurses mode the other dialogs in the DialogTree + get the button with the "cancel" functionality re-enabled. +- Avoid unexpected side-effects of Package::Remove. +- Fixed "Trigger Automatic Configuration" in Autoconfig dialog + by enabling the automatic configuration if the trigger is "on". +- 2.17.38 + +------------------------------------------------------------------- Thu Nov 13 11:27:13 CET 2008 - jsmeix@suse.de - In Sharing dialog fixed removing all BrowseAddress values Modified: trunk/printer/src/Printerlib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/Printerlib.ycp?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/src/Printerlib.ycp (original) +++ trunk/printer/src/Printerlib.ycp Thu Nov 13 14:45:13 2008 @@ -126,6 +126,16 @@ ); return false; } + // Package::Install(package_name) has unexpected side-effects + // because it does additionally remove whatever other packages + // for example to "automatically solve" existing package conflicts + // without any dialog where the user could accept or reject additional removals + // (the user may have intentionally accepted whatever package conflict). + // I am only interested to install exactly the one package which was specified + // and all what this one package requires but I am not interested to get whatever + // other packages removed but I do not know a function which does this. + // Therefore I use Package::Install(package_name) because it is most important + // to get all installed what is required by the package which was specified. if( ! Package::Install( package_name ) ) { y2milestone( "TestAndInstallPackage: Failed to install required package %1.", package_name ); Popup::Error( // Message of a Popup::Error where %1 will be replaced by the package name. @@ -145,17 +155,72 @@ { y2milestone( "TestAndInstallPackage: skip remove because %1", result["stdout"]:"package is not installed" ); return true; } - if( ! Package::Remove( package_name ) ) + else + { if( ! Popup::ContinueCancel( sformat( // Body of a Popup::ContinueCancel + // where %1 will be replaced by the package name + // when removing package %1 would break dependencies. + _("Remove package %1?"), + package_name + ) + ) + ) + { // The user has decided not to continue. + // Therefore we exit here but with "false" because + // the request to remove the package was not done. + return false; + } + } + // Intentionally Package::Remove(package_name) is not used here + // because it does additionally remove whatever other packages + // for example to "automatically solve" existing package conflicts + // without any dialog where the user could accept or reject additional removals + // (the user may have intentionally accepted whatever package conflict). + // Furthermore Package::Remove(package_name) does additionally install + // whatever other packages for example to "automatically solve" whatever + // kind of RPM soft requirements (Recommends) for other packages. + // I am only interested to remove exactly the one package which was specified + // and I am not interested to get whatever replacement package installed. + // Usually (i.e. in a openSUSE standard system) the packages which are removed here + // do not have dependencies or the calling function removes dependant packages + // in the right order (e.g. first hplip and then hplip-hpijs, see driveradd.ycp) + // but the user might have installed whatever third-party packages + // which could have dependencies to the package which should be removed here. + if( ! ExecuteBashCommand( "rpm -e --test '" + package_name + "'" ) ) + { // There is no Popup::ContinueCancelHeadlineDetails available. + // Therefore the exact RPM message is shown via a separated Popup::ErrorDetails. + Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails + // where %1 will be replaced by the package name. + _("Removing package %1 would break dependencies."), + package_name + ), + result["stderr"]:"" + ); + if( ! Popup::ContinueCancelHeadline( sformat( // Header of a Popup::ContinueCancelHeadline + // where %1 will be replaced by the package name + // when removing package %1 would break dependencies. + _("Remove %1 regardless of breaking dependencies?"), + package_name + ), + // Body of a Popup::ContinueCancelHeadline + // when removing package %1 would break dependencies. + _("Breaking dependencies leads to arbitrary failures elsewhere.") + ) + ) + { // The user has decided not to continue which is the right decission. + // Therefore we exit here but with "false" because removing the package failed. + return false; + } + } + if( ! ExecuteBashCommand( "rpm -e --nodeps '" + package_name + "'" ) ) { y2milestone( "TestAndInstallPackage: Failed to remove package %1.", package_name ); - Popup::Error( // Message of a Popup::Error where %1 will be replaced by the package name. - // Only a simple message because: - // Either the user has explicitely rejected to remove the package, - // or this error does not happen on a normal system - // (i.e. a system which is not totally broken or totally messed up). - sformat( _("Failed to remove package %1."), - package_name - ) - ); + Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails + // where %1 will be replaced by the package name. + // Only a simple message because this error does not happen on a normal system. + _("Failed to remove package %1."), + package_name + ), + result["stderr"]:"" + ); return false; } } Modified: trunk/printer/src/autoconfig.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/autoconfig.ycp?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/src/autoconfig.ycp (original) +++ trunk/printer/src/autoconfig.ycp Thu Nov 13 14:45:13 2008 @@ -109,6 +109,7 @@ `Left ( `CheckBox ( `id("cups_autoconfig_trigger"), + `opt(`notify), // CheckBox to trigger that print queues are automatically created right now: _("&Trigger Automatic Configuration") ) @@ -336,11 +337,19 @@ if( "cups_autoconfig_configure_new_attached" == event["WidgetID"]:"" ) { // Set the CheckBox to trigger automatic configuration to "off" // when cups-autoconfig should not do an automatic configuration - // but do not automatically set the trigger to "on" in the other case: + // but do not automatically set the trigger to "on" in the opposite case: if( ! (boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attached"), `Value ) ) { UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false ); } } + if( "cups_autoconfig_trigger" == event["WidgetID"]:"" ) + { // Set the CheckBox to do an automatic configuration to "on" + // when the CheckBox to trigger automatic configuration is set to "on" + // but do not automatically disable automatic configuration in the opposite case: + if( (boolean)UI::QueryWidget( `id("cups_autoconfig_trigger"), `Value ) ) + { UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Value, true ); + } + } } if( "Activated" == event["EventReason"]:"" ) { if( `back == event["ID"]:nil ) Modified: trunk/printer/src/driveradd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/driveradd.ycp?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/src/driveradd.ycp (original) +++ trunk/printer/src/driveradd.ycp Thu Nov 13 14:45:13 2008 @@ -275,7 +275,7 @@ // when hpijs-standalone is removed by the package management system // and because we do want to get rid of it, it is removed by plain rpm: if( Printerlib::TestAndInstallPackage( "hpijs-standalone", "installed" ) ) - { Printerlib::ExecuteBashCommand( "rpm -e --nodeps hpijs-standalone" ); + { Printerlib::TestAndInstallPackage( "hpijs-standalone", "remove" ); } if( ! Printerlib::TestAndInstallPackage( "hpijs-standalone", "installed" ) ) { if( Printerlib::TestAndInstallPackage( "hplip", "install" ) ) @@ -319,7 +319,7 @@ { // It can lead to an almost endless sequence of further problems // when hpijs-standalone is removed by the package management system // and because we do want to get rid of it, it is removed by plain rpm: - Printerlib::ExecuteBashCommand( "rpm -e --nodeps hpijs-standalone" ); + Printerlib::TestAndInstallPackage( "hpijs-standalone", "remove" ); if( ! Printerlib::TestAndInstallPackage( "hpijs-standalone", "installed" ) ) { // Try again to install hplip only if hpijs-standalone was actually removed. if( Printerlib::TestAndInstallPackage( "hplip", "install" ) ) Modified: trunk/printer/src/overview.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/overview.ycp?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/src/overview.ycp (original) +++ trunk/printer/src/overview.ycp Thu Nov 13 14:45:13 2008 @@ -261,13 +261,26 @@ // so that the button with "back/cancel" functionality must be carefully re-enabled // whenever the Overview dialog is replaced by another dialog tab in the DialogTree // so that the other dialogs in the DialogTree have a button with "cancel" functionality. + // In graphical mode: + // When the Overview dialog is to be replaced by another dialog tab in the DialogTree + // the event has the form e.g.: $["EventSerialNo":2, "EventType":"MenuEvent", "ID":"network"] + // i.e. the EventType is "MenuEvent" so that testing only this general condition + // (without a specific match if "ID" is one of "network","sharing","policies","autoconfig") + // should be sufficiently safe to get the button with "back/cancel" functionality restored. + // In ncurses mode: + // When the Overview dialog is to be replaced by another dialog tab in the DialogTree + // the event has the form e.g.: $["EventReason":"Activated", "EventSerialNo":0, "EventType":"WidgetEvent", + // "ID":`wizardTree, "WidgetClass":`Tree, "WidgetID":`wizardTree] + // The EventType "WidgetEvent" cannot be used here because it is too unspecific + // because "WidgetEvent" type events are all kind of clicked buttons so that + // for ncurses mode the ID is used as test if the Overview dialog is to be + // replaced by another dialog tab in the DialogTree. + // This strange testing method works at least for openSUSE 11.0 and openSUSE 11.1. Wizard::HideBackButton(); - if( "MenuEvent" == event["EventType"]:"" ) - { // When the Overview dialog is to be replaced by another dialog tab in the DialogTree - // the EventType is "MenuEvent" so that testing only this general condition - // (without a specific match if "ID" is one of "network","sharing","policies","autoconfig") - // should be sufficiently safe to get the button with "back/cancel" functionality restored. - Wizard::RestoreBackButton(); + if( "MenuEvent" == event["EventType"]:"" + || `wizardTree == event["ID"]:nil + ) + { Wizard::RestoreBackButton(); // The above RestoreBackButton restores also its label to the default "Back" // but according to the new YaST style guide at // http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEd... Modified: trunk/printer/src/sharing.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/sharing.ycp?rev=53275&r1=53274&r2=53275&view=diff ============================================================================== --- trunk/printer/src/sharing.ycp (original) +++ trunk/printer/src/sharing.ycp Thu Nov 13 14:45:13 2008 @@ -59,7 +59,7 @@ ( `Left ( `RadioButton ( `id(`deny_remote_access_radio_button), - `opt(`notify, `immediate), + `opt(`notify), // A RadioButton label to deny remote access to local print queues: _("&Deny remote access"), initial_deny_remote_access @@ -68,7 +68,7 @@ `Left ( `RadioButton ( `id(`allow_remote_access_radio_button), - `opt(`notify, `immediate), + `opt(`notify), // A RadioButton label to allow remote access to local print queues: _("&Allow remote access"), initial_allow_remote_access -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org