[yast-commit] r40933 - in /trunk/online-update: VERSION package/yast2-online-update.changes src/OnlineUpdateCallbacks.ycp src/online_update_install.ycp
![](https://seccdn.libravatar.org/avatar/ccabc6c04379b11d036b089b67199614.jpg?s=120&d=mm&r=g)
Author: jsuchome Date: Mon Sep 17 10:54:38 2007 New Revision: 40933 URL: http://svn.opensuse.org/viewcvs/yast?rev=40933&view=rev Log: - register download callbacks (#309127) - 2.15.22 Modified: trunk/online-update/VERSION trunk/online-update/package/yast2-online-update.changes trunk/online-update/src/OnlineUpdateCallbacks.ycp trunk/online-update/src/online_update_install.ycp Modified: trunk/online-update/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/VERSION?rev=40933&r... ============================================================================== --- trunk/online-update/VERSION (original) +++ trunk/online-update/VERSION Mon Sep 17 10:54:38 2007 @@ -1 +1 @@ -2.15.21 +2.15.22 Modified: trunk/online-update/package/yast2-online-update.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/package/yast2-onlin... ============================================================================== --- trunk/online-update/package/yast2-online-update.changes (original) +++ trunk/online-update/package/yast2-online-update.changes Mon Sep 17 10:54:38 2007 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Sep 17 10:39:22 CEST 2007 - jsuchome@suse.cz + +- register download callbacks (#309127) +- 2.15.22 + +------------------------------------------------------------------- Fri Sep 14 21:12:47 CEST 2007 - jsuchome@suse.cz - show random time only in Mode::config (#310384) Modified: trunk/online-update/src/OnlineUpdateCallbacks.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/src/OnlineUpdateCal... ============================================================================== --- trunk/online-update/src/OnlineUpdateCallbacks.ycp (original) +++ trunk/online-update/src/OnlineUpdateCallbacks.ycp Mon Sep 17 10:54:38 2007 @@ -35,9 +35,9 @@ // last_callback = "PatchProgressCallback"; y2debug("PatchProgressCallback %1", num); - - if ( UI::WidgetExists( `id( `patchprogress ) ) ) { - UI::ChangeWidget( `id( `patchprogress ), `Value, num ); +Popup::Message (sformat ("PatchProgressCallback %1", num)); + if ( UI::WidgetExists( `id( `you_patch_progress ) ) ) { + UI::ChangeWidget( `id( `you_patch_progress ), `Value, num ); } if (aborted) return false; @@ -52,6 +52,12 @@ return true; } + global boolean ProgressDownloadCallback (integer percent, integer expected_size) + { + y2debug ("ProgressDownloadCallback %1, %2", percent, expected_size); + return PatchProgressCallback (percent); + } + global void MessageCallback( string patchname, string patchsummary, string message ) { last_callback = "MessageCallback"; @@ -111,17 +117,33 @@ { // progress log item (%1 is name of package) ProgressLog (sformat (_("Retrieving %1..."), name)); - if (UI::WidgetExists (`id (`patchprogress))) + if (UI::WidgetExists (`id (`you_patch_progress))) { - UI::ChangeWidget (`id (`patchprogress), `Label, + UI::ChangeWidget (`id (`you_patch_progress), `Label, // progress bar label _("Package Download Progress")); - UI::ChangeWidget (`id (`patchprogress), `Value, 0); + UI::ChangeWidget (`id (`you_patch_progress), `Value, 0); } last_callback = "StartProvide"; return true; } + global void StartDownload (string url, string localfile) + { + /* + // reformat the URL + string url_report = URL::FormatURL(URL::Parse(url), max_size); + + FIXME new text to ProgressLog? + // progress log item (%1 is name of file) + string message = sformat (_("Downloading: %1"), url_report); + ProgressLog (message); + // + progress to 0? + */ + last_callback = "StartDownload"; + } + + /** Callback for starting installation of a package. */ @@ -130,12 +152,12 @@ { // progress log item (%1 is name of package, %2 is summary) ProgressLog( sformat( _("Installing %1: \"%2\" "), name, summary ) ); - if (UI::WidgetExists (`id (`patchprogress))) + if (UI::WidgetExists (`id (`you_patch_progress))) { - UI::ChangeWidget (`id (`patchprogress), `Label, + UI::ChangeWidget (`id (`you_patch_progress), `Label, // progress bar label _("Package Installation Progress")); - UI::ChangeWidget (`id (`patchprogress), `Value, 0); + UI::ChangeWidget (`id (`you_patch_progress), `Value, 0); } last_callback = "StartPackage"; return true; @@ -166,8 +188,8 @@ { FinishLine (true); total_progress = total_progress + 1; - if ( UI::WidgetExists( `id( `progress ) ) ) { - UI::ChangeWidget( `id( `progress ), `Value, total_progress); + if ( UI::WidgetExists( `id( `you_total_progress ) ) ) { + UI::ChangeWidget( `id( `you_total_progress ), `Value, total_progress); } } last_callback = "DonePackage"; @@ -188,29 +210,35 @@ if (last_callback == "StartProvide") FinishLine (false); total_progress = total_progress + 1; - if ( UI::WidgetExists( `id( `progress ) ) ) { - UI::ChangeWidget( `id( `progress ), `Value, total_progress); + if ( UI::WidgetExists( `id( `you_total_progress ) ) ) { + UI::ChangeWidget( `id( `you_total_progress ), `Value, total_progress); } } last_callback = "DoneProvide"; return ret; } + global void DoneDownload (integer error_value, string error_text) { + PackageCallbacks::DoneDownload (error_value, error_text); if (last_callback != "FinishPatchDeltaProvide") + FinishLine (false); + last_callback = "DoneDownload"; + } + /** * callback for start of delta download */ global void StartDeltaDownload (string name, integer download_size) { // progress log item (%1 is name of delta RPM - if (last_callback == "StartProvide") + if (last_callback == "StartProvide" || last_callback == "StartDownload") ProgressLog ("\n" + indent); ProgressLog (sformat(_("Downloading delta RPM %1"), name)); - if (UI::WidgetExists (`id (`patchprogress))) + if (UI::WidgetExists (`id (`you_patch_progress))) { - UI::ChangeWidget (`id (`patchprogress), `Label, + UI::ChangeWidget (`id (`you_patch_progress), `Label, // progress bar label _("Delta RPM Download Progress")); - UI::ChangeWidget (`id (`patchprogress), `Value, 0); + UI::ChangeWidget (`id (`you_patch_progress), `Value, 0); } last_callback = "StartDeltaDownload"; } @@ -247,12 +275,12 @@ global void StartDeltaApply (string name) { // progress log item (%1 is name of delta RPM) ProgressLog (indent + sformat(_("Applying delta RPM: %1"), name)); - if (UI::WidgetExists (`id (`patchprogress))) + if (UI::WidgetExists (`id (`you_patch_progress))) { - UI::ChangeWidget (`id (`patchprogress), `Label, + UI::ChangeWidget (`id (`you_patch_progress), `Label, // progress bar label _("Delta RPM Application Progress")); - UI::ChangeWidget (`id (`patchprogress), `Value, 0); + UI::ChangeWidget (`id (`you_patch_progress), `Value, 0); } last_callback = "StartDeltaApply"; } @@ -263,8 +291,8 @@ */ global void ProgressDeltaApply (integer num) { y2debug ("ProgressDeltaApply: %1", num); - if (UI::WidgetExists (`id (`patchprogress))) { - UI::ChangeWidget (`id (`patchprogress), `Value, num); + if (UI::WidgetExists (`id (`you_patch_progress))) { + UI::ChangeWidget (`id (`you_patch_progress), `Value, num); } last_callback = "ProgressDeltaApply"; } @@ -292,12 +320,12 @@ if (last_callback == "StartProvide") ProgressLog ("\n" + indent); ProgressLog (sformat(_("Downloading patch RPM %1"), name)); - if (UI::WidgetExists (`id (`patchprogress))) + if (UI::WidgetExists (`id (`you_patch_progress))) { - UI::ChangeWidget (`id (`patchprogress), `Label, + UI::ChangeWidget (`id (`you_patch_progress), `Label, // progress bar label _("Patch RPM Download Progress")); - UI::ChangeWidget (`id (`patchprogress), `Value, 0); + UI::ChangeWidget (`id (`you_patch_progress), `Value, 0); } last_callback = "StartPatchDownload"; } @@ -343,12 +371,12 @@ y2milestone("ScriptStart: patch_name:%1, patch_version:%2, patch_arch:%3, script:%4, installation:%5", patch_name, patch_version, patch_arch, script_path, installation); string patch_full_name = PackageCallbacks::FormatPatchName(patch_name, patch_version, patch_arch); - if (UI::WidgetExists(`id(`patchprogress))) + if (UI::WidgetExists(`id(`you_patch_progress))) { - UI::ChangeWidget(`id(`patchprogress), `Label, + UI::ChangeWidget(`id(`you_patch_progress), `Label, // progress bar label _("Script Execution Progress")); - UI::ChangeWidget(`id(`patchprogress), `Value, 0); + UI::ChangeWidget(`id(`you_patch_progress), `Value, 0); } // log entry, %1 is name of the patch which contains the script @@ -399,16 +427,16 @@ { y2milestone("ScriptFinish"); - if (UI::WidgetExists(`id(`patchprogress))) + if (UI::WidgetExists(`id(`you_patch_progress))) { - UI::ChangeWidget(`id(`patchprogress), `Value, 100); + UI::ChangeWidget(`id(`you_patch_progress), `Value, 100); } FinishLine(true); total_progress = total_progress + 1; - if (UI::WidgetExists(`id( `progress ))) + if (UI::WidgetExists(`id( `you_total_progress ))) { - UI::ChangeWidget(`id(`progress), `Value, total_progress); + UI::ChangeWidget(`id(`you_total_progress), `Value, total_progress); } last_callback = "ScriptFinish"; @@ -448,7 +476,11 @@ Pkg::CallbackProgressPackage ("OnlineUpdateCallbacks::PatchProgressCallback"); Pkg::CallbackDonePackage( "OnlineUpdateCallbacks::DonePackage" ); - Pkg::CallbackResolvableReport ("OnlineUpdateCallbacks::MessageCallback"); + Pkg::CallbackResolvableReport("OnlineUpdateCallbacks::MessageCallback"); + + Pkg::CallbackStartDownload( "OnlineUpdateCallbacks::StartDownload" ); + Pkg::CallbackProgressDownload( "OnlineUpdateCallbacks::ProgressDownloadCallback" ); + Pkg::CallbackDoneDownload ("OnlineUpdateCallbacks::DoneDownload"); Pkg::CallbackMediaChange ("PackageCallbacks::MediaChange"); Modified: trunk/online-update/src/online_update_install.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/online-update/src/online_update_i... ============================================================================== --- trunk/online-update/src/online_update_install.ycp (original) +++ trunk/online-update/src/online_update_install.ycp Mon Sep 17 10:54:38 2007 @@ -27,11 +27,11 @@ `LogView(`id(`log), _("Progress Log"), 5, 0 ), `VSpacing( 0.5 ), // progress bar label - `ProgressBar( `id( `patchprogress ), _("Package Progress") ), + `ProgressBar( `id( `you_patch_progress ), _("Package Progress") ), `VSpacing( 0.2 ), `ReplacePoint (`id(`rpprogress), // progress bar label - `ProgressBar( `id( `progress ), _("Total Progress") ) + `ProgressBar( `id( `you_total_progress ), _("Total Progress") ) ), `VSpacing( 0.5 ), `VSpacing( 0.2 ) @@ -62,7 +62,7 @@ UI::ReplaceWidget (`id(`rpprogress), // progress bar label - `ProgressBar( `id( `progress ), _("Total Progress"), total_progress) + `ProgressBar( `id( `you_total_progress ), _("Total Progress"), total_progress) ); // FIXME no chance to get this after Commit (bug 188556) @@ -87,8 +87,8 @@ changed_packages = changed_packages || commit[0]:0 > 0; - UI::ChangeWidget( `id( `patchprogress ), `Value, 100 ); - UI::ChangeWidget( `id( `progress ), `Value, total_progress); + UI::ChangeWidget( `id( `you_patch_progress ), `Value, 100 ); + UI::ChangeWidget( `id( `you_total_progress ), `Value, total_progress); symbol ret = `next; if (!Stage::cont ()) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn.opensuse.org