Hello community,
here is the log from the commit of package yast2-packager
checked in at Tue Mar 11 18:19:48 CET 2008.
--------
--- yast2-packager/yast2-packager.changes 2008-03-05 17:47:45.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-packager/yast2-packager.changes 2008-03-11 13:31:20.306860000 +0100
@@ -1,0 +2,6 @@
+Tue Mar 11 13:28:00 CET 2008 - lslezak@suse.cz
+
+- display download rate in callbacks (#168935)
+- 2.16.24
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-2.16.23.tar.bz2
New:
----
yast2-packager-2.16.24.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.z18667/_old 2008-03-11 18:16:17.000000000 +0100
+++ /var/tmp/diff_new_pack.z18667/_new 2008-03-11 18:16:17.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-packager (Version 2.16.23)
+# spec file for package yast2-packager (Version 2.16.24)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,25 +12,25 @@
Name: yast2-packager
-Version: 2.16.23
+Version: 2.16.24
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-packager-2.16.23.tar.bz2
+Source0: yast2-packager-2.16.24.tar.bz2
Prefix: /usr
BuildRequires: gcc-c++ libxcrypt-devel perl-XML-Writer update-desktop-files yast2-country-data yast2-devtools yast2-slp yast2-testsuite yast2-xml
-# URL::MakeParamsFromMap and URL::MakeMapFromParams
-BuildRequires: yast2 >= 2.16.25
-# changed signatures of GPG calbacks
-BuildRequires: yast2-pkg-bindings >= 2.16.11
+# enhanced String::FormatRateMessage()
+BuildRequires: yast2 >= 2.16.34
+# changed signature of ProgressProvide calback
+BuildRequires: yast2-pkg-bindings >= 2.16.17
# Module: OneClickInstallStandard
Requires: perl-XML-Bare yast2-perl-bindings
# Newly added RPM
Requires: yast2-country-data >= 2.16.3
Requires: yast2-installation >= 2.15.12
-# New functions: GPG key management
-Requires: yast2-pkg-bindings >= 2.16.10
+# changed signature of ProgressProvide calback
+Requires: yast2-pkg-bindings >= 2.16.17
# URL::MakeParamsFromMap and URL::MakeMapFromParams
Requires: yast2 >= 2.16.25
# unzipping license file
@@ -70,7 +70,7 @@
Arvin Schnell
%prep
-%setup -n yast2-packager-2.16.23
+%setup -n yast2-packager-2.16.24
%build
%{prefix}/bin/y2tool y2autoconf
@@ -106,6 +106,9 @@
%{prefix}/lib/YaST2/servers_non_y2/ag_*
%doc %{prefix}/share/doc/packages/yast2-packager
%changelog
+* Tue Mar 11 2008 lslezak@suse.cz
+- display download rate in callbacks (#168935)
+- 2.16.24
* Wed Mar 05 2008 lslezak@suse.cz
- added Pkg::CallbackStartRefresh() and Pkg::CallbackDoneRefresh()
handlers, ask user to skip repository refresh at start up
++++++ yast2-packager-2.16.23.tar.bz2 -> yast2-packager-2.16.24.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/configure new/yast2-packager-2.16.24/configure
--- old/yast2-packager-2.16.23/configure 2008-03-05 17:47:10.000000000 +0100
+++ new/yast2-packager-2.16.24/configure 2008-03-11 13:30:54.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-packager 2.16.23.
+# Generated by GNU Autoconf 2.61 for yast2-packager 2.16.24.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -574,8 +574,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-packager'
PACKAGE_TARNAME='yast2-packager'
-PACKAGE_VERSION='2.16.23'
-PACKAGE_STRING='yast2-packager 2.16.23'
+PACKAGE_VERSION='2.16.24'
+PACKAGE_STRING='yast2-packager 2.16.24'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1197,7 +1197,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-packager 2.16.23 to adapt to many kinds of systems.
+\`configure' configures yast2-packager 2.16.24 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1268,7 +1268,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-packager 2.16.23:";;
+ short | recursive ) echo "Configuration of yast2-packager 2.16.24:";;
esac
cat <<\_ACEOF
@@ -1346,7 +1346,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-packager configure 2.16.23
+yast2-packager configure 2.16.24
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1360,7 +1360,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-packager $as_me 2.16.23, which was
+It was created by yast2-packager $as_me 2.16.24, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2181,7 +2181,7 @@
# Define the identity of the package.
PACKAGE='yast2-packager'
- VERSION='2.16.23'
+ VERSION='2.16.24'
cat >>confdefs.h <<_ACEOF
@@ -2409,7 +2409,7 @@
-VERSION="2.16.23"
+VERSION="2.16.24"
RPMNAME="yast2-packager"
MAINTAINER="Ladislav Slezak "
@@ -3304,7 +3304,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-packager $as_me 2.16.23, which was
+This file was extended by yast2-packager $as_me 2.16.24, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3347,7 +3347,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-packager config.status 2.16.23
+yast2-packager config.status 2.16.24
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/configure.in new/yast2-packager-2.16.24/configure.in
--- old/yast2-packager-2.16.23/configure.in 2008-03-05 17:47:06.000000000 +0100
+++ new/yast2-packager-2.16.24/configure.in 2008-03-11 13:30:50.000000000 +0100
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.16.6 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-packager, 2.16.23, http://bugs.opensuse.org/, yast2-packager)
+AC_INIT(yast2-packager, 2.16.24, http://bugs.opensuse.org/, yast2-packager)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.16.23"
+VERSION="2.16.24"
RPMNAME="yast2-packager"
MAINTAINER="Ladislav Slezak "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/src/modules/PackageCallbacks.ycp new/yast2-packager-2.16.24/src/modules/PackageCallbacks.ycp
--- old/yast2-packager-2.16.23/src/modules/PackageCallbacks.ycp 2008-03-05 17:47:00.000000000 +0100
+++ new/yast2-packager-2.16.24/src/modules/PackageCallbacks.ycp 2008-03-11 13:30:41.000000000 +0100
@@ -7,7 +7,7 @@
*
* Purpose: provides the default Callbacks for Pkg::
*
- * $Id: PackageCallbacks.ycp 45242 2008-03-05 16:46:59Z lslezak $
+ * $Id: PackageCallbacks.ycp 45346 2008-03-11 12:30:40Z lslezak $
*
*/
@@ -60,6 +60,9 @@
boolean autorefreshing = false;
boolean autorefreshing_aborted = false;
+ boolean textmode = UI::GetDisplayInfo()["TextMode"]:false;
+ integer display_width = UI::GetDisplayInfo()["Width"]:0;
+
//--------------------------------------------------------------------------
// defaults
@@ -880,7 +883,7 @@
void SetHeaderSourcePopup(string text)
{
// Qt UI uses bold font, the string must be shortened even more
- integer ui_adjustment = UI::GetDisplayInfo()["TextMode"]:false ? 0 : 5;
+ integer ui_adjustment = textmode ? 0 : 5;
if (size(text) > max_size - ui_adjustment)
{
@@ -894,7 +897,7 @@
void SetLabelSourcePopup(string text)
{
// Qt uses proportional font, the string might be longer
- integer ui_adjustment = UI::GetDisplayInfo()["TextMode"]:false ? 0 : 6;
+ integer ui_adjustment = textmode ? 0 : 6;
if (size(text) > max_size + ui_adjustment)
{
@@ -1626,6 +1629,8 @@
}
}
+ string download_file = "";
+
global void StartDownload (string url, string localfile)
{
y2milestone("Downloading %1 to %2", url, localfile);
@@ -1635,6 +1640,8 @@
// reformat the URL
string url_report = URL::FormatURL(URL::Parse(url), max_size);
+ // remember the URL
+ download_file = url_report;
// message in a progress popup
string message = sformat (_("Downloading: %1"), url_report);
@@ -1658,8 +1665,7 @@
}
}
-
- global boolean ProgressDownload (integer percent, integer expected_size)
+ global boolean ProgressDownload (integer percent, integer bps_avg, integer bps_current)
{
if (autorefreshing && autorefreshing_aborted)
{
@@ -1679,13 +1685,39 @@
}
}
else {
+ string msg_rate = "";
+
+ if (bps_current > 0)
+ {
+ // do not show the average download rate if the space is limited
+ if (textmode && display_width < 100)
+ {
+ bps_avg = -1;
+ }
+
+ string format = textmode ? ("%1 - " + download_file) : (download_file + " - %1");
+
+ // progress bar label, %1 is URL with optional download rate
+ msg_rate = sformat(_("Downloading: %1"), String::FormatRateMessage(format, bps_avg, bps_current));
+ }
+
if (FullScreen())
{
Progress::SubprogressValue(percent);
+
+ if (size(msg_rate) > 0)
+ {
+ Progress::SubprogressTitle(msg_rate);
+ }
}
else
{
UI::ChangeWidget (`id(`progress), `Value, percent);
+
+ if (size(msg_rate) > 0)
+ {
+ UI::ChangeWidget (`id(`progress), `Label, msg_rate);
+ }
}
boolean download_aborted = UI::PollInput () == `abort;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/src/modules/SlideShowCallbacks.ycp new/yast2-packager-2.16.24/src/modules/SlideShowCallbacks.ycp
--- old/yast2-packager-2.16.23/src/modules/SlideShowCallbacks.ycp 2007-08-08 09:13:34.000000000 +0200
+++ new/yast2-packager-2.16.24/src/modules/SlideShowCallbacks.ycp 2008-03-11 13:30:41.000000000 +0100
@@ -6,7 +6,7 @@
*
* Purpose: provides the Callbacks for SlideShow
*
- * $Id: SlideShowCallbacks.ycp 40068 2007-08-08 07:13:34Z lslezak $
+ * $Id: SlideShowCallbacks.ycp 45346 2008-03-11 12:30:40Z lslezak $
*
*/
@@ -92,19 +92,19 @@
/**
* during file providal
*/
- global boolean ProgressProvide( integer percent )
+ global boolean ProgressProvide(integer percent, integer bps_avg, integer bps_current)
{
if (_remote_provide)
{
- SlideShow::UpdateCurrentPackageProgress ( percent );
+ SlideShow::UpdateCurrentPackageRateProgress ( percent, bps_avg, bps_current );
}
HandleInput();
return ! SlideShow::GetUserAbort();
}
- global boolean ProgressDownload(integer percent, integer dummy)
+ global boolean ProgressDownload(integer percent, integer bps_avg, integer bps_current)
{
- return ProgressProvide(percent);
+ return ProgressProvide(percent, bps_avg, bps_current);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/src/modules/SlideShow.ycp new/yast2-packager-2.16.24/src/modules/SlideShow.ycp
--- old/yast2-packager-2.16.23/src/modules/SlideShow.ycp 2007-11-19 14:04:38.000000000 +0100
+++ new/yast2-packager-2.16.24/src/modules/SlideShow.ycp 2008-03-11 13:30:41.000000000 +0100
@@ -5,7 +5,7 @@
*
* Author: Stefan Hundhammer
*
- * $Id: SlideShow.ycp 41629 2007-10-30 08:36:25Z locilka $
+ * $Id: SlideShow.ycp 45346 2008-03-11 12:30:40Z lslezak $
*
*/
{
@@ -72,6 +72,10 @@
boolean user_abort = false;
+ // properties of the current UI
+ boolean textmode = UI::GetDisplayInfo()["TextMode"]:false;
+ integer display_width = UI::GetDisplayInfo()["Width"]:0;
+
global string relnotes = nil;
/**
@@ -692,6 +696,9 @@
return true;
}
+ string provide_name = "";
+ string provide_size = "";
+
global void SlideGenericProvideStart (string pkg_name, integer sz,
string pattern, boolean remote)
{
@@ -700,8 +707,21 @@
if ( UI::WidgetExists(`progressCurrentPackage) )
{
- UI::ChangeWidget(`progressCurrentPackage, `Label, remote ?
- sformat(_("Downloading %1 (download size %2)"), pkg_name, String::FormatSize(sz)) : pkg_name);
+ string provide_msg = "";
+
+ if (remote)
+ {
+ provide_name = pkg_name;
+ provide_size = String::FormatSize(sz);
+
+ provide_msg = sformat(_("Downloading %1 (download size %2)"), provide_name, provide_size);
+ }
+ else
+ {
+ provide_msg = pkg_name;
+ }
+
+ UI::ChangeWidget(`progressCurrentPackage, `Label, provide_msg);
UI::ChangeWidget(`progressCurrentPackage, `Value, 0);
}
//
@@ -1080,12 +1100,36 @@
*
* @param pkg_percent package percentage
**/
- global void UpdateCurrentPackageProgress( integer pkg_percent )
+ global void UpdateCurrentPackageProgress(integer pkg_percent)
{
if ( UI::WidgetExists(`progressCurrentPackage ) )
+ {
UI::ChangeWidget(`progressCurrentPackage, `Value, pkg_percent);
+ }
}
+ global void UpdateCurrentPackageRateProgress(integer pkg_percent, integer bps_avg, integer bps_current)
+ {
+ // update the download rate
+ if ( UI::WidgetExists(`progressCurrentPackage ) )
+ {
+ UI::ChangeWidget(`progressCurrentPackage, `Value, pkg_percent);
+
+ if (bps_current > 0)
+ {
+ // do not show the average download rate if the space is limited
+ if (textmode && display_width < 100)
+ {
+ bps_avg = -1;
+ }
+
+ string msg_rate = String::FormatRateMessage(provide_name + " - %1", bps_avg, bps_current);
+ msg_rate = sformat(_("Downloading %1 (download size %2)"), msg_rate, provide_size);
+
+ UI::ChangeWidget(`progressCurrentPackage, `Label, msg_rate);
+ }
+ }
+ }
/**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/src/modules/testUI.ycp new/yast2-packager-2.16.24/src/modules/testUI.ycp
--- old/yast2-packager-2.16.23/src/modules/testUI.ycp 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-2.16.24/src/modules/testUI.ycp 2008-03-11 10:39:13.000000000 +0100
@@ -0,0 +1,3 @@
+{
+ y2internal("UI: %1", UI::GetDisplayInfo());
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.16.23/VERSION new/yast2-packager-2.16.24/VERSION
--- old/yast2-packager-2.16.23/VERSION 2008-03-05 17:46:51.000000000 +0100
+++ new/yast2-packager-2.16.24/VERSION 2008-03-11 13:29:50.000000000 +0100
@@ -1 +1 @@
-2.16.23
+2.16.24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org