Author: sh-sh-sh Date: Tue Apr 1 17:50:33 2008 New Revision: 45937 URL: http://svn.opensuse.org/viewcvs/yast?rev=45937&view=rev Log: Added "HelpText" property to YWidget for easier support of YCP wizard layouts without permanent help panel Modified: trunk/libyui/VERSION trunk/libyui/package/yast2-libyui.changes trunk/libyui/src/YUISymbols.h trunk/libyui/src/YWidget.cc trunk/libyui/src/YWidget.h Modified: trunk/libyui/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/VERSION?rev=45937&r1=45936&r2=45937&view=diff ============================================================================== --- trunk/libyui/VERSION (original) +++ trunk/libyui/VERSION Tue Apr 1 17:50:33 2008 @@ -1 +1 @@ -2.16.40 +2.16.41 Modified: trunk/libyui/package/yast2-libyui.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/package/yast2-libyui.changes?rev=45937&r1=45936&r2=45937&view=diff ============================================================================== --- trunk/libyui/package/yast2-libyui.changes (original) +++ trunk/libyui/package/yast2-libyui.changes Tue Apr 1 17:50:33 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Apr 1 17:49:15 CEST 2008 - sh@suse.de + +- Added "HelpText" property to YWidget for easier support of + YCP wizard layouts without permanent help panel +- V 2.16.41 + +------------------------------------------------------------------- Thu Mar 20 19:17:19 CET 2008 - sh@suse.de - Added standard file logger (when used independently of YaST2) Modified: trunk/libyui/src/YUISymbols.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YUISymbols.h?rev=45937&r1=45936&r2=45937&view=diff ============================================================================== --- trunk/libyui/src/YUISymbols.h (original) +++ trunk/libyui/src/YUISymbols.h Tue Apr 1 17:50:33 2008 @@ -157,6 +157,7 @@ #define YUIProperty_Enabled "Enabled" #define YUIProperty_ExpectedSize "ExpectedSize" #define YUIProperty_Filename "Filename" +#define YUIProperty_HelpText "HelpText" #define YUIProperty_IconPath "IconPath" #define YUIProperty_InputMaxLength "InputMaxLength" #define YUIProperty_Item "Item" Modified: trunk/libyui/src/YWidget.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YWidget.cc?rev=45937&r1=45936&r2=45937&view=diff ============================================================================== --- trunk/libyui/src/YWidget.cc (original) +++ trunk/libyui/src/YWidget.cc Tue Apr 1 17:50:33 2008 @@ -88,6 +88,7 @@ YBothDim<int> weight; int functionKey; string widgetName; + string helpText; }; @@ -340,7 +341,18 @@ { priv->widgetName = name; } - + + +string YWidget::helpText() const +{ + return priv->helpText; +} + + +void YWidget::setHelpText( const string & helpText ) +{ + priv->helpText = helpText; +} YWidgetID * @@ -350,8 +362,7 @@ } -void -YWidget::setId( YWidgetID * newId ) +void YWidget::setId( YWidgetID * newId ) { if ( priv->id ) delete priv->id; @@ -360,8 +371,7 @@ } -bool -YWidget::hasId() const +bool YWidget::hasId() const { return priv->id != 0; } @@ -397,6 +407,7 @@ * @property boolean Notify the current notify state (see also `opt( `notify )) * @property string WidgetClass the widget class of this widget (YLabel, YPushButton, ...) * @property string WidgetName internal name for this widget (by default the string-ized ID) + * @property string HelpText help text * @property string DebugLabel (possibly translated) text describing this widget for debugging **/ @@ -405,6 +416,7 @@ propSet.add( YProperty( YUIProperty_WidgetClass, YStringProperty, true ) ); // read-only propSet.add( YProperty( YUIProperty_DebugLabel, YStringProperty, true ) ); // read-only propSet.add( YProperty( YUIProperty_WidgetName, YStringProperty ) ); + propSet.add( YProperty( YUIProperty_HelpText, YStringProperty ) ); } return propSet; @@ -427,6 +439,7 @@ if ( propertyName == YUIProperty_Enabled ) setEnabled( val.boolVal() ); else if ( propertyName == YUIProperty_Notify ) setNotify ( val.boolVal() ); else if ( propertyName == YUIProperty_WidgetName ) setWidgetName( val.stringVal() ); + else if ( propertyName == YUIProperty_HelpText ) setHelpText( val.stringVal() ); return true; // success -- no special processing necessary } @@ -449,6 +462,7 @@ if ( propertyName == YUIProperty_Notify ) return YPropertyValue( notify() ); if ( propertyName == YUIProperty_WidgetClass ) return YPropertyValue( widgetClass() ); if ( propertyName == YUIProperty_WidgetName ) return YPropertyValue( widgetName() ); + if ( propertyName == YUIProperty_HelpText ) return YPropertyValue( helpText() ); if ( propertyName == YUIProperty_DebugLabel ) return YPropertyValue( debugLabel() ); return YPropertyValue( false ); // NOTREACHED @@ -653,7 +667,7 @@ void YWidget::dumpWidget( YWidget *w, int indentationLevel ) { std::ostringstream str; - + string indentation ( indentationLevel * 4, ' ' ); str << "Widget tree: " << indentation << w; @@ -663,7 +677,7 @@ << hex << w->widgetRep() << dec << ")"; } - + string stretch; if ( w->stretchable( YD_HORIZ ) ) stretch += "hstretch "; @@ -671,7 +685,7 @@ if ( ! stretch.empty() ) str << " ( " << stretch << " ) "; - + yuiMilestone() << str.str() << endl; } @@ -682,7 +696,7 @@ // // Record this widget's user input property (if there is any) // - + if ( userInputProperty() ) { macroRecorder->recordWidgetProperty( this, userInputProperty() ); @@ -691,7 +705,7 @@ // // Record the child widgets' (if there are any) user input // - + for ( YWidgetListConstIterator it = childrenBegin(); it != childrenEnd(); ++it ) Modified: trunk/libyui/src/YWidget.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui/src/YWidget.h?rev=45937&r1=45936&r2=45937&view=diff ============================================================================== --- trunk/libyui/src/YWidget.h (original) +++ trunk/libyui/src/YWidget.h Tue Apr 1 17:50:33 2008 @@ -89,6 +89,20 @@ **/ void setWidgetName( const string & name ); + /** + * Return the help text for this widget. + **/ + string helpText() const; + + /** + * Set a help text for this widget. + * + * Currently, the UI does not do anything with this text but store it. + * Displaying the text at a convenient time is currently the application's + * responsibility. This may change in future versions. + **/ + void setHelpText( const string & helpText ); + // // Property Management @@ -545,7 +559,7 @@ /** * Recursively save the user input of all child widgets to a macro - * recorder: + * recorder: * * All child widgets that could contain data entered by the user * are requested to send their contents to the macro recorder, e.g. input @@ -559,7 +573,7 @@ * * Widgets that need another number of properties recorded should * reimplement this method (and NOT call this default method in the new - * implementation). + * implementation). **/ virtual void saveUserInput( YMacroRecorder *macroRecorder ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org