Author: visnov
Date: Tue Sep 2 11:11:07 2008
New Revision: 50556
URL: http://svn.opensuse.org/viewcvs/yast?rev=50556&view=rev
Log:
- unified progress bar during installation
Added:
trunk/installation/src/clients/inst_prepareprogress.ycp
Modified:
trunk/installation/package/yast2-installation.changes
trunk/installation/src/clients/inst_deploy_image.ycp
trunk/installation/src/modules/ImageInstallation.ycp
Modified: trunk/installation/package/yast2-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=50556&r1=50555&r2=50556&view=diff
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Tue Sep 2 11:11:07 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Sep 2 11:10:01 CEST 2008 - visnov@suse.cz
+
+- Use unified progressbar during installation (FATE #303860)
+
+-------------------------------------------------------------------
Thu Aug 28 15:19:57 CEST 2008 - locilka@suse.cz
- Using new ButtonBox widget.
Modified: trunk/installation/src/clients/inst_deploy_image.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_deploy_image.ycp?rev=50556&r1=50555&r2=50556&view=diff
==============================================================================
--- trunk/installation/src/clients/inst_deploy_image.ycp (original)
+++ trunk/installation/src/clients/inst_deploy_image.ycp Tue Sep 2 11:11:07 2008
@@ -6,6 +6,7 @@
import "SourceManager";
import "String";
import "PackageCallbacks";
+import "SlideShow";
textdomain "installation";
@@ -20,6 +21,8 @@
y2milestone ("Deploying images");
+SlideShow::MoveToStage( "images" );
+
list<string> images = ImageInstallation::ImageOrder ();
integer last_image = nil;
@@ -39,7 +42,7 @@
void SetProgress () {
integer percent = 100 * _current_step_in_subprogress / _current_subprogress_total;
- UI::ChangeWidget (`id ("one_image"), `Value, percent);
+ SlideShow::SubProgress( percent, nil );
}
void OverallProgressHandler (string id, integer current_step) {
@@ -67,7 +70,8 @@
// when deploying images, label is handled separately
if (id != "deploying_images") {
string new_label = ImageInstallation::GetProgressLayoutLabel (id);
- UI::ChangeWidget (`id ("one_image"), `Label, new_label);
+ SlideShow::SubProgressStart( new_label );
+ SlideShow::AppendMessageToInstLog( new_label );
}
_previous_id = id;
@@ -91,7 +95,7 @@
// update UI only if nr% has changed
if (_current_overall_progress > _last_overall_progress) {
_last_overall_progress = _current_overall_progress;
- UI::ChangeWidget (`id ("deploying_progress"), `Value, _current_overall_progress);
+ SlideShow::StageProgress(_current_overall_progress, nil);
}
}
@@ -111,20 +115,14 @@
map current_image = ImageInstallation::GetCurrentImageDetails();
if (_last_download_progress < percent) {
- string current_image_name = current_image["name"]:"";
- if (current_image_name == "") {
- UI::ChangeWidget (
- `id ("one_image"), `Label,
- sformat (_("Downloading image at speed %1/s"), String::FormatSize (bps_current))
- );
+ string image_info = current_image["name"]:"";
+ if (image_info == "") {
+ image_info = sformat (_("Downloading image at speed %1/s"), String::FormatSize (bps_current));
} else {
- UI::ChangeWidget (
- `id ("one_image"), `Label,
- sformat (_("Downloading image %1 at speed %2/s"), current_image_name, String::FormatSize (bps_current))
- );
+ image_info = sformat (_("Downloading image %1 at speed %2/s"), image_info, String::FormatSize (bps_current));
}
-
- UI::ChangeWidget (`id ("one_image"), `Value, percent);
+
+ SlideShow::SubProgress( percent, image_info );
integer current_image_nr = current_image["image_nr"]:0;
integer current_steps = 0;
@@ -170,18 +168,18 @@
if (x_progress == 0) {
string current_image_name = current_image["name"]:"";
if (current_image_name == "") {
- UI::ChangeWidget (`id ("one_image"), `Label, _("Deploying image..."));
+ current_image_name = _("Deploying image...");
} else {
- UI::ChangeWidget (`id ("one_image"), `Label, sformat (_("Deploying image %1..."), current_image_name));
+ current_image_name = sformat (_("Deploying image %1..."), current_image_name);
}
- // one image done
- } else if (x_progress == 100) {
- UI::ChangeWidget (`id ("one_image"), `Label, _("Image deployed"));
+ // one image done
+ SlideShow::SubProgressStart( current_image_name );
+ SlideShow::AppendMessageToInstLog( current_image_name );
}
// set current step
if (x_progress > _last_progress) {
- UI::ChangeWidget (`id ("one_image"), `Value, x_progress);
+ SlideShow::SubProgress( x_progress, nil );
_last_progress = x_progress;
integer current_image_nr = current_image["image_nr"]:0;
integer current_steps = 0;
@@ -202,6 +200,7 @@
ImageInstallation::AdjustProgressLayout ("deploying_images", (_steps_for_one_image * size (images)), _("Deploying Images..."));
+/*
Wizard::SetContents (
_("Deploying Installation Images"),
`VBox (
@@ -234,6 +233,7 @@
installation program has to download them first before they are deployed.</p>"),
false, false
);
+*/
ImageInstallation::StoreAllChanges();
Added: trunk/installation/src/clients/inst_prepareprogress.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_prepareprogress.ycp?rev=50556&view=auto
==============================================================================
--- trunk/installation/src/clients/inst_prepareprogress.ycp (added)
+++ trunk/installation/src/clients/inst_prepareprogress.ycp Tue Sep 2 11:11:07 2008
@@ -0,0 +1,62 @@
+/**
+ * Module: inst_prepareprogress.ycp
+ *
+ * Authors: Stanislav Visnovsky (visnov@suse.cz)
+ *
+ * Purpose:
+ * Set up the global progress for the installation.
+ *
+ * possible return values: `back, `abort `next
+ */
+
+{
+ textdomain "installation";
+ import "Installation";
+ import "Mode";
+ import "Packages";
+ import "Language";
+ import "SlideShow";
+ import "ImageInstallation";
+ import "StorageClients";
+ import "PackageSlideShow";
+
+ y2milestone("BEGIN of inst_prepareprogress.ycp");
+
+ Packages::SlideShowSetUp (Language::language);
+
+ SlideShow::OpenDialog();
+ PackageSlideShow::InitPkgData(true); // FIXME: this is odd!
+
+ ImageInstallation::FillUpImagesDetails();
+
+ list< map > stages = [
+ $[
+ "name" : "disk",
+ "description": _("Preparing disks..."),
+ "value" : Mode::update() ? 0 : 120, // FIXME: 2 minutes
+ "units" : `sec,
+ ],
+ $[
+ "name" : "images",
+ "description": _("Deploying Images..."),
+ "value" : ImageInstallation::TotalSize() / 1024, // kilobytes
+ "units" : `kb,
+ ],
+ $[
+ "name" : "packages",
+ "description": _("Installing Packages..."),
+ // here, we do a hack, because until images are deployed, we cannot determine how many
+ // packages will be really installed additionally
+ "value" : (PackageSlideShow::total_size_to_install - ImageInstallation::TotalSize()) / 1024 , // kilobytes
+ "units" : `kb,
+ ],
+ ];
+
+ SlideShow::Setup( stages );
+
+ symbol ret_val = `auto;
+
+ y2milestone("END of inst_prepareprogress.ycp");
+
+ return ret_val;
+}
Modified: trunk/installation/src/modules/ImageInstallation.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/modules/ImageInstallation.ycp?rev=50556&r1=50555&r2=50556&view=diff
==============================================================================
--- trunk/installation/src/modules/ImageInstallation.ycp (original)
+++ trunk/installation/src/modules/ImageInstallation.ycp Tue Sep 2 11:11:07 2008
@@ -25,6 +25,7 @@
import "Arch";
import "PackageCallbacks";
import "Popup";
+import "SlideShow";
textdomain "installation";
@@ -263,6 +264,7 @@
break;
}
} else {
+ SlideShow::HandleInput( ret );
sleep (200);
}
}
@@ -360,6 +362,19 @@
integer _current_image_from_imageset = -1;
+global integer TotalSize()
+{
+ integer sum = 0;
+
+ y2milestone( "Computing total images size from [%1], data %2", _image_order, images_details );
+ foreach( string image, _image_order, {
+ sum = sum + images_details[image,"size"]:0;
+ });
+
+ y2milestone( "Total images size: %1", sum );
+ return sum;
+}
+
void SetCurrentImageDetails (map img) {
_current_image_from_imageset = _current_image_from_imageset + 1;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org