YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2008
- 26 participants
- 1212 discussions
[yast-commit] r50559 - in /trunk/yast2: VERSION package/yast2.changes
by locilka@svn.opensuse.org 02 Sep '08
by locilka@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: locilka
Date: Tue Sep 2 11:27:23 2008
New Revision: 50559
URL: http://svn.opensuse.org/viewcvs/yast?rev=50559&view=rev
Log:
2.17.16
Modified:
trunk/yast2/VERSION
trunk/yast2/package/yast2.changes
Modified: trunk/yast2/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=50559&r1=50558…
==============================================================================
--- trunk/yast2/VERSION (original)
+++ trunk/yast2/VERSION Tue Sep 2 11:27:23 2008
@@ -1 +1 @@
-2.17.15
+2.17.16
Modified: trunk/yast2/package/yast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=…
==============================================================================
--- trunk/yast2/package/yast2.changes (original)
+++ trunk/yast2/package/yast2.changes Tue Sep 2 11:27:23 2008
@@ -4,6 +4,7 @@
- Extended control file handling to accept 'execute' module
parameter to be called instead of 'name'/inst_'name'
(BNC #401319).
+- 2.17.16
-------------------------------------------------------------------
Thu Aug 28 11:55:05 CEST 2008 - locilka(a)suse.cz
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50558 - in /trunk/packager: package/ src/clients/ src/modules/
by visnov@svn.opensuse.org 02 Sep '08
by visnov@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: visnov
Date: Tue Sep 2 11:23:10 2008
New Revision: 50558
URL: http://svn.opensuse.org/viewcvs/yast?rev=50558&view=rev
Log:
Unified progress during installation
Added:
trunk/packager/src/modules/PackageSlideShow.ycp
trunk/packager/src/modules/Slides.ycp
Modified:
trunk/packager/package/yast2-packager.changes
trunk/packager/src/clients/inst_rpmcopy.ycp
trunk/packager/src/clients/sw_single.ycp
trunk/packager/src/modules/PackageInstallation.ycp
trunk/packager/src/modules/Packages.ycp
trunk/packager/src/modules/SlideShow.ycp
trunk/packager/src/modules/SlideShowCallbacks.ycp
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Tue Sep 2 11:23:10 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Sep 2 11:11:56 CEST 2008 - visnov(a)suse.cz
+
+- Use unified progress bar during installation (FATE #303860)
+
+-------------------------------------------------------------------
Wed Aug 27 13:28:07 CEST 2008 - locilka(a)suse.cz
- Initializing installation URL got from install.inf (RepoURL)
Modified: trunk/packager/src/clients/inst_rpmcopy.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_rpmcop…
==============================================================================
--- trunk/packager/src/clients/inst_rpmcopy.ycp (original)
+++ trunk/packager/src/clients/inst_rpmcopy.ycp Tue Sep 2 11:23:10 2008
@@ -27,6 +27,7 @@
import "PackageInstallation";
import "Packages";
import "SlideShow";
+ import "PackageSlideShow";
import "SlideShowCallbacks";
import "Popup";
import "Report";
@@ -661,7 +662,7 @@
}
list<string> failed = [];
- list<string> patterns = AutoinstData::post_patterns;
+ list<string> patterns = []; // WORKAROUND, REMOVE!!! AutoinstData::post_patterns;
/* set SoftLock to avoid the installation of recommended patterns (#159466) */
foreach( map<string,any> p, Pkg::ResolvableProperties ("", `pattern, ""), ``{
Pkg::ResolvableSetSoftLock( p["name"]:"", `pattern );
@@ -871,9 +872,10 @@
// initialize the package agent in continue mode
Packages::Init( true );
RestoreDiskCacheSettings ();
- }
- SlideShow::OpenSlideShowDialog ();
+ // in 1st stage, this is opened already
+ SlideShow::OpenDialog ();
+ }
Pkg::TargetLogfile (Installation::destdir + Directory::logdir + "/y2logRPM");
@@ -899,6 +901,13 @@
integer maxnumbercds = cdnumbers["maxnumbercds"]:10;
integer current_cd_no = cdnumbers["current_cd_no"]:1;
+ // re-initialize package information
+ PackageSlideShow::InitPkgData(true);
+ // we want the table
+ SlideShow::ShowTable();
+ // move the progress to the packages stage
+ SlideShow::MoveToStage("packages");
+
// install packages from CD current_cd_no to CD maxnumbercds
symbol result = InstallPackagesFromMedia (current_cd_no, maxnumbercds);
@@ -909,7 +918,7 @@
Pkg::PkgCommit (9999);
}
- SlideShow::CloseSlideShowDialog();
+ SlideShow::CloseDialog();
if (result != `abort)
{
Modified: trunk/packager/src/clients/sw_single.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/sw_single.y…
==============================================================================
--- trunk/packager/src/clients/sw_single.ycp (original)
+++ trunk/packager/src/clients/sw_single.ycp Tue Sep 2 11:23:10 2008
@@ -528,6 +528,19 @@
SlideShow::InitPkgData(true); // force reinitialization
SlideShow::OpenSlideShowDialog();
+ list< map<string,any> > stages = [
+ $[
+ "name" : "packages",
+ "description": _("Installing Packages..."),
+ "value" : SlideShow::total_size_to_install / 1024 , // kilobytes
+ "units" : `kb,
+ ],
+ ];
+
+ SlideShow::Setup( stages );
+
+ SlideShow::MoveToStage( "packages" );
+
import "PackageInstallation";
Pkg::TargetLogfile (Installation::destdir + Directory::logdir + "/y2logRPM");
integer oldvmlinuzsize = (integer) SCR::Read(.target.size, "/boot/vmlinuz");
Modified: trunk/packager/src/modules/PackageInstallation.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/PackageInst…
==============================================================================
--- trunk/packager/src/modules/PackageInstallation.ycp (original)
+++ trunk/packager/src/modules/PackageInstallation.ycp Tue Sep 2 11:23:10 2008
@@ -16,6 +16,7 @@
import "Directory";
import "Packages";
import "SlideShow";
+ import "PackageSlideShow";
import "Label";
@@ -100,7 +101,7 @@
list <integer> sources = Pkg::SourceGetCurrent (false);
integer source_id = sources[0]:0;
- SlideShow::InitPkgData(false);
+ PackageSlideShow::InitPkgData(false);
// structure: [ ["source_name", id] ]
list< list > src_list = Pkg::PkgMediaNames();
@@ -112,13 +113,13 @@
if (media_number == 0)
{
- SlideShow::SetCurrentCdNo (first_source, 1);
+ PackageSlideShow::SetCurrentCdNo (first_source, 1);
}
else
{
- SlideShow::SetCurrentCdNo (first_source, media_number);
+ PackageSlideShow::SetCurrentCdNo (first_source, media_number);
}
- SlideShow::UpdateAllCdProgress (false);
+ PackageSlideShow::UpdateAllCdProgress (false);
SlideShow::StartTimer();
boolean do_commit = true;
Added: trunk/packager/src/modules/PackageSlideShow.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/PackageSlid…
==============================================================================
--- trunk/packager/src/modules/PackageSlideShow.ycp (added)
+++ trunk/packager/src/modules/PackageSlideShow.ycp Tue Sep 2 11:23:10 2008
@@ -0,0 +1,1113 @@
+/**
+ * Module: PackageSlideShow.ycp
+ *
+ * Purpose: Module to access slides from installation repository
+ *
+ * Author: Stefan Hundhammer <sh(a)suse.de>
+ * Stanislav Visnovsky <visnov(a)suse.cz>
+ *
+ */
+{
+ module "PackageSlideShow";
+
+ textdomain "packager";
+
+ import "Slides";
+ import "SlideShow";
+ import "String";
+
+ global list<list<integer> > total_sizes_per_cd_per_src = []; // total sizes per inst-src: [ [42, 43, 44], [12, 13, 14] ]
+ global list<list<integer> > remaining_sizes_per_cd_per_src = []; // remaining sizes
+ global list<list<integer> > remaining_times_per_cd_per_src = []; // remaining times
+ global list<string> inst_src_names = []; // a list of strings identifying each repository
+ global list<list<integer> > total_pkg_count_per_cd_per_src = []; // number of pkgs per inst-src: [ [7, 5, 3], [2, 3, 4] ]
+ global list<list<integer> > remaining_pkg_count_per_cd_per_src = []; // remaining number of pkgs
+ global map<integer,integer> srcid_to_current_src_no = $[];
+ // the string is follwed by a media number, e.g. "Medium 1"
+ global string media_type = _("Medium");
+ global integer total_size_installed = 0;
+ global integer total_size_to_install = 0;
+ global integer min_time_per_cd = 10; // const - minimum time displayed per CD if there is something to install
+ global integer max_time_per_cd = 7200; // const - seconds to cut off predicted time (it's bogus anyway)
+ global integer size_column = 1; // const - column number for remaining size per CD
+ global integer pkg_count_column = 2; // const - column number for remaining number of packages per CD
+ global integer time_column = 3; // const - column number for remaining time per CD
+ global integer current_src_no = -1; // 1..n
+ global integer current_cd_no = -1; // 1..n
+ global integer next_src_no = -1;
+ global integer next_cd_no = -1;
+ global boolean last_cd = false;
+ global integer total_cd_count = 0;
+ global boolean unit_is_seconds = false; // begin with package sizes
+ global integer bytes_per_second = 1;
+ global boolean init_pkg_data_complete = false;
+
+ boolean debug = false; // more debugging info
+ string provide_name = ""; // currently downlaoded package name
+ string provide_size = ""; // currently downlaoded package size
+
+
+/*****************************************************************************/
+/*************** Formatting functions and helpers ***************************/
+/*****************************************************************************/
+
+ /**
+ * Get version info for a package (without build no.)
+ *
+ * @param pkg_name name of the package without path and ".rpm" extension
+ * @return version string
+ **/
+ global string StripReleaseNo( string pkg_name )
+ {
+ integer build_no_pos = findlastof (pkg_name, "-" ); // find trailing build no.
+
+ if ( build_no_pos != nil && build_no_pos > 0 )
+ {
+ // cut off trailing build no.
+ pkg_name = substring( pkg_name , 0, build_no_pos );
+ }
+
+ return pkg_name;
+ }
+
+ /**
+ * Get package file name from path
+ *
+ * @param pkg_name location of the package
+ * @return string package file name
+ **/
+ global string StripPath(string pkg_name)
+ {
+ if (pkg_name == nil)
+ {
+ return nil;
+ }
+
+ integer file_pos = findlastof(pkg_name, "/");
+
+ if (file_pos != nil && file_pos > 0 )
+ {
+ // return just the file name
+ pkg_name = substring(pkg_name, file_pos + 1);
+ }
+
+ return pkg_name;
+ }
+
+
+ /**
+ * set media type "CD" or "DVD"
+ */
+ global void SetMediaType (string new_media_type)
+ {
+ media_type = new_media_type;
+ }
+
+ /**
+ * Sum up all list items
+ **/
+ integer ListSum( list<integer> sizes )
+ {
+ integer sum = 0;
+
+ foreach( integer item, sizes, ``{
+ if ( item != -1 )
+ sum = sum + item;
+ });
+
+ return sum;
+ }
+
+
+ /**
+ * Sum up all positive list items, but cut off individual items at a maximum value.
+ * Negative return values indicate overflow of any individual item at "max_cutoff".
+ * In this case, the real sum is the absolute value of the return value.
+ **/
+ integer ListSumCutOff( list<integer> sizes, integer max_cutoff )
+ {
+ boolean overflow = false;
+ integer sum = 0;
+
+ foreach( integer item, sizes, ``{
+ if ( item > 0 )
+ {
+ if ( item > max_cutoff )
+ {
+ overflow = true;
+ sum = sum + max_cutoff;
+ }
+ else
+ sum = sum + item;
+ }
+ });
+
+ if ( overflow )
+ sum = -sum;
+
+ return sum;
+ }
+
+
+ integer TotalRemainingSize()
+ {
+ return ListSum( flatten( remaining_sizes_per_cd_per_src ) );
+ }
+
+
+ integer TotalRemainingTime()
+ {
+ return ListSumCutOff( flatten( remaining_times_per_cd_per_src ),
+ max_time_per_cd );
+ }
+
+
+ integer TotalRemainingPkgCount()
+ {
+ return ListSum( flatten( remaining_pkg_count_per_cd_per_src ) );
+ }
+
+
+ integer TotalInstalledSize()
+ {
+ return total_size_to_install - TotalRemainingSize();
+ }
+
+
+ /**
+ * Format an integer number as (at least) two digits; use leading zeroes if
+ * necessary.
+ * @return number as two-digit string
+ **/
+ string FormatTwoDigits( integer x )
+ {
+ return x < 10 && x >= 0 ?
+ sformat( "0%1", x ) :
+ sformat( "%1", x );
+ }
+
+
+ /**
+ * Format an integer seconds value with min:sec or hours:min:sec
+ **/
+ string FormatTime( integer seconds )
+ {
+ if ( seconds < 0 )
+ return "";
+
+ if ( seconds < 3600 ) // Less than one hour
+ {
+ return sformat( "%1:%2", FormatTwoDigits( seconds / 60 ), FormatTwoDigits( seconds % 60 ) );
+ }
+ else // More than one hour - we don't hope this will ever happen, but who knows?
+ {
+ integer hours = seconds / 3600;
+ seconds = seconds % 3600;
+ return sformat( "%1:%2:%3", hours, FormatTwoDigits( seconds / 60 ), FormatTwoDigits( seconds % 60 ) );
+ }
+ }
+
+
+ /**
+ * Format an integer seconds value with min:sec or hours:min:sec
+ *
+ * Negative values are interpreted as overflow - ">" is prepended and the
+ * absolute value is used.
+ **/
+ string FormatTimeShowOverflow( integer seconds )
+ {
+ string text = "";
+
+ if ( seconds < 0 ) // Overflow (indicated by negative value)
+ {
+ // When data throughput goes downhill (stalled network connection etc.),
+ // cut off the predicted time at a reasonable maximum.
+ // "%1" is a predefined maximum time.
+
+ text = sformat( _(">%1"), FormatTime( -seconds ) );
+ }
+ else
+ {
+ text = FormatTime( seconds );
+ }
+
+ return text;
+ }
+
+
+ /**
+ * Format number of remaining bytes to be installed as string.
+ * @param remaining bytes remaining, -1 for 'done'
+ * @return string human readable remaining time or byte / kB/ MB size
+ **/
+ string FormatRemainingSize( integer remaining )
+ {
+ if ( remaining < 0 )
+ {
+ // Nothing more to install from this CD (very concise - little space!!)
+ return _("Done.");
+ }
+ if ( remaining == 0 )
+ {
+ return "";
+ }
+
+ return String::FormatSize( remaining );
+ }
+
+
+ /**
+ * Format number of remaining packages to be installed as string.
+ * @param remaining bytes remaining, -1 for 'done'
+ * @return string human readable remaining time or byte / kB/ MB size
+ **/
+ string FormatRemainingCount( integer remaining )
+ {
+ if ( remaining < 0 )
+ {
+ // Nothing more to install from this CD (very concise - little space!!)
+ return _("Done.");
+ }
+ if ( remaining == 0 )
+ {
+ return "";
+ }
+
+ return sformat( "%1", remaining );
+ }
+
+
+ string FormatNextMedia()
+ {
+ string text = "";
+
+ if ( next_src_no >= 0 && next_cd_no >= 0 )
+ {
+ string next_media_name = sformat( "%1 %2 %3",
+ inst_src_names[ next_src_no ]:"",
+ media_type, next_cd_no+1 );
+
+ if ( unit_is_seconds )
+ {
+ // Status line informing about the next CD that will be used
+ // %1: Media type ("CD" / "DVD", ???)
+ // %2: Media name ("SuSE Linux Professional CD 2" )
+ // %3: Time remaining until this media will be needed
+ text = sformat( _("Next %1: %2 -- %3"), media_type, next_media_name,
+ FormatTime( remaining_times_per_cd_per_src[ current_src_no-1, current_cd_no-1 ]: 1) );
+ }
+ else
+ {
+ // Status line informing about the next CD that will be used
+ // %1: Media type ("CD" / "DVD", ???)
+ // %2: Media name ("SuSE Linux Professional CD 2" )
+ text = sformat( _("Next %1: %2"), media_type, next_media_name );
+ }
+ }
+
+ return text;
+ }
+
+/*****************************************************************************/
+/*********************** Computing Helpers **********************************/
+/*****************************************************************************/
+
+
+ /**
+ * Perform sanity check for correct initialzation etc.
+ * @param silent don't complain in log file
+ * @return true if OK, false if any error
+ **/
+ boolean SanityCheck( boolean silent )
+ {
+ return true; // FIXME!
+ if ( ! init_pkg_data_complete )
+ {
+ if ( ! silent )
+ {
+ y2error( "SlideShow::SanityCheck(): Slide show not correctly initialized: " +
+ "SlideShow::InitPkgData() never called!" );
+ }
+ return false;
+ }
+
+ if ( current_src_no < 1 || current_cd_no < 1 )
+ {
+ // nothing to install but something is going to be deleted, so it's OK
+ if (Pkg::IsAnyResolvable(`package, `to_remove))
+ {
+ return true;
+ }
+ else if (!silent)
+ {
+ y2error(-1, "SlideShow::SanityCheck(): Illegal values for current_src (%1) or current_cd (%2)",
+ current_src_no, current_cd_no );
+ y2milestone( "total sizes: %1", total_sizes_per_cd_per_src );
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Update internal bookkeeping: subtract size of one package from the
+ * global list of remaining sizes per CD
+ **/
+ void SubtractPackageSize( integer pkg_size )
+ {
+ integer remaining = remaining_sizes_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]: 1;
+ remaining = remaining - pkg_size;
+ total_size_installed = total_size_installed + pkg_size;
+
+ if ( remaining <= 0 )
+ {
+ // -1 is the indicator for "done with this CD" - not to be
+ // confused with 0 for "nothing to install from this CD".
+ remaining = -1;
+ }
+
+ remaining_sizes_per_cd_per_src [ current_src_no-1, current_cd_no-1 ] = remaining;
+ remaining_pkg_count_per_cd_per_src [ current_src_no-1, current_cd_no-1 ] =
+ remaining_pkg_count_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]:0 -1;
+
+ if ( unit_is_seconds )
+ {
+ integer seconds = 0;
+
+ if ( remaining > 0 && bytes_per_second > 0 )
+ seconds = remaining / bytes_per_second;
+
+ remaining_times_per_cd_per_src [ current_src_no-1, current_cd_no-1 ] = seconds;
+ }
+
+ if ( debug )
+ y2milestone( "SubtractPackageSize( %1 ) -> %2", pkg_size, remaining_sizes_per_cd_per_src);
+ }
+
+
+ /**
+ * Initialize internal pacakge data, such as remaining package sizes and
+ * times. This may not be called before the pkginfo server is up and
+ * running, so this cannot be reliably done from the constructor in all
+ * cases.
+ * @param force true to force reinitialization
+ **/
+ global void InitPkgData(boolean force)
+ {
+ if ( init_pkg_data_complete && ! force)
+ return;
+
+ // Reinititalize some globals (in case this is a second run)
+ total_size_installed = 0;
+ //total_time_elapsed = 0;
+ //start_time = -1;
+ current_src_no = -1; // 1..n
+ current_cd_no = -1; // 1..n
+ next_src_no = -1;
+ next_cd_no = -1;
+ last_cd = false;
+ unit_is_seconds = false; // begin with package sizes
+ bytes_per_second = 1;
+
+ list< list > src_list = Pkg::PkgMediaNames();
+ inst_src_names = maplist( list src, src_list, ``(src[0]:"CD") );
+
+ y2milestone ("Media names: %1", inst_src_names);
+
+ integer index = 0;
+
+ srcid_to_current_src_no = listmap( list src, src_list, {
+ index = index + 1;
+ return $[src[1]:-1 : index];
+ });
+
+ y2milestone ("Repository mapping information: %1", srcid_to_current_src_no );
+
+ total_sizes_per_cd_per_src = Pkg::PkgMediaSizes();
+ total_pkg_count_per_cd_per_src = Pkg::PkgMediaCount();
+
+
+ total_size_to_install = ListSum( flatten( total_sizes_per_cd_per_src ) );
+ y2milestone("total_size_to_install: %1", total_size_to_install);
+ remaining_sizes_per_cd_per_src = (list<list <integer> >) eval (total_sizes_per_cd_per_src);
+ remaining_pkg_count_per_cd_per_src = (list<list <integer> >) eval (total_pkg_count_per_cd_per_src);
+ total_cd_count = size( flatten( total_sizes_per_cd_per_src ) );
+ init_pkg_data_complete = true;
+
+ y2milestone( "SlideShow::InitPkgData() done; total_sizes_per_cd_per_src: %1", total_sizes_per_cd_per_src );
+ y2milestone( "SlideShow::InitPkgData(): pkg: %1", total_pkg_count_per_cd_per_src );
+
+ // RebuildDialog(true);
+ }
+
+ /**
+ * Try to figure out what media will be needed next
+ * and set next_src_no and next_cd_no accordingly.
+ **/
+ void FindNextMedia()
+ {
+ // Normally we would have to use current_cd_no+1,
+ // but since this uses 1..n and we need 0..n-1
+ // for array subscripts anyway, use it as it is.
+ next_cd_no = current_cd_no;
+ next_src_no = current_src_no-1;
+ last_cd = false;
+
+ while ( next_src_no < size( remaining_sizes_per_cd_per_src ) )
+ {
+ list<integer> remaining_sizes = remaining_sizes_per_cd_per_src[ next_src_no ]: [];
+
+ while ( next_cd_no < size( remaining_sizes ) )
+ {
+ if ( remaining_sizes[ next_cd_no ]:0 > 0 )
+ {
+ if ( debug )
+ y2milestone( "Next media: src: %1 CD: %2", next_src_no, next_cd_no );
+ return;
+ }
+ else
+ {
+ next_cd_no = next_cd_no + 1;
+ }
+ }
+
+ next_src_no = next_src_no + 1;
+ }
+
+ if ( debug )
+ y2milestone( "No next media - all done" );
+
+ next_src_no = -1;
+ next_cd_no = -1;
+ last_cd = true;
+ }
+
+
+ /**
+ * Set the current repository and CD number. Must be called for each CD change.
+ * src_no: 1...n
+ * cd_no: 1...n
+ **/
+ global void SetCurrentCdNo( integer src_no, integer cd_no )
+ {
+ if (cd_no == 0)
+ {
+ y2milestone("medium number 0, using medium number 1");
+ cd_no = 1;
+ }
+
+ y2milestone("SetCurrentCdNo() - src: %1 , CD: %2", src_no, cd_no);
+ current_src_no = srcid_to_current_src_no[src_no]:-1;
+ current_cd_no = cd_no;
+
+ SlideShow::CheckForSlides();
+ FindNextMedia();
+
+ if ( Slides::HaveSlides() && Slides::HaveSlideSupport() )
+ {
+ if ( ! SlideShow::HaveSlideWidget() )
+ {
+ SlideShow::RebuildDialog();
+
+ if ( SlideShow::user_switched_to_details )
+ SlideShow::SwitchToDetailsView();
+ }
+
+ if ( ! SlideShow::user_switched_to_details ) // Don't override explicit user request!
+ {
+ SlideShow::SwitchToSlideView();
+ }
+ }
+ else
+ {
+ if ( ! SlideShow::ShowingDetails() )
+ SlideShow::RebuildDialog();
+ }
+ }
+
+
+
+ /**
+ * Recalculate remaining times per CD based on package sizes remaining
+ * and data rate so far. Recalculation is only done each 'recalc_interval'
+ * seconds unless 'force_recalc' is set to 'true'.
+ *
+ * @param force_recalc force recalculation even if timeout not reached yet
+ * @return true if recalculated, false if not
+ **/
+ boolean RecalcRemainingTimes( boolean force_recalc )
+ {
+ if ( ! force_recalc
+ && time() < SlideShow::next_recalc_time )
+ {
+ // Nothing to do (yet) - simply return
+ return false;
+ }
+
+
+ // Actually do recalculation
+
+ integer elapsed = SlideShow::total_time_elapsed;
+
+ if ( SlideShow::start_time >= 0 )
+ {
+ elapsed = elapsed + time() - SlideShow::start_time;
+ }
+
+ if ( elapsed == 0 )
+ {
+ // Called too early - no calculation possible yet.
+ // This happens regularly during initialization, so an error
+ // message wouldn't be a good idea here.
+
+ return false;
+ }
+
+ // This is the real thing.
+
+ integer real_bytes_per_second = total_size_installed / elapsed;
+
+ // But this turns out to be way to optimistic - RPM gets slower and
+ // slower while installing. So let's add some safety margin to make
+ // sure initial estimates are on the pessimistic side - the
+ // installation being faster than initially estimated will be a
+ // pleasant surprise to the user. Most users don't like it the other
+ // way round.
+ //
+ // The "pessimistic factor" progressively decreases as the installation
+ // proceeds. It begins with about 1.7, i.e. the data transfer rate is
+ // halved to what it looks like initially. It decreases to 1.0 towards
+ // the end.
+
+ float pessimistic_factor = 1.0;
+
+ if ( total_size_to_install > 0 )
+ pessimistic_factor = 1.7 - tofloat( total_size_installed ) / tofloat( total_size_to_install );
+ bytes_per_second = tointeger( tofloat( real_bytes_per_second ) / pessimistic_factor + 0.5 );
+
+ if ( bytes_per_second < 1 )
+ bytes_per_second = 1;
+
+ remaining_times_per_cd_per_src = [];
+
+ // Recalculate remaining times for the individual CDs
+
+ foreach ( list<integer> remaining_sizes_list, remaining_sizes_per_cd_per_src,
+ ``{
+ list<integer> remaining_times_list = [];
+ integer remaining_time = -1;
+
+ foreach ( integer remaining_size, remaining_sizes_list,
+ ``{
+ remaining_time = remaining_size;
+
+ if ( remaining_size > 0 )
+ {
+ remaining_time = remaining_size / bytes_per_second;
+
+ if ( remaining_time < min_time_per_cd )
+ {
+ // It takes at least this long for the CD drive to spin up and
+ // for RPM to do _anything_. Times below this values are
+ // ridiculously unrealistic.
+ remaining_time = min_time_per_cd;
+ }
+ else if ( remaining_time > max_time_per_cd ) // clip off at 2 hours
+ {
+ // When data throughput goes downhill (stalled network connection etc.),
+ // cut off the predicted time at a reasonable maximum.
+ remaining_time = max_time_per_cd;
+ }
+ }
+ remaining_times_list = add( remaining_times_list, remaining_time );
+ });
+
+ remaining_times_per_cd_per_src = add( remaining_times_per_cd_per_src, remaining_times_list );
+ });
+
+
+ // Recalculate slide interval
+
+ if ( Slides::HaveSlides() )
+ {
+ integer slides_remaining = size( Slides::slides ) - SlideShow::current_slide_no - 1;
+
+ if ( slides_remaining > 0 )
+ {
+ // The remaining time for the rest of the slides depends on the
+ // remaining time for the current CD only: This is where the
+ // slide images and texts reside. Normally, only CD1 has slides
+ // at all, i.e. the slide show must be finished when CD1 is
+ // done.
+ //
+ // In addition to that, take elapsed time for current slide
+ // into account so all slides get about the same time.
+
+ integer time_remaining = remaining_times_per_cd_per_src[current_src_no-1, current_cd_no-1]:1 + time() - SlideShow::slide_start_time;
+ SlideShow::slide_interval = time_remaining / slides_remaining;
+ y2debug( "New slide interval: %1 - slides remaining: %2 - remaining time: %3",
+ SlideShow::slide_interval, slides_remaining, time_remaining );
+
+ if ( SlideShow::slide_interval < SlideShow::slide_min_interval )
+ {
+ SlideShow::slide_interval = SlideShow::slide_min_interval;
+ y2debug( "Resetting slide interval to min slide interval: %1", SlideShow::slide_interval );
+ }
+
+ if ( SlideShow::slide_interval > SlideShow::slide_max_interval )
+ {
+ SlideShow::slide_interval = SlideShow::slide_max_interval;
+ y2debug( "Resetting slide interval to max slide interval: %1", SlideShow::slide_interval );
+ }
+ }
+ }
+
+ SlideShow::next_recalc_time = time() + SlideShow::recalc_interval;
+
+ return true;
+ }
+
+ /**
+ * Switch unit to seconds if necessary and recalc everything accordingly.
+ * @return true if just switched from sizes to seconds, false otherwise
+ **/
+ boolean SwitchToSecondsIfNecessary()
+ {
+ if ( unit_is_seconds
+ || time() < SlideShow::start_time + SlideShow::initial_recalc_delay )
+ {
+ return false; // no need to switch
+ }
+
+ RecalcRemainingTimes( true ); // force recalculation
+ unit_is_seconds = true;
+
+ return true; // just switched
+ }
+
+
+
+/*****************************************************************************/
+/****************** Callbacks and progress bars *****************************/
+/*****************************************************************************/
+
+
+
+ /**
+ * Update progress widgets for the current CD: Label and ProgressBar.
+ * Use global statistics variables for that.
+ **/
+ global void UpdateCurrentCdProgress(boolean silent_check)
+ {
+ if ( ! SanityCheck( silent_check ) ) return;
+ if ( ! UI::WidgetExists(`cdStatisticsTable) ) return;
+
+
+ //
+ // Update table entries for current CD
+ //
+
+ integer remaining = remaining_sizes_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]:0;
+ UI::ChangeWidget(`id(`cdStatisticsTable ),
+ `Item( sformat( "cd(%1,%2)", current_src_no-1, current_cd_no-1), size_column ),
+ FormatRemainingSize( remaining ) );
+
+ UI::ChangeWidget(`id(`cdStatisticsTable ),
+ `Item( sformat( "cd(%1,%2)", current_src_no-1, current_cd_no-1), pkg_count_column ),
+ FormatRemainingCount( remaining_pkg_count_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]:0 ) );
+
+ if ( unit_is_seconds )
+ {
+ // Convert 'remaining' from size (bytes) to time (seconds)
+
+ remaining = remaining / bytes_per_second;
+
+ if ( remaining <= 0 )
+ remaining = 0;
+
+ if ( remaining > max_time_per_cd ) // clip off at 2 hours
+ {
+ // When data throughput goes downhill (stalled network connection etc.),
+ // cut off the predicted time at a reasonable maximum.
+ remaining = -max_time_per_cd;
+ }
+
+ UI::ChangeWidget(`id(`cdStatisticsTable ),
+ `Item( sformat( "cd(%1,%2)", current_src_no-1, current_cd_no-1), time_column ),
+ FormatTimeShowOverflow( remaining ) );
+ }
+
+
+ //
+ // Update "total" table entries
+ //
+
+ UI::ChangeWidget(`id( `cdStatisticsTable ),
+ `Item( "total", size_column ),
+ FormatRemainingSize( TotalRemainingSize() ) );
+
+ UI::ChangeWidget(`id( `cdStatisticsTable ),
+ `Item( "total", pkg_count_column ),
+ FormatRemainingCount( TotalRemainingPkgCount() ) );
+
+ if ( unit_is_seconds )
+ {
+ UI::ChangeWidget(`id( `cdStatisticsTable ), `Item( "total", time_column ),
+ FormatTimeShowOverflow( TotalRemainingTime() ) );
+
+ }
+ }
+
+ /**
+ * Update progress widgets
+ **/
+ void UpdateTotalProgress(boolean silent_check)
+ {
+ SlideShow::StageProgress( ( TotalInstalledSize() >> 10 ) * 100 / ( total_size_to_install >> 10 ), nil /*, SlideShow::GetProgressLabel()*/ );
+
+ UpdateCurrentCdProgress(silent_check);
+
+ if ( UI::WidgetExists(`nextMedia ) )
+ {
+ string nextMedia = FormatNextMedia();
+
+ if ( nextMedia != "" || last_cd )
+ {
+ UI::ChangeWidget(`nextMedia, `Value, nextMedia );
+ UI::RecalcLayout();
+ last_cd = false;
+ }
+ }
+ }
+
+
+ /**
+ * Returns a table widget item list for CD statistics
+ **/
+ list<term> CdStatisticsTableItems()
+ {
+ list<term> itemList = [];
+
+ //
+ // Add "Total" item - at the top so it is visible by default even if there are many items
+ //
+
+ {
+ // List column header for total remaining MB and time to install
+ string caption = _("Total");
+ integer remaining = TotalRemainingSize();
+ string rem_size = FormatRemainingSize( remaining );
+ string rem_count = FormatRemainingCount( TotalRemainingPkgCount() );
+ string rem_time = "";
+
+ if ( unit_is_seconds && bytes_per_second > 0 )
+ {
+ rem_time = FormatTimeShowOverflow( TotalRemainingTime() );
+ }
+
+ itemList = add( itemList, SlideShow::TableItem( "total", caption, " " + rem_size, " " + rem_count, " " + rem_time ) );
+ }
+
+
+ //
+ // Now go through all repositories
+ //
+
+ integer src_no = 0;
+
+ foreach ( list<integer> inst_src, remaining_sizes_per_cd_per_src, ``{
+ y2milestone( "src #%1: %2", src_no, inst_src );
+
+ if (ListSum(inst_src) > 0) // Ignore repositories from where there is nothing is to install
+ {
+ // Add heading for this repository
+ itemList = add( itemList, SlideShow::TableItem( sformat( "src(%1)", src_no ),
+ inst_src_names[ src_no ]:"", "", "", "" ) );
+
+ integer cd_no = 0;
+
+ foreach ( integer remaining, inst_src, ``{
+ if ( remaining > 0
+ || ( src_no+1 == current_src_no && cd_no+1 == current_cd_no ) ) // suppress current CD
+ {
+ string caption = sformat( "%1 %2", media_type, cd_no+1 ); // "CD 1" - column #0
+ string rem_size = FormatRemainingSize( remaining ); // column #1
+ string rem_count = FormatRemainingCount( remaining_pkg_count_per_cd_per_src[ src_no, cd_no ]:0 );
+ string rem_time = "";
+
+ if ( unit_is_seconds && bytes_per_second > 0 )
+ {
+ remaining = remaining / bytes_per_second;
+ rem_time = FormatTime( remaining ); // column #2
+
+ if ( remaining > max_time_per_cd ) // clip off at 2 hours
+ {
+ // When data throughput goes downhill (stalled network connection etc.),
+ // cut off the predicted time at a reasonable maximum.
+ // "%1" is a predefined maximum time.
+ rem_time = FormatTimeShowOverflow( -max_time_per_cd );
+ }
+ }
+
+ itemList = add( itemList,
+ SlideShow::TableItem( sformat("cd(%1,%2)", src_no, cd_no ), // ID
+ caption, " " + rem_size, " " + rem_count, " " + rem_time ) );
+ }
+
+ cd_no = cd_no + 1;
+ });
+ }
+
+ src_no = src_no + 1;
+ });
+
+ if ( debug )
+ {
+ y2milestone( "Remaining: %1", remaining_sizes_per_cd_per_src );
+ y2milestone( "CD table item list:\n%1", itemList );
+ }
+
+ return itemList;
+ }
+
+
+
+ /**
+ * Progress display update
+ * This is called via the packager's progress callbacks.
+ *
+ * @param pkg_percent package percentage
+ **/
+ global void UpdateCurrentPackageProgress(integer pkg_percent)
+ {
+ SlideShow::SubProgress( pkg_percent, nil );
+ }
+
+ // update the download rate
+ global void UpdateCurrentPackageRateProgress(integer pkg_percent, integer bps_avg, integer bps_current)
+ {
+ if( ! SlideShow::ShowingDetails() ) return;
+
+ string new_text = nil; // no update of the label
+ if (bps_current > 0)
+ {
+ // do not show the average download rate if the space is limited
+ if (SlideShow::textmode && SlideShow::display_width < 100)
+ {
+ bps_avg = -1;
+ }
+ new_text = String::FormatRateMessage(provide_name + " - %1", bps_avg, bps_current);
+ new_text = sformat(_("Downloading %1 (download size %2)"), new_text, provide_size);
+ }
+
+ SlideShow::SubProgress( pkg_percent, new_text );
+ }
+
+
+ /**
+ * Update progress widgets for all CDs.
+ * Uses global statistics variables.
+ **/
+ global void UpdateAllCdProgress(boolean silent_check)
+ {
+ if ( ! SanityCheck( silent_check ) ) return;
+
+ if ( unit_is_seconds )
+ RecalcRemainingTimes( true ); // force
+
+ SlideShow::UpdateTable( CdStatisticsTableItems() );
+ }
+
+
+ /**
+ * Return a CD's progress bar ID
+ * @param src_no number of the repository (from 0 on)
+ * @param cd_no number of the CD within that repository (from 0 on)
+ **/
+ string CdProgressId( integer src_no, integer cd_no )
+ {
+ return sformat( "Src %1 CD %2", src_no, cd_no );
+ }
+
+
+ /**
+ * package start display update
+ * - this is called at the end of a new package
+ *
+ * @param pkg_name package name
+ * @param deleting Flag: deleting (true) or installing (false) package?
+ **/
+ global void SlideDisplayDone ( string pkg_name,
+ integer pkg_size,
+ boolean deleting )
+ {
+ if ( ! deleting )
+ {
+ SubtractPackageSize( pkg_size );
+
+ if (SwitchToSecondsIfNecessary()
+ || RecalcRemainingTimes( false ) ) // no forced recalculation
+ {
+ y2debug( "Updating progress for all CDs" );
+ UpdateAllCdProgress(false);
+ }
+ else
+ {
+ UpdateCurrentCdProgress(false);
+ }
+
+ UpdateTotalProgress(false);
+
+ } // ! deleting
+
+ }
+
+
+
+ /**
+ * package start display update
+ * - this is called at the beginning of a new package
+ *
+ * @param pkg_name package name
+ * @param pkg_summary package summary (short description)
+ * @param deleting Flag: deleting (true) or installing (false) package?
+ **/
+ global void SlideDisplayStart( string pkg_name,
+ string pkg_summary,
+ integer pkg_size,
+ boolean deleting )
+ {
+ if ( ! SanityCheck( false ) ) return;
+
+ // remove path
+ pkg_name = StripPath(pkg_name);
+
+ // remove release and .rpm suffix
+ // pkg_name = StripReleaseNo( pkg_name ); // bug #154872
+
+ if ( deleting )
+ {
+ pkg_size = -1;
+
+ // This is a kind of misuse of insider knowledge: If there are packages to delete, this
+ // deletion comes first, and only then packages are installed. This, however, greatly
+ // distorts the estimated times based on data throughput so far: While packages are
+ // deleted, throughput is zero, and estimated times rise to infinity (they are cut off
+ // at max_time_per_cd to hide this). So we make sure the time spent deleting packages is
+ // not counted for estimating remaining times - reset the timer.
+ //
+ // Note: This will begin to fail when some day packages are deleted in the middle of the
+ // installaton process.
+
+ SlideShow::ResetTimer();
+ }
+
+ if ( pkg_summary == nil )
+ pkg_summary = "";
+
+ string msg = "";
+
+ if ( deleting )
+ {
+ // Heading for the progress bar for the current package
+ // while it is deleted. "%1" is the package name.
+ msg = sformat( _("Deleting %1"), pkg_name );
+ }
+ else
+ {
+ // package installation - summary text
+ // %1 is RPM name, %2 is installed (unpacked) size (e.g. 6.20MB)
+ msg = sformat( _("%1 (installed size %2)"), pkg_name, String::FormatSize( pkg_size ) );
+ }
+
+
+ //
+ // Update package progress bar
+ //
+ SlideShow::SubProgress( 0, msg );
+
+ // Update global progress bar
+ string rem_string = "";
+ integer tot_rem_t = TotalRemainingTime();
+
+ rem_string = ( unit_is_seconds && bytes_per_second > 0 && tot_rem_t > 0) ?
+ sformat("%1 / %2", FormatRemainingSize(TotalRemainingSize()), FormatTimeShowOverflow(tot_rem_t))
+ : FormatRemainingSize(TotalRemainingSize());
+ SlideShow::SetGlobalProgressLabel( SlideShow::CurrentStageDescription() + sformat(_(" (Remaining: %1)"), rem_string));
+
+ //
+ // Update (user visible) installation log
+ //
+ SlideShow::AppendMessageToInstLog( sformat( _("Installing %1"), msg) );
+
+ //
+ // Update the current slide if applicable
+ //
+ if ( SlideShow::ShowingSlide() )
+ {
+ SlideShow::ChangeSlideIfNecessary();
+ }
+ }
+
+
+ global void SlideGenericProvideStart (string pkg_name, integer sz,
+ string pattern, boolean remote)
+ {
+ if ( ! SanityCheck( false ) ) return;
+ if ( ! SlideShow::ShowingDetails() ) return;
+
+ 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;
+ }
+
+ SlideShow::SubProgress( 0, provide_msg );
+
+ //
+ // Update (user visible) installation log
+ // for remote download only
+ //
+
+ if( ! remote ) return;
+
+ y2milestone( "Package '%1' is remote", pkg_name );
+
+ // message in the installatino log, %1 is package name,
+ // %2 is package size
+ SlideShow::AppendMessageToInstLog( sformat (pattern, pkg_name, String::FormatSize (sz)) );
+ }
+
+ global void SlideDeltaApplyStart (string pkg_name) {
+ if ( ! SanityCheck( false ) ) return;
+ if ( ! SlideShow::ShowingDetails() ) return;
+
+ SlideShow::SubProgress( 0, pkg_name );
+
+ SlideShow::AppendMessageToInstLog( sformat (_("Applying delta RPM: %1"), pkg_name) );
+ }
+
+
+ /**
+ * Package providal start
+ */
+ global void SlideProvideStart (string pkg_name, integer sz, boolean remote)
+ {
+ // message in the installatino log, %1 is package name,
+ // %2 is package size
+ SlideGenericProvideStart (pkg_name, sz, _("Downloading %1 (download size %2)"),
+ remote);
+ }
+
+
+
+}
Modified: trunk/packager/src/modules/Packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.yc…
==============================================================================
--- trunk/packager/src/modules/Packages.ycp (original)
+++ trunk/packager/src/modules/Packages.ycp Tue Sep 2 11:23:10 2008
@@ -25,6 +25,7 @@
import "ProductFeatures";
import "ProductControl";
import "Report";
+import "Slides";
import "SlideShow";
import "SpaceCalculation";
import "String";
@@ -1070,7 +1071,7 @@
// try to download only slides that are needed (by selected language)
// no images are cached
string search_for_dir = sformat ("/%1/setup/slide/", datadir);
- FindAndCopySlideDirWithoutCallbacks(our_slidedir, source, search_for_dir, lang_long, lang_short, SlideShow::fallback_lang);
+ FindAndCopySlideDirWithoutCallbacks(our_slidedir, source, search_for_dir, lang_long, lang_short, Slides::fallback_lang);
// fallback solution disabled
/*
@@ -1090,7 +1091,7 @@
*/
y2milestone ("Setting up the slide directory local copy: %1", our_slidedir);
- SlideShow::SetSlideDir (our_slidedir);
+ Slides::SetSlideDir (our_slidedir);
if (load_release_notes (source))
{
Modified: trunk/packager/src/modules/SlideShow.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SlideShow.y…
==============================================================================
--- trunk/packager/src/modules/SlideShow.ycp (original)
+++ trunk/packager/src/modules/SlideShow.ycp Tue Sep 2 11:23:10 2008
@@ -1,9 +1,10 @@
/**
* Module: SlideShow.ycp
*
- * Purpose: Slide show during package installation
+ * Purpose: Slide show during installation
*
* Author: Stefan Hundhammer <sh(a)suse.de>
+ * Stanislav Visnovsky <visnov(a)suse.cz>
*
* $Id$
*
@@ -20,104 +21,60 @@
import "String";
import "Wizard";
import "FileUtils";
+ import "Mode";
+ import "Popup";
+ import "Slides";
- global list<list<integer> > total_sizes_per_cd_per_src = []; // total sizes per inst-src: [ [42, 43, 44], [12, 13, 14] ]
- global list<list<integer> > remaining_sizes_per_cd_per_src = []; // remaining sizes
- global list<list<integer> > remaining_times_per_cd_per_src = []; // remaining times
- global list<string> inst_src_names = []; // a list of strings identifying each repository
- global list<list<integer> > total_pkg_count_per_cd_per_src = []; // number of pkgs per inst-src: [ [7, 5, 3], [2, 3, 4] ]
- global list<list<integer> > remaining_pkg_count_per_cd_per_src = []; // remaining number of pkgs
- global map<integer,integer> srcid_to_current_src_no = $[];
- // the string is follwed by a media number, e.g. "Medium 1"
- global string media_type = _("Medium");
- global integer total_size_installed = 0;
- global integer total_size_to_install = 0;
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 min_time_per_cd = 10; // const - minimum time displayed per CD if there is something to install
- global integer max_time_per_cd = 7200; // const - seconds to cut off predicted time (it's bogus anyway)
- global integer size_column = 1; // const - column number for remaining size per CD
- global integer pkg_count_column = 2; // const - column number for remaining number of packages per CD
- global integer time_column = 3; // const - column number for remaining time per CD
- global integer next_recalc_time = -1;
- global integer current_src_no = -1; // 1..n
- global integer current_cd_no = -1; // 1..n
- global integer next_src_no = -1;
- global integer next_cd_no = -1;
- global boolean last_cd = false;
- global integer total_cd_count = 0;
- global boolean unit_is_seconds = false; // begin with package sizes
- global integer bytes_per_second = 1;
+ 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 string slide_base_path = Installation::sourcedir + "/suse/setup/slide";
-
- global string slide_txt_path = "";
- global string slide_pic_path = "";
- global string fallback_lang = "en";
global integer slide_interval = slide_min_interval;
- global list<string> slides = [];
global string language = Language::language;
- global boolean init_pkg_data_complete = false;
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;
+ 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
- boolean textmode = nil;
- integer display_width = nil;
+ global boolean textmode = UI::GetDisplayInfo()["TextMode"]:false;
+ global integer display_width = UI::GetDisplayInfo()["Width"]:0;
global string relnotes = nil;
+
+ global void ChangeSlideIfNecessary(); // forward declaration
/**
- * return the value of text_mode (true for ncurses)
- */
- global boolean GetTextMode () {
-
- if (textmode == nil)
- {
- map display_info = UI::GetDisplayInfo ();
- textmode = display_info["TextMode"]:false;
- }
- return textmode;
- }
-
- /**
- * return the value of screen width
+ * Set the flag that user requested abort of the installation
+ * @param abort new state of the abort requested flag (true = abort requested)
*/
- global integer GetDisplayWidth () {
-
- if (display_width == nil)
- {
- map display_info = UI::GetDisplayInfo ();
- display_width = display_info["Width"]:0;
- }
- return display_width;
- }
-
- /**
- * Constructor
- **/
- global void SlideShow()
- {
- y2milestone( "SlideShow constructor" );
- next_recalc_time = time();
- }
-
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;
@@ -161,12 +118,11 @@
total_time_elapsed % 60 ); // sec
}
-
/**
* Check if currently the "Details" page is shown
* @return true if showing details, false otherwise
**/
- boolean ShowingDetails()
+ global boolean ShowingDetails()
{
return widgets_created && UI::WidgetExists(`detailsPage );
}
@@ -176,653 +132,164 @@
* Check if currently the "Slide Show" page is shown
* @return true if showing details, false otherwise
**/
- boolean ShowingSlide()
+ global boolean ShowingSlide()
{
- return widgets_created && UI::WidgetExists(`slidesPage );
+ return widgets_created && UI::WidgetExists(`slideShowPage );
}
/**
* Check if currently the "Release Notes" page is shown
* @return true if showing details, false otherwise
**/
- boolean ShowingRelNotes()
+ global boolean ShowingRelNotes()
{
return widgets_created && UI::WidgetExists(`relNotesPage);
}
-
- /**
- * Sum up all list items
- **/
- integer ListSum( list<integer> sizes )
- {
- integer sum = 0;
-
- foreach( integer item, sizes, ``{
- if ( item != -1 )
- sum = sum + item;
- });
-
- return sum;
- }
-
-
- /**
- * Sum up all positive list items, but cut off individual items at a maximum value.
- * Negative return values indicate overflow of any individual item at "max_cutoff".
- * In this case, the real sum is the absolute value of the return value.
- **/
- integer ListSumCutOff( list<integer> sizes, integer max_cutoff )
- {
- boolean overflow = false;
- integer sum = 0;
-
- foreach( integer item, sizes, ``{
- if ( item > 0 )
- {
- if ( item > max_cutoff )
- {
- overflow = true;
- sum = sum + max_cutoff;
- }
- else
- sum = sum + item;
- }
- });
-
- if ( overflow )
- sum = -sum;
-
- return sum;
- }
-
-
- integer TotalRemainingSize()
- {
- return ListSum( flatten( remaining_sizes_per_cd_per_src ) );
- }
-
-
- integer TotalRemainingTime()
- {
- return ListSumCutOff( flatten( remaining_times_per_cd_per_src ),
- max_time_per_cd );
- }
-
-
- integer TotalRemainingPkgCount()
- {
- return ListSum( flatten( remaining_pkg_count_per_cd_per_src ) );
- }
-
-
- integer TotalInstalledSize()
- {
- return total_size_to_install - TotalRemainingSize();
- }
-
-
- /**
- * Format an integer number as (at least) two digits; use leading zeroes if
- * necessary.
- * @return number as two-digit string
- **/
- string FormatTwoDigits( integer x )
- {
- return x < 10 && x >= 0 ?
- sformat( "0%1", x ) :
- sformat( "%1", x );
- }
-
-
- /**
- * Format an integer seconds value with min:sec or hours:min:sec
- **/
- string FormatTime( integer seconds )
- {
- if ( seconds < 0 )
- return "";
-
- if ( seconds < 3600 ) // Less than one hour
- {
- return sformat( "%1:%2", FormatTwoDigits( seconds / 60 ), FormatTwoDigits( seconds % 60 ) );
- }
- else // More than one hour - we don't hope this will ever happen, but who knows?
- {
- integer hours = seconds / 3600;
- seconds = seconds % 3600;
- return sformat( "%1:%2:%3", hours, FormatTwoDigits( seconds / 60 ), FormatTwoDigits( seconds % 60 ) );
- }
- }
-
-
- /**
- * Format an integer seconds value with min:sec or hours:min:sec
- *
- * Negative values are interpreted as overflow - ">" is prepended and the
- * absolute value is used.
- **/
- string FormatTimeShowOverflow( integer seconds )
- {
- string text = "";
-
- if ( seconds < 0 ) // Overflow (indicated by negative value)
- {
- // When data throughput goes downhill (stalled network connection etc.),
- // cut off the predicted time at a reasonable maximum.
- // "%1" is a predefined maximum time.
-
- text = sformat( _(">%1"), FormatTime( -seconds ) );
- }
- else
- {
- text = FormatTime( seconds );
- }
-
- return text;
- }
-
-
- /**
- * Format number of remaining bytes to be installed as string.
- * @param remaining bytes remaining, -1 for 'done'
- * @return string human readable remaining time or byte / kB/ MB size
- **/
- string FormatRemainingSize( integer remaining )
- {
- if ( remaining < 0 )
- {
- // Nothing more to install from this CD (very concise - little space!!)
- return _("Done.");
- }
- if ( remaining == 0 )
- {
- return "";
- }
-
- return String::FormatSize( remaining );
- }
-
-
- /**
- * Format number of remaining packages to be installed as string.
- * @param remaining bytes remaining, -1 for 'done'
- * @return string human readable remaining time or byte / kB/ MB size
- **/
- string FormatRemainingCount( integer remaining )
- {
- if ( remaining < 0 )
- {
- // Nothing more to install from this CD (very concise - little space!!)
- return _("Done.");
- }
- if ( remaining == 0 )
- {
- return "";
- }
-
- return sformat( "%1", remaining );
- }
-
-
- string FormatTotalRemaining()
- {
- // (Short!) headline for the total remaining time or MBs to install
- return sformat( _("Remaining:\n%1"),
- unit_is_seconds ?
- FormatTimeShowOverflow( TotalRemainingTime() ) :
- FormatRemainingSize( TotalRemainingSize() ) );
- }
-
-
- string FormatNextMedia()
- {
- string text = "";
-
- if ( next_src_no >= 0 && next_cd_no >= 0 )
- {
- string next_media_name = sformat( "%1 %2 %3",
- inst_src_names[ next_src_no ]:"",
- media_type, next_cd_no+1 );
-
- if ( unit_is_seconds )
- {
- // Status line informing about the next CD that will be used
- // %1: Media type ("CD" / "DVD", ???)
- // %2: Media name ("SuSE Linux Professional CD 2" )
- // %3: Time remaining until this media will be needed
- text = sformat( _("Next %1: %2 -- %3"), media_type, next_media_name,
- FormatTime( remaining_times_per_cd_per_src[ current_src_no-1, current_cd_no-1 ]: 1) );
- }
- else
- {
- // Status line informing about the next CD that will be used
- // %1: Media type ("CD" / "DVD", ???)
- // %2: Media name ("SuSE Linux Professional CD 2" )
- text = sformat( _("Next %1: %2"), media_type, next_media_name );
- }
- }
-
- return text;
- }
-
-
- /**
- * Normalize a CD size list like [ [ 111, 0, 333 ], [ 211, 222, 0 ] ]
- * to a flat single list that doesn't contain any 0 items (but -1 if there are any)
- * If the resulting list would be completely empty, use a simple fallback: [ 1 ]
- **/
- list<integer> FlattenNoZeroes( list< list<integer> > sizesPerSourceList )
- {
- list <integer> normalizedList =
- filter( integer item, flatten( sizesPerSourceList ),
- ``{ return item != 0; });
-
- if ( size( normalizedList ) < 1 )
- normalizedList = [ 1 ];
-
- return normalizedList;
- }
-
-
/**
- * Get a list of available slides (images) for the slide show.
- * @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 )
- {
- y2debug( "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.
- **/
- boolean HaveSlideSupport()
+ * 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)
{
- 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
+ if ( UI::WidgetExists(`progressCurrentPackage ) )
{
- return false;
+ UI::ChangeWidget(`progressCurrentPackage, `Value, 0);
+ UI::ChangeWidget(`progressCurrentPackage, `Label, text);
}
+
+ sub_progress_label = text;
}
-
-
- /**
- * Check if slides are available.
- *
- * Not to be confused with HaveSlideSupport() which checks
- * if slides could be displayed if there are any.
- **/
- boolean HaveSlides()
- {
- return size( slides ) > 0;
- }
-
-
- /**
- * Check if the dialog is currently set up so the user could switch to the slide page.
- **/
- 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()
+ * 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)
{
- slides = [];
-
- map tmp = (map) WFM::Read(.local.stat, slide_base_path);
- if (! tmp["isdir"]:false)
+ if( UI::WidgetExists( `progressCurrentPackage ) )
{
- slide_base_path = "/var/adm/YaST/InstSrcManager/tmp/CurrentMedia/suse/setup/slide";
+ UI::ChangeWidget(`progressCurrentPackage, `Value, value );
+ if( text != nil )
+ UI::ChangeWidget(`progressCurrentPackage, `Label, text );
}
-
- if ( debug && false )
- {
- y2milestone( "Debug mode - using faster time recalc values" );
- initial_recalc_delay = 7;
- recalc_interval = 5;
- slide_min_interval = 5;
- }
-
-
- if ( Stage::initial () || Stage::cont () )
- {
- if ( HaveSlideSupport() )
- {
- y2milestone( "Display OK for slide show" );
-
- slides = GetSlideList( language );
- }
- else
- {
- y2warning( "Disabling slide show - insufficient display capabilities" );
- }
- }
- }
-
-
- /**
- * Set the slide show text.
- * @param text
- **/
- void SetSlideText( string 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)
{
- if ( UI::WidgetExists(`slideText ) )
+ total_progress_label = text;
+ if ( UI::WidgetExists(`progressTotal ) )
{
- //
- // 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;
- }
-
- UI::ChangeWidget(`slideText, `Value, text );
+ UI::ChangeWidget(`progressTotal, `Value, 0);
+ UI::ChangeWidget(`progressTotal, `Label, text );
}
+
+ total_progress_label = text;
+ total_progress_value = 0;
}
-
-
+
/**
- * Load one slide from files complete with image and textual description.
- * @param text_file_name file name + path of the text file (rich text / HTML)
- * @return true if OK, false if error
- **/
- boolean LoadSlideFile( string text_file_name )
+ * 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)
{
- string text = (string) SCR::Read( .target.string, [text_file_name, ""] );
+ if( new_text != nil)
+ total_progress_label = new_text;
+ total_progress_value = value;
- if ( text == "" )
+ if ( UI::WidgetExists(`progressTotal ) )
{
- return false;
+ UI::ChangeWidget(`progressTotal, `Value, value);
+ if( new_text != nil )
+ UI::ChangeWidget(`progressTotal, `Label, new_text );
}
else
+ y2milestone( "progressTotal widget missing" );
+
+ // update slide
+ if( ShowingSlide() )
{
- y2debug( "Loading slide show text from %1", text_file_name);
- SetSlideText( text );
- return true;
- }
- }
-
-
- /**
- * Get version info for a package (without build no.)
- *
- * @param pkg_name name of the package without path and ".rpm" extension
- * @return version string
- **/
- global string StripReleaseNo( string pkg_name )
- {
- integer build_no_pos = findlastof (pkg_name, "-" ); // find trailing build no.
-
- if ( build_no_pos != nil && build_no_pos > 0 )
- {
- // cut off trailing build no.
- pkg_name = substring( pkg_name , 0, build_no_pos );
- }
-
- return pkg_name;
- }
-
- /**
- * Get package file name from path
- *
- * @param pkg_name location of the package
- * @return string package file name
- **/
- global string StripPath(string pkg_name)
- {
- if (pkg_name == nil)
- {
- return nil;
- }
-
- integer file_pos = findlastof(pkg_name, "/");
-
- if (file_pos != nil && file_pos > 0 )
- {
- // return just the file name
- pkg_name = substring(pkg_name, file_pos + 1);
+ ChangeSlideIfNecessary();
}
-
- return pkg_name;
}
+ map<string, map<string,any> > _stages = $[]; // list of the configured stages
+ map<string, any> _current_stage = nil; // current stage
/**
- * set media type "CD" or "DVD"
+ * Return the description for the current stage.
+ * @return string localized string description
*/
- global void SetMediaType (string new_media_type)
+ global string CurrentStageDescription()
{
- media_type = new_media_type;
+ return _current_stage["description"]:_("Installing...");
}
-
-
+
/**
- * Set the slide show directory
+ * Move the global progress to the beginning of the given stage.
+ * @param stage_name id of the stage to move to
*/
- global void SetSlideDir( string dir )
- {
- slide_base_path = dir;
-
- map tmp = (map) WFM::Read (.local.stat, slide_base_path);
-
- if ( ! tmp["isdir"]:false )
- slide_base_path = "/var/adm/YaST/InstSrcManager/tmp/CurrentMedia/suse/setup/slide";
-
- y2milestone( "SetSlideDir: %1", slide_base_path );
- }
-
-
- /**
- * Perform sanity check for correct initialzation etc.
- * @param silent don't complain in log file
- * @return true if OK, false if any error
- **/
- boolean SanityCheck( boolean silent )
+ global void MoveToStage( string stage_name )
{
- if ( ! init_pkg_data_complete )
+ if( ! haskey( _stages, stage_name ) )
{
- if ( ! silent )
- {
- y2error( "SlideShow::SanityCheck(): Slide show not correctly initialized: " +
- "SlideShow::InitPkgData() never called!" );
- }
- return false;
- }
-
- if ( current_src_no < 1 || current_cd_no < 1 )
- {
- // nothing to install but something is going to be deleted, so it's OK
- if (Pkg::IsAnyResolvable(`package, `to_remove))
- {
- return true;
- }
- else if (!silent)
- {
- y2error(-1, "SlideShow::SanityCheck(): Illegal values for current_src (%1) or current_cd (%2)",
- current_src_no, current_cd_no );
- y2milestone( "total sizes: %1", total_sizes_per_cd_per_src );
- }
- return false;
- }
-
- return true;
- }
-
- string provide_name = "";
- string provide_size = "";
-
- global void SlideGenericProvideStart (string pkg_name, integer sz,
- string pattern, boolean remote)
- {
- if ( ! SanityCheck( false ) ) return;
- if ( ! ShowingDetails() ) return;
-
- if ( UI::WidgetExists(`progressCurrentPackage) )
- {
- 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);
+ y2error( "Unknown progress stage \"%1\"", stage_name );
+ return;
}
- //
- // Update (user visible) installation log
- // for remote download only
- //
- if( ! remote ) return;
-
- y2milestone( "Package '%1' is remote", pkg_name );
+ _current_stage = _stages[stage_name]:nil;
- string strsize = String::FormatSize (sz);
- // message in the installatino log, %1 is package name,
- // %2 is package size
- string msg = sformat (pattern, pkg_name, strsize);
- string log_line = "\n" + msg;
- inst_log = inst_log + log_line;
-
- if ( ShowingDetails() )
- {
- if ( UI::WidgetExists( `instLog ) )
- UI::ChangeWidget(`instLog, `LastLine, log_line );
- }
-
- }
-
- global void SlideDeltaApplyStart (string pkg_name) {
- if ( ! SanityCheck( false ) ) return;
- if ( ! ShowingDetails() ) return;
-
- if ( UI::WidgetExists(`progressCurrentPackage) )
- {
- UI::ChangeWidget(`progressCurrentPackage, `Label, pkg_name);
- UI::ChangeWidget(`progressCurrentPackage, `Value, 0);
- }
-
- string msg = sformat (_("Applying delta RPM: %1"), pkg_name);
- string log_line = "\n" + msg;
- inst_log = inst_log + log_line;
-
- if ( ShowingDetails() )
- {
- if ( UI::WidgetExists( `instLog ) )
- UI::ChangeWidget(`instLog, `LastLine, log_line );
- }
+ 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...") );
}
-
/**
- * Package providal start
- */
- global void SlideProvideStart (string pkg_name, integer sz, boolean remote)
+ * 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 )
{
- // message in the installatino log, %1 is package name,
- // %2 is package size
- SlideGenericProvideStart (pkg_name, sz, _("Downloading %1 (download size %2)"),
- remote);
+ UpdateGlobalProgress( _current_stage["start"]:0 + (value * _current_stage["size"]:1 / 100), text );
}
-
/**
- * Set the curent language. Must be called once during initialization.
- **/
- global void SetLanguage( string new_language )
+ * Return the current global progress label.
+ * @return string current label
+ */
+ global void SetGlobalProgressLabel( string text )
{
- language = new_language;
+ total_progress_label = text;
+ if ( UI::WidgetExists(`progressTotal ) )
+ {
+ UI::ChangeWidget(`progressTotal, `Label, text);
+ }
}
/**
- * Append message to the installation log
+ * Append message to the installation log.
+ * @param msg message to be added, without trailing eoln
*/
global void AppendMessageToInstLog (string msg)
{
@@ -836,480 +303,68 @@
}
}
- /**
- * Update internal bookkeeping: subtract size of one package from the
- * global list of remaining sizes per CD
- **/
- void SubtractPackageSize( integer pkg_size )
- {
- integer remaining = remaining_sizes_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]: 1;
- remaining = remaining - pkg_size;
- total_size_installed = total_size_installed + pkg_size;
-
- if ( remaining <= 0 )
- {
- // -1 is the indicator for "done with this CD" - not to be
- // confused with 0 for "nothing to install from this CD".
- remaining = -1;
- }
-
- remaining_sizes_per_cd_per_src [ current_src_no-1, current_cd_no-1 ] = remaining;
- remaining_pkg_count_per_cd_per_src [ current_src_no-1, current_cd_no-1 ] =
- remaining_pkg_count_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]:0 -1;
-
- if ( unit_is_seconds )
- {
- integer seconds = 0;
-
- if ( remaining > 0 && bytes_per_second > 0 )
- seconds = remaining / bytes_per_second;
-
- remaining_times_per_cd_per_src [ current_src_no-1, current_cd_no-1 ] = seconds;
- }
-
- if ( debug )
- y2milestone( "SubtractPackageSize( %1 ) -> %2", pkg_size, remaining_sizes_per_cd_per_src);
- }
-
-
- /**
- * Return a CD's progress bar ID
- * @param src_no number of the repository (from 0 on)
- * @param cd_no number of the CD within that repository (from 0 on)
- **/
- string CdProgressId( integer src_no, integer cd_no )
- {
- return sformat( "Src %1 CD %2", src_no, cd_no );
- }
/**
- * Recalculate remaining times per CD based on package sizes remaining
- * and data rate so far. Recalculation is only done each 'recalc_interval'
- * seconds unless 'force_recalc' is set to 'true'.
- *
- * @param force_recalc force recalculation even if timeout not reached yet
- * @return true if recalculated, false if not
- **/
- boolean RecalcRemainingTimes( boolean force_recalc )
- {
- if ( ! force_recalc
- && time() < next_recalc_time )
- {
- // Nothing to do (yet) - simply return
- return false;
- }
-
-
- // Actually do recalculation
-
- integer elapsed = total_time_elapsed;
-
- if ( start_time >= 0 )
- {
- elapsed = elapsed + time() - start_time;
- }
-
- if ( elapsed == 0 )
- {
- // Called too early - no calculation possible yet.
- // This happens regularly during initialization, so an error
- // message wouldn't be a good idea here.
-
- return false;
- }
-
-
- // This is the real thing.
-
- integer real_bytes_per_second = total_size_installed / elapsed;
-
- // But this turns out to be way to optimistic - RPM gets slower and
- // slower while installing. So let's add some safety margin to make
- // sure initial estimates are on the pessimistic side - the
- // installation being faster than initially estimated will be a
- // pleasant surprise to the user. Most users don't like it the other
- // way round.
- //
- // The "pessimistic factor" progressively decreases as the installation
- // proceeds. It begins with about 1.7, i.e. the data transfer rate is
- // halved to what it looks like initially. It decreases to 1.0 towards
- // the end.
-
- float pessimistic_factor = 1.0;
-
- if ( total_size_to_install > 0 )
- pessimistic_factor = 1.7 - tofloat( total_size_installed ) / tofloat( total_size_to_install );
- bytes_per_second = tointeger( tofloat( real_bytes_per_second ) / pessimistic_factor + 0.5 );
-
- if ( bytes_per_second < 1 )
- bytes_per_second = 1;
-
- remaining_times_per_cd_per_src = [];
-
- // Recalculate remaining times for the individual CDs
-
- foreach ( list<integer> remaining_sizes_list, remaining_sizes_per_cd_per_src,
- ``{
- list<integer> remaining_times_list = [];
- integer remaining_time = -1;
-
- foreach ( integer remaining_size, remaining_sizes_list,
- ``{
- remaining_time = remaining_size;
-
- if ( remaining_size > 0 )
- {
- remaining_time = remaining_size / bytes_per_second;
-
- if ( remaining_time < min_time_per_cd )
- {
- // It takes at least this long for the CD drive to spin up and
- // for RPM to do _anything_. Times below this values are
- // ridiculously unrealistic.
- remaining_time = min_time_per_cd;
- }
- else if ( remaining_time > max_time_per_cd ) // clip off at 2 hours
- {
- // When data throughput goes downhill (stalled network connection etc.),
- // cut off the predicted time at a reasonable maximum.
- remaining_time = max_time_per_cd;
- }
- }
- remaining_times_list = add( remaining_times_list, remaining_time );
- });
-
- remaining_times_per_cd_per_src = add( remaining_times_per_cd_per_src, remaining_times_list );
- });
-
-
- // Recalculate slide interval
-
- if ( size( slides ) > 0 )
- {
- integer slides_remaining = size( slides ) - current_slide_no - 1;
-
- if ( slides_remaining > 0 )
- {
- // The remaining time for the rest of the slides depends on the
- // remaining time for the current CD only: This is where the
- // slide images and texts reside. Normally, only CD1 has slides
- // at all, i.e. the slide show must be finished when CD1 is
- // done.
- //
- // In addition to that, take elapsed time for current slide
- // into account so all slides get about the same time.
-
- integer time_remaining = remaining_times_per_cd_per_src[current_src_no-1, current_cd_no-1]:1 + time() - slide_start_time;
- slide_interval = time_remaining / slides_remaining;
- y2debug( "New slide interval: %1 - slides remaining: %2 - remaining time: %3",
- slide_interval, slides_remaining, time_remaining );
-
- if ( slide_interval < slide_min_interval )
- {
- slide_interval = slide_min_interval;
- y2debug( "Resetting slide interval to min slide interval: %1", slide_interval );
- }
-
- if ( slide_interval > slide_max_interval )
- {
- slide_interval = slide_max_interval;
- y2debug( "Resetting slide interval to max slide interval: %1", slide_interval );
- }
- }
- }
-
- next_recalc_time = time() + recalc_interval;
-
- return true;
- }
-
-
- /**
- * Create one single item for the CD statistics table
- **/
- term TableItem( string id, string col1, string col2, string col3, string col4 )
- {
- return `item(`id( id ), col1, col2, col3, col4 );
- }
-
-
- /**
- * Returns a table widget item list for CD statistics
+ * Check if the dialog is currently set up so the user could switch to the slide page.
**/
- list<term> CdStatisticsTableItems()
+ global boolean HaveSlideWidget()
{
- list<term> itemList = [];
-
- //
- // Add "Total" item - at the top so it is visible by default even if there are many items
- //
-
- {
- // List column header for total remaining MB and time to install
- string caption = _("Total");
- integer remaining = TotalRemainingSize();
- string rem_size = FormatRemainingSize( remaining );
- string rem_count = FormatRemainingCount( TotalRemainingPkgCount() );
- string rem_time = "";
-
- if ( unit_is_seconds && bytes_per_second > 0 )
- {
- rem_time = FormatTimeShowOverflow( TotalRemainingTime() );
- }
-
- itemList = add( itemList, TableItem( "total", caption, " " + rem_size, " " + rem_count, " " + rem_time ) );
- }
-
-
- //
- // Now go through all repositories
- //
-
- integer src_no = 0;
-
- foreach ( list<integer> inst_src, remaining_sizes_per_cd_per_src, ``{
- y2milestone( "src #%1: %2", src_no, inst_src );
-
- if (ListSum(inst_src) > 0) // Ignore repositories from where there is nothing is to install
- {
- // Add heading for this repository
- itemList = add( itemList, TableItem( sformat( "src(%1)", src_no ),
- inst_src_names[ src_no ]:"", "", "", "" ) );
-
- integer cd_no = 0;
-
- foreach ( integer remaining, inst_src, ``{
- if ( remaining > 0
- || ( src_no+1 == current_src_no && cd_no+1 == current_cd_no ) ) // suppress current CD
- {
- string caption = sformat( "%1 %2", media_type, cd_no+1 ); // "CD 1" - column #0
- string rem_size = FormatRemainingSize( remaining ); // column #1
- string rem_count = FormatRemainingCount( remaining_pkg_count_per_cd_per_src[ src_no, cd_no ]:0 );
- string rem_time = "";
-
- if ( unit_is_seconds && bytes_per_second > 0 )
- {
- remaining = remaining / bytes_per_second;
- rem_time = FormatTime( remaining ); // column #2
-
- if ( remaining > max_time_per_cd ) // clip off at 2 hours
- {
- // When data throughput goes downhill (stalled network connection etc.),
- // cut off the predicted time at a reasonable maximum.
- // "%1" is a predefined maximum time.
- rem_time = FormatTimeShowOverflow( -max_time_per_cd );
- }
- }
-
- itemList = add( itemList,
- TableItem( sformat("cd(%1,%2)", src_no, cd_no ), // ID
- caption, " " + rem_size, " " + rem_count, " " + rem_time ) );
- }
-
- cd_no = cd_no + 1;
- });
- }
-
- src_no = src_no + 1;
- });
-
- if ( debug )
- {
- y2milestone( "Remaining: %1", remaining_sizes_per_cd_per_src );
- y2milestone( "CD table item list:\n%1", itemList );
- }
-
- return itemList;
+ return UI::WidgetExists(`dumbTab);
}
-
/**
- * Progress display update
- * This is called via the packager's progress callbacks.
- *
- * @param pkg_percent package percentage
+ * 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 UpdateCurrentPackageProgress(integer pkg_percent)
+ global void CheckForSlides()
{
- if ( UI::WidgetExists(`progressCurrentPackage ) )
- {
- UI::ChangeWidget(`progressCurrentPackage, `Value, pkg_percent);
- }
- }
+ Slides::CheckBasePath();
- global void UpdateCurrentPackageRateProgress(integer pkg_percent, integer bps_avg, integer bps_current)
- {
- // update the download rate
- if ( UI::WidgetExists(`progressCurrentPackage ) )
+ if ( Stage::initial () || Stage::cont () )
{
- UI::ChangeWidget(`progressCurrentPackage, `Value, pkg_percent);
-
- if (bps_current > 0)
+ if ( Slides::HaveSlideSupport() )
{
- // do not show the average download rate if the space is limited
- if (GetTextMode () && GetDisplayWidth () < 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);
+ y2milestone( "Display OK for slide show, loading" );
+ Slides::LoadSlides( language );
}
- }
- }
-
-
- /**
- * Update progress widgets for all CDs.
- * Uses global statistics variables.
- **/
- global void UpdateAllCdProgress(boolean silent_check)
- {
- if ( ! SanityCheck( silent_check ) ) return;
- if ( ! widgets_created ) return;
-
- if ( unit_is_seconds )
- RecalcRemainingTimes( true ); // force
-
- if ( UI::WidgetExists(`cdStatisticsTable) )
- UI::ChangeWidget(`cdStatisticsTable, `Items, CdStatisticsTableItems() );
- }
-
-
- /**
- * Update progress widgets for the current CD: Label and ProgressBar.
- * Use global statistics variables for that.
- **/
- global void UpdateCurrentCdProgress(boolean silent_check)
- {
- if ( ! SanityCheck( silent_check ) ) return;
- if ( ! UI::WidgetExists(`cdStatisticsTable) ) return;
-
-
- //
- // Update table entries for current CD
- //
-
- integer remaining = remaining_sizes_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]:0;
- UI::ChangeWidget(`id(`cdStatisticsTable ),
- `Item( sformat( "cd(%1,%2)", current_src_no-1, current_cd_no-1), size_column ),
- FormatRemainingSize( remaining ) );
-
- UI::ChangeWidget(`id(`cdStatisticsTable ),
- `Item( sformat( "cd(%1,%2)", current_src_no-1, current_cd_no-1), pkg_count_column ),
- FormatRemainingCount( remaining_pkg_count_per_cd_per_src [ current_src_no-1, current_cd_no-1 ]:0 ) );
-
- if ( unit_is_seconds )
- {
- // Convert 'remaining' from size (bytes) to time (seconds)
-
- remaining = remaining / bytes_per_second;
-
- if ( remaining <= 0 )
- remaining = 0;
-
- if ( remaining > max_time_per_cd ) // clip off at 2 hours
+ else
{
- // When data throughput goes downhill (stalled network connection etc.),
- // cut off the predicted time at a reasonable maximum.
- remaining = -max_time_per_cd;
+ y2warning( "Disabling slide show - insufficient display capabilities" );
}
-
- UI::ChangeWidget(`id(`cdStatisticsTable ),
- `Item( sformat( "cd(%1,%2)", current_src_no-1, current_cd_no-1), time_column ),
- FormatTimeShowOverflow( remaining ) );
- }
-
-
- //
- // Update "total" table entries
- //
-
- UI::ChangeWidget(`id( `cdStatisticsTable ),
- `Item( "total", size_column ),
- FormatRemainingSize( TotalRemainingSize() ) );
-
- UI::ChangeWidget(`id( `cdStatisticsTable ),
- `Item( "total", pkg_count_column ),
- FormatRemainingCount( TotalRemainingPkgCount() ) );
-
- if ( unit_is_seconds )
- {
- UI::ChangeWidget(`id( `cdStatisticsTable ), `Item( "total", time_column ),
- FormatTimeShowOverflow( TotalRemainingTime() ) );
-
}
}
- string GetProgressLabel()
- {
- string rem_string = "";
- integer tot_rem_t = TotalRemainingTime();
-
- rem_string = ( unit_is_seconds && bytes_per_second > 0 && tot_rem_t > 0) ?
- sformat("%1 / %2", FormatRemainingSize(TotalRemainingSize()), FormatTimeShowOverflow(tot_rem_t))
- : FormatRemainingSize(TotalRemainingSize());
-
- return sformat(_("Remaining: %1"), rem_string);
- }
/**
- * Update progress widgets
+ * Set the slide show text.
+ * @param text
**/
- void UpdateTotalProgress(boolean silent_check)
+ void SetSlideText( string text )
{
- if ( UI::WidgetExists(`multiProgressMeter ) )
- UI::ChangeWidget(`multiProgressMeter, `Values, FlattenNoZeroes( remaining_sizes_per_cd_per_src ) );
-
- if ( UI::WidgetExists(`progressTotal ) )
- {
- // progress is in kB
- UI::ChangeWidget(`progressTotal, `Value, TotalInstalledSize() >> 10);
- UI::ChangeWidget(`progressTotal, `Label, GetProgressLabel() );
- }
-
- UpdateCurrentCdProgress(silent_check);
-
- if ( UI::WidgetExists(`nextMedia ) )
+ if ( UI::WidgetExists(`slideText ) )
{
- string nextMedia = FormatNextMedia();
-
- if ( nextMedia != "" || last_cd )
- {
- UI::ChangeWidget(`nextMedia, `Value, nextMedia );
- UI::RecalcLayout();
- last_cd = false;
- }
+ UI::ChangeWidget(`slideText, `Value, text );
}
-
- if ( UI::WidgetExists(`totalRemainingLabel ) )
- UI::ChangeWidget(`totalRemainingLabel, `Value, FormatTotalRemaining() );
-
- if ( UI::WidgetExists(`multiProgressMeter ) ) // Avoid that in NCurses - too much flicker
- UI::RecalcLayout();
}
/**
- * Switch unit to seconds if necessary and recalc everything accordingly.
- * @return true if just switched from sizes to seconds, false otherwise
+ * Set the curent language. Must be called once during initialization.
**/
- boolean SwitchToSecondsIfNecessary()
+ global void SetLanguage( string new_language )
{
- if ( unit_is_seconds
- || time() < start_time + initial_recalc_delay )
- {
- return false; // no need to switch
- }
+ language = new_language;
+ }
- RecalcRemainingTimes( true ); // force recalculation
- unit_is_seconds = true;
- return true; // just switched
+ /**
+ * 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 );
}
@@ -1319,18 +374,17 @@
**/
void LoadSlide( integer slide_no )
{
- if ( slide_no > size( slides ) )
+ if ( slide_no > size( Slides::slides ) )
{
slide_no = 0;
}
current_slide_no = slide_no;
- string slide_name = slides[slide_no]:"";
+ string slide_name = Slides::slides[slide_no]:"";
slide_start_time = time();
- if ( LoadSlideFile( sformat ("%1/%2", slide_txt_path, slide_name ) ) ) return;
- SetSlideText ("");
+ SetSlideText( Slides::LoadSlideFile( slide_name ) );
}
@@ -1338,9 +392,9 @@
* Check if the current slide needs to be changed and do that if
* necessary.
**/
- void ChangeSlideIfNecessary()
+ global void ChangeSlideIfNecessary()
{
- if ( current_slide_no + 1 < size( slides )
+ if ( current_slide_no + 1 < size( Slides::slides )
&& time() > slide_start_time + slide_interval )
{
y2debug( "Loading slide #%1", current_slide_no + 2 );
@@ -1348,151 +402,6 @@
}
}
-
- /**
- * package start display update
- * - this is called at the beginning of a new package
- *
- * @param pkg_name package name
- * @param pkg_summary package summary (short description)
- * @param deleting Flag: deleting (true) or installing (false) package?
- **/
- global void SlideDisplayStart( string pkg_name,
- string pkg_summary,
- integer pkg_size,
- boolean deleting )
- {
- if ( ! SanityCheck( false ) ) return;
-
- // remove path
- pkg_name = StripPath(pkg_name);
-
- // remove release and .rpm suffix
- // pkg_name = StripReleaseNo( pkg_name ); // bug #154872
-
- if ( deleting )
- {
- pkg_size = -1;
-
- // This is a kind of misuse of insider knowledge: If there are packages to delete, this
- // deletion comes first, and only then packages are installed. This, however, greatly
- // distorts the estimated times based on data throughput so far: While packages are
- // deleted, throughput is zero, and estimated times rise to infinity (they are cut off
- // at max_time_per_cd to hide this). So we make sure the time spent deleting packages is
- // not counted for estimating remaining times - reset the timer.
- //
- // Note: This will begin to fail when some day packages are deleted in the middle of the
- // installaton process.
-
- ResetTimer();
- }
-
- if ( pkg_summary == nil )
- pkg_summary = "";
-
- string msg = "";
-
- if ( deleting )
- {
- // Heading for the progress bar for the current package
- // while it is deleted. "%1" is the package name.
- msg = sformat( _("Deleting %1"), pkg_name );
- }
- else
- {
- // package installation - summary text
- // %1 is RPM name, %2 is installed (unpacked) size (e.g. 6.20MB)
- msg = sformat( _("%1 (installed size %2)"), pkg_name, String::FormatSize( pkg_size ) );
- }
-
-
- //
- // Update package progress bar
- //
-
- if ( UI::WidgetExists(`progressCurrentPackage) )
- {
- UI::ChangeWidget(`progressCurrentPackage, `Label, msg );
- UI::ChangeWidget(`progressCurrentPackage, `Value, 0);
- }
-
-
- //
- // Update (user visible) installation log
- //
-
- string log_line = "\n" + msg;
-
- if ( pkg_summary != "" )
- log_line = log_line + " -- " + pkg_summary;
-
- inst_log = inst_log + log_line;
-
- if ( ShowingDetails() )
- {
- if ( UI::WidgetExists( `instLog ) )
- UI::ChangeWidget(`instLog, `LastLine, log_line );
- }
- else
- {
- ChangeSlideIfNecessary();
- }
-
-
- if ( ! deleting )
- {
- // the actions are performed when package installation finishes
-// SubtractPackageSize( pkg_size );
- y2milestone( "Installing %1 -- %2", pkg_name, pkg_summary );
-
-// if (SwitchToSecondsIfNecessary()
-// || RecalcRemainingTimes( false ) ) // no forced recalculation
-// {
-// y2debug( "Updating progress for all CDs" );
-// UpdateAllCdProgress();
-// }
-// else
-// {
-// UpdateCurrentCdProgress();
-// }
-
-// UpdateTotalProgress(false);
-
- } // ! deleting
- }
-
- /**
- * package start display update
- * - this is called at the end of a new package
- *
- * @param pkg_name package name
- * @param deleting Flag: deleting (true) or installing (false) package?
- **/
- global void SlideDisplayDone ( string pkg_name,
- integer pkg_size,
- boolean deleting )
- {
- if ( ! deleting )
- {
- SubtractPackageSize( pkg_size );
-
- if (SwitchToSecondsIfNecessary()
- || RecalcRemainingTimes( false ) ) // no forced recalculation
- {
- y2debug( "Updating progress for all CDs" );
- UpdateAllCdProgress(false);
- }
- else
- {
- UpdateCurrentCdProgress(false);
- }
-
- UpdateTotalProgress(false);
-
- } // ! deleting
-
- }
-
/**
* 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() )
@@ -1501,14 +410,6 @@
**/
term AddProgressWidgets( symbol page_id, term page_contents )
{
- integer progress_max_kB = total_size_to_install >> 10;
-
- // max value cannot be 0, it means "tick" progress
- if (progress_max_kB <= 0)
- {
- progress_max_kB = 1;
- }
-
term widgets =
`HBox(`id( page_id ),
`HSpacing( 1 ),
@@ -1516,17 +417,13 @@
`VWeight( 1, // lower layout priority
page_contents ),
// Progress bar for overall progress of software package installation
- `ProgressBar(`id(`progressTotal ), GetProgressLabel(),
- // progress is in kB due to 32 bit UI limit
- progress_max_kB, TotalInstalledSize() >> 10)
+ `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 )
);
- y2milestone("total_size_to_install: %1", total_size_to_install);
-
y2debug( "widget term: \n%1", widgets );
return widgets;
}
@@ -1548,18 +445,9 @@
return widgets;
}
-
- /**
- * Construct widgets for the "details" page
- *
- * @return A term describing the widgets
- **/
- term DetailsPageWidgets()
+ term DetailsTableWidget()
{
- term widgets =
- AddProgressWidgets( `detailsPage,
- `VBox(
- `VWeight( 1,
+ return `VWeight( 1,
`Table( `id(`cdStatisticsTable), `opt(`keepSorting),
`header(
// Table headings for CD statistics during installation
@@ -1571,13 +459,25 @@
// Table headings for CD statistics during installation
`Right( _("Time") )
),
- CdStatisticsTableItems()
+ 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 ), "", 6, 0 )
+ `LogView(`id(`instLog ), _("Actions performed:"), 6, 0 )
),
- `ProgressBar(`id(`progressCurrentPackage), " ", 100, 0 )
+ `ProgressBar(`id(`progressCurrentPackage), sub_progress_label, 100, sub_progress_value )
)
);
@@ -1585,6 +485,11 @@
return widgets;
}
+ /**
+ * Construct widgets for the "release notes" page
+ *
+ * @return A term describing the widgets
+ **/
term RelNotesPageWidgets() {
term widgets = AddProgressWidgets (`relNotesPage,
`RichText (relnotes)
@@ -1606,30 +511,37 @@
{
UI::ChangeWidget(`dumbTab, `CurrentItem, `showSlide );
UI::ReplaceWidget(`tabContents, SlidePageWidgets() );
- UpdateTotalProgress(false);
+ // UpdateTotalProgress(false); // FIXME: this breaks other stages!
}
}
-
/**
- * Switch from the 'slide show' view to the 'details' view.
- **/
- global void SwitchToDetailsView(boolean silent_check)
+ * Rebuild the details page.
+ */
+ void RebuildDetailsView()
{
- if ( ShowingDetails() )
- return;
-
if ( UI::WidgetExists(`tabContents ) )
{
UI::ChangeWidget(`dumbTab, `CurrentItem, `showDetails );
UI::ReplaceWidget(`tabContents, DetailsPageWidgets() );
+ y2milestone( "Contents set to details" );
}
- UpdateTotalProgress(silent_check);
- UpdateAllCdProgress(silent_check);
-
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();
}
/**
@@ -1644,11 +556,14 @@
{
UI::ChangeWidget(`dumbTab, `CurrentItem, `showRelNotes );
UI::ReplaceWidget(`tabContents, RelNotesPageWidgets() );
- UpdateTotalProgress(false);
+ // UpdateTotalProgress(false);
}
}
+ /**
+ * Help text for the dialog
+ */
string HelpText()
{
// Help text while software packages are being installed (displayed only in rare cases)
@@ -1658,14 +573,15 @@
}
- void RebuildDialog(boolean silent_check)
+ /**
+ * Rebuild the dialog. Useful if slides become available post-creating the dialog.
+ */
+ global void RebuildDialog()
{
- if (!SanityCheck(silent_check)) return;
-
term contents = `Empty();
- if ( UI::HasSpecialWidget(`DumbTab) && HaveSlideSupport()
- && HaveSlides() )
+ if ( UI::HasSpecialWidget(`DumbTab) && Slides::HaveSlideSupport()
+ && Slides::HaveSlides() )
{
list tabs = [
// tab
@@ -1698,17 +614,19 @@
contents = DetailsPageWidgets();
}
+ y2milestone( "SlideShow contents: %1", contents);
+
Wizard::SetContents(
// Dialog heading while software packages are being installed
- _("Package Installation"),
+ _("Perform Installation"),
contents,
HelpText(),
false, false ); // has_back, has_next
widgets_created = true;
- if ( ! HaveSlides() && ShowingSlide() )
- SwitchToDetailsView(false);
+ if ( ! Slides::HaveSlides() && ShowingSlide() )
+ SwitchToDetailsView();
}
@@ -1738,7 +656,7 @@
HelpText(),
false, false ); // has_back, has_next
- RebuildDialog(true);
+ RebuildDialog();
Wizard::SetTitleIcon("yast-sw_single");
// reset abort status
@@ -1747,153 +665,17 @@
/**
- * Initialize internal pacakge data, such as remaining package sizes and
- * times. This may not be called before the pkginfo server is up and
- * running, so this cannot be reliably done from the constructor in all
- * cases.
- * @param force true to force reinitialization
- **/
- global void InitPkgData(boolean force)
+ * Initialize generic data to default values
+ */
+ global void Reset()
{
- if ( init_pkg_data_complete && ! force)
- return;
-
- // Reinititalize some globals (in case this is a second run)
- total_size_installed = 0;
- total_time_elapsed = 0;
- start_time = -1;
- next_recalc_time = -1;
- current_src_no = -1; // 1..n
- current_cd_no = -1; // 1..n
- next_src_no = -1;
- next_cd_no = -1;
- last_cd = false;
- unit_is_seconds = false; // begin with package sizes
- bytes_per_second = 1;
current_slide_no = 0;
slide_start_time = 0;
-
- list< list > src_list = Pkg::PkgMediaNames();
- inst_src_names = maplist( list src, src_list, ``(src[0]:"CD") );
-
- y2milestone ("Media names: %1", inst_src_names);
-
- integer index = 0;
-
- srcid_to_current_src_no = listmap( list src, src_list, {
- index = index + 1;
- return $[src[1]:-1 : index];
- });
-
- y2milestone ("Repository mapping information: %1", srcid_to_current_src_no );
-
- total_sizes_per_cd_per_src = Pkg::PkgMediaSizes();
- total_pkg_count_per_cd_per_src = Pkg::PkgMediaCount();
-
-
- total_size_to_install = ListSum( flatten( total_sizes_per_cd_per_src ) );
- y2milestone("total_size_to_install: %1", total_size_to_install);
- remaining_sizes_per_cd_per_src = (list<list <integer> >) eval (total_sizes_per_cd_per_src);
- remaining_pkg_count_per_cd_per_src = (list<list <integer> >) eval (total_pkg_count_per_cd_per_src);
- total_cd_count = size( flatten( total_sizes_per_cd_per_src ) );
- init_pkg_data_complete = true;
-
- y2milestone( "SlideShow::InitPkgData() done; total_sizes_per_cd_per_src: %1", total_sizes_per_cd_per_src );
- y2milestone( "SlideShow::InitPkgData(): pkg: %1", total_pkg_count_per_cd_per_src );
- RebuildDialog(true);
- }
-
-
-
- /**
- * Try to figure out what media will be needed next
- * and set next_src_no and next_cd_no accordingly.
- **/
- void FindNextMedia()
- {
- // Normally we would have to use current_cd_no+1,
- // but since this uses 1..n and we need 0..n-1
- // for array subscripts anyway, use it as it is.
- next_cd_no = current_cd_no;
- next_src_no = current_src_no-1;
- last_cd = false;
-
- while ( next_src_no < size( remaining_sizes_per_cd_per_src ) )
- {
- list<integer> remaining_sizes = remaining_sizes_per_cd_per_src[ next_src_no ]: [];
-
- while ( next_cd_no < size( remaining_sizes ) )
- {
- if ( remaining_sizes[ next_cd_no ]:0 > 0 )
- {
- if ( debug )
- y2milestone( "Next media: src: %1 CD: %2", next_src_no, next_cd_no );
- return;
- }
- else
- {
- next_cd_no = next_cd_no + 1;
- }
- }
-
- next_src_no = next_src_no + 1;
- }
-
- if ( debug )
- y2milestone( "No next media - all done" );
-
- next_src_no = -1;
- next_cd_no = -1;
- last_cd = true;
- }
-
-
- /**
- * Set the current repository and CD number. Must be called for each CD change.
- * src_no: 1...n
- * cd_no: 1...n
- **/
- global void SetCurrentCdNo( integer src_no, integer cd_no )
- {
- if (cd_no == 0)
- {
- y2milestone("medium number 0, using medium number 1");
- cd_no = 1;
- }
-
- y2milestone("SetCurrentCdNo() - src: %1 , CD: %2", src_no, cd_no);
- current_src_no = srcid_to_current_src_no[src_no]:-1;
- current_cd_no = cd_no;
-
- CheckForSlides();
- FindNextMedia();
-
- if ( HaveSlides() && HaveSlideSupport() )
- {
- if ( ! HaveSlideWidget() )
- {
- RebuildDialog(false);
-
- if ( user_switched_to_details )
- SwitchToDetailsView(false);
- }
-
- if ( ! user_switched_to_details ) // Don't override explicit user request!
- {
- SwitchToSlideView();
- LoadSlide(0);
- }
- }
- else
- {
- if ( ! ShowingDetails() )
- RebuildDialog(false);
- else
- UpdateTotalProgress(false);
-
- current_slide_no = 0;
- }
+ total_time_elapsed = 0;
+ start_time = -1;
+ next_recalc_time = -1;
}
+
/**
@@ -1903,12 +685,13 @@
{
if ( button == `showDetails && ! ShowingDetails() )
{
+ y2milestone( "User asks to switch to details" );
user_switched_to_details = true ;
- SwitchToDetailsView(false);
+ SwitchToDetailsView();
}
else if ( button == `showSlide && ! ShowingSlide() )
{
- if ( HaveSlides() )
+ if ( Slides::HaveSlides() )
{
user_switched_to_details = false;
SwitchToSlideView();
@@ -1934,29 +717,70 @@
/**
+ * 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 OpenSlideShowDialog()
+ global void OpenDialog()
{
// call SlideShowCallbacks::InstallSlideShowCallbacks()
WFM::call("wrapper_slideshow_callbacks", ["InstallSlideShowCallbacks"]);
- OpenSlideShowBaseDialog();
+ // check for slides first, otherwise dialogs will be built without them
CheckForSlides();
- if ( HaveSlides() )
+ OpenSlideShowBaseDialog();
+
+ if ( Slides::HaveSlides() )
LoadSlide(0);
else
- SwitchToDetailsView(true);
-
- UpdateAllCdProgress(true);
+ SwitchToDetailsView();
}
/**
* Close the slide show dialog.
**/
- global void CloseSlideShowDialog()
+ global void CloseDialog()
{
if ( opened_own_wizard )
Wizard::CloseDialog();
@@ -1965,4 +789,110 @@
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<string,any> > stages )
+ {
+ // initiliaze the generic counters
+ Reset();
+
+ // gather total amount of time need
+ integer total_time = 0;
+
+ foreach( map<string,any> 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<string,any> 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 );
+ }
+
}
Modified: trunk/packager/src/modules/SlideShowCallbacks.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SlideShowCa…
==============================================================================
--- trunk/packager/src/modules/SlideShowCallbacks.ycp (original)
+++ trunk/packager/src/modules/SlideShowCallbacks.ycp Tue Sep 2 11:23:10 2008
@@ -22,6 +22,7 @@
import "PackageCallbacks";
import "Popup";
import "SlideShow";
+ import "PackageSlideShow";
import "Message";
import "Directory";
import "URL";
@@ -82,7 +83,7 @@
if ( remote )
{
- SlideShow::SlideProvideStart (name , archivesize, remote);
+ PackageSlideShow::SlideProvideStart (name , archivesize, remote);
_remote_provide = true;
}
}
@@ -95,7 +96,7 @@
{
if (_remote_provide)
{
- SlideShow::UpdateCurrentPackageProgress( percent );
+ PackageSlideShow::UpdateCurrentPackageProgress( percent );
}
HandleInput();
return ! SlideShow::GetUserAbort();
@@ -103,7 +104,7 @@
global boolean ProgressDownload(integer percent, integer bps_avg, integer bps_current)
{
- SlideShow::UpdateCurrentPackageRateProgress(percent, bps_avg, bps_current);
+ PackageSlideShow::UpdateCurrentPackageRateProgress(percent, bps_avg, bps_current);
HandleInput();
return ! SlideShow::GetUserAbort();
@@ -117,7 +118,7 @@
{
if ( _remote_provide )
{
- SlideShow::UpdateCurrentPackageProgress( 100 );
+ PackageSlideShow::UpdateCurrentPackageProgress( 100 );
_remote_provide = false;
}
if (SlideShow::GetUserAbort())
@@ -291,7 +292,7 @@
**/
global void DisplayStartInstall(string pkg_name, string pkg_description, integer pkg_size, boolean deleting )
{
- SlideShow::SlideDisplayStart( pkg_name, pkg_description, pkg_size, deleting );
+ PackageSlideShow::SlideDisplayStart( pkg_name, pkg_description, pkg_size, deleting );
HandleInput();
// warn user about exhausted diskspace during installation (not if deleting packages)
@@ -395,7 +396,7 @@
if (!SlideShow::GetUserAbort())
{
- SlideShow::UpdateCurrentPackageProgress ( pkg_percent );
+ PackageSlideShow::UpdateCurrentPackageProgress ( pkg_percent );
}
if (SlideShow::GetUserAbort())
@@ -414,7 +415,7 @@
{
if (SlideShow::GetUserAbort())
return "I";
- SlideShow::UpdateCurrentPackageProgress (100);
+ PackageSlideShow::UpdateCurrentPackageProgress (100);
string ret = "";
if (error != 0)
@@ -423,7 +424,7 @@
}
if (size (ret) == 0 || tolower (substring (ret, 0, 1)) != "r")
{
- SlideShow::SlideDisplayDone(
+ PackageSlideShow::SlideDisplayDone(
PackageCallbacks::_package_name,
PackageCallbacks::_package_size,
PackageCallbacks::_deleting_package);
@@ -437,7 +438,7 @@
*/
global void StartDeltaProvide( string name, integer archivesize )
{
- SlideShow::SlideGenericProvideStart (name , archivesize, _("Downloading delta RPM %1 (download size %2)"), true /*remote*/);
+ PackageSlideShow::SlideGenericProvideStart (name , archivesize, _("Downloading delta RPM %1 (download size %2)"), true /*remote*/);
_remote_provide = true;
}
@@ -446,7 +447,7 @@
*/
global void StartDeltaApply( string name )
{
- SlideShow::SlideDeltaApplyStart (name);
+ PackageSlideShow::SlideDeltaApplyStart (name);
_remote_provide = true;
}
/**
@@ -454,7 +455,7 @@
*/
global void StartPatchProvide( string name, integer archivesize )
{
- SlideShow::SlideGenericProvideStart (name , archivesize, _("Downloading patch RPM %1 (download size %2)"), true /*remote*/);
+ PackageSlideShow::SlideGenericProvideStart (name , archivesize, _("Downloading patch RPM %1 (download size %2)"), true /*remote*/);
_remote_provide = true;
}
@@ -463,7 +464,7 @@
*/
global void ProgressDeltaApply( integer percent )
{
- SlideShow::UpdateCurrentPackageProgress ( percent );
+ PackageSlideShow::UpdateCurrentPackageProgress ( percent );
}
/**
@@ -500,9 +501,9 @@
global void CallbackSourceChange( integer source, integer media)
{
PackageCallbacks::SourceChange( source, media ); // inform PackageCallbacks about the change
- SlideShow::SetCurrentCdNo( source, media );
- SlideShow::UpdateCurrentPackageProgress(0);
- SlideShow::UpdateAllCdProgress(false);
+ PackageSlideShow::SetCurrentCdNo( source, media );
+ PackageSlideShow::UpdateCurrentPackageProgress(0);
+ PackageSlideShow::UpdateAllCdProgress(false);
};
global string MediaChange (string error_code, string error, string url, string product,
@@ -525,7 +526,7 @@
// moved from PackageCallbacks
if (ret == "" || URL::Check(ret))
{
- SlideShow::SetCurrentCdNo (PackageCallbacks::_current_source, wanted);
+ PackageSlideShow::SetCurrentCdNo (PackageCallbacks::_current_source, wanted);
}
}
Added: trunk/packager/src/modules/Slides.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Slides.ycp?…
==============================================================================
--- trunk/packager/src/modules/Slides.ycp (added)
+++ trunk/packager/src/modules/Slides.ycp Tue Sep 2 11:23:10 2008
@@ -0,0 +1,205 @@
+/**
+ * Module: Slides.ycp
+ *
+ * Purpose: Module to access slides from installation repository
+ *
+ * Author: Stefan Hundhammer <sh(a)suse.de>
+ * Stanislav Visnovsky <visnov(a)suse.cz>
+ *
+ */
+{
+ module "Slides";
+
+ textdomain "packager";
+
+ 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;
+ }
+}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50557 - in /trunk/yast2: library/control/src/ProductControl.ycp package/yast2.changes
by locilka@svn.opensuse.org 02 Sep '08
by locilka@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: locilka
Date: Tue Sep 2 11:20:57 2008
New Revision: 50557
URL: http://svn.opensuse.org/viewcvs/yast?rev=50557&view=rev
Log:
- Extended control file handling to accept 'execute' module
parameter to be called instead of 'name'/inst_'name'
(BNC #401319).
Modified:
trunk/yast2/library/control/src/ProductControl.ycp
trunk/yast2/package/yast2.changes
Modified: trunk/yast2/library/control/src/ProductControl.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/control/src/Produc…
==============================================================================
--- trunk/yast2/library/control/src/ProductControl.ycp (original)
+++ trunk/yast2/library/control/src/ProductControl.ycp Tue Sep 2 11:20:57 2008
@@ -312,28 +312,41 @@
return false;
};
-
-string getClientName(string name ) {
+/**
+ * Returns name of the script to call. If 'execute' is defined,
+ * the client name is taken from there. Then, if a custom control
+ * file is defined, client name is defined as 'name'. Then, inst_'name'
+ * or just 'name' is returned if it does not match the 'inst_' regexp.
+ *
+ * @param string name
+ * @param string execute
+ * @see custom_control_file
+ */
+string getClientName (string name, string execute) {
if (Mode::test())
{
return "inst_test_workflow";
}
- // All client start with "inst_".
- string client = "";
- if ( custom_control_file != "")
- {
- return name;
+
+ // BNC #401319
+ // 'execute; is defined and thus returned
+ if (execute != "" && execute != "") {
+ y2milestone ("Step name '%1' executes '%2'", name, execute);
+ return execute;
}
- else
- {
- if (issubstring(name, _client_prefix)) {
+
+ // Defined custom control file
+ if (custom_control_file != "") {
+ return name;
+
+ // All standard clients start with "inst_"
+ } else {
+ if (issubstring (name, _client_prefix)) {
return name;
} else {
- client = _client_prefix + name;
- return client;
+ return _client_prefix + name;
}
-
}
}
@@ -345,7 +358,7 @@
*/
global define term getClientTerm (map step, map def, any former_result)
{
- string client = getClientName(step["name"]:"dummy");
+ string client = getClientName (step["name"]:"dummy", step["execute"]:"");
term result = toterm(client);
map<string,any> arguments = $[];
@@ -1129,9 +1142,12 @@
{
map step = modules[current_step]:$[];
string step_name = step["name"]:"";
+ // BNC #401319
+ // if "execute" is defined, it's called without modifications
+ string step_execute = step["execute"]:"";
+ string step_id = step["id"]:"";
boolean run_in_update_mode = step["update"]:true; // default is true
boolean retranslate = step["retranslate"]:false;
- string step_id = step["id"]:"";
// Don't mark back button disabled when back button status
// is forced in the control file
@@ -1208,7 +1224,7 @@
y2error("Error writing step identifier");
}
- symbol result = (symbol) WFM::CallFunction (getClientName(step_name), args);
+ symbol result = (symbol) WFM::CallFunction (getClientName (step_name, step_execute), args);
y2milestone ("Calling %1 returned %2", argterm, result);
// bnc #369846
Modified: trunk/yast2/package/yast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=…
==============================================================================
--- trunk/yast2/package/yast2.changes (original)
+++ trunk/yast2/package/yast2.changes Tue Sep 2 11:20:57 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Sep 2 11:18:36 CEST 2008 - locilka(a)suse.cz
+
+- Extended control file handling to accept 'execute' module
+ parameter to be called instead of 'name'/inst_'name'
+ (BNC #401319).
+
+-------------------------------------------------------------------
Thu Aug 28 11:55:05 CEST 2008 - locilka(a)suse.cz
- Adapted Popup, Confirm, CWM, ALog, GPGWidgets, NetworkPopup,
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50556 - in /trunk/installation: package/yast2-installation.changes src/clients/inst_deploy_image.ycp src/clients/inst_prepareprogress.ycp src/modules/ImageInstallation.ycp
by visnov@svn.opensuse.org 02 Sep '08
by visnov@svn.opensuse.org 02 Sep '08
02 Sep '08
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-insta…
==============================================================================
--- 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(a)suse.cz
+
+- Use unified progressbar during installation (FATE #303860)
+
+-------------------------------------------------------------------
Thu Aug 28 15:19:57 CEST 2008 - locilka(a)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_de…
==============================================================================
--- 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 <string, any> 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_pr…
==============================================================================
--- 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(a)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<string,any> > 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/ImageIn…
==============================================================================
--- 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 <string,any> img) {
_current_image_from_imageset = _current_image_from_imageset + 1;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
02 Sep '08
Author: jsuchome
Date: Tue Sep 2 10:41:18 2008
New Revision: 50555
URL: http://svn.opensuse.org/viewcvs/yast?rev=50555&view=rev
Log:
Created tag stable-2_17_1 for nis-server
Added:
tags/stable-2_17_1/nis-server/
- copied from r50554, trunk/nis-server/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50554 - in /trunk/nis-server: VERSION package/yast2-nis-server.changes src/securenets.ycp
by jsuchome@svn.opensuse.org 02 Sep '08
by jsuchome@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: jsuchome
Date: Tue Sep 2 10:41:14 2008
New Revision: 50554
URL: http://svn.opensuse.org/viewcvs/yast?rev=50554&view=rev
Log:
- fixed button alignment (bnc#421043)
- 2.17.1
Modified:
trunk/nis-server/VERSION
trunk/nis-server/package/yast2-nis-server.changes
trunk/nis-server/src/securenets.ycp
Modified: trunk/nis-server/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/VERSION?rev=50554&r1=…
==============================================================================
--- trunk/nis-server/VERSION (original)
+++ trunk/nis-server/VERSION Tue Sep 2 10:41:14 2008
@@ -1 +1 @@
-2.17.0
+2.17.1
Modified: trunk/nis-server/package/yast2-nis-server.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/package/yast2-nis-ser…
==============================================================================
--- trunk/nis-server/package/yast2-nis-server.changes (original)
+++ trunk/nis-server/package/yast2-nis-server.changes Tue Sep 2 10:41:14 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Sep 2 10:40:11 CEST 2008 - jsuchome(a)suse.cz
+
+- fixed button alignment (bnc#421043)
+- 2.17.1
+
+-------------------------------------------------------------------
Thu Aug 28 14:16:47 CEST 2008 - jsuchome(a)suse.cz
- adapted to recent changes in nis-client (no check for DHCP)
Modified: trunk/nis-server/src/securenets.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/nis-server/src/securenets.ycp?re…
==============================================================================
--- trunk/nis-server/src/securenets.ycp (original)
+++ trunk/nis-server/src/securenets.ycp Tue Sep 2 10:41:14 2008
@@ -158,26 +158,25 @@
list<term> allow_query = ItemizeSecurenets (NisServer::securenets);
integer n_items = size (allow_query);
- term buttons = `HBox ();
- // To translators: pushbutton label
- buttons = add (buttons, `PushButton (`id (`add), `opt (`key_F3), _("A&dd")));
- // To translators: pushbutton label
- buttons = add (buttons, `PushButton (`id (`edit), `opt (`key_F4), _("&Edit")));
- // To translators: pushbutton label
- buttons = add (buttons, `PushButton (`id (`delete), `opt (`key_F5), _("De&lete")));
-
- term contents = `VBox ();
- contents = add (contents, `Table (`id (`table), `opt (`notify, `immediate),
- `header (
- // To translators: table headers
- _("Netmask"),
- // To translators: table headers
- _("Network")),
- allow_query));
- contents = add (contents, buttons);
+ term buttons = `HBox (
+ `PushButton (`id (`add), Label::AddButton ()),
+ `PushButton (`id (`edit), Label::EditButton ()),
+ `Left (
+ `PushButton (`id (`delete), Label::DeleteButton ())
+ )
+ );
+
+ term contents = `VBox (
+ `Table (`id (`table), `opt (`notify, `immediate), `header (
+ // To translators: table header
+ _("Netmask"),
+ // To translators: table header
+ _("Network")
+ ), allow_query),
+ buttons
+ );
-
- // To translators: dialog label
+ // To translators: dialog label
Wizard::SetContents (_("NIS Server Query Hosts Setup"), contents, helptext, true, true);
Wizard::SetNextButton(`next, Label::FinishButton() );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50553 - in /trunk/storage/storage/src/include: ep-dm-lib.ycp ep-dm.ycp ep-hd-lib.ycp ep-hd.ycp ep-log.ycp ep-lvm-lib.ycp ep-main.ycp ep-raid-lib.ycp ep-settings.ycp
by aschnell@svn.opensuse.org 02 Sep '08
by aschnell@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: aschnell
Date: Tue Sep 2 10:39:44 2008
New Revision: 50553
URL: http://svn.opensuse.org/viewcvs/yast?rev=50553&view=rev
Log:
- work on messages
Modified:
trunk/storage/storage/src/include/ep-dm-lib.ycp
trunk/storage/storage/src/include/ep-dm.ycp
trunk/storage/storage/src/include/ep-hd-lib.ycp
trunk/storage/storage/src/include/ep-hd.ycp
trunk/storage/storage/src/include/ep-log.ycp
trunk/storage/storage/src/include/ep-lvm-lib.ycp
trunk/storage/storage/src/include/ep-main.ycp
trunk/storage/storage/src/include/ep-raid-lib.ycp
trunk/storage/storage/src/include/ep-settings.ycp
Modified: trunk/storage/storage/src/include/ep-dm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-d…
==============================================================================
--- trunk/storage/storage/src/include/ep-dm-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-dm-lib.ycp Tue Sep 2 10:39:44 2008
@@ -12,6 +12,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No DM device selected."));
return;
}
@@ -21,6 +22,7 @@
if (data["used_by"]:"" != "")
{
+ // error popup
Popup::Error(sformat(_("The DM %1 is in use. It cannot be
edited. To edit %1, make sure it is not used."), device));
return;
@@ -28,8 +30,6 @@
if (DlgEditDmVolume(data))
{
- Debug("edit dm from data", data);
-
Storage::ChangeVolumeProperties(data);
UpdateNavigationTree(nil);
Modified: trunk/storage/storage/src/include/ep-dm.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-d…
==============================================================================
--- trunk/storage/storage/src/include/ep-dm.ycp (original)
+++ trunk/storage/storage/src/include/ep-dm.ycp Tue Sep 2 10:39:44 2008
@@ -31,6 +31,7 @@
Greasemonkey::Transform(
`VBox(
`HStretch(),
+ // heading
`IconAndHeading(_("Device Mapper (DM)"), dm_icon),
`Table(`id(`table), `opt(`keepSorting, `notify),
table_header, table_contents)
@@ -62,6 +63,7 @@
`VBox(
StorageFields::Overview(fields, target_map, dm_device),
`HBox(
+ // push button text
`PushButton(`id(`edit), _("Edit...")),
`HStretch()
)
@@ -94,8 +96,6 @@
{
string part_device = (string) user_data;
- Debug("part_device", substring(part_device, 5));
-
symbol Predicate(map disk, map partition)
{
return StorageFields::PredicateUsedByDevice(disk, partition, [ part_device ]);
@@ -134,9 +134,12 @@
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
`VBox(
+ // heading
`IconAndHeading(sformat(_("DM Device: %1"), device), dm_icon),
`DumbTab(`id(`tab), [
+ // push button text
`item(`id(`overview), _("&Overview")),
+ // push button text
`item(`id(`devices), _("&Used Devices"))
],
`ReplacePoint(`id(`tab_panel), TabPanel::empty_panel)
Modified: trunk/storage/storage/src/include/ep-hd-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-h…
==============================================================================
--- trunk/storage/storage/src/include/ep-hd-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd-lib.ycp Tue Sep 2 10:39:44 2008
@@ -292,8 +292,7 @@
if (!disk["dasdfmt"]:false)
{
// popup text, %1 is replaced by a dasd name e.g. /dev/dasda
- boolean doit = Popup::YesNo(sformat(
-_("Running dasdfmt deletes all data on the disk.
+ boolean doit = Popup::YesNo(sformat(_("Running dasdfmt deletes all data on the disk.
Really execute dasdfmt on disk %1?
"), device));
Modified: trunk/storage/storage/src/include/ep-hd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-h…
==============================================================================
--- trunk/storage/storage/src/include/ep-hd.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd.ycp Tue Sep 2 10:39:44 2008
@@ -438,6 +438,7 @@
Greasemonkey::Transform(
`VBox(
`HStretch(),
+ // heading
`IconAndHeading(sformat(_("Partition: %1"), device), hd_part_icon),
StorageFields::Overview(fields, target_map, device),
`HBox(
Modified: trunk/storage/storage/src/include/ep-log.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-l…
==============================================================================
--- trunk/storage/storage/src/include/ep-log.ycp (original)
+++ trunk/storage/storage/src/include/ep-log.ycp Tue Sep 2 10:39:44 2008
@@ -18,8 +18,11 @@
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
`VBox(
+ // heading
`IconAndHeading(_("Log"), log_icon),
+ // label for log view
`LogView(`id(`log), sformat(_("Contents of %1:"), file), 10, 0),
+ // push button text
`PushButton(`id(`update), _("Update"))
)
));
Modified: trunk/storage/storage/src/include/ep-lvm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-l…
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-lib.ycp Tue Sep 2 10:39:44 2008
@@ -44,6 +44,7 @@
if (size(unused_pvs) < 1)
{
+ // error popup
Popup::Error(_("There are not enough suitable unused devices to create a volume group.
To use LVM, at least one unused partition of type 0x8e (or 0x83) or one unused
@@ -55,8 +56,6 @@
if (DlgCreateVolumeGroupNew(data))
{
- Debug("create vg from data", data);
-
string vg_name = data["name"]:"error";
integer pe_size = data["pesize"]:0;
@@ -77,6 +76,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No volume group selected."));
return;
}
@@ -89,8 +89,6 @@
symbol Commit()
{
- Debug("resize vg from data", data);
-
list<string> devices_old = (list<string>) union(data["devices"]:[], data["devices_add"]:[]);
devices_old = filter(string tmp, devices_old, { return !contains(data["devices_rem"]:[], tmp); });
list<string> devices_new = data["devices_new"]:[];
@@ -104,6 +102,7 @@
if (!RemovePvs(vgname, devices_removed))
{
+ // error popup
Popup::Error(_("Failed to remove some physical devices. TODO"));
// TODO: update data
@@ -128,6 +127,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No volume group selected."));
return;
}
@@ -139,7 +139,7 @@
if (count > 0)
{
- // Message popup
+ // message popup
Popup::Message(sformat(_("The volume group \"%1\" contains at least one logical
volume. It cannot be removed. Remove all logical volumes then
remove the volume group.
@@ -164,6 +164,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No logical volume selected."));
return;
}
@@ -177,6 +178,7 @@
if (target_map[device, "pe_free"]:0 == 0)
{
+ // error popup
Popup::Error(sformat(_("No free space left in the volume group \"%1\"."), vg_name));
return;
}
@@ -191,8 +193,6 @@
// ChangeVolumeProperties and thus addLogicalVolume need the device
data["device"] = device + "/" + data["name"]:"";
- Debug("create lv from data", data);
-
if (!addLogicalVolume(data, substring(device, 5)))
return `back;
@@ -213,6 +213,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No logical volume selected."));
return;
}
@@ -222,8 +223,6 @@
if (DlgEditLogicalVolume(data))
{
- Debug("edit lv from data", data);
-
Storage::ChangeVolumeProperties(data);
UpdateNavigationTree(nil);
@@ -237,6 +236,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No logical volume selected."));
return;
}
@@ -252,6 +252,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No logical volume selected."));
return;
}
Modified: trunk/storage/storage/src/include/ep-main.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-m…
==============================================================================
--- trunk/storage/storage/src/include/ep-main.ycp (original)
+++ trunk/storage/storage/src/include/ep-main.ycp Tue Sep 2 10:39:44 2008
@@ -174,17 +174,26 @@
// TODO: same ordering as with IterateTargetMap
tree = [ `item(`id(`all), `icon(all_icon), short_hostname, open(`all), [
+ // tree node label
`item(`id(`hd), `icon(hd_icon), _("Hard Disks"), open(`hd), subtree[`hd]:[]),
+ // tree node label
`item(`id(`md), `icon(raid_icon), _("RAID"), open(`md), subtree[`md]:[]),
+ // tree node label
`item(`id(`lvm), `icon(lvm_icon), _("Volume Management"), open(`lvm), subtree[`lvm]:[]),
+ // tree node label
`item(`id(`loop), `icon(loop_icon), _("Crypt Files"), open(`loop), subtree[`loop]:[]),
+ // tree node label
`item(`id(`dm), `icon(dm_icon), _("Device Mapper"), open(`dm), subtree[`dm]:[]),
+ // tree node label
`item(`id(`nfs), `icon(nfs_icon), _("NFS"), open(`nfs)/*, subtree[`nfs]:[]*/),
+ // tree node label
`item(`id(`unused), `icon(unused_icon), _("Unused Devices"), open(`unused))
]),
+ // tree node label
`item(`id(`settings), `icon(settings_icon), _("Settings"), open(`settings)) ];
if (Mode::normal())
+ // tree node label
tree = add(tree, `item(`id(`log), `icon(log_icon), _("Log"), open(`log)));
}
@@ -247,6 +256,7 @@
term contents = `MarginBox(0.5, 0.5,
`HBox(
`HWeight(30,
+ // tree node label
`Tree(`id(`tree), `opt(`notify), _("System View"), tree)
),
`HWeight(70,
Modified: trunk/storage/storage/src/include/ep-raid-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-r…
==============================================================================
--- trunk/storage/storage/src/include/ep-raid-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-raid-lib.ycp Tue Sep 2 10:39:44 2008
@@ -44,6 +44,7 @@
if (size(unused_devices) < 2)
{
+ // error popup
Popup::Error(_("There are not enough suitable unused devices to create a RAID."));
return;
}
@@ -57,8 +58,6 @@
if (DlgCreateRaidNew(data))
{
- Debug("create raid from data", data);
-
integer nr = data["nr"]:0;
symbol raid_type = symbolof(toterm(data["raid_type"]:"raid0"));
@@ -89,6 +88,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No RAID selected."));
return;
}
@@ -98,6 +98,7 @@
if (data["used_by"]:"" != "")
{
+ // error popup, %1 is replaced by device name e.g. /dev/md1
Popup::Error(sformat(_("The RAID %1 is in use. It cannot be
edited. To edit %1, make sure it is not used."), device));
return;
@@ -105,8 +106,6 @@
if (DlgEditRaid(data))
{
- Debug("edit raid from data", data);
-
Storage::ChangeVolumeProperties(data);
UpdateNavigationTree(nil);
@@ -120,6 +119,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No RAID selected."));
return;
}
@@ -129,6 +129,7 @@
if (!data["create"]:false)
{
+ // error popup, %1 is replaced by device name e.g. /dev/md1
Popup::Error(sformat(_("The RAID %1 is already created on disk. It cannot be
resized. To resize %1, remove it and create it again."), device));
return;
@@ -136,6 +137,7 @@
if (data["used_by"]:"" != "")
{
+ // error popup, %1 is replaced by device name e.g. /dev/md1
Popup::Error(sformat(_("The RAID %1 is in use. It cannot be
resized. To resize %1, make sure it is not used."), device));
return;
@@ -143,8 +145,6 @@
if (DlgResizeRaid(data))
{
- Debug("resize raid from data", data);
-
integer raid_nr = data["nr"]:0;
list<string> devices_old = data["devices"]:[];
@@ -159,6 +159,7 @@
if (!RemoveDevices(raid_nr, devices_removed))
{
+ // error popup
Popup::Error(_("Failed to remove some devices. TODO"));
}
@@ -173,6 +174,7 @@
{
if (device == nil)
{
+ // error popup
Popup::Error(_("No RAID selected."));
return;
}
Modified: trunk/storage/storage/src/include/ep-settings.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-s…
==============================================================================
--- trunk/storage/storage/src/include/ep-settings.ycp (original)
+++ trunk/storage/storage/src/include/ep-settings.ycp Tue Sep 2 10:39:44 2008
@@ -9,12 +9,19 @@
list< map<symbol, any> > visible_fields = [
+ // list entry
$[ `label : _("Label"), `fields : [ `label ] ],
+ // list entry
$[ `label : _("UUID"), `fields : [ `uuid ] ],
+ // list entry
$[ `label : _("Mount by"), `fields : [ `mount_by ] ],
+ // list entry
$[ `label : _("Used by"), `fields : [ `used_by ] ],
+ // list entry
$[ `label : _("BIOS ID"), `fields : [ `bios_id ] ],
+ // list entry
$[ `label : _("Cylinder information"), `fields : toset([ `start_cyl, `end_cyl, `num_cyl, `cyl_size ]) ],
+ // list entry
$[ `label : _("Fibre Channel information"), `fields : toset([ `fc_wwpn, `fc_fcp_lun, `fc_port_id ]) ]
];
@@ -37,33 +44,55 @@
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
`VBox(
+ // dialog heading
`IconAndHeading(_("Settings"), settings_icon),
`VBox(
`Left(`ComboBoxSelected(`id(`default_mountby),
+ // combo box label
_("Default Mount by"),
- [ `item(`id(`device), _("Device Name")),
- `item(`id(`label), _("Volume Label")),
- `item(`id(`uuid), _("UUID")),
- `item(`id(`id), _("Device ID")),
- `item(`id(`path), _("Device Path")) ],
+ [
+ // combo box entry
+ `item(`id(`device), _("Device Name")),
+ // combo box entry
+ `item(`id(`label), _("Volume Label")),
+ // combo box entry
+ `item(`id(`uuid), _("UUID")),
+ // combo box entry
+ `item(`id(`id), _("Device ID")),
+ // combo box entry
+ `item(`id(`path), _("Device Path"))
+ ],
`id(Storage::GetDefaultMountBy()))),
`Left(`ComboBoxSelected(`id(`default_fs),
+ // combo box label
_("Default File System"),
- [ `item(`id(`ext2), "Ext2"),
- `item(`id(`ext3), "Ext3"),
- `item(`id(`reiserfs), "Reiser") ],
+ [
+ // combo box entry
+ `item(`id(`ext2), "Ext2"),
+ // combo box entry
+ `item(`id(`ext3), "Ext3"),
+ // combo box entry
+ `item(`id(`reiserfs), "Reiser")
+ ],
`id(Partitions::DefaultFs()))),
`VSpacing(1),
`Left(`ComboBoxSelected(`id(`display_name), `opt(`notify),
+ // combo box label
_("Show Storage Devices by"),
- [ `item(`id(`device), _("Device Name")),
- `item(`id(`id), _("Device ID")),
- `item(`id(`path), _("Device Path")) ],
+ [
+ // combo box entry
+ `item(`id(`device), _("Device Name")),
+ // combo box entry
+ `item(`id(`id), _("Device ID")),
+ // combo box entry
+ `item(`id(`path), _("Device Path"))
+ ],
`id(StorageSettings::GetDisplayName()))),
//This looks extremely ugly, but obviously there are few other means how
//to make MultiSelection widget smaller, yet still readable
`Left(`HBox(
`MultiSelectionBox(`id(`visible_fields), `opt(`shrinkable),
+ // multi selection box label
_("Visible Information On Storage Devices"),
PreselectVisibleFields()),
`HStretch()
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50552 - in /trunk/ldap-server/src: LdapDatabase.ycp agent/SlapdConfigAgent.cc
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 10:33:14 2008
New Revision: 50552
URL: http://svn.opensuse.org/viewcvs/yast?rev=50552&view=rev
Log:
read by-Clauses from libslapdconfig
Modified:
trunk/ldap-server/src/LdapDatabase.ycp
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
Modified: trunk/ldap-server/src/LdapDatabase.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapDatabase.ycp…
==============================================================================
--- trunk/ldap-server/src/LdapDatabase.ycp (original)
+++ trunk/ldap-server/src/LdapDatabase.ycp Tue Sep 2 10:33:14 2008
@@ -532,6 +532,15 @@
`who_dn_subtree : [ _("All entries in the subtree") , "dn.subtree" ],
`who_group : [ _("All members of the group"), "group" ]
];
+ map<string, symbol> whoString2Id = $[
+ "*" : `who_all,
+ "users" : `who_users,
+ "anonymous" : `who_anon,
+ "self" : `who_self,
+ "dn.base" : `who_dn,
+ "dn.subtree" : `who_dn_subtree,
+ "group" : `who_group
+ ];
map<symbol, list<string> > accessId2String = $[
`access_none : [ _("No Access"), "none"],
@@ -543,6 +552,16 @@
`access_manage : [ _("Manage (full access)"), "manage" ]
];
+ map<string, symbol> accessString2Id = $[
+ "none" : `access_none,
+ "disclose" : `access_disclose,
+ "auth" : `access_auth,
+ "compare" : `access_compare,
+ "read" : `access_read,
+ "write" : `access_write,
+ "manage" : `access_manage
+ ];
+
global map AddAclAccess(string suffix, map access)
{
list itemlist = [];
@@ -950,6 +969,7 @@
map targetMap = acl["target"]:$[];
map resMap =$[];
resMap["target"] = $[];
+ resMap["access"] = [];
if ( size(targetMap) == 0 )
{
resMap["target", "what"] = `dn_all;
@@ -972,6 +992,17 @@
resMap["target", "filter"] = targetMap["filter"]:"";
resMap["target", "attrs"] = targetMap["attrs"]:"";
}
+ list<map> accessList = [];
+ foreach( map access, acl["access"]:[],
+ {
+ map<string,any> accessMap = $[];
+ accessMap["level"] = accessString2Id[access["level"]:""]:`access_none;
+ accessMap["type"] = whoString2Id[access["type"]:""]:`nil;
+ accessMap["dn"] = access["value"]:"";
+ accessList = add( accessList, accessMap );
+ }
+ );
+ resMap["access"] = accessList;
acllist = add( acllist, resMap );
}
);
Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
==============================================================================
--- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original)
+++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Tue Sep 2 10:33:14 2008
@@ -626,7 +626,7 @@
{
YCPMap aclMap;
YCPMap targetMap;
- YCPMap accessMap;
+ YCPList accessList;
if ( (*j)->matchesAll() )
{
}
@@ -659,8 +659,18 @@
targetMap.add( YCPString("dn"), dnMap );
}
}
- aclMap.add( YCPString("target"), targetMap );
- aclMap.add( YCPString("access"), accessMap );
+ aclMap.add( YCPString("target"), targetMap );
+ OlcAclByList byList =(*j)->getAclByList() ;
+ OlcAclByList::const_iterator k;
+ for ( k = byList.begin() ; k != byList.end(); k++ )
+ {
+ YCPMap byMap;
+ byMap.add(YCPString("level"), YCPString( (*k)->getLevel() ) );
+ byMap.add(YCPString("type"), YCPString( (*k)->getType() ) );
+ byMap.add(YCPString("value"), YCPString( (*k)->getValue() ) );
+ accessList.add(byMap);
+ }
+ aclMap.add( YCPString("access"), accessList );
resList.add(aclMap);
}
return resList;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50551 - in /trunk/ldap-server/src/lib: slapd-config.cpp slapd-config.h
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 10:33:10 2008
New Revision: 50551
URL: http://svn.opensuse.org/viewcvs/yast?rev=50551&view=rev
Log:
Added Storage Class for ACL "by" clauses
Modified:
trunk/ldap-server/src/lib/slapd-config.cpp
trunk/ldap-server/src/lib/slapd-config.h
Modified: trunk/ldap-server/src/lib/slapd-config.cpp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.cpp (original)
+++ trunk/ldap-server/src/lib/slapd-config.cpp Tue Sep 2 10:33:10 2008
@@ -539,6 +539,9 @@
}
else
{
+ std::string type = "";
+ std::string value = "";
+ std::string level = "";
spos = tmppos+1;
// skip whitespaces
tmppos = aclString.find_first_not_of("\t ", spos );
@@ -552,6 +555,7 @@
if ( aclString[spos] == '*' )
{
log_it(SLAPD_LOG_ERR, "by clause matches all entries" );
+ type = "*";
}
tmppos = aclString.find_first_of("=\t ", spos );
if ( tmppos == std::string::npos )
@@ -561,20 +565,28 @@
}
else
{
- log_it(SLAPD_LOG_INFO, "bytype: " + aclString.substr(spos, tmppos-spos) );
+ if ( type.empty() )
+ type = aclString.substr(spos, tmppos-spos);
+
+ log_it(SLAPD_LOG_INFO, "bytype: " + type );
if ( aclString[tmppos] == '=' )
{
spos = tmppos+1;
tmppos = extractAlcToken( aclString, spos, true );
- // is this a quoted string ?
- log_it(SLAPD_LOG_INFO, "byvalue: " + aclString.substr(spos, tmppos-spos) );
+ value = aclString.substr(spos, tmppos-spos);
+ log_it(SLAPD_LOG_INFO, "byvalue: " + value );
}
spos = tmppos+1;
tmppos = extractAlcToken( aclString, spos, false );
- log_it(SLAPD_LOG_INFO, "access: " + aclString.substr(spos, tmppos-spos) );
+ level = aclString.substr(spos, tmppos-spos);
+ log_it(SLAPD_LOG_INFO, "access: " + level );
spos = aclString.find_first_not_of("\t ", tmppos+1 );
tmppos = aclString.find_first_of("\t ", spos );
}
+ log_it(SLAPD_LOG_INFO, "level <"+level+"> type <"+type+"> value <"+value+">" );
+ boost::shared_ptr<OlcAclBy> by( new OlcAclBy(level, type, value) );
+ log_it(SLAPD_LOG_INFO, " type <"+by->getType()+">" );
+ m_byList.push_back(by);
}
}
}
@@ -640,6 +652,11 @@
return m_all;
}
+OlcAclByList OlcAccess::getAclByList() const
+{
+ return m_byList;
+}
+
OlcDatabase::OlcDatabase( const LDAPEntry& le=LDAPEntry()) : OlcConfigEntry(le)
{
Modified: trunk/ldap-server/src/lib/slapd-config.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.h (original)
+++ trunk/ldap-server/src/lib/slapd-config.h Tue Sep 2 10:33:10 2008
@@ -122,6 +122,33 @@
std::string m_parent;
};
+class OlcAclBy
+{
+ public:
+ inline OlcAclBy( const std::string& level,
+ const std::string& type,
+ const std::string& value = "" ) :
+ m_level(level), m_type(type), m_value(value) {};
+
+ inline std::string getLevel() const {
+ return m_level;
+ }
+
+ inline std::string getType() const {
+ return m_type;
+ }
+
+ inline std::string getValue() const {
+ return m_value;
+ }
+
+ private:
+ std::string m_level;
+ std::string m_type;
+ std::string m_value;
+};
+
+typedef std::list<boost::shared_ptr<OlcAclBy> > OlcAclByList;
class OlcAccess
{
public:
@@ -137,6 +164,7 @@
std::string getDnType() const;
std::string getDnValue() const;
bool matchesAll() const;
+ OlcAclByList getAclByList() const;
private:
std::string m_filter;
@@ -144,6 +172,7 @@
std::string m_dn_value;
std::string m_dn_type;
bool m_all;
+ OlcAclByList m_byList;
};
typedef std::list<boost::shared_ptr<OlcOverlay> > OlcOverlayList;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50550 - in /trunk/ldap-server/src: LdapDatabase.ycp agent/SlapdConfigAgent.cc tree_structure.ycp
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 10:33:06 2008
New Revision: 50550
URL: http://svn.opensuse.org/viewcvs/yast?rev=50550&view=rev
Log:
handle AccessList return from libslapdconfig
Modified:
trunk/ldap-server/src/LdapDatabase.ycp
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/tree_structure.ycp
Modified: trunk/ldap-server/src/LdapDatabase.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapDatabase.ycp…
==============================================================================
--- trunk/ldap-server/src/LdapDatabase.ycp (original)
+++ trunk/ldap-server/src/LdapDatabase.ycp Tue Sep 2 10:33:06 2008
@@ -942,9 +942,52 @@
}
- global boolean DbAclRead( integer dbindex )
+ global boolean DbAclRead( integer dbindex, list<map> readAcls )
{
acllist = [];
+ foreach( map acl, readAcls,
+ {
+ map targetMap = acl["target"]:$[];
+ map resMap =$[];
+ resMap["target"] = $[];
+ if ( size(targetMap) == 0 )
+ {
+ resMap["target", "what"] = `dn_all;
+ }
+ else
+ {
+ map dnMap = targetMap["dn"]:$[];
+ if (size(dnMap) > 0)
+ {
+ if (dnMap["style"]:"" == "subtree" )
+ {
+ resMap["target", "what"] = `dn_subtree;
+ }
+ else if (dnMap["style"]:"" == "base" )
+ {
+ resMap["target", "what"] = `dn_base;
+ }
+ resMap["target", "dn"] = dnMap["value"]:"";
+ }
+ resMap["target", "filter"] = targetMap["filter"]:"";
+ resMap["target", "attrs"] = targetMap["attrs"]:"";
+ }
+ acllist = add( acllist, resMap );
+ }
+ );
+ integer pos = -1;
+ list itemlist = maplist (map v, acllist,
+ {
+ pos=pos+1;
+ return `item( `id(pos),
+ whatId2String[v["target","what"]:`none,0]:"",
+ v["target","dn"]:"",
+ v["target","filter"]:"",
+ v["target","attrs"]:"All Attributes"
+ );
+ }
+ );
+ UI::ChangeWidget( `tab_acl, `Items, itemlist) ;
return true;
}
Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
==============================================================================
--- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original)
+++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Tue Sep 2 10:33:06 2008
@@ -619,8 +619,51 @@
}
else if ( dbComponent == "acl" )
{
- (*i)->getAcl();
- return resMap;
+ YCPList resList;
+ OlcAccessList aclList = (*i)->getAcl();
+ OlcAccessList::const_iterator j;
+ for ( j = aclList.begin(); j != aclList.end(); j++ )
+ {
+ YCPMap aclMap;
+ YCPMap targetMap;
+ YCPMap accessMap;
+ if ( (*j)->matchesAll() )
+ {
+ }
+ else
+ {
+ std::string filter = (*j)->getFilter();
+ if (filter != "" )
+ {
+ targetMap.add( YCPString("filter"), YCPString(filter) );
+ }
+ std::string attrs = (*j)->getAttributes();
+ if (attrs != "" )
+ {
+ targetMap.add( YCPString("attrs"), YCPString(attrs) );
+ }
+ std::string dn_value = (*j)->getDnValue();
+ if ( dn_value != "" )
+ {
+ YCPMap dnMap;
+ std::string dn_type = (*j)->getDnType();
+ if (dn_type == "dn.subtree" )
+ {
+ dnMap.add(YCPString("style"), YCPString("subtree") );
+ }
+ else
+ {
+ dnMap.add(YCPString("style"), YCPString("base") );
+ }
+ dnMap.add(YCPString("value"), YCPString(dn_value) );
+ targetMap.add( YCPString("dn"), dnMap );
+ }
+ }
+ aclMap.add( YCPString("target"), targetMap );
+ aclMap.add( YCPString("access"), accessMap );
+ resList.add(aclMap);
+ }
+ return resList;
}
else
{
Modified: trunk/ldap-server/src/tree_structure.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.y…
==============================================================================
--- trunk/ldap-server/src/tree_structure.ycp (original)
+++ trunk/ldap-server/src/tree_structure.ycp Tue Sep 2 10:33:06 2008
@@ -754,7 +754,7 @@
string treeItem = current_tree_item;
integer index = (integer)widget_map[current_tree_item,"index"]:nil;
list<map> acllist = LdapServer::ReadDatabaseAcl( index );
- return LdapDatabase::DbAclRead( index );
+ return LdapDatabase::DbAclRead( index, acllist );
}
define boolean cb_input_acl()
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0