Author: lslezak
Date: Fri Nov 9 12:26:04 2007
New Revision: 41915
URL: http://svn.opensuse.org/viewcvs/yast?rev=41915&view=rev
Log:
- display download callbacks in the main window, no flashing popups
(#338626)
Modified:
trunk/product-creator/package/yast2-product-creator.changes
trunk/product-creator/src/ProductCreator.ycp
trunk/product-creator/src/complex.ycp
Modified: trunk/product-creator/package/yast2-product-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-product-creator.changes?rev=41915&r1=41914&r2=41915&view=diff
==============================================================================
--- trunk/product-creator/package/yast2-product-creator.changes (original)
+++ trunk/product-creator/package/yast2-product-creator.changes Fri Nov 9 12:26:04 2007
@@ -12,6 +12,8 @@
(#335164)
- skip isolinux configuration when the architecture is not i386
or x86_64 (#335167)
+- display download callbacks in the main window, no flashing popups
+ (#338626)
-------------------------------------------------------------------
Fri Nov 2 11:13:58 CET 2007 - jsuchome@suse.cz
Modified: trunk/product-creator/src/ProductCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/ProductCreator.ycp?rev=41915&r1=41914&r2=41915&view=diff
==============================================================================
--- trunk/product-creator/src/ProductCreator.ycp (original)
+++ trunk/product-creator/src/ProductCreator.ycp Fri Nov 9 12:26:04 2007
@@ -2313,6 +2313,68 @@
y2debug("source_id: %1, url: %2, task: %3, error: %4, reason: %5", numeric_id, url, task, error, reason);
}
+global void InitDownload(string task)
+{
+ y2debug("InitDownload: %1", task);
+}
+
+global void DestDownload()
+{
+ y2debug("DestDownload");
+}
+
+global void StartDownload (string url, string localfile)
+{
+ // reformat the URL
+ string url_report = URL::FormatURL(URL::Parse(url), 60);
+
+ if (Mode::commandline()) {
+ CommandLine::PrintVerbose(url_report);
+ }
+ else
+ {
+ // change the label
+ UI::ChangeWidget(`id(`pb), `Label, sformat(_("Copying %1"), url_report));
+ }
+}
+
+
+global void StartDownloadEmpty (string url, string localfile)
+{
+ y2debug("StartDownload: %1", url);
+}
+
+global boolean ProgressDownload (integer percent, integer expected_size)
+{
+ return UI::PollInput() != `abort;
+}
+
+global void RedirectCallbacks()
+{
+ Pkg::CallbackSourceReportStart("ProductCreator::CallbackSourceReportStart");
+ Pkg::CallbackSourceReportProgress("ProductCreator::CallbackSourceReportProgress");
+ Pkg::CallbackSourceReportEnd("ProductCreator::CallbackSourceReportEnd");
+
+ Pkg::CallbackInitDownload ("ProductCreator::InitDownload");
+ Pkg::CallbackStartDownload ("ProductCreator::StartDownload");
+ Pkg::CallbackProgressDownload ("ProductCreator::ProgressDownload");
+ // use the standard callback handler
+ Pkg::CallbackDoneDownload ("PackageCallbacks::DoneDownload");
+ Pkg::CallbackDestDownload ("ProductCreator::DestDownload");
+}
+
+global void ResetCallbacks()
+{
+ Pkg::CallbackSourceReportStart("PackageCallbacks::CallbackSourceReportStart");
+ Pkg::CallbackSourceReportProgress("PackageCallbacks::CallbackSourceReportProgress");
+ Pkg::CallbackSourceReportEnd("PackageCallbacks::CallbackSourceReportEnd");
+
+ Pkg::CallbackInitDownload ("PackageCallbacks::InitDownload");
+ Pkg::CallbackStartDownload ("PackageCallbacks::StartDownload");
+ Pkg::CallbackProgressDownload ("PackageCallbacks::ProgressDownload");
+ Pkg::CallbackDoneDownload ("PackageCallbacks::DoneDownload");
+ Pkg::CallbackDestDownload ("PackageCallbacks::DestDownload");
+}
/**
* CopyPackages()
@@ -2328,13 +2390,10 @@
boolean ret = true;
- // disable source report callbacks - there is a progress dialog
- Pkg::CallbackSourceReportStart("ProductCreator::CallbackSourceReportStart");
- Pkg::CallbackSourceReportProgress("ProductCreator::CallbackSourceReportProgress");
- Pkg::CallbackSourceReportEnd("ProductCreator::CallbackSourceReportEnd");
-
y2milestone("Package summary: %1", toCopy);
+ Pkg::CallbackStartDownload ("ProductCreator::StartDownloadEmpty");
+
// copy the packages
foreach(integer source, map