Hello community,
here is the log from the commit of package yast2
checked in at Tue Sep 9 19:12:56 CEST 2008.
--------
--- yast2/yast2.changes 2008-09-08 10:04:39.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2/yast2.changes 2008-09-09 10:35:36.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Sep 9 10:24:41 CEST 2008 - locilka@suse.cz
+
+- Modules 'Slides' and 'SlideShow' moved here from packager.
+- 2.17.19
+
+-------------------------------------------------------------------
Old:
----
yast2-2.17.18.tar.bz2
New:
----
yast2-2.17.19.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.Hir901/_old 2008-09-09 19:12:49.000000000 +0200
+++ /var/tmp/diff_new_pack.Hir901/_new 2008-09-09 19:12:49.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2 (Version 2.17.18)
+# spec file for package yast2 (Version 2.17.19)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2
-Version: 2.17.18
-Release: 2
+Version: 2.17.19
+Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-2.17.18.tar.bz2
+Source0: yast2-2.17.19.tar.bz2
Prefix: /usr
Source1: yast2-rpmlintrc
BuildRequires: perl-XML-Writer update-desktop-files yast2-devtools yast2-perl-bindings yast2-testsuite
@@ -66,8 +66,8 @@
# InstExtensionImage module moved here from installation
Conflicts: yast2-installation < 2.16.18
Conflicts: yast2-update < 2.16.1
-# ag_anyxml moved to yast2 from yast2-packager
-Conflicts: yast2-packager < 2.16.5
+# Modules 'Slides' and 'SlideShow' moved from yast2-packager to yast2
+Conflicts: yast2-packager < 2.17.12
Conflicts: yast2-mouse < 2.16.0
Conflicts: autoyast2-installation < 2.16.2
# country_long.ycp and country.ycp moved to yast2
@@ -149,7 +149,7 @@
Steffen Winterfeldt
%prep
-%setup -n yast2-2.17.18
+%setup -n yast2-2.17.19
%build
%{prefix}/bin/y2tool y2autoconf
@@ -253,6 +253,9 @@
%doc %{prefix}/share/doc/packages/yast2/types
%doc %{prefix}/share/doc/packages/yast2/wizard
%changelog
+* Tue Sep 09 2008 locilka@suse.cz
+- Modules 'Slides' and 'SlideShow' moved here from packager.
+- 2.17.19
* Mon Sep 08 2008 mzugec@suse.cz
- fix for testsuite
* Fri Sep 05 2008 mzugec@suse.cz
++++++ yast2-2.17.18.tar.bz2 -> yast2-2.17.19.tar.bz2 ++++++
++++ 6673 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-2.17.18/configure.in new/yast2-2.17.19/configure.in
--- old/yast2-2.17.18/configure.in 2008-09-08 09:37:43.000000000 +0200
+++ new/yast2-2.17.19/configure.in 2008-09-09 10:41:30.000000000 +0200
@@ -1,9 +1,9 @@
dnl configure.in for yast2
dnl
-dnl -- This file is generated by y2autoconf 2.17.0 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2, 2.17.18, http://bugs.opensuse.org/, yast2)
+AC_INIT(yast2, 2.17.19, http://bugs.opensuse.org/, yast2)
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.17.18"
+VERSION="2.17.19"
RPMNAME="yast2"
MAINTAINER="Jiri Srain "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-2.17.18/library/modules/Version.ycp new/yast2-2.17.19/library/modules/Version.ycp
--- old/yast2-2.17.18/library/modules/Version.ycp 2008-09-08 09:38:10.000000000 +0200
+++ new/yast2-2.17.19/library/modules/Version.ycp 2008-09-09 10:41:38.000000000 +0200
@@ -20,7 +20,7 @@
/**
* Version of the yast2 package
*/
-global string yast2 = "2.17.18";
+global string yast2 = "2.17.19";
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-2.17.18/library/packages/src/Makefile.am new/yast2-2.17.19/library/packages/src/Makefile.am
--- old/yast2-2.17.18/library/packages/src/Makefile.am 2008-04-10 08:47:39.000000000 +0200
+++ new/yast2-2.17.19/library/packages/src/Makefile.am 2008-09-09 10:21:51.000000000 +0200
@@ -4,16 +4,7 @@
YCPCFLAGS = -M ../../modules/ -M ../../wizard/src -M ../../system/src/ -M ../../types/src -M ../../commandline/src -M ../../xml/src -M ../../control/src
-module_DATA = \
- PackageLock.ycp \
- Package.ycp \
- PackageAI.ycp \
- PackageSystem.ycp \
- PackageCallbacks.ycp \
- PackageCallbacksInit.ycp \
- SignatureCheckCallbacks.ycp \
- SignatureCheckDialogs.ycp \
- Product.ycp
+module_DATA = $(wildcard [A-Z]*.ycp [A-Z]*.pm)
ynclude_DATA = \
common.ycp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-2.17.18/library/packages/src/SlideShow.ycp new/yast2-2.17.19/library/packages/src/SlideShow.ycp
--- old/yast2-2.17.18/library/packages/src/SlideShow.ycp 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-2.17.19/library/packages/src/SlideShow.ycp 2008-09-09 11:02:07.000000000 +0200
@@ -0,0 +1,982 @@
+/**
+ * Module: SlideShow.ycp
+ *
+ * Purpose: Slide show during installation
+ *
+ * Author: Stefan Hundhammer
+ * Stanislav Visnovsky
+ *
+ * $Id: SlideShow.ycp 50852 2008-09-09 09:02:07Z locilka $
+ *
+ * Usage:
+ * This is a generic module for handling global progress bar with optional slideshow/release notes etc.
+ *
+ * Global progress
+ * ===============
+ * The basic idea is that the progress consists of "stages" - during a new install,
+ * there are 3: disk preparation, image deployment and package installation.
+ *
+ * Before the first client using the unified progress, the stages need to be set
+ * up, e.g. :
+ *
+ * list< map > stages = [
+ * $[
+ * "name" : "disk",
+ * "description": _("Preparing disks..."),
+ * "value" : Mode::update() ? 0 : 120, // 2 minutes, who needs more? ;-)
+ * "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 );
+ *
+ * The function will calculate the partitioning of the unified progress based on
+ * estimate of a needed time. A stage can provide the estimate of time or an
+ * amount of data to be transferred (the constants used are based on assumption
+ * of 15 min install time and that the data are downloaded and written to disk).
+ * The logic is no rocket science as the only goal for a progress bar is to have
+ * it move somewhat regularly. Also, the function resets timers and other
+ * progress status information, including which parts are shown. See \ref SlideShow::Reset.
+ *
+ * A client using the new unified progress will do basically 2 things:
+ *
+ * 1) calls SlideShow::MoveToStage( stage-id )
+ * - this will move the global progress to a proper position for start of the
+ * stage and updates also the label ("description" entry in the map)
+ *
+ * 2) calls regularly SlideShow::StageProgress( new_percent, new_label )
+ * - new_percent is the progress inside of the current stage, the library will
+ * recompute this to get a global progress percents.
+ * - if new_label is nil, label is not updated.
+ *
+ * SlideShow dialogs
+ * =================
+ * // SlideShow language must be set before opening the dialog
+ * SlideShow::SetLanguage( Language::language );
+ * SlideShow::OpenDialog ();
+ * ... ...
+ * SlideShow::CloseDialog ();
+ *
+ * More functionality
+ * ==================
+ * The SlideShow dialog contains the following functionality:
+ * - global progress (see above)
+ * - subprogress for the current action (e.g. download a package, format
+ * disk, ...)
+ * - installation log
+ * - slide show support
+ * - optional package table
+ * - release notes viewer
+ */
+{
+ module "SlideShow";
+
+ textdomain "base";
+
+ import "Installation";
+ import "Label";
+ import "Stage";
+ import "String";
+ import "Wizard";
+ import "FileUtils";
+ import "Mode";
+ import "Popup";
+ import "Slides";
+
+ global integer total_time_elapsed = 0;
+ global integer start_time = -1;
+ global integer initial_recalc_delay = 60; // const - seconds before initially calculating remaining times
+ global integer recalc_interval = 30; // const - seconds between "remaining time" recalculations
+ global integer next_recalc_time = time();
+
+ global integer current_slide_no = 0;
+ global integer slide_start_time = 0;
+ global integer slide_min_interval = 30; // const - minimum seconds between slide changes
+ global integer slide_max_interval = 3*60; // const - maximum seconds between slide changes
+ global integer slide_interval = slide_min_interval;
+ global string language = "en";
+ global boolean widgets_created = false;
+ global boolean user_switched_to_details = false;
+ global boolean opened_own_wizard = false;
+ global string inst_log = "";
+ global boolean debug = false;
+
+ 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;
+ list<term> table_items = [];
+
+ boolean _show_table = false;
+
+ // properties of the current UI
+ global boolean textmode = UI::GetDisplayInfo()["TextMode"]:false;
+ global integer display_width = UI::GetDisplayInfo()["Width"]:0;
+
+ global string relnotes = nil;
+
+ global void ChangeSlideIfNecessary(); // forward declaration
+
+ /**
+ * Set the flag that user requested abort of the installation
+ * @param abort new state of the abort requested flag (true = abort requested)
+ */
+ global void SetUserAbort(boolean abort)
+ {
+ user_abort = abort;
+ }
+
+ /**
+ * Get the status of the flag that user requested abort of the installation
+ * @return boolean state of the abort requested flag (true = abort requested)
+ */
+ global boolean GetUserAbort()
+ {
+ return user_abort;
+ }
+
+ /**
+ * Start the internal (global) timer.
+ **/
+ global void StartTimer()
+ {
+ start_time = time();
+ }
+
+
+ /**
+ * Reset the internal (global) timer.
+ **/
+ global void ResetTimer()
+ {
+ start_time = time();
+ }
+
+
+ /**
+ * Stop the internal (global) timer and account elapsed time.
+ **/
+ global void StopTimer()
+ {
+ if ( start_time < 0 )
+ {
+ y2error( "StopTimer(): No timer running." );
+ return;
+ }
+
+ integer elapsed = time() - start_time;
+ start_time = -1;
+ total_time_elapsed = total_time_elapsed + elapsed;
+ y2debug("StopTimer(): Elapsed this time: %1 sec; total: %2 sec (%3:%4)",
+ elapsed, total_time_elapsed,
+ total_time_elapsed / 60, // min
+ total_time_elapsed % 60 ); // sec
+ }
+
+ /**
+ * Check if currently the "Details" page is shown
+ * @return true if showing details, false otherwise
+ **/
+ global boolean ShowingDetails()
+ {
+ return widgets_created && UI::WidgetExists(`detailsPage );
+ }
+
+
+ /**
+ * Check if currently the "Slide Show" page is shown
+ * @return true if showing details, false otherwise
+ **/
+ global boolean ShowingSlide()
+ {
+ return widgets_created && UI::WidgetExists(`slideShowPage );
+ }
+
+ /**
+ * Check if currently the "Release Notes" page is shown
+ * @return true if showing details, false otherwise
+ **/
+ global boolean ShowingRelNotes()
+ {
+ return widgets_created && UI::WidgetExists(`relNotesPage);
+ }
+
+ /**
+ * Restart the subprogress of the slideshow. This means the
+ * label will be set to \param text, value to 0.
+ * @param text new label for the subprogress
+ */
+ global void SubProgressStart(string text)
+ {
+ if ( UI::WidgetExists(`progressCurrentPackage ) )
+ {
+ UI::ChangeWidget(`progressCurrentPackage, `Value, 0);
+ UI::ChangeWidget(`progressCurrentPackage, `Label, text);
+ }
+
+ sub_progress_label = text;
+ }
+
+ /**
+ * Update status of subprogress of the slideshow. The new value will be set
+ * to \param value, if the \text is not nil, the label will be updated
+ * to this text as well. Otherwise label will not change.
+ * @param value new value for the subprogress
+ * @param text new label for the subprogress
+ */
+ global void SubProgress(integer value, string text)
+ {
+ if( UI::WidgetExists( `progressCurrentPackage ) )
+ {
+ UI::ChangeWidget(`progressCurrentPackage, `Value, value );
+ if( text != nil )
+ UI::ChangeWidget(`progressCurrentPackage, `Label, text );
+ }
+
+ sub_progress_value = value;
+ if (text != nil)
+ sub_progress_label = text;
+ }
+
+ /**
+ * Restart the global progress of the slideshow. This means the
+ * label will be set to \param text, value to 0.
+ * @param text new label for the global progress
+ */
+ global void GlobalProgressStart(string text)
+ {
+ total_progress_label = text;
+ if ( UI::WidgetExists(`progressTotal ) )
+ {
+ UI::ChangeWidget(`progressTotal, `Value, 0);
+ UI::ChangeWidget(`progressTotal, `Label, text );
+ }
+
+ total_progress_label = text;
+ total_progress_value = 0;
+ }
+
+ /**
+ * Update status of global progress of the slideshow. The new value will be set
+ * to \param value, if the \text is not nil, the label will be updated
+ * to this text as well. Otherwise label will not change.
+ * @param value new value for the global progress
+ * @param text new label for the global progress
+ */
+ void UpdateGlobalProgress(integer value, string new_text)
+ {
+ if( new_text != nil)
+ total_progress_label = new_text;
+ total_progress_value = value;
+
+ if ( UI::WidgetExists(`progressTotal ) )
+ {
+ UI::ChangeWidget(`progressTotal, `Value, value);
+ if( new_text != nil )
+ UI::ChangeWidget(`progressTotal, `Label, new_text );
+ }
+ else
+ y2milestone( "progressTotal widget missing" );
+
+ // update slide
+ if( ShowingSlide() )
+ {
+ ChangeSlideIfNecessary();
+ }
+ }
+
+ map > _stages = $[]; // list of the configured stages
+ map _current_stage = nil; // current stage
+
+ /**
+ * Return the description for the current stage.
+ * @return string localized string description
+ */
+ global string CurrentStageDescription()
+ {
+ return _current_stage["description"]:_("Installing...");
+ }
+
+ /**
+ * Move the global progress to the beginning of the given stage.
+ * @param stage_name id of the stage to move to
+ */
+ global void MoveToStage( string stage_name )
+ {
+ if( ! haskey( _stages, stage_name ) )
+ {
+ y2error( "Unknown progress stage \"%1\"", stage_name );
+ return;
+ }
+
+ _current_stage = _stages[stage_name]:nil;
+
+ y2milestone( "Moving to stage %1 (%2)", stage_name, _stages[stage_name, "start"]:0 );
+ // translators: default global progress bar label
+ UpdateGlobalProgress( _stages[stage_name, "start"]:0, _current_stage["description"]:_("Installing...") );
+ }
+
+ /**
+ * Update the global progress according to the progress in the current stage.
+ * The new value will be set to the per cent of the current stage according to \param value,
+ * if the \text is not nil, the label will be updated
+ * to this text as well. Otherwise label will not change.
+ * @param value new value for the stage progress
+ * @param text new label for the global progress
+ */
+ global void StageProgress( integer value, string text )
+ {
+ UpdateGlobalProgress( _current_stage["start"]:0 + (value * _current_stage["size"]:1 / 100), text );
+ }
+
+ /**
+ * Return the current global progress label.
+ * @return string current label
+ */
+ global void SetGlobalProgressLabel( string text )
+ {
+ total_progress_label = text;
+ if ( UI::WidgetExists(`progressTotal ) )
+ {
+ UI::ChangeWidget(`progressTotal, `Label, text);
+ }
+ }
+
+ /**
+ * Append message to the installation log.
+ * @param msg message to be added, without trailing eoln
+ */
+ global void AppendMessageToInstLog (string msg)
+ {
+ string log_line = "\n" + msg;
+ inst_log = inst_log + log_line;
+
+ if ( ShowingDetails() )
+ {
+ if ( UI::WidgetExists( `instLog ) )
+ UI::ChangeWidget(`instLog, `LastLine, log_line );
+ }
+ }
+
+
+
+ /**
+ * Check if the dialog is currently set up so the user could switch to the slide page.
+ **/
+ global boolean HaveSlideWidget()
+ {
+ return UI::WidgetExists(`dumbTab);
+ }
+
+
+ /**
+ * Check if the slide show is available. This must be called before trying
+ * to access any slides; some late initialization is done here.
+ **/
+ global void CheckForSlides()
+ {
+ Slides::CheckBasePath();
+
+ if ( Stage::initial () || Stage::cont () )
+ {
+ if ( Slides::HaveSlideSupport() )
+ {
+ y2milestone( "Display OK for slide show, loading" );
+ Slides::LoadSlides( language );
+ }
+ else
+ {
+ y2warning( "Disabling slide show - insufficient display capabilities" );
+ }
+ }
+ }
+
+
+ /**
+ * Set the slide show text.
+ * @param text
+ **/
+ void SetSlideText( string text )
+ {
+ if ( UI::WidgetExists(`slideText ) )
+ {
+ UI::ChangeWidget(`slideText, `Value, text );
+ }
+ }
+
+
+ /**
+ * Set the curent language. Must be called once during initialization.
+ **/
+ global void SetLanguage( string new_language )
+ {
+ language = new_language;
+ }
+
+
+ /**
+ * Create one single item for the CD statistics table
+ **/
+ global term TableItem( string id, string col1, string col2, string col3, string col4 )
+ {
+ return `item(`id( id ), col1, col2, col3, col4 );
+ }
+
+
+ /**
+ * Load a slide image + text.
+ * @param slide_no number of slide to load
+ **/
+ void LoadSlide( integer slide_no )
+ {
+ if ( slide_no > size( Slides::slides ) )
+ {
+ slide_no = 0;
+ }
+
+ current_slide_no = slide_no;
+
+ string slide_name = Slides::slides[slide_no]:"";
+ slide_start_time = time();
+
+ SetSlideText( Slides::LoadSlideFile( slide_name ) );
+ }
+
+
+ /**
+ * Check if the current slide needs to be changed and do that if
+ * necessary.
+ **/
+ global void ChangeSlideIfNecessary()
+ {
+ if ( current_slide_no + 1 < size( Slides::slides )
+ && time() > slide_start_time + slide_interval )
+ {
+ y2debug( "Loading slide #%1", current_slide_no + 2 );
+ LoadSlide( current_slide_no + 1 );
+ }
+ }
+
+ /**
+ * Add widgets for progress bar etc. around a slide show page
+ * @param page_id ID to use for this page (for checking with UI::WidgetExists() )
+ * @param page_contents The inner widgets (the page contents)
+ * @return A term describing the widgets
+ **/
+ term AddProgressWidgets( symbol page_id, term page_contents )
+ {
+ term widgets =
+ `HBox(`id( page_id ),
+ `HSpacing( 1 ),
+ `VBox(
+ `VWeight( 1, // lower layout priority
+ page_contents ),
+ // Progress bar for overall progress of software package installation
+ `ProgressBar(`id(`progressTotal ), total_progress_label, 100, total_progress_value)
+ // intentionally omitting `Label(`nextMedia) -
+ // too much flicker upon update (UI::RecalcLayout() ) on NCurses
+ ),
+ `HSpacing( 0.5 )
+ );
+
+ y2debug( "widget term: \n%1", widgets );
+ return widgets;
+ }
+
+
+ /**
+ * Construct widgets describing a page with the real slide show
+ * (the RichText / HTML page)
+ *
+ * @return A term describing the widgets
+ **/
+ term SlidePageWidgets()
+ {
+ term widgets =
+ AddProgressWidgets( `slideShowPage,
+ `RichText(`id(`slideText), "" )
+ );
+ y2debug( "widget term: \n%1", widgets );
+ return widgets;
+ }
+
+ term DetailsTableWidget()
+ {
+ return `VWeight( 1,
+ `Table( `id(`cdStatisticsTable), `opt(`keepSorting),
+ `header(
+ // Table headings for CD statistics during installation
+ _("Media"),
+ // Table headings for CD statistics during installation
+ `Right( _("Size") ),
+ // Table headings for CD statistics during installation
+ `Right( _("Packages") ),
+ // Table headings for CD statistics during installation
+ `Right( _("Time") )
+ ),
+ table_items
+ )
+ );
+ }
+
+ /**
+ * Construct widgets for the "details" page
+ *
+ * @return A term describing the widgets
+ **/
+ term DetailsPageWidgets()
+ {
+ term widgets =
+ AddProgressWidgets( `detailsPage,
+ `VBox( _show_table ? DetailsTableWidget() : `Empty(),
+ `VWeight( 1,
+ `LogView(`id(`instLog ), _("Actions performed:"), 6, 0 )
+ ),
+ `ProgressBar(`id(`progressCurrentPackage), sub_progress_label, 100, sub_progress_value )
+ )
+ );
+
+ y2debug( "widget term: \n%1", widgets );
+ return widgets;
+ }
+
+ /**
+ * Construct widgets for the "release notes" page
+ *
+ * @return A term describing the widgets
+ **/
+ term RelNotesPageWidgets() {
+ term widgets = AddProgressWidgets (`relNotesPage,
+ `RichText (relnotes)
+ );
+ y2debug( "widget term: \n%1", widgets );
+ return widgets;
+ }
+
+
+ /**
+ * Switch from the 'details' view to the 'slide show' view.
+ **/
+ global void SwitchToSlideView()
+ {
+ if ( ShowingSlide() )
+ return;
+
+ if ( UI::WidgetExists(`tabContents ) )
+ {
+ UI::ChangeWidget(`dumbTab, `CurrentItem, `showSlide );
+ UI::ReplaceWidget(`tabContents, SlidePageWidgets() );
+ // UpdateTotalProgress(false); // FIXME: this breaks other stages!
+ }
+ }
+
+ /**
+ * Rebuild the details page.
+ */
+ void RebuildDetailsView()
+ {
+ if ( UI::WidgetExists(`tabContents ) )
+ {
+ UI::ChangeWidget(`dumbTab, `CurrentItem, `showDetails );
+ UI::ReplaceWidget(`tabContents, DetailsPageWidgets() );
+ y2milestone( "Contents set to details" );
+ }
+
+ if ( UI::WidgetExists( `instLog ) && inst_log != "" )
+ UI::ChangeWidget(`instLog, `Value, inst_log );
+ }
+
+ /**
+ * Switch from the 'slide show' view to the 'details' view.
+ **/
+ global void SwitchToDetailsView()
+ {
+ if ( ShowingDetails() )
+ {
+ y2milestone( "Already showing details" );
+ return;
+ }
+ RebuildDetailsView();
+ }
+
+ /**
+ * Switch to the 'release notes' view.
+ **/
+ global void SwitchToReleaseNotesView()
+ {
+ if ( ShowingRelNotes() )
+ return;
+
+ if ( UI::WidgetExists(`tabContents ) )
+ {
+ UI::ChangeWidget(`dumbTab, `CurrentItem, `showRelNotes );
+ UI::ReplaceWidget(`tabContents, RelNotesPageWidgets() );
+ // UpdateTotalProgress(false);
+ }
+ }
+
+
+ /**
+ * Help text for the dialog
+ */
+ string HelpText()
+ {
+ // Help text while software packages are being installed (displayed only in rare cases)
+ string help_text = _("<p>Please wait while packages are being installed.</p>");
+
+ return help_text;
+ }
+
+
+ /**
+ * Rebuild the dialog. Useful if slides become available post-creating the dialog.
+ */
+ global void RebuildDialog()
+ {
+ term contents = `Empty();
+
+ if ( UI::HasSpecialWidget(`DumbTab) && Slides::HaveSlideSupport()
+ && Slides::HaveSlides() )
+ {
+ list tabs = [
+ // tab
+ `item(`id(`showSlide ), _("Slide Sho&w") ),
+ // tab
+ `item(`id(`showDetails ), _("&Details") )
+ ];
+ if (relnotes != nil && relnotes != "")
+ // tab
+ tabs = add (tabs, `item (`id (`showRelNotes), _("Release &Notes")));
+
+ contents =
+ `DumbTab(`id(`dumbTab ), tabs,
+ `VBox(
+ `VSpacing( 0.4 ),
+ `VWeight( 1, // lower layout priority
+ `HBox(
+ `HSpacing( 1 ),
+ `ReplacePoint(`id(`tabContents), SlidePageWidgets() ),
+ `HSpacing( 0.5 )
+ )
+ ),
+ `VSpacing( 0.4 )
+ )
+ );
+
+ }
+ else
+ {
+ contents = DetailsPageWidgets();
+ }
+
+ y2milestone( "SlideShow contents: %1", contents);
+
+ Wizard::SetContents(
+ // Dialog heading while software packages are being installed
+ _("Perform Installation"),
+ contents,
+ HelpText(),
+ false, false ); // has_back, has_next
+
+ widgets_created = true;
+
+ if ( ! Slides::HaveSlides() && ShowingSlide() )
+ SwitchToDetailsView();
+ }
+
+
+
+ /**
+ * Open the slide show base dialog with empty work area (placeholder for
+ * the image) and CD statistics.
+ **/
+ void OpenSlideShowBaseDialog()
+ {
+ if ( ! Wizard::IsWizardDialog() ) // If there is no Wizard dialog open already, open one
+ {
+ Wizard::OpenNextBackDialog();
+ opened_own_wizard = true;
+ }
+
+ UI::WizardCommand(`ProtectNextButton( false ) );
+ Wizard::RestoreBackButton();
+ Wizard::RestoreAbortButton();
+ Wizard::EnableAbortButton();
+ Wizard::RestoreNextButton();
+
+ Wizard::SetContents(
+ // Dialog heading while software packages are being installed
+ _("Package Installation"),
+ `Empty(), // Wait until InitPkgData() is called from outside
+ HelpText(),
+ false, false ); // has_back, has_next
+
+ RebuildDialog();
+ Wizard::SetTitleIcon("yast-sw_single");
+
+ // reset abort status
+ SetUserAbort(false);
+ }
+
+
+ /**
+ * Initialize generic data to default values
+ */
+ global void Reset()
+ {
+ current_slide_no = 0;
+ slide_start_time = 0;
+ total_time_elapsed = 0;
+ start_time = -1;
+ next_recalc_time = -1;
+ }
+
+
+
+ /**
+ * Process (slide show) input (button press).
+ **/
+ global void HandleInput( any button )
+ {
+ if ( button == `showDetails && ! ShowingDetails() )
+ {
+ y2milestone( "User asks to switch to details" );
+ user_switched_to_details = true ;
+ SwitchToDetailsView();
+ }
+ else if ( button == `showSlide && ! ShowingSlide() )
+ {
+ if ( Slides::HaveSlides() )
+ {
+ user_switched_to_details = false;
+ SwitchToSlideView();
+ LoadSlide( current_slide_no );
+ }
+ else
+ {
+ UI::ChangeWidget(`dumbTab, `CurrentItem, `showDetails );
+ }
+ }
+ else if ( button == `showRelNotes && ! ShowingRelNotes() )
+ {
+ user_switched_to_details = false;
+ SwitchToReleaseNotesView();
+ }
+ else if ( button == `debugHotkey )
+ {
+ debug = ! debug;
+ y2milestone( "Debug mode: %1", debug );
+ }
+ // note: `abort is handled in SlideShowCallbacks::HandleInput()
+ }
+
+
+ /**
+ * Check for user button presses and handle them. Generic handling to be used in the
+ * progress handlers.
+ **/
+ global void GenericHandleInput()
+ {
+ // any button = SlideShow::debug ? UI::PollInput() : UI::TimeoutUserInput( 10 );
+ any button = UI::PollInput();
+
+ // in case of cancel ask user if he really wants to quit installation
+ if ( button == `abort || button == `cancel )
+ {
+ if ( Mode::normal () )
+ {
+ SlideShow::SetUserAbort(Popup::AnyQuestion( Popup::NoHeadline(),
+ // popup yes-no
+ _("Do you really want\nto quit the installation?"),
+ Label::YesButton(),
+ Label::NoButton(),
+ `focus_no ));
+ }
+ else if ( Stage::initial () )
+ {
+ SlideShow::SetUserAbort(Popup::ConfirmAbort( `unusable ));
+ }
+ else // Mode::update (), Stage::cont ()
+ {
+ SlideShow::SetUserAbort(Popup::ConfirmAbort( `incomplete ));
+ }
+
+ if (SlideShow::GetUserAbort())
+ {
+ SlideShow::AppendMessageToInstLog (_("Aborted"));
+ }
+ }
+ else
+ {
+ SlideShow::HandleInput( button );
+ }
+ }
+
+ /**
+ * Open the slide show dialog.
+ **/
+ global void OpenDialog()
+ {
+ // call SlideShowCallbacks::InstallSlideShowCallbacks()
+ WFM::call("wrapper_slideshow_callbacks", ["InstallSlideShowCallbacks"]);
+
+ // check for slides first, otherwise dialogs will be built without them
+ CheckForSlides();
+
+ OpenSlideShowBaseDialog();
+
+ if ( Slides::HaveSlides() )
+ LoadSlide(0);
+ else
+ SwitchToDetailsView();
+ }
+
+
+ /**
+ * Close the slide show dialog.
+ **/
+ global void CloseDialog()
+ {
+ if ( opened_own_wizard )
+ Wizard::CloseDialog();
+
+ // call SlideShowCallbacks::RemoveSlideShowCallbacks()
+ WFM::call("wrapper_slideshow_callbacks", ["RemoveSlideShowCallbacks"]);
+ }
+
+ global void ShowTable()
+ {
+ if ( ShowingDetails() && ! _show_table )
+ {
+ _show_table = true;
+ RebuildDetailsView();
+ }
+ _show_table = true;
+ }
+
+ global void HideTable()
+ {
+ if ( ShowingDetails() && _show_table )
+ {
+ _show_table = false;
+ RebuildDetailsView();
+ }
+ _show_table = false;
+ }
+
+ global void UpdateTable( list<term> items )
+ {
+ table_items = items;
+ if( ShowingDetails() && _show_table )
+ {
+ UI::ChangeWidget( `id(`cdStatisticsTable), `Items, items );
+ }
+ }
+
+ /**
+ * Prepare the stages for the global progressbar. Will compute the total estimate of time and
+ * partition the global 100% to given stages based on their estimates. Can compute out of
+ * time and size to download.
+ *
+ * The stages description list example:
+ * [
+ * $[
+ * "name" : "disk",
+ * "description" : "Prepare disk...",
+ * "value" : 85, // disk speed can be guessed by the storage, thus passing time
+ * "units" : `sec
+ * ],
+ * $[
+ * "name" : "images";
+ * "description" : "Deploying images...",
+ * "value" : 204800, // amount of kb to be downloaded/installed
+ * "units" : `kb
+ * ],
+ * ]
+ */
+ global void Setup( list< map > stages )
+ {
+ // initiliaze the generic counters
+ Reset();
+
+ // gather total amount of time need
+ integer total_time = 0;
+
+ foreach( map stage, stages, {
+ if( stage["units"]:`sec == `sec )
+ {
+ total_time = total_time + stage["value"]:0;
+ }
+ else // assume kilobytes
+ {
+ // assume 15 minutes for installation of openSUSE 11.0, giving 3495 as the constant for kb/s
+ total_time = total_time + (stage["value"]:0 / 3495);
+ }
+ });
+
+ y2milestone( "Total estimated time: %1", total_time );
+
+ integer start = 0; // value where the current stage starts
+
+ _stages = $[]; // prepare a new stages description
+
+ // distribute the total time to stages as per cents
+ foreach( map stage, stages, {
+ if( stage["units"]:`sec == `sec )
+ {
+ stage["size"] = stage["value"]:0 * 100 / total_time;
+ stage["start"] = start;
+
+ start = start + stage["size"]:0;
+ }
+ else // assume kilobytes
+ {
+ // 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;
+ }
+
+ _stages[ stage["name"]:"" ] = stage;
+
+ // setup first stage
+ if( _current_stage == nil )
+ _current_stage = stage;
+ });
+
+ y2milestone( "Global progress bar: %1", _stages );
+ }
+
+ /**
+ * Returns the current setup defined by Setup().
+ *
+ * @return map > stages
+ * @see Setup()
+ * @struct $[ stage_name : $[ stage_setup ], ... ]
+ */
+ global map > GetSetup () {
+ return _stages;
+ }
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-2.17.18/library/packages/src/Slides.ycp new/yast2-2.17.19/library/packages/src/Slides.ycp
--- old/yast2-2.17.18/library/packages/src/Slides.ycp 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-2.17.19/library/packages/src/Slides.ycp 2008-09-09 10:36:31.000000000 +0200
@@ -0,0 +1,205 @@
+/**
+ * Module: Slides.ycp
+ *
+ * Purpose: Module to access slides from installation repository
+ *
+ * Author: Stefan Hundhammer
+ * Stanislav Visnovsky
+ *
+ */
+{
+ module "Slides";
+
+ textdomain "base";
+
+ import "FileUtils";
+ import "Installation";
+
+ // list of currently known slides, in the order they should be shown
+ global list<string> slides = [];
+ // base path to look for slides
+ global string slide_base_path = Installation::sourcedir + "/suse/setup/slide";
+ // path to look for texts of slides
+ global string slide_txt_path = "";
+ // path to look for images of slides
+ global string slide_pic_path = "";
+ // if no other language is configured, use this fallback
+ global string fallback_lang = "en";
+
+
+
+ /**
+ * Get a list of available slides (images) for the slide show.
+ * @param lang language of slides to load
+ * @return list slides
+ **/
+ list<string> GetSlideList( string lang )
+ {
+ list<string> slide_list = nil;
+
+ string txt_path = sformat( "%1/txt/%2", slide_base_path, lang );
+ if (FileUtils::Exists (txt_path)) {
+ slide_list = (list<string>) SCR::Read (.target.dir, txt_path );
+ }
+
+ if ( slide_list == nil )
+ {
+ y2error( "Directory %1 does not exist", txt_path );
+ if ( size( lang ) > 2 )
+ {
+ lang = substring( lang, 0, 2 );
+ txt_path = sformat( "%1/txt/%2", slide_base_path, lang );
+
+ if (FileUtils::Exists (txt_path)) {
+ slide_list = (list<string>) SCR::Read (.target.dir, txt_path );
+ }
+ }
+ }
+
+ if ( slide_list == nil )
+ {
+ y2milestone( "Slideshow directory %1 does not exist", txt_path );
+ }
+ else
+ {
+ y2milestone ("Using slides from '%1' (%2 slides)", txt_path, size (slide_list));
+
+ slide_list = sort( filter( string filename, slide_list, ``{
+ // Check for valid extensions - ignore editor save files and other leftover stuff
+ return regexpmatch( filename, ".*\.(rtf|RTF|html|HTML|htm|HTM)$" );
+ } ) );
+
+ y2debug( "GetSlideList(): Slides at %1: %2", txt_path, slide_list );
+ }
+
+ if ( slide_list != nil && size( slide_list ) > 0 ) // Slide texts found
+ {
+ slide_txt_path = txt_path;
+ slide_pic_path = slide_base_path + "/pic";
+
+ y2milestone ("Using TXT: %1, PIC: %2", slide_txt_path, slide_pic_path);
+ }
+ else // No slide texts found
+ {
+ y2debug( "No slides found at %1", txt_path );
+
+ // function calls itself!
+ if ( lang != fallback_lang )
+ {
+ y2debug( "Trying to load slides from fallback: %1", fallback_lang );
+ slide_list = GetSlideList( fallback_lang );
+ }
+ }
+
+ return slide_list;
+ }
+
+
+ /**
+ * Check if showing slides is supported.
+ *
+ * Not to be confused with HaveSlides() which checks if there are slides available.
+ * @return boolean if the current UI is capable of showing slides
+ **/
+ global boolean HaveSlideSupport()
+ {
+ map disp = UI::GetDisplayInfo();
+
+ if (disp != nil // This shouldn't happen, but who knows?
+ && disp["HasImageSupport"]:false
+ && disp["DefaultWidth"]:-1 >= 800
+ && disp["DefaultHeight"]:-1 >= 600
+ && disp["Depth"]:-1 >= 8 )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ /**
+ * Check if slides are available.
+ *
+ * Not to be confused with HaveSlideSupport() which checks
+ * if slides could be displayed if there are any.
+ * @return boolean if the loaded list of slides contains any slides
+ **/
+ global boolean HaveSlides()
+ {
+ return size( slides ) > 0;
+ }
+
+ /**
+ * Load one slide from files complete with image and textual description.
+ * Also adapt img links
+ * @param slide_name name of the slide
+ * @return true if OK, false if error
+ **/
+ global string LoadSlideFile( string slide_name )
+ {
+ string text_file_name = sformat ("%1/%2", slide_txt_path, slide_name );
+ // returns empty string if not found
+ string text = (string) SCR::Read( .target.string, [text_file_name, ""] );
+
+ //
+ // Fix <img src> tags: Replace image path with current slide_pic_path
+ //
+ while (true)
+ {
+ string replaced = regexpsub( text, "(.*)&imagedir;(.*)",
+ sformat("\\1%1\\2", slide_pic_path ) );
+ if ( replaced == nil ) break;
+ text = replaced;
+ }
+
+ return text;
+ }
+
+
+ /**
+ * Set the slide show directory
+ */
+ global void SetSlideDir( string dir )
+ {
+ slide_base_path = dir;
+
+ map tmp = (map) WFM::Read (.local.stat, slide_base_path);
+
+ if ( ! tmp["isdir"]:false )
+ {
+ y2error( "Using default path instead of %1", tmp );
+ slide_base_path = "/var/adm/YaST/InstSrcManager/tmp/CurrentMedia/suse/setup/slide";
+ }
+
+ y2milestone( "SetSlideDir: %1", slide_base_path );
+ }
+
+ /**
+ * Load slides for the given language and store them in the internal variables.
+ * @param language requested language of the slides
+ */
+ global void LoadSlides( string language )
+ {
+ slides = GetSlideList( language );
+ }
+
+ /**
+ * Check, if the base path set up for slides is valid (it exists and contains slides)
+ * @return boolean true, if it is possible to load the slides
+ */
+ global boolean CheckBasePath()
+ {
+ map tmp = (map) WFM::Read(.local.stat, slide_base_path);
+ if (! tmp["isdir"]:false)
+ {
+ y2error( "Using default path instead of %1", slide_base_path );
+ slide_base_path = "/var/adm/YaST/InstSrcManager/tmp/CurrentMedia/suse/setup/slide";
+
+ return false;
+ }
+ return true;
+ }
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-2.17.18/VERSION new/yast2-2.17.19/VERSION
--- old/yast2-2.17.18/VERSION 2008-09-05 14:23:52.000000000 +0200
+++ new/yast2-2.17.19/VERSION 2008-09-09 10:24:08.000000000 +0200
@@ -1 +1 @@
-2.17.18
+2.17.19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org