Author: sh-sh-sh
Date: Tue Sep 25 17:00:25 2007
New Revision: 41089
URL: http://svn.opensuse.org/viewcvs/yast?rev=41089&view=rev
Log:
changed WidgetFactory::createTable()
Added:
branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItem.h
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
branches/tmp/sh/mod-ui/core/libyui/src/YCPItem.h
branches/tmp/sh/mod-ui/core/libyui/src/YCPTreeItem.h
branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am Tue Sep 25 17:00:25 2007
@@ -95,6 +95,7 @@
YCPItemParser.h \
YCPTreeItem.h \
YCPTreeItemParser.h \
+ YCPTableItem.h \
YCPPropertyHandler.h \
YCPValueWidgetID.h \
YCP_UI_Exception.h \
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPItem.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPItem.h?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPItem.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPItem.h Tue Sep 25 17:00:25 2007
@@ -82,12 +82,12 @@
{ YItem::setLabel( newLabel->value() ); }
/**
- * Return this icon's icon name as a YCPString.
+ * Return this item's icon name as a YCPString.
**/
YCPString iconName() const { return YCPString( YItem::iconName() ); }
/**
- * Set this icon's icon name with a YCPString.
+ * Set this item's icon name with a YCPString.
**/
void setIconName( const YCPString & newIconName )
{ YItem::setIconName( newIconName->value() ); }
Added: branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItem.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItem.h?rev=41089&view=auto
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItem.h (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPTableItem.h Tue Sep 25 17:00:25 2007
@@ -0,0 +1,89 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YCPTableItem.h
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+#ifndef YCPTableItem_h
+#define YCPTableItem_h
+
+#include
+#include
+#include "YItem.h"
+
+
+/**
+ * Item class with YCPValue IDs
+ **/
+class YCPTableItem: public YTableItem
+{
+public:
+
+ /**
+ * Constructor
+ **/
+ YCPTableItem( const YCPValue & id )
+ : YTableItem()
+ , _id( id )
+ {}
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YCPTableItem()
+ {}
+
+ /**
+ * Return 'true' if this item has an ID.
+ **/
+ bool hasId() const { return ! _id.isNull() && ! _id->isVoid(); }
+
+ /**
+ * Return this item's ID.
+ **/
+ YCPValue id() const { return _id; }
+
+ /**
+ * Set a new ID.
+ **/
+ void setId( const YCPValue & newId ) { _id = newId; }
+
+ /**
+ * Create a new cell and add it (even if both 'label' and
+ * 'iconName' are empty).
+ **/
+ void addCell( const YCPString & label, const YCPString & iconName )
+ YTableItem::addCell( label->value(), iconName->value() );
+
+ /**
+ * Return the label of cell no. 'index' (counting from 0 on) as a YCPString
+ * or an empty YCPString if there is no cell with that index.
+ **/
+ YCPString label( int index ) const { return YCPString( YTableItem::label( index ) ); }
+
+ /**
+ * Return the icon of cell no. 'index' (counting from 0 on) as a YCPString
+ * or an empty YCPString if there is no cell with that index.
+ **/
+ YCPString iconName( int index ) const { return YCPString( YItem::iconName( index ) ); }
+
+
+private:
+
+ YCPValue _id;
+};
+
+
+#endif // YCPTableItem_h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPTreeItem.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPTreeItem.h?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPTreeItem.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPTreeItem.h Tue Sep 25 17:00:25 2007
@@ -103,12 +103,12 @@
{ YTreeItem::setLabel( newLabel->value() ); }
/**
- * Return this icon's icon name as a YCPString.
+ * Return this item's icon name as a YCPString.
**/
YCPString iconName() const { return YCPString( YTreeItem::iconName() ); }
/**
- * Set this icon's icon name with a YCPString.
+ * Set this item's icon name with a YCPString.
**/
void setIconName( const YCPString & newIconName )
{ YTreeItem::setIconName( newIconName->value() ); }
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTableItem.h Tue Sep 25 17:00:25 2007
@@ -98,7 +98,7 @@
* Create a new cell and add it (even if both 'label' and
* 'iconName' are empty).
**/
- void addCell( const string & label, const string & iconName = "" );
+ void addCell( const string & label, const string & iconName = string() );
/**
* Delete all cells.
@@ -118,7 +118,8 @@
YTableCellConstIterator cellsEnd() const { return _cells.end(); }
/**
- * Return the cell at the specified index (counting from 0 on) or 0 if there is none.
+ * Return the cell at the specified index (counting from 0 on)
+ * or 0 if there is none.
**/
const YTableCell * cell( int index ) const;
@@ -128,8 +129,8 @@
int cellCount() const { return _cells.size(); }
/**
- * Return 'true' if this item has a cell with the specified index (counting
- * from 0 on), 'false' otherwise.
+ * Return 'true' if this item has a cell with the specified index
+ * (counting from 0 on), 'false' otherwise.
**/
bool hasCell( int index ) const
{ return index >= 0 && (unsigned) index < _cells.size(); }
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Tue Sep 25 17:00:25 2007
@@ -97,7 +97,7 @@
virtual YComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false ) = 0;
virtual YSelectionBox * createSelectionBox ( YWidget * parent, const string & label ) = 0;
virtual YTree * createTree ( YWidget * parent, const string & label ) = 0;
- virtual YTable * createTable ( YWidget * parent ) = 0;
+ virtual YTable * createTable ( YWidget * parent, int columns ) = 0;
virtual YProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 ) = 0;
virtual YRichText * createRichText ( YWidget * parent, const string & text, bool plainTextMode = false ) = 0;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc Tue Sep 25 17:00:25 2007
@@ -165,7 +165,7 @@
NCTable *
-NCWidgetFactory::createTable( YWidget * parent )
+NCWidgetFactory::createTable( YWidget * parent, int columns )
{
return 0; // FIXME: TO DO
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h Tue Sep 25 17:00:25 2007
@@ -116,7 +116,8 @@
virtual NCTree * createTree ( YWidget * parent,
const string & label );
- virtual NCTable * createTable ( YWidget * parent );
+ virtual NCTable * createTable ( YWidget * parent,
+ int columns );
virtual NCProgressBar * createProgressBar ( YWidget * parent,
const string & label,
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Tue Sep 25 17:00:25 2007
@@ -181,7 +181,7 @@
YQTable *
-YQWidgetFactory::createTable( YWidget * parent )
+YQWidgetFactory::createTable( YWidget * parent, int columns )
{
return 0; // FIXME: TO DO
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h?rev=41089&r1=41088&r2=41089&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Tue Sep 25 17:00:25 2007
@@ -91,7 +91,7 @@
virtual YQComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false );
virtual YQSelectionBox * createSelectionBox ( YWidget * parent, const string & label );
virtual YQTree * createTree ( YWidget * parent, const string & label );
- virtual YQTable * createTable ( YWidget * parent );
+ virtual YQTable * createTable ( YWidget * parent, int columns );
virtual YQProgressBar * createProgressBar ( YWidget * parent, const string & label, int maxValue = 100 );
virtual YQRichText * createRichText ( YWidget * parent, const string & text, bool plainTextMode = false );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org