Mailinglist Archive: yast-commit (723 mails)

< Previous Next >
[yast-commit] r47383 - in /trunk/scanner: VERSION package/yast2-scanner.changes src/Scanner.ycp
  • From: jsmeix@xxxxxxxxxxxxxxxx
  • Date: Thu, 08 May 2008 15:47:56 -0000
  • Message-id: <20080508154756.9DAC32DD63@xxxxxxxxxxxxxxxx>
Author: jsmeix
Date: Thu May 8 17:47:56 2008
New Revision: 47383

URL: http://svn.opensuse.org/viewcvs/yast?rev=47383&view=rev
Log:

- V 2.16.10
- Implemented a progress bar while creating the scanner database
without any new or changed text because of the 'text freeze'
(see Novell/Suse Bugzilla bnc#388144).


Modified:
trunk/scanner/VERSION
trunk/scanner/package/yast2-scanner.changes
trunk/scanner/src/Scanner.ycp

Modified: trunk/scanner/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/scanner/VERSION?rev=47383&r1=47382&r2=47383&view=diff
==============================================================================
--- trunk/scanner/VERSION (original)
+++ trunk/scanner/VERSION Thu May 8 17:47:56 2008
@@ -1 +1 @@
-2.16.9
+2.16.10

Modified: trunk/scanner/package/yast2-scanner.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/scanner/package/yast2-scanner.changes?rev=47383&r1=47382&r2=47383&view=diff
==============================================================================
--- trunk/scanner/package/yast2-scanner.changes (original)
+++ trunk/scanner/package/yast2-scanner.changes Thu May 8 17:47:56 2008
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu May 8 16:58:51 CEST 2008 - jsmeix@xxxxxxx
+
+- V 2.16.10
+- Implemented a progress bar while creating the scanner database
+ without any new or changed text because of the 'text freeze'
+ (see Novell/Suse Bugzilla bnc#388144).
+
+-------------------------------------------------------------------
Wed May 7 15:40:27 CEST 2008 - jsmeix@xxxxxxx

- V 2.16.9

Modified: trunk/scanner/src/Scanner.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/scanner/src/Scanner.ycp?rev=47383&r1=47382&r2=47383&view=diff
==============================================================================
--- trunk/scanner/src/Scanner.ycp (original)
+++ trunk/scanner/src/Scanner.ycp Thu May 8 17:47:56 2008
@@ -798,14 +798,37 @@
|| -1 == SCR::Read( .target.size, database_filename )
)
{ // Show feedback because creating the scanner database takes a few seconds:
- Popup::ShowFeedback( // No title for a simple busy message:
- "",
- // Busy message:
- // Body of a Popup::ShowFeedback:
- _("Creating scanner database...")
- );
+ string feedback_message = _("Creating scanner database...");
+ boolean progress_feedback = UI::HasSpecialWidget( `DownloadProgress );
+ if( progress_feedback )
+ { // Show nice self-updating feedback:
+ // Empty an existing database file so that the DownloadProgress starts
at the beginning.
+ ExecuteBashCommand( "cat /dev/null >" + database_filename );
+ UI::OpenDialog( `MinSize( 60, 3,
+ `ReplacePoint(
`id(`create_database_progress_replace_point),
+ `DownloadProgress(
feedback_message,
+
database_filename,
+ // On my
openSUSE 10.3 the size is about 538000 bytes:
+ 600000
+ )
+ )
+ )
+ );
+ }
+ else
+ { // Show a simple static busy message:
+ Popup::ShowFeedback( // No title for a simple busy message:
+ "",
+ feedback_message
+ );
+ }
if( ! ExecuteBashCommand( create_database_commandline ) )
- { Popup::ClearFeedback();
+ { if( progress_feedback )
+ { UI::CloseDialog();
+ }
+ else
+ { Popup::ClearFeedback();
+ }
Report::Error( // Message of a Report::Error.
// Only a simple message because this error does not
happen on a normal system
// (i.e. a system which is not totally broken or totally
messed up).
@@ -813,7 +836,33 @@
);
return false;
}
- Popup::ClearFeedback();
+ if( progress_feedback )
+ { // Setting the DownloadProgress to 100% by setting its property
+ // ExpectedSize to 1 (setting it to 0 results wrong output) by calling
+ // UI::ChangeWidget( `id(`create_database_progress), `ExpectedSize, 1 )
+ // results bad looking output because the DownloadProgress widget is
visible re-drawn
+ // first with a small 1% initially starting progress bar which then
jumps up to 100%
+ // but what is intended is that the current progress bar jumps directly
up to 100%.
+ // Therefore DownloadProgress is not used at all but replaced by a 100%
ProgressBar.
+ // Because ProgressBar has a different default width than
DownloadProgress,
+ // a MinWidth which is sufficient for both is set above.
+ // The size is measured in units roughly equivalent to the size of a
character
+ // in the respective UI (1/80 of the full screen width horizontally,
+ // 1/25 of the full screen width vertically) where full screen size
+ // is 640x480 pixels (y2qt) or 80x25 characters (y2ncurses).
+ UI::ReplaceWidget( `id(`create_database_progress_replace_point),
+ `ProgressBar( feedback_message,
+ 100,
+ 100
+ )
+ );
+ // Sleep half a second to let the user notice that the progress is
finished:
+ sleep( 500 );
+ UI::CloseDialog();
+ }
+ else
+ { Popup::ClearFeedback();
+ }
}
database = (list< map< string, string > >)SCR::Read( .target.ycp,
database_filename );
if( database == nil )

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages