Author: lslezak Date: Wed Apr 22 16:32:53 2009 New Revision: 56919 URL: http://svn.opensuse.org/viewcvs/yast?rev=56919&view=rev Log: - callbacks - close download popup and source progress popup if an error occurrs (#216950) Modified: branches/SuSE-SLE-10-SP3-Branch/packager/ (props changed) branches/SuSE-SLE-10-SP3-Branch/packager/package/yast2-packager.changes branches/SuSE-SLE-10-SP3-Branch/packager/src/modules/PackageCallbacks.ycp Modified: branches/SuSE-SLE-10-SP3-Branch/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/packager/package/yast2-packager.changes?rev=56919&r1=56918&r2=56919&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/packager/package/yast2-packager.changes (original) +++ branches/SuSE-SLE-10-SP3-Branch/packager/package/yast2-packager.changes Wed Apr 22 16:32:53 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Apr 22 13:41:58 CEST 2009 - lslezak@suse.cz + +- callbacks - close download popup and source progress popup if + an error occurrs (#216950) + +------------------------------------------------------------------- Fri Apr 10 18:34:12 CEST 2009 - lslezak@suse.cz - copy /etc/shadow from inst-sys to the target during installation Modified: branches/SuSE-SLE-10-SP3-Branch/packager/src/modules/PackageCallbacks.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/packager/src/modules/PackageCallbacks.ycp?rev=56919&r1=56918&r2=56919&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/packager/src/modules/PackageCallbacks.ycp (original) +++ branches/SuSE-SLE-10-SP3-Branch/packager/src/modules/PackageCallbacks.ycp Wed Apr 22 16:32:53 2009 @@ -90,6 +90,11 @@ CommandLine::PrintVerbose(sformat(_("Downloading package %1 (%2)..."), name, sz)); } else { + if (_provide_popup) + { + UI::CloseDialog(); + } + // popup heading term providebox = ProgressBox (_("Downloading Package"), name, sz); UI::OpenDialog(providebox); @@ -176,7 +181,10 @@ { y2milestone("DoneProvide: %1", error); if (_provide_popup) + { UI::CloseDialog(); + _provide_popup = false; + } if (Mode::commandline()) { @@ -189,7 +197,6 @@ provide_aborted = false; return "CANCEL"; } - _provide_popup = false; if (error != 0) { @@ -677,6 +684,12 @@ UI::CloseDialog(); + if (_provide_popup) + { + UI::CloseDialog(); + _provide_popup = false; + } + if (!Mode::normal ()) { import "SlideShow"; @@ -802,7 +815,7 @@ UI::OpenDialog( `VBox( `HSpacing(max_size), - `Heading(`id(`label), `opt(`hstretch), display), + `Heading(`id(`label_source_popup), `opt(`hstretch), display), `ProgressBar (`id (`progress), " ", 100, 0) ) ); @@ -846,8 +859,21 @@ return true; } +// is the top level window source popup? +boolean IsSourcePopup() +{ + return UI::WidgetExists(`id(`progress)) && + UI::WidgetExists(`id(`label_source_popup)); +} + void CloseSourcePopup() { + if (!IsSourcePopup()) + { + y2error("The toplevel dialog is not a source popup dialog!"); + return; + } + _source_open = _source_open - 1; // set 100% progress @@ -861,6 +887,25 @@ y2milestone("CloseSourcePopup: _source_open: %1", _source_open); } +// completely close the source popup window (all instances) +// should be called if an error occurrs +void CloseSourcePopupAll() +{ + if (!IsSourcePopup()) + { + y2error("The toplevel dialog is not a source popup dialog!"); + return; + } + + _source_open = 0; + + // set 100% progress + SourcePopupSetProgress(100); + + y2milestone("Closing source progress popup - all instances"); + UI::CloseDialog(); +} + global void SourceCreateStart(string url) { y2milestone ("SourceCreateStart: %1", url); @@ -938,13 +983,7 @@ UI::CloseDialog (); y2milestone ("Source create error: Returning %1", ret); - if (ret == `RETRY) - { - // The start callback will be evaluated again, - // but the end callback will be called just once. - // This call replaces the missing end callback. - CloseSourcePopup(); - } + CloseSourcePopupAll(); return ret; } @@ -1135,13 +1174,7 @@ UI::CloseDialog (); y2milestone ("Source report error: Returning %1", ret); - if (ret == `RETRY) - { - // The start callback will be evaluated again, - // but the end callback will be called just once. - // This call replaces the missing end callback. - CloseSourcePopup(); - } + CloseSourcePopupAll(); return ret; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org