Author: sh-sh-sh Date: Fri Oct 5 23:36:04 2007 New Revision: 41274 URL: http://svn.opensuse.org/viewcvs/yast?rev=41274&view=rev Log: fixed and improved icon handling Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItemParser.cc branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Fri Oct 5 23:36:04 2007 @@ -2177,8 +2177,7 @@ else logUnknownOption( term, optList->value(o) ); } - YCPTerm headerTerm = term->value( argnr )->asTerm(); - YCPList itemList = term->value( argnr+1 )->asList(); + YCPTerm headerTerm = term->value( argnr )->asTerm(); int columns = headerTerm->size(); YTable * table = YUI::widgetFactory()->createTable( parent, columns ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItemParser.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItemParser.cc?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItemParser.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItemParser.cc Fri Oct 5 23:36:04 2007 @@ -206,5 +206,12 @@ // The cellTerm->size() check above and the other checks in the loop handle that. YUI_CHECK_PTR( parent ); + + if ( label.isNull() ) + label = YCPString( "" ); + + if ( iconName.isNull() ) + iconName = YCPString( "" ); + parent->addCell( label, iconName ); } Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc Fri Oct 5 23:36:04 2007 @@ -180,11 +180,13 @@ * @property string Label caption above the combo box * @property string ValidChars set of valid input characters * @property integer InputMaxLength maximum number of input characters + * @property string IconPath Base path for icons */ propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); propSet.add( YProperty( YUIProperty_ValidChars, YStringProperty ) ); propSet.add( YProperty( YUIProperty_InputMaxLength, YIntegerProperty ) ); + propSet.add( YProperty( YUIProperty_IconPath, YStringProperty ) ); propSet.add( YWidget::propertySet() ); } @@ -201,6 +203,7 @@ else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() ); else if ( propertyName == YUIProperty_ValidChars ) setValidChars( val.stringVal() ); else if ( propertyName == YUIProperty_InputMaxLength ) setInputMaxLength( val.integerVal() ); + else if ( propertyName == YUIProperty_IconPath ) setIconBasePath( val.stringVal() ); else { return YWidget::setProperty( propertyName, val ); @@ -219,6 +222,7 @@ else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() ); else if ( propertyName == YUIProperty_ValidChars ) return YPropertyValue( validChars() ); else if ( propertyName == YUIProperty_InputMaxLength ) return YPropertyValue( inputMaxLength() ); + else if ( propertyName == YUIProperty_IconPath ) return YPropertyValue( iconBasePath() ); else { return YWidget::getProperty( propertyName ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YSelectionBox.cc Fri Oct 5 23:36:04 2007 @@ -97,12 +97,14 @@ * @property itemID Value The currently selected item * @property itemID CurrentItem The currently selected item * @property itemList Items All items - * @property string Label caption above the selection box + * @property string Label Caption above the selection box + * @property string IconPath Base path for icons */ propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_CurrentItem, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Items, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); + propSet.add( YProperty( YUIProperty_IconPath, YStringProperty ) ); propSet.add( YWidget::propertySet() ); } @@ -119,6 +121,7 @@ else if ( propertyName == YUIProperty_CurrentItem ) return false; // Needs special handling else if ( propertyName == YUIProperty_Items ) return false; // Needs special handling else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() ); + else if ( propertyName == YUIProperty_IconPath ) setIconBasePath( val.stringVal() ); else { return YWidget::setProperty( propertyName, val ); @@ -137,6 +140,7 @@ else if ( propertyName == YUIProperty_CurrentItem ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_Items ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() ); + else if ( propertyName == YUIProperty_IconPath ) return YPropertyValue( iconBasePath() ); else { return YWidget::getProperty( propertyName ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc Fri Oct 5 23:36:04 2007 @@ -169,12 +169,14 @@ * @property `icon(...) Cell Icon for one one cell * @property string Item Alias for Cell * @property string Item QueryWidget only: Return one complete item + * @property string IconPath Base path for icons */ propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_CurrentItem, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Items, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Cell, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Item, YOtherProperty ) ); + propSet.add( YProperty( YUIProperty_IconPath, YStringProperty ) ); propSet.add( YWidget::propertySet() ); } @@ -192,6 +194,7 @@ else if ( propertyName == YUIProperty_Items ) return false; // Needs special handling else if ( propertyName == YUIProperty_Cell ) return false; // Needs special handling else if ( propertyName == YUIProperty_Item ) return false; // Needs special handling + else if ( propertyName == YUIProperty_IconPath ) setIconBasePath( val.stringVal() ); else { return YWidget::setProperty( propertyName, val ); @@ -211,6 +214,7 @@ else if ( propertyName == YUIProperty_Items ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_Cell ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_Item ) return YPropertyValue( YOtherProperty ); + else if ( propertyName == YUIProperty_IconPath ) return YPropertyValue( iconBasePath() ); else { return YWidget::getProperty( propertyName ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YTree.cc Fri Oct 5 23:36:04 2007 @@ -76,6 +76,7 @@ * @property itemList Items All items * @property map<ItemID> OpenItems Map of IDs of all open items - can only be queried, not set * @property string Label caption above the tree + * @property string IconPath Base path for icons */ propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_CurrentItem, YOtherProperty ) ); @@ -83,6 +84,7 @@ propSet.add( YProperty( YUIProperty_Items, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_OpenItems, YOtherProperty ) ); propSet.add( YProperty( YUIProperty_Label, YStringProperty ) ); + propSet.add( YProperty( YUIProperty_IconPath, YStringProperty ) ); propSet.add( YWidget::propertySet() ); } @@ -101,6 +103,7 @@ else if ( propertyName == YUIProperty_Items ) return false; // Needs special handling else if ( propertyName == YUIProperty_OpenItems ) return false; // Needs special handling else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() ); + else if ( propertyName == YUIProperty_IconPath ) setIconBasePath( val.stringVal() ); else { return YWidget::setProperty( propertyName, val ); @@ -121,6 +124,7 @@ else if ( propertyName == YUIProperty_Items ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_OpenItems ) return YPropertyValue( YOtherProperty ); else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() ); + else if ( propertyName == YUIProperty_IconPath ) return YPropertyValue( iconBasePath() ); else { return YWidget::getProperty( propertyName ); Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h?rev=41274&r1=41273&r2=41274&view=diff ============================================================================== --- branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h (original) +++ branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h Fri Oct 5 23:36:04 2007 @@ -155,6 +155,7 @@ #define YUIProperty_Enabled "Enabled" #define YUIProperty_ExpectedSize "ExpectedSize" #define YUIProperty_Filename "Filename" +#define YUIProperty_IconPath "IconPath" #define YUIProperty_InputMaxLength "InputMaxLength" #define YUIProperty_Item "Item" #define YUIProperty_Items "Items" -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org