[yast-commit] r38256 - in /branches/tmp/sh/mod-ui/core/libyui/src: ChangeLog YPushButton.cc YUI.h YUI_widgets.cc YWidget.h
Author: sh-sh-sh Date: Fri Jun 1 18:38:17 2007 New Revision: 38256 URL: http://svn.opensuse.org/viewcvs/yast?rev=38256&view=rev Log: ported PushButton Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc branches/tmp/sh/mod-ui/core/libyui/src/YUI.h branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog?rev=38256&r1=38255&r2=38256&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Fri Jun 1 18:38:17 2007 @@ -20,6 +20,12 @@ Reason: No more YCP depencency in YWidget derived classes. See YRadioButton or YTextEntry for examples. +* All widgets: widgetClass() now returns const char *, no longer char * + (gcc had already complained in abuild about this) + auto-replace this with: + + perl -p -i -e 's/virtual char \*widgetClass/virtual const char *widgetClass/' *.h + * YRadioButton: @@ -54,3 +60,11 @@ * overloaded virtual setInputMaxLength( int ) is now required to call YTextEntry::setInputMaxLength() at its end + + +* YPushButton: + + * Made all memeber variables private. + Access via access functions only from now on. + + * label is now std::string , no longer YCPString Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc?rev=38256&r1=38255&r2=38256&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc Fri Jun 1 18:38:17 2007 @@ -23,6 +23,7 @@ #include "YUISymbols.h" #include "YPushButton.h" + struct YPushButtonPrivate { std::string label; @@ -35,7 +36,7 @@ : label( label ) , isDefaultButton( isDefaultButton ) {} -} +}; YPushButton::YPushButton( const YWidgetOpt & opt, const std::string & label ) @@ -77,9 +78,9 @@ if ( propSet.isEmpty() ) { /* - * @property string Label text on the button + * @property string Label text on the button */ - propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); + propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); propSet.add( YWidget::propertySet() ); } Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI.h?rev=38256&r1=38255&r2=38256&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Fri Jun 1 18:38:17 2007 @@ -544,7 +544,7 @@ * Creates a push button. * @param label Label of the button */ - virtual YWidget *createPushButton( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0; + virtual YWidget *createPushButton( YWidget *parent, YWidgetOpt & opt, const std::string & label ) = 0; /** * Creates a menu button. Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc?rev=38256&r1=38255&r2=38256&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_widgets.cc Fri Jun 1 18:38:17 2007 @@ -1239,8 +1239,8 @@ const YCPList & optList, int argnr, bool isIconButton ) { - YCPString label( "" ); - YCPString iconName( "" ); + std::string label; + std::string iconName; if ( isIconButton ) { @@ -1253,8 +1253,8 @@ return 0; } - iconName = term->value( argnr )->asString(); - label = term->value( argnr+1 )->asString(); + iconName = term->value( argnr )->asString()->value(); + label = term->value( argnr+1 )->asString()->value(); } else { @@ -1266,7 +1266,7 @@ return 0; } - label = term->value( argnr )->asString(); + label = term->value( argnr )->asString()->value(); } // Parse options @@ -1287,13 +1287,13 @@ // Look up default function keys unless explicitly set if ( opt.key_Fxx.value() == 0 ) - opt.key_Fxx.setValue( defaultFunctionKey( label ) ); + opt.key_Fxx.setValue( defaultFunctionKey( YCPString( label ) ) ); YPushButton * button = dynamic_cast<YPushButton *> ( createPushButton( parent, opt, label ) ); - if ( isIconButton && button ) + if ( button && isIconButton ) button->setIcon( iconName ); return button; Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h?rev=38256&r1=38255&r2=38256&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Fri Jun 1 18:38:17 2007 @@ -64,7 +64,7 @@ * Returns a descriptive name of this widget class for logging, * debugging etc. */ - virtual char * widgetClass() { return "YWidget"; } + virtual const char * widgetClass() { return "YWidget"; } /** * Returns a descriptive label of this widget instance. -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
sh-sh-sh@svn.opensuse.org