Mailinglist Archive: yast-commit (1056 mails)
| < Previous | Next > |
[yast-commit] r44453 - in /trunk/core/libyui/src: YUISymbols.h YWidget.cc YWidget.h ycp-ui/YCPDialogParser.cc
- From: sh-sh-sh@xxxxxxxxxxxxxxxx
- Date: Thu, 14 Feb 2008 14:45:09 -0000
- Message-id: <20080214144510.3CBFA1075EF@xxxxxxxxxxxxxxxx>
Author: sh-sh-sh
Date: Thu Feb 14 15:45:09 2008
New Revision: 44453
URL: http://svn.opensuse.org/viewcvs/yast?rev=44453&view=rev
Log:
widget name
Modified:
trunk/core/libyui/src/YUISymbols.h
trunk/core/libyui/src/YWidget.cc
trunk/core/libyui/src/YWidget.h
trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc
Modified: trunk/core/libyui/src/YUISymbols.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUISymbols.h?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/YUISymbols.h (original)
+++ trunk/core/libyui/src/YUISymbols.h Thu Feb 14 15:45:09 2008
@@ -178,6 +178,7 @@
#define YUIProperty_Values "Values"
#define YUIProperty_VisibleLines "VisibleLines"
#define YUIProperty_WidgetClass "WidgetClass"
+#define YUIProperty_WidgetName "WidgetName"
#define YUIProperty_Timeout "Timeout"
#define YUIProperty_Alive "Alive"
Modified: trunk/core/libyui/src/YWidget.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidget.cc?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/YWidget.cc (original)
+++ trunk/core/libyui/src/YWidget.cc Thu Feb 14 15:45:09 2008
@@ -85,6 +85,7 @@
YBothDim<bool> stretch;
YBothDim<int> weight;
int functionKey;
+ string widgetName;
};
@@ -327,6 +328,19 @@
}
+string YWidget::widgetName() const
+{
+ return priv->widgetName;
+}
+
+
+void YWidget::setWidgetName( const string & name )
+{
+ priv->widgetName = name;
+}
+
+
+
YWidgetID *
YWidget::id() const
{
@@ -380,6 +394,7 @@
* @property boolean Enabled enabled/disabled state of this
widget
* @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 DebugLabel (possibly translated) text
describing this widget for debugging
**/
@@ -387,6 +402,7 @@
propSet.add( YProperty( YUIProperty_Notify, YBoolProperty
) );
propSet.add( YProperty( YUIProperty_WidgetClass,
YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_DebugLabel,
YStringProperty, true ) ); // read-only
+ propSet.add( YProperty( YUIProperty_WidgetName, YStringProperty
) );
}
return propSet;
@@ -408,6 +424,7 @@
if ( propertyName == YUIProperty_Enabled ) setEnabled(
val.boolVal() );
else if ( propertyName == YUIProperty_Notify ) setNotify (
val.boolVal() );
+ else if ( propertyName == YUIProperty_WidgetName ) setWidgetName(
val.stringVal() );
return true; // success -- no special processing necessary
}
@@ -429,6 +446,7 @@
if ( propertyName == YUIProperty_Enabled ) return
YPropertyValue( isEnabled() );
if ( propertyName == YUIProperty_Notify ) return
YPropertyValue( notify() );
if ( propertyName == YUIProperty_WidgetClass ) return
YPropertyValue( widgetClass() );
+ if ( propertyName == YUIProperty_WidgetName ) return
YPropertyValue( widgetName() );
if ( propertyName == YUIProperty_DebugLabel ) return
YPropertyValue( debugLabel() );
return YPropertyValue( false ); // NOTREACHED
@@ -688,6 +706,10 @@
if ( w )
{
stream << w->widgetClass();
+
+ if ( ! w->widgetName().empty() )
+ stream << " " << w->widgetName();
+
string debugLabel = w->debugLabel();
if ( debugLabel.empty() )
Modified: trunk/core/libyui/src/YWidget.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidget.h?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/YWidget.h (original)
+++ trunk/core/libyui/src/YWidget.h Thu Feb 14 15:45:09 2008
@@ -79,6 +79,16 @@
**/
virtual string debugLabel() const;
+ /**
+ * Return this widget's debugging name (if one was previously set).
+ **/
+ string widgetName() const;
+
+ /**
+ * Set a widget name for debugging.
+ **/
+ void setWidgetName( const string & name );
+
//
// Property Management
Modified: trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc (original)
+++ trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc Thu Feb 14 15:45:09 2008
@@ -319,10 +319,10 @@
if ( w )
{
if ( ! id.isNull() && // ID specified for this widget
- ! id->isVoid() &&
- ! w->hasId() ) // widget doesn't have an ID yet
+ ! id->isVoid() )
{
- w->setId( new YCPValueWidgetID( id ) );
+ if ( ! w->hasId() ) // widget doesn't have an ID yet
+ w->setId( new YCPValueWidgetID( id ) );
/*
* Note: Don't set the ID if it is already set!
@@ -335,6 +335,8 @@
* on the Weight's child, which is not what the application
* programmer expects.
*/
+
+ w->setWidgetName( id->toString() );
}
if ( opt.isDisabled.value() ) w->setDisabled();
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Thu Feb 14 15:45:09 2008
New Revision: 44453
URL: http://svn.opensuse.org/viewcvs/yast?rev=44453&view=rev
Log:
widget name
Modified:
trunk/core/libyui/src/YUISymbols.h
trunk/core/libyui/src/YWidget.cc
trunk/core/libyui/src/YWidget.h
trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc
Modified: trunk/core/libyui/src/YUISymbols.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUISymbols.h?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/YUISymbols.h (original)
+++ trunk/core/libyui/src/YUISymbols.h Thu Feb 14 15:45:09 2008
@@ -178,6 +178,7 @@
#define YUIProperty_Values "Values"
#define YUIProperty_VisibleLines "VisibleLines"
#define YUIProperty_WidgetClass "WidgetClass"
+#define YUIProperty_WidgetName "WidgetName"
#define YUIProperty_Timeout "Timeout"
#define YUIProperty_Alive "Alive"
Modified: trunk/core/libyui/src/YWidget.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidget.cc?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/YWidget.cc (original)
+++ trunk/core/libyui/src/YWidget.cc Thu Feb 14 15:45:09 2008
@@ -85,6 +85,7 @@
YBothDim<bool> stretch;
YBothDim<int> weight;
int functionKey;
+ string widgetName;
};
@@ -327,6 +328,19 @@
}
+string YWidget::widgetName() const
+{
+ return priv->widgetName;
+}
+
+
+void YWidget::setWidgetName( const string & name )
+{
+ priv->widgetName = name;
+}
+
+
+
YWidgetID *
YWidget::id() const
{
@@ -380,6 +394,7 @@
* @property boolean Enabled enabled/disabled state of this
widget
* @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 DebugLabel (possibly translated) text
describing this widget for debugging
**/
@@ -387,6 +402,7 @@
propSet.add( YProperty( YUIProperty_Notify, YBoolProperty
) );
propSet.add( YProperty( YUIProperty_WidgetClass,
YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_DebugLabel,
YStringProperty, true ) ); // read-only
+ propSet.add( YProperty( YUIProperty_WidgetName, YStringProperty
) );
}
return propSet;
@@ -408,6 +424,7 @@
if ( propertyName == YUIProperty_Enabled ) setEnabled(
val.boolVal() );
else if ( propertyName == YUIProperty_Notify ) setNotify (
val.boolVal() );
+ else if ( propertyName == YUIProperty_WidgetName ) setWidgetName(
val.stringVal() );
return true; // success -- no special processing necessary
}
@@ -429,6 +446,7 @@
if ( propertyName == YUIProperty_Enabled ) return
YPropertyValue( isEnabled() );
if ( propertyName == YUIProperty_Notify ) return
YPropertyValue( notify() );
if ( propertyName == YUIProperty_WidgetClass ) return
YPropertyValue( widgetClass() );
+ if ( propertyName == YUIProperty_WidgetName ) return
YPropertyValue( widgetName() );
if ( propertyName == YUIProperty_DebugLabel ) return
YPropertyValue( debugLabel() );
return YPropertyValue( false ); // NOTREACHED
@@ -688,6 +706,10 @@
if ( w )
{
stream << w->widgetClass();
+
+ if ( ! w->widgetName().empty() )
+ stream << " " << w->widgetName();
+
string debugLabel = w->debugLabel();
if ( debugLabel.empty() )
Modified: trunk/core/libyui/src/YWidget.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidget.h?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/YWidget.h (original)
+++ trunk/core/libyui/src/YWidget.h Thu Feb 14 15:45:09 2008
@@ -79,6 +79,16 @@
**/
virtual string debugLabel() const;
+ /**
+ * Return this widget's debugging name (if one was previously set).
+ **/
+ string widgetName() const;
+
+ /**
+ * Set a widget name for debugging.
+ **/
+ void setWidgetName( const string & name );
+
//
// Property Management
Modified: trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc?rev=44453&r1=44452&r2=44453&view=diff
==============================================================================
--- trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc (original)
+++ trunk/core/libyui/src/ycp-ui/YCPDialogParser.cc Thu Feb 14 15:45:09 2008
@@ -319,10 +319,10 @@
if ( w )
{
if ( ! id.isNull() && // ID specified for this widget
- ! id->isVoid() &&
- ! w->hasId() ) // widget doesn't have an ID yet
+ ! id->isVoid() )
{
- w->setId( new YCPValueWidgetID( id ) );
+ if ( ! w->hasId() ) // widget doesn't have an ID yet
+ w->setId( new YCPValueWidgetID( id ) );
/*
* Note: Don't set the ID if it is already set!
@@ -335,6 +335,8 @@
* on the Weight's child, which is not what the application
* programmer expects.
*/
+
+ w->setWidgetName( id->toString() );
}
if ( opt.isDisabled.value() ) w->setDisabled();
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |