On Thu, Jan 10, 2008 at 04:07:46PM -0000, tgoettlicher@svn.opensuse.org wrote:
Author: tgoettlicher Date: Thu Jan 10 17:07:46 2008 New Revision: 43537
URL: http://svn.opensuse.org/viewcvs/yast?rev=43537&view=rev Log: added BusyIndicator widget (fate #302559)
Hi, Thomas has asked me for a review of the implementation, here it is: We are adding a new widget. In general, we need - documentation http://forgeftp.novell.com/yast/doc/SL10.3/tdg/Book-UIReference.html OK, it is there - implementation for all 3 UIs I see only qt. What about the rest? - proper dependencies because the ABI changes See below
Added: trunk/core/libyui/doc/examples/BusyIndicator.ycp trunk/core/libyui/src/YBusyIndicator.cc trunk/core/libyui/src/YBusyIndicator.h Modified: trunk/core/VERSION trunk/core/libyui/src/Makefile.am trunk/core/libyui/src/YCPDialogParser.cc trunk/core/libyui/src/YCPDialogParser.h trunk/core/libyui/src/YUISymbols.h trunk/core/libyui/src/YWidgetFactory.h trunk/core/package/yast2-core.changes
...
Added: trunk/core/libyui/doc/examples/BusyIndicator.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/BusyIndicator.ycp?rev=43537&view=auto ============================================================================== --- trunk/core/libyui/doc/examples/BusyIndicator.ycp (added) +++ trunk/core/libyui/doc/examples/BusyIndicator.ycp Thu Jan 10 17:07:46 2008 @@ -0,0 +1,33 @@ +// Simple ProgressBar example BusyIndicator
+{ + integer timeout = 1001; // in milliseconds
+ + UI::OpenDialog( + `VBox( + `BusyIndicator(`id(`busy), "Sample busy indicator", timeout ), + `PushButton(`id(`alive), "send &tick"), + `PushButton(`id(`query), "&query"), + `Right(`PushButton(`id(`close), "&Close" ) ) + ) + ); + + + while ( true ) + { + symbol button = (symbol) UI::UserInput(); + + if ( button == `alive ) + { + UI::ChangeWidget(`id(`busy), `Alive, true); + UI::ChangeWidget(`id(`busy), `Timeout, 999); + } + else if ( button == `query ) + { + UI::ChangeWidget(`id(`busy), `Label, sformat("timeout: %1, alive: %2",UI::QueryWidget(`id(`busy), `Timeout), UI::QueryWidget(`id(`busy), `Alive))); + } + else if ( button == `close ) + break; + } + + UI::CloseDialog(); +}
Added: trunk/core/libyui/src/YBusyIndicator.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YBusyIndicator.cc?rev=43537&view=auto ============================================================================== --- trunk/core/libyui/src/YBusyIndicator.cc (added) +++ trunk/core/libyui/src/YBusyIndicator.cc Thu Jan 10 17:07:46 2008 +const YPropertySet & +YBusyIndicator::propertySet() +{ + static YPropertySet propSet; + + if ( propSet.isEmpty() ) + { + /* + * @property integer Timeout timeout until busy indicator changes to stalled state in ms
+ * @property bool Alive busy indicator is in alive or stalled state + * @property string Label caption above the busy indicator + */ + propSet.add( YProperty( YUIProperty_Timeout, YIntegerProperty ) ); + propSet.add( YProperty( YUIProperty_Alive, YBoolProperty ) ); + propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); + propSet.add( YWidget::propertySet() ); + } + + return propSet; +} Added: trunk/core/libyui/src/YBusyIndicator.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YBusyIndicator.h?rev=43537&view=auto ============================================================================== --- trunk/core/libyui/src/YBusyIndicator.h (added) +++ trunk/core/libyui/src/YBusyIndicator.h Thu Jan 10 17:07:46 2008 + /** + * Return the current timout value.
in milliseconds
+ **/ + int timeout() const; + Modified: trunk/core/libyui/src/YCPDialogParser.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.cc?rev=43537&r1=43536&r2=43537&view=diff ============================================================================== --- trunk/core/libyui/src/YCPDialogParser.cc (original) +++ trunk/core/libyui/src/YCPDialogParser.cc Thu Jan 10 17:07:46 2008 @@ -80,6 +80,7 @@ #include "YTree.h" #include "YWizard.h" #include "YTimezoneSelector.h" +#include "YBusyIndicator.h"
using std::string;
@@ -262,6 +263,7 @@ else if ( s == YUIWidget_VSquash ) w = parseSquash ( p, opt, term, ol, n, false, true ); else if ( s == YUIWidget_VStretch ) w = parseSpacing ( p, opt, term, ol, n, YD_VERT, true ); else if ( s == YUIWidget_VWeight ) w = parseWeight ( p, opt, term, ol, n, YD_VERT ); + else if ( s == YUIWidget_BusyIndicator ) w = parseBusyIndicator ( p, opt, term, ol, n );
// Special widgets - may or may not be supported by the specific UI. // The YCP application should ask for presence of such a widget with Has???Widget() prior to creating one. @@ -2198,6 +2200,9 @@ * value will be 100. If you omit the optional parameter <tt>progress</tt>, the * progress bar will set to 0 initially. * + * If you don't know the number of total steps you might want to use the + * BusyIndicator widget instead of ProgressBar. + * **/
YWidget * @@ -3307,6 +3312,54 @@ return selector; }
+/** + * @widget Busy Indicator
BusyIndicator (make -C core/libyui/doc and see the generated docs to proofread it)
+ * @short Graphical busy indicator + * @class YBusyIndicator + * @arg string label the label describing the bar + * @optarg integer timeout the timout until busy indicator changes to stalled state s/timout/timeout/ in milliseconds, 1000ms by default
+ * @usage `BusyIndicator(`id(`busy), "background action", 2000 ), + * @example BusyIndicator.ycp + * + * @description + * + * A busy indicator is a bar with a label that gives feedback to the user that + * a task is in progress and the user has to wait. It is similar to a progress bar. + * The difference is that a busy indicator can be used when the total number of + * steps is not known before the action starts. You have to send keep alive messages + * by setting alive to true every now and then, otherwise the busy indicator will + * change to stalled state. + * + **/ Modified: trunk/core/libyui/src/YWidgetFactory.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidgetFactory.h?rev=43537&r1=43536&r2=43537&view=diff ============================================================================== --- trunk/core/libyui/src/YWidgetFactory.h (original) +++ trunk/core/libyui/src/YWidgetFactory.h Thu Jan 10 17:07:46 2008 @@ -56,6 +56,7 @@ class YTableHeader; class YTimeField; class YTree; +class YBusyIndicator;
@@ -102,6 +103,7 @@ virtual YTable * createTable ( YWidget * parent, YTableHeader * header ) = 0; virtual YProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 ) = 0; virtual YRichText * createRichText ( YWidget * parent, const string & text = string(), bool plainTextMode = false ) = 0; + virtual YBusyIndicator * createBusyIndicator ( YWidget * parent, const string & label, int timeout = 1000 ) = 0;
Adding a virtual method makes a library binary incompatible: http://techbase.kde.org/index.php?title=Policies/Binary_Compatibility_Issues... I see that you use the implementation pointer technique in the widget itself but we probably cannot avoid the ABI change for the factory class. So we have to add proper RPM dependencies. The easiest way should be changing the soname, like this in Makefile.am: -libpy2UI_la_LDFLAGS = -version-info 2:0 +libpy2UI_la_LDFLAGS = -version-info 3:0 -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Hi Martin, thank you for the code review. I will take care for the issues you have mentioned. How can I update the documentation at http://forgeftp.novell.com/ ? Thomas On Mon, 2008-01-14 at 11:29 +0100, Martin Vidner wrote:
On Thu, Jan 10, 2008 at 04:07:46PM -0000, tgoettlicher@svn.opensuse.org wrote:
Author: tgoettlicher Date: Thu Jan 10 17:07:46 2008 New Revision: 43537
URL: http://svn.opensuse.org/viewcvs/yast?rev=43537&view=rev Log: added BusyIndicator widget (fate #302559)
Hi,
Thomas has asked me for a review of the implementation, here it is:
We are adding a new widget. In general, we need - documentation http://forgeftp.novell.com/yast/doc/SL10.3/tdg/Book-UIReference.html OK, it is there
- implementation for all 3 UIs I see only qt. What about the rest?
- proper dependencies because the ABI changes See below
Added: trunk/core/libyui/doc/examples/BusyIndicator.ycp trunk/core/libyui/src/YBusyIndicator.cc trunk/core/libyui/src/YBusyIndicator.h Modified: trunk/core/VERSION trunk/core/libyui/src/Makefile.am trunk/core/libyui/src/YCPDialogParser.cc trunk/core/libyui/src/YCPDialogParser.h trunk/core/libyui/src/YUISymbols.h trunk/core/libyui/src/YWidgetFactory.h trunk/core/package/yast2-core.changes
...
Added: trunk/core/libyui/doc/examples/BusyIndicator.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/BusyIndicator.ycp?rev=43537&view=auto ============================================================================== --- trunk/core/libyui/doc/examples/BusyIndicator.ycp (added) +++ trunk/core/libyui/doc/examples/BusyIndicator.ycp Thu Jan 10 17:07:46 2008 @@ -0,0 +1,33 @@ +// Simple ProgressBar example BusyIndicator
+{ + integer timeout = 1001; // in milliseconds
+ + UI::OpenDialog( + `VBox( + `BusyIndicator(`id(`busy), "Sample busy indicator", timeout ), + `PushButton(`id(`alive), "send &tick"), + `PushButton(`id(`query), "&query"), + `Right(`PushButton(`id(`close), "&Close" ) ) + ) + ); + + + while ( true ) + { + symbol button = (symbol) UI::UserInput(); + + if ( button == `alive ) + { + UI::ChangeWidget(`id(`busy), `Alive, true); + UI::ChangeWidget(`id(`busy), `Timeout, 999); + } + else if ( button == `query ) + { + UI::ChangeWidget(`id(`busy), `Label, sformat("timeout: %1, alive: %2",UI::QueryWidget(`id(`busy), `Timeout), UI::QueryWidget(`id(`busy), `Alive))); + } + else if ( button == `close ) + break; + } + + UI::CloseDialog(); +}
Added: trunk/core/libyui/src/YBusyIndicator.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YBusyIndicator.cc?rev=43537&view=auto ============================================================================== --- trunk/core/libyui/src/YBusyIndicator.cc (added) +++ trunk/core/libyui/src/YBusyIndicator.cc Thu Jan 10 17:07:46 2008 +const YPropertySet & +YBusyIndicator::propertySet() +{ + static YPropertySet propSet; + + if ( propSet.isEmpty() ) + { + /* + * @property integer Timeout timeout until busy indicator changes to stalled state in ms
+ * @property bool Alive busy indicator is in alive or stalled state + * @property string Label caption above the busy indicator + */ + propSet.add( YProperty( YUIProperty_Timeout, YIntegerProperty ) ); + propSet.add( YProperty( YUIProperty_Alive, YBoolProperty ) ); + propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); + propSet.add( YWidget::propertySet() ); + } + + return propSet; +} Added: trunk/core/libyui/src/YBusyIndicator.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YBusyIndicator.h?rev=43537&view=auto ============================================================================== --- trunk/core/libyui/src/YBusyIndicator.h (added) +++ trunk/core/libyui/src/YBusyIndicator.h Thu Jan 10 17:07:46 2008 + /** + * Return the current timout value.
in milliseconds
+ **/ + int timeout() const; + Modified: trunk/core/libyui/src/YCPDialogParser.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.cc?rev=43537&r1=43536&r2=43537&view=diff ============================================================================== --- trunk/core/libyui/src/YCPDialogParser.cc (original) +++ trunk/core/libyui/src/YCPDialogParser.cc Thu Jan 10 17:07:46 2008 @@ -80,6 +80,7 @@ #include "YTree.h" #include "YWizard.h" #include "YTimezoneSelector.h" +#include "YBusyIndicator.h"
using std::string;
@@ -262,6 +263,7 @@ else if ( s == YUIWidget_VSquash ) w = parseSquash ( p, opt, term, ol, n, false, true ); else if ( s == YUIWidget_VStretch ) w = parseSpacing ( p, opt, term, ol, n, YD_VERT, true ); else if ( s == YUIWidget_VWeight ) w = parseWeight ( p, opt, term, ol, n, YD_VERT ); + else if ( s == YUIWidget_BusyIndicator ) w = parseBusyIndicator ( p, opt, term, ol, n );
// Special widgets - may or may not be supported by the specific UI. // The YCP application should ask for presence of such a widget with Has???Widget() prior to creating one. @@ -2198,6 +2200,9 @@ * value will be 100. If you omit the optional parameter <tt>progress</tt>, the * progress bar will set to 0 initially. * + * If you don't know the number of total steps you might want to use the + * BusyIndicator widget instead of ProgressBar. + * **/
YWidget * @@ -3307,6 +3312,54 @@ return selector; }
+/** + * @widget Busy Indicator
BusyIndicator (make -C core/libyui/doc and see the generated docs to proofread it)
+ * @short Graphical busy indicator + * @class YBusyIndicator + * @arg string label the label describing the bar + * @optarg integer timeout the timout until busy indicator changes to stalled state s/timout/timeout/ in milliseconds, 1000ms by default
+ * @usage `BusyIndicator(`id(`busy), "background action", 2000 ), + * @example BusyIndicator.ycp + * + * @description + * + * A busy indicator is a bar with a label that gives feedback to the user that + * a task is in progress and the user has to wait. It is similar to a progress bar. + * The difference is that a busy indicator can be used when the total number of + * steps is not known before the action starts. You have to send keep alive messages + * by setting alive to true every now and then, otherwise the busy indicator will + * change to stalled state. + * + **/ Modified: trunk/core/libyui/src/YWidgetFactory.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidgetFactory.h?rev=43537&r1=43536&r2=43537&view=diff ============================================================================== --- trunk/core/libyui/src/YWidgetFactory.h (original) +++ trunk/core/libyui/src/YWidgetFactory.h Thu Jan 10 17:07:46 2008 @@ -56,6 +56,7 @@ class YTableHeader; class YTimeField; class YTree; +class YBusyIndicator;
@@ -102,6 +103,7 @@ virtual YTable * createTable ( YWidget * parent, YTableHeader * header ) = 0; virtual YProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 ) = 0; virtual YRichText * createRichText ( YWidget * parent, const string & text = string(), bool plainTextMode = false ) = 0; + virtual YBusyIndicator * createBusyIndicator ( YWidget * parent, const string & label, int timeout = 1000 ) = 0;
Adding a virtual method makes a library binary incompatible: http://techbase.kde.org/index.php?title=Policies/Binary_Compatibility_Issues... I see that you use the implementation pointer technique in the widget itself but we probably cannot avoid the ABI change for the factory class.
So we have to add proper RPM dependencies. The easiest way should be changing the soname, like this in Makefile.am: -libpy2UI_la_LDFLAGS = -version-info 2:0 +libpy2UI_la_LDFLAGS = -version-info 3:0
-- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner
Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Thomas Goettlicher wrote:
Hi Martin,
thank you for the code review. I will take care for the issues you have mentioned.
How can I update the documentation at http://forgeftp.novell.com/ ?
Hi, Updating the documentation there is not as easy as it looks to be. The documentation is generated from sources and then uploaded by rsync. First, documentation needs to be fixed in XML or source files, then documentation (or its part) regenerated and uploaded. See http://svn.opensuse.org/svn/yast/trunk/doc/_build-www.sh L. -- Lukas Ocilka, YaST Developer (xn--luk-gla45d) ----------------------------------------------------------------- SUSE LINUX, s. r. o., Lihovarska 1060/12, Praha 9, Czech Republic
> > Author: tgoettlicher > - implementation for all 3 UIs > I see only qt. What about the rest? We (me & gtk folks) did not implement it so far and I guess we cannot expect Thomas to do it for us ;-) And please somebody switch that feature to 'implementation' state, I'm not sure I can do it myself ... B. -- \\\\\ Katarina Machalkova \\\\\\\__o YaST developer __\\\\\\\'/_ & hedgehog painter
On Mon, 2008-01-14 at 13:09 +0100, Katarina Machalkova wrote:
I see only qt. What about the rest?
We (me & gtk folks) did not implement it so far and I guess we cannot expect Thomas to do it for us ;-) Phew! I guess it would be hard for me to implement this widget in ncurses or gtk.
Thomas -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Mon, Jan 14, 2008 at 02:09:48PM +0100, Thomas Goettlicher wrote:
On Mon, 2008-01-14 at 13:09 +0100, Katarina Machalkova wrote:
I see only qt. What about the rest?
We (me & gtk folks) did not implement it so far and I guess we cannot expect Thomas to do it for us ;-) Phew! I guess it would be hard for me to implement this widget in ncurses or gtk.
But until someone implements it, you must not submit your change to autobuild or ncurses and gtk will break: YNCursesUI.cc:101: error: cannot allocate an object of abstract type 'NCWidgetFactory' NCWidgetFactory.h:63: note: because the following virtual functions are pure within 'NCWidgetFactory': /home/mvidner/pfx/include/YaST2/yui/YWidgetFactory.h:106: note: virtual YBusyIndicator* YWidgetFactory::createBusyIndicator(YWidget*, const std::string&, int) Alternatively, you could make the widget into an optional one, like the timezone selector. -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Monday 14 January 2008 14:15:19 Martin Vidner wrote:
Alternatively, you could make the widget into an optional one, like the timezone selector.
I think this widget is pretty basic so it should not be optional, and it is implementable in any UI. We will try to implement it in ncurses. Should be trivial. Duncan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Am Montag 14 Januar 2008 schrieb Duncan Mac-Vicar Prett:
On Monday 14 January 2008 14:15:19 Martin Vidner wrote:
Alternatively, you could make the widget into an optional one, like the timezone selector.
I think this widget is pretty basic so it should not be optional, and it is implementable in any UI.
We will try to implement it in ncurses. Should be trivial.
When? without a new yast2-core I can't submit any yast2-qt fixes ;( Greetings, Stephan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Mon, 2008-01-14 at 19:07 +0100, Stephan Kulow wrote:
We will try to implement it in ncurses. Should be trivial.
When? without a new yast2-core I can't submit any yast2-qt fixes ;( I have already submitted a package of the yast2-core (with busy indicator). I think you can submit yast2-qt fixes now.
Thomas -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Am Dienstag 15 Januar 2008 schrieb Thomas Goettlicher:
On Mon, 2008-01-14 at 19:07 +0100, Stephan Kulow wrote:
We will try to implement it in ncurses. Should be trivial.
When? without a new yast2-core I can't submit any yast2-qt fixes ;(
I have already submitted a package of the yast2-core (with busy indicator). I think you can submit yast2-qt fixes now.
You might have tagged a new release, but factory still has 2.16.19 - i.e. nothing was submitted. I worked around the problem in disabling all features in yast2-qt package that need newer yast2-core, so I could submit a new version for alpha1. Greetings, Stephan -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Tue, 2008-01-15 at 11:14 +0100, Stephan Kulow wrote:
You might have tagged a new release, but factory still has 2.16.19 - i.e. nothing was submitted. Upps! Sorry /work wasn't mounted on my machine and submitting failed.
Thomas -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Mon, Jan 14, 2008 at 11:29:35AM +0100, Martin Vidner wrote:
On Thu, Jan 10, 2008 at 04:07:46PM -0000, tgoettlicher@svn.opensuse.org wrote:
+ virtual YBusyIndicator * createBusyIndicator ( YWidget * parent, const string & label, int timeout = 1000 ) = 0;
Adding a virtual method makes a library binary incompatible: http://techbase.kde.org/index.php?title=Policies/Binary_Compatibility_Issues... I see that you use the implementation pointer technique in the widget itself but we probably cannot avoid the ABI change for the factory class.
So we have to add proper RPM dependencies. The easiest way should be changing the soname, like this in Makefile.am: -libpy2UI_la_LDFLAGS = -version-info 2:0 +libpy2UI_la_LDFLAGS = -version-info 3:0
What I did not realize was that the plugin loader has a hardcoded "2" for version number (... "/libpy2" + name + ".so.2" in core/libycp/src/pathsearch.cc). Removing the version suffix from there is not easy, because libfoo.so is in foo-devel.rpm, unlike libfoo.so.2. So for the time being I will revert the SO version to 2 and use RPM versioning instead. -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (6)
-
Duncan Mac-Vicar Prett
-
Katarina Machalkova
-
Lukas Ocilka
-
Martin Vidner
-
Stephan Kulow
-
Thomas Goettlicher