Author: visnov Date: Thu Aug 28 15:52:39 2008 New Revision: 50459 URL: http://svn.opensuse.org/viewcvs/yast?rev=50459&view=rev Log: - make it work on running system - storage progress needs more work Modified: branches/tmp/visnov/progress/packager/SlideShow.ycp branches/tmp/visnov/progress/storage/StorageClients.ycp Modified: branches/tmp/visnov/progress/packager/SlideShow.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/visnov/progress/packager/SlideShow.ycp?rev=50459&r1=50458&r2=50459&view=diff ============================================================================== --- branches/tmp/visnov/progress/packager/SlideShow.ycp (original) +++ branches/tmp/visnov/progress/packager/SlideShow.ycp Thu Aug 28 15:52:39 2008 @@ -74,7 +74,12 @@ boolean user_abort = false; + // we need to remember the values for tab switching string total_progress_label = _("Installing..."); + string sub_progress_label = _("Installing..."); + integer total_progress_value = 0; + integer sub_progress_value =0; + boolean _show_table = false; // properties of the current UI @@ -169,6 +174,8 @@ UI::ChangeWidget(`progressCurrentPackage, `Value, 0); UI::ChangeWidget(`progressCurrentPackage, `Label, text); } + + sub_progress_label = text; } // update the subprogress widget @@ -180,6 +187,10 @@ if( text != nil ) UI::ChangeWidget(`progressCurrentPackage, `Label, text ); } + + sub_progress_value = value; + if (text != nil) + sub_progress_label = text; } // start a new global progress @@ -191,6 +202,9 @@ UI::ChangeWidget(`progressTotal, `Value, 0); UI::ChangeWidget(`progressTotal, `Label, text ); } + + total_progress_label = text; + total_progress_value = 0; } // update the global progress widget @@ -198,10 +212,10 @@ { if( new_text != nil) total_progress_label = new_text; + total_progress_value = value; if ( UI::WidgetExists(`progressTotal ) ) { - y2milestone( "Changing progressTotal to %1", value ); UI::ChangeWidget(`progressTotal, `Value, value); if( new_text != nil ) UI::ChangeWidget(`progressTotal, `Label, new_text ); @@ -236,7 +250,6 @@ global void StageProgress( integer value, string text ) { - y2milestone( "Stage progress: %1\nValue: %2", _current_stage, value ); UpdateGlobalProgress( _current_stage["start"]:0 + (value * _current_stage["size"]:1 / 100), text ); } @@ -1456,8 +1469,6 @@ **/ term AddProgressWidgets( symbol page_id, term page_contents ) { - y2milestone("Adding progress widgets"); - term widgets = `HBox(`id( page_id ), `HSpacing( 1 ), @@ -1465,7 +1476,7 @@ `VWeight( 1, // lower layout priority page_contents ), // Progress bar for overall progress of software package installation - `ProgressBar(`id(`progressTotal ), GetProgressLabel(), 100, 0) + `ProgressBar(`id(`progressTotal ), GetProgressLabel(), 100, total_progress_value) // intentionally omitting `Label(`nextMedia) - // too much flicker upon update (UI::RecalcLayout() ) on NCurses ), @@ -1527,7 +1538,7 @@ `VWeight( 1, `LogView(`id(`instLog ), _("Actions performed:"), 6, 0 ) ), - `ProgressBar(`id(`progressCurrentPackage), " ", 100, 0 ) + `ProgressBar(`id(`progressCurrentPackage), sub_progress_label, 100, sub_progress_value ) ) ); @@ -1556,7 +1567,7 @@ { UI::ChangeWidget(`dumbTab, `CurrentItem, `showSlide ); UI::ReplaceWidget(`tabContents, SlidePageWidgets() ); - UpdateTotalProgress(false); // FIXME: this breaks other stages! + // UpdateTotalProgress(false); // FIXME: this breaks other stages! } } @@ -1570,8 +1581,8 @@ y2milestone( "Contents set to details" ); } - UpdateTotalProgress(silent_check); - UpdateAllCdProgress(silent_check); + // UpdateTotalProgress(silent_check); + // UpdateAllCdProgress(silent_check); if ( UI::WidgetExists( `instLog ) && inst_log != "" ) UI::ChangeWidget(`instLog, `Value, inst_log ); @@ -1602,7 +1613,7 @@ { UI::ChangeWidget(`dumbTab, `CurrentItem, `showRelNotes ); UI::ReplaceWidget(`tabContents, RelNotesPageWidgets() ); - UpdateTotalProgress(false); + // UpdateTotalProgress(false); } } @@ -1698,7 +1709,6 @@ HelpText(), false, false ); // has_back, has_next - y2milestone( "OpenSlideShowBaseDialog calls RebuildDialog" ); RebuildDialog(true); Wizard::SetTitleIcon("yast-sw_single"); @@ -1857,8 +1867,8 @@ { if ( ! ShowingDetails() ) RebuildDialog(false); - else - UpdateTotalProgress(false); + //else + // UpdateTotalProgress(false); // current_slide_no = 0; - do not restart slideshow for next CD } @@ -1963,8 +1973,6 @@ SwitchToDetailsView(true); UpdateAllCdProgress(true); - - y2milestone( "OpenSlideShowDialog done" ); } @@ -2061,6 +2069,8 @@ // assume 15 minutes for installation of openSUSE 11.0, giving 3495 as the constant stage["size"] = ( stage["value"]:0 * 100 ) / 3495 / total_time; stage["start"] = start; + if( stage["size"]:0 + start > 100 ) + stage["size"] = 100 - start; start = start + stage["size"]:0; } Modified: branches/tmp/visnov/progress/storage/StorageClients.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/visnov/progress/storage/StorageClients.ycp?rev=50459&r1=50458&r2=50459&view=diff ============================================================================== --- branches/tmp/visnov/progress/storage/StorageClients.ycp (original) +++ branches/tmp/visnov/progress/storage/StorageClients.ycp Thu Aug 28 15:52:39 2008 @@ -31,7 +31,6 @@ integer f = 100 * cur / max; SlideShow::SubProgress( f, nil ); SlideShow::GenericHandleInput(); -// UI::ChangeWidget (`id(`progress), `Value, f); } global void EnablePopup() @@ -57,10 +56,9 @@ current_action = current_action + 1; - // assume every text change means another action + // hack: assume every text change means another action + y2milestone( "Current action: %1, total stage progress: %2", current_action, current_action * 100 / total_actions ); SlideShow::StageProgress( current_action * 100 / total_actions, nil ); - -// UI::ChangeWidget (`id(`progress), `Label, text); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org