Author: lslezak Date: Thu Jul 9 14:16:00 2009 New Revision: 57975 URL: http://svn.opensuse.org/viewcvs/yast?rev=57975&view=rev Log: - Call UI::RecalcLayout() after changing push button label (bnc#510282) - Improved automatic retry after download failure (more attepts, logarithmic back-off, retry download in more cases) (bnc#119813) - 2.18.20 Modified: trunk/yast2/VERSION trunk/yast2/library/packages/src/PackageCallbacks.ycp trunk/yast2/package/yast2.changes Modified: trunk/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=57975&r1=57974&r2=57975&view=diff ============================================================================== --- trunk/yast2/VERSION (original) +++ trunk/yast2/VERSION Thu Jul 9 14:16:00 2009 @@ -1 +1 @@ -2.18.19 +2.18.20 Modified: trunk/yast2/library/packages/src/PackageCallbacks.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/packages/src/PackageCallbacks.ycp?rev=57975&r1=57974&r2=57975&view=diff ============================================================================== --- trunk/yast2/library/packages/src/PackageCallbacks.ycp (original) +++ trunk/yast2/library/packages/src/PackageCallbacks.ycp Thu Jul 9 14:16:00 2009 @@ -81,12 +81,16 @@ // seconds for automatic retry after a timeout const integer retry_timeout = 30; // number of automatic retries - const integer retry_attempts = 3; + const integer retry_attempts = 100; + // max. retry timeout (15 minutes) + const integer retry_max_timeout = 15*60; // current values for retry functionality string retry_url = ""; integer current_retry_timeout = retry_timeout; - integer current_retry_attempt = retry_attempts; + integer current_retry_attempt = 0; + + const integer vsize_no_details = 1; // functions related to the persistent storage void LoadConfig() @@ -175,6 +179,11 @@ return ret; } + string RetryLabel(integer timeout) + { + return sformat(_("Remaining time to automatic retry: %1"), String::FormatTime(timeout)); + } + /** at start of file providal * */ @@ -251,9 +260,10 @@ `Left(`Label( message)) ), `VSpacing(0.1), - `Left(`CheckBox(`id(`show), `opt(`notify), + `HBox(`HSpacing(0.6), + `Left(`CheckBox(`id(`show), `opt(`notify), // check box - _("Show &details"), info_on )), + _("Show &details"), info_on ))), `VSpacing(0.4), `HBox(`VSpacing(vertical_size), `HSpacing(0.1), @@ -280,7 +290,7 @@ else { UI::CloseDialog(); - UI::OpenDialog( `opt(`decorated), LayoutPopup (message, buttonbox, 2, false) ); + UI::OpenDialog( `opt(`decorated), LayoutPopup (message, buttonbox, vsize_no_details, false) ); UI::ReplaceWidget(`id(`info), `Empty() ); } return false; @@ -378,7 +388,7 @@ } else { - UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, 2, false) ); + UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, vsize_no_details, false) ); UI::ReplaceWidget(`id(`info), `Empty() ); } @@ -598,7 +608,7 @@ } else { - UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, 2, false) ); + UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, vsize_no_details, false) ); UI::ReplaceWidget(`id(`info), `Empty() ); } @@ -874,27 +884,39 @@ // Autoretry code boolean doing_auto_retry = false; - if (error_code == "IO_SOFT") + if (error_code == "IO_SOFT" || contains(["ftp", "sftp", "http", "https", "nfs", "smb"], url_scheme)) { // this a different file, reset the retry counter if (retry_url != url) { retry_url = url; - current_retry_attempt = retry_attempts; + current_retry_attempt = 0; } // is the maximum retry count reached? - if (current_retry_attempt > 0) + if (current_retry_attempt < retry_attempts) { - // reset the counter - current_retry_timeout = retry_timeout; + // reset the counter, use logarithmic back-off with maximum limit + current_retry_timeout = (current_retry_attempt < 10) ? + retry_timeout * (1 << current_retry_attempt) : retry_max_timeout; + + if (current_retry_timeout > retry_max_timeout) + { + current_retry_timeout = retry_max_timeout; + } + button_box = `VBox( - `Left(`Label(`id(`auto_retry), sformat(_("Automatically Retry After %1 Seconds"), current_retry_timeout))), + // failed download will be automatically retried after the timeout, %1 = formatted time (MM:SS format) + `Left(`Label(`id(`auto_retry), RetryLabel(current_retry_timeout))), button_box ); doing_auto_retry = true; } + else + { + y2warning("Max. autoretry count (%1) reached, giving up...", retry_attempts); + } } y2milestone("Autoretry: %1", doing_auto_retry); @@ -950,7 +972,7 @@ } else { - UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, 2, false) ); + UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, vsize_no_details, false) ); UI::ReplaceWidget(`id(`info), `Empty() ); } @@ -987,12 +1009,12 @@ r = `retry; // decrease attempt counter - current_retry_attempt = current_retry_attempt - 1; + current_retry_attempt = current_retry_attempt + 1; } else { // popup string - refresh the displayed counter - UI::ChangeWidget(`id(`auto_retry), `Label, sformat(_("Automatically Retry After %1 Seconds"), current_retry_timeout)); + UI::ChangeWidget(`id(`auto_retry), `Label, RetryLabel(current_retry_timeout)); } } else @@ -2086,6 +2108,7 @@ { // push button label UI::ChangeWidget(`id(`abort), `Label, _("Skip Autorefresh")); + UI::RecalcLayout(); } autorefreshing = true; @@ -2097,6 +2120,7 @@ if (!Mode::commandline() && UI::WidgetExists(`id(`abort))) { UI::ChangeWidget(`id(`abort), `Label, Label::AbortButton()); + UI::RecalcLayout(); } y2milestone("Autorefresh done"); @@ -2365,7 +2389,7 @@ `PushButton (`id (`ignore), `opt (`okButton), Label::IgnoreButton()) ); - UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, 1, false) ); + UI::OpenDialog( `opt(`decorated), LayoutPopup (message, button_box, vsize_no_details, false) ); any r = nil; Modified: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=57975&r1=57974&r2=57975&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Thu Jul 9 14:16:00 2009 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Jul 9 13:55:26 CEST 2009 - lslezak@suse.cz + +- Call UI::RecalcLayout() after changing push button label + (bnc#510282) +- Improved automatic retry after download failure (more attepts, + logarithmic back-off, retry download in more cases) (bnc#119813) +- 2.18.20 + +------------------------------------------------------------------- Wed Jul 08 11:29:44 CEST 2009 - aschnell@suse.de - added GetIntegerFeature() and SetIntegerFeature() to -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org