Author: sh-sh-sh
Date: Thu Oct 25 16:21:39 2007
New Revision: 41573
URL: http://svn.opensuse.org/viewcvs/yast?rev=41573&view=rev
Log:
YTable now uses YTableHeader object in constructor
so column headers and alignment are known right away
in the constructor
(bubli's request)
Added:
branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.cc
branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.h
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h
branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc
branches/tmp/sh/mod-ui/core/libyui/src/YTable.h
branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQTable.cc
branches/tmp/sh/mod-ui/qt/src/YQTable.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/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Thu Oct 25 16:21:39 2007
@@ -384,3 +384,11 @@
a custom pointer to some other class.
Look at YQMenuButton for a sample implementation.
+
+
+2007-10-25 17:00 sh@suse.de
+
+* Changed YTable header handling (bubli's request):
+ - Constructor now gets YTableHeader object
+ - no more setHeader() and setAlignment functions - get rid of them
+ - use columns(), header(), alignment() in the constructor to set up columns
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=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am Thu Oct 25 16:21:39 2007
@@ -27,6 +27,7 @@
YItem.cc \
YTreeItem.cc \
YTableItem.cc \
+ YTableHeader.cc \
YProperty.cc \
YUIComponent.cc \
YUIException.cc \
@@ -117,6 +118,7 @@
YMenuItem.h \
YTreeItem.h \
YTableItem.h \
+ YTableHeader.h \
YOptionalWidgetFactory.h \
YPackageSelectorPlugin.h \
YProperty.h \
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.h Thu Oct 25 16:21:39 2007
@@ -59,6 +59,7 @@
* Return the alignment in the specified dimension.
**/
YAlignmentType alignment( YUIDimension dim ) const;
+
/**
* Return the left margin in pixels, the distance between the left edge of
* this alignment and the left edge of the child widget.
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=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Thu Oct 25 16:21:39 2007
@@ -2080,6 +2080,7 @@
return 0;
}
+
// Parse options
bool immediate = false;
@@ -2093,36 +2094,50 @@
}
YCPTerm headerTerm = term->value( argnr )->asTerm();
- int columns = headerTerm->size();
-
- YTable * table = YUI::widgetFactory()->createTable( parent, columns );
-
+
+ YTable * table = YUI::widgetFactory()->createTable( parent, parseTableHeader( headerTerm ) );
+
if ( keepSorting )
table->setKeepSorting( true );
if ( immediate )
table->setImmediateMode( true );
+
+ if ( numArgs >= 2 ) // Fill table with items, if item list is specified
+ {
+ YCPList itemList = term->value( argnr+1 )->asList();
+ table->addItems( YCPTableItemParser::parseTableItemList( itemList ) );
+ }
+
+ return table;
+}
- //
- // Parse header term
- //
+
+YTableHeader *
+YCPDialogParser::parseTableHeader( const YCPTerm & headerTerm )
+{
+ YTableHeader * header = new YTableHeader();
+ YUI_CHECK_NEW( header );
+
for ( int i=0; i < headerTerm->size(); i++ )
{
YCPValue colHeader = headerTerm->value( i );
if ( colHeader->isString() )
{
- table->setHeader( i, colHeader->asString()->value() );
+ header->addColumn( colHeader->asString()->value() );
}
else if ( colHeader->isTerm() )
{
- YCPTerm colHeaderTerm = colHeader->asTerm();
-
- if ( colHeaderTerm->name() == YUISymbol_Left ) table->setAlignment( i, YTable::Left );
- else if ( colHeaderTerm->name() == YUISymbol_Right ) table->setAlignment( i, YTable::Right );
- else if ( colHeaderTerm->name() == YUISymbol_Center ) table->setAlignment( i, YTable::Center );
+ string headerText;
+ YAlignmentType alignment = YAlignBegin;
+ YCPTerm colHeaderTerm = colHeader->asTerm();
+
+ if ( colHeaderTerm->name() == YUISymbol_Left ) alignment = YAlignBegin;
+ else if ( colHeaderTerm->name() == YUISymbol_Right ) alignment = YAlignEnd;
+ else if ( colHeaderTerm->name() == YUISymbol_Center ) alignment = YAlignCenter;
else
{
string msg = string( "Unknown table header alignment: " )
@@ -2134,7 +2149,7 @@
if ( colHeaderTerm->size() > 0 )
{
if ( colHeaderTerm->value(0)->isString() )
- table->setHeader( i, colHeaderTerm->value(0)->asString()->value() );
+ headerText = colHeaderTerm->value(0)->asString()->value();
else
{
string msg = string( "Expected string for table header, not " )
@@ -2153,16 +2168,12 @@
ycperror( "%s", msg.c_str() );
}
}
- }
- }
- if ( numArgs >= 2 ) // Fill table with items, if item list is specified
- {
- YCPList itemList = term->value( argnr+1 )->asList();
- table->addItems( YCPTableItemParser::parseTableItemList( itemList ) );
+ header->addColumn( headerText, alignment );
+ }
}
-
- return table;
+
+ return header;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h Thu Oct 25 16:21:39 2007
@@ -31,6 +31,7 @@
class YWidget;
class YMenu;
class YMenuButton;
+class YTableHeader;
/**
@@ -216,6 +217,8 @@
static YWidget * parseTable( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr );
+ static YTableHeader * parseTableHeader( const YCPTerm & headerTerm );
+
static YWidget * parseProgressBar( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr );
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=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTable.cc Thu Oct 25 16:21:39 2007
@@ -17,11 +17,6 @@
/-*/
-#include
-#include
-#include
-#include
-#include
#define y2log_component "ui"
#include
@@ -33,32 +28,29 @@
struct YTablePrivate
{
- YTablePrivate( int col )
- : columns( col )
+ YTablePrivate( YTableHeader * header )
+ : header( header )
, keepSorting( false )
, immediateMode( false )
{
- headers.resize( columns ); // Fill with empty strings (from default constructor)
- alignments.resize( columns, YTable::Left );
}
- int columns;
- bool keepSorting;
- bool immediateMode;
- vector<string> headers;
- vectorYTable::Alignment alignments;
+ YTableHeader * header;
+ bool keepSorting;
+ bool immediateMode;
};
-YTable::YTable( YWidget * parent, int columns )
+YTable::YTable( YWidget * parent, YTableHeader * header )
: YSelectionWidget( parent,
"", // label
true ) // enforceSingleSelection
- , priv( new YTablePrivate( columns ) )
+ , priv( new YTablePrivate( header ) )
{
- YUI_CHECK_NEW( priv );
+ YUI_CHECK_PTR( header );
+ YUI_CHECK_NEW( priv );
setDefaultStretchable( YD_HORIZ, true );
setDefaultStretchable( YD_VERT, true );
@@ -67,57 +59,36 @@
YTable::~YTable()
{
- // NOP
+ if ( priv->header )
+ delete priv->header;
}
int
YTable::columns() const
{
- return priv->columns;
+ return priv->header->columns();
}
bool
YTable::hasColumn( int column ) const
{
- return column >= 0 && column <= priv->columns;
-}
-
-
-void
-YTable::setHeader( int column, const string & text )
-{
- if ( hasColumn( column ) )
- priv->headers[ column ] = text;
+ return priv->header->hasColumn( column );
}
string
YTable::header( int column ) const
{
- if ( hasColumn( column ) )
- return priv->headers[ column ];
- else
- return "";
+ return priv->header->header( column );
}
-void
-YTable::setAlignment( int column, YTable::Alignment alignment )
-{
- if ( hasColumn( column ) )
- priv->alignments[ column ] = alignment;
-}
-
-
-YTable::Alignment
+YAlignmentType
YTable::alignment( int column ) const
{
- if ( hasColumn( column ) )
- return priv->alignments[ column ];
- else
- return YTable::Left;
+ return priv->header->alignment( column );
}
@@ -227,4 +198,3 @@
macroRecorder->recordWidgetProperty( this, YUIProperty_CurrentItem );
}
-
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTable.h?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTable.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTable.h Thu Oct 25 16:21:39 2007
@@ -19,9 +19,10 @@
#ifndef YTable_h
#define YTable_h
+#include "YTypes.h"
#include "YSelectionWidget.h"
#include "YTableItem.h"
-
+#include "YTableHeader.h"
class YMacroRecorder;
class YTablePrivate;
@@ -51,9 +52,14 @@
{
protected:
/**
- * Constructor. 'columns' is the number of columns to be created.
+ * Constructor.
+ *
+ * 'header' describes the table's headers: Number of columns, column
+ * headings, and column alignment. The widget assumes ownership of this
+ * object and will delete it when appropriate. The header cannot be changed
+ * after creating the widget.
**/
- YTable( YWidget * parent, int columns );
+ YTable( YWidget * parent, YTableHeader * header );
public:
@@ -69,56 +75,32 @@
virtual const char * widgetClass() const { return "YTable"; }
/**
- * Return the number of coluns of this table.
- * Note that this can only be set in the constructor.
+ * Return the number of columns of this table.
**/
int columns() const;
/**
- * Return 'true' if this table has 'column' columns.
+ * Return 'true' if this table has a column no. 'column'
+ * (counting from 0 on).
**/
bool hasColumn( int column ) const;
/**
- * Set the header text for the specified column (counting from 0 on).
- *
- * Derived classes can overwrite this function, but they should call this
- * base class function in the new implementation.
- **/
- virtual void setHeader( int column, const string & text );
-
- /**
* Return the header text for the specified column.
**/
string header( int column ) const;
- enum Alignment
- {
- Left,
- Center,
- Right
- };
-
- /**
- * Set the alignment for the specified column (counting from 0 on):
- * YTable::Left, YTable::Center, YTable::Right
- *
- * Derived classes can overwrite this function, but they should call this
- * base class function in the new implementation.
- **/
- virtual void setAlignment( int column, YTable::Alignment alignment );
-
/**
* Return the alignment for the specified column.
**/
- YTable::Alignment alignment( int column ) const;
+ YAlignmentType alignment( int column ) const;
/**
* Deliver even more events than with notify() set.
*
* With "notify" alone, a table widget sends an ActivatedEvent when the
- * user double-clicks an item or presses the "space" key on it. It does not
- * send an event when the user just sends another item.
+ * user double-clicks an item or presses the "space" key on it. It does
+ * not send an event when the user just sends another item.
*
* With "immediate", it also sends a SelectionChangedEvent when the user
* selects another item. "immediate" implicitly includes "notify".
Added: branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.cc?rev=41573&view=auto
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.cc (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.cc Thu Oct 25 16:21:39 2007
@@ -0,0 +1,94 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YTableHeader.cc
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+
+#include <vector>
+#define y2log_component "ui"
+#include
+#include "YTableHeader.h"
+#include "YUIException.h"
+
+using std::vector;
+
+
+struct YTableHeaderPrivate
+{
+ YTableHeaderPrivate()
+ {}
+
+ vector<string> headers;
+ vector<YAlignmentType> alignments;
+};
+
+
+
+
+YTableHeader::YTableHeader()
+ : priv( new YTableHeaderPrivate )
+{
+ YUI_CHECK_NEW( priv );
+}
+
+
+YTableHeader::~YTableHeader()
+{
+ // NOP
+}
+
+
+void
+YTableHeader::addColumn( const string & header, YAlignmentType alignment )
+{
+ priv->headers.push_back( header );
+ priv->alignments.push_back( alignment );
+}
+
+
+int
+YTableHeader::columns() const
+{
+ return (int) priv->headers.size();
+}
+
+
+bool
+YTableHeader::hasColumn( int column ) const
+{
+ return column >= 0 && column < (int) priv->headers.size();
+}
+
+
+string
+YTableHeader::header( int column ) const
+{
+ if ( column >= 0 && column < (int) priv->headers.size() )
+ return priv->headers[ column ];
+ else
+ return "";
+}
+
+
+YAlignmentType
+YTableHeader::alignment( int column ) const
+{
+ if ( column >= 0 && column < (int) priv->alignments.size() )
+ return priv->alignments[ column ];
+ else
+ return YAlignBegin;
+}
+
Added: branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.h?rev=41573&view=auto
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.h (added)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTableHeader.h Thu Oct 25 16:21:39 2007
@@ -0,0 +1,85 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: YTableHeader.h
+
+ Author: Stefan Hundhammer
+
+/-*/
+
+#ifndef YTableHeader_h
+#define YTableHeader_h
+
+#include <string>
+#include "ImplPtr.h"
+#include "YTypes.h"
+
+using std::string;
+
+
+class YTableHeaderPrivate;
+
+/**
+ * Helper class for YTable for table column properties:
+ *
+ * - number of columns
+ * - header for each column
+ * - alignment for each column
+ **/
+class YTableHeader
+{
+public:
+ /**
+ * Constructor.
+ **/
+ YTableHeader();
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YTableHeader();
+
+ /**
+ * Add a column with the specified colum header text and alignment.
+ **/
+ void addColumn( const string & header,
+ YAlignmentType alignment = YAlignBegin );
+
+ /**
+ * Return the number of columns.
+ **/
+ int columns() const;
+
+ /**
+ * Return 'true' if this table header has a column no. 'column'
+ * (counting from 0 on).
+ **/
+ bool hasColumn( int column ) const;
+
+ /**
+ * Return the header text for the specified column.
+ **/
+ string header( int column ) const;
+
+ /**
+ * Return the alignment for the specified column.
+ **/
+ YAlignmentType alignment( int column ) const;
+
+
+private:
+
+ ImplPtr<YTableHeaderPrivate> priv;
+};
+
+
+#endif // YTableHeader_h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YTypes.h Thu Oct 25 16:21:39 2007
@@ -52,6 +52,4 @@
};
-
-
#endif // YTypes_h
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=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Thu Oct 25 16:21:39 2007
@@ -53,6 +53,7 @@
class YSpacing;
class YSquash;
class YTable;
+class YTableHeader;
class YTimeField;
class YTree;
@@ -97,7 +98,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, int columns ) = 0;
+ virtual YTable * createTable ( YWidget * parent, YTableHeader * header ) = 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/qt/src/YQTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQTable.cc?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTable.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQTable.cc Thu Oct 25 16:21:39 2007
@@ -30,21 +30,45 @@
#include "YQTable.h"
-YQTable::YQTable( YWidget * parent,
- int columns )
+YQTable::YQTable( YWidget * parent, YTableHeader * tableHeader )
: QVBox( (QWidget *) parent->widgetRep() )
- , YTable( parent, columns )
+ , YTable( parent, tableHeader )
{
setWidgetRep( this );
setMargin( YQWidgetMargin );
_qt_listView = new QY2ListView( this );
YUI_CHECK_NEW( _qt_listView );
+ _qt_listView->setAllColumnsShowFocus( true );
- for ( int i=0; i < columns; i++ )
- _qt_listView->addColumn( "" ); // Headers are not known yet
- _qt_listView->setAllColumnsShowFocus( true );
+ //
+ // Add columns
+ //
+
+ for ( int i=0; i < columns(); i++ )
+ {
+ _qt_listView->addColumn( fromUTF8( header( i ) ) );
+
+ int qt_alignment = Qt::Left;
+
+ switch ( alignment( i ) )
+ {
+ case YAlignBegin: qt_alignment = Qt::AlignLeft; break;
+ case YAlignCenter: qt_alignment = Qt::AlignCenter; break;
+ case YAlignEnd: qt_alignment = Qt::AlignRight; break;
+
+ case YAlignUnchanged: break;
+ }
+
+ _qt_listView->setColumnAlignment( i, qt_alignment );
+ // _qt_listView->adjustColumn( column );
+ }
+
+
+ //
+ // Connect signals and slots
+ //
connect( _qt_listView, SIGNAL( doubleClicked ( QListViewItem * ) ),
this, SLOT ( slotActivated ( QListViewItem * ) ) );
@@ -64,40 +88,6 @@
void
-YQTable::setHeader( int column, const string & text )
-{
- YTable::setHeader( column, text );
-
- if ( hasColumn( column ) )
- {
- _qt_listView->header()->setLabel( column, fromUTF8( text ) );
- _qt_listView->adjustColumn( column );
- }
-}
-
-
-void
-YQTable::setAlignment( int column, YTable::Alignment alignment )
-{
- YTable::setAlignment( column, alignment );
-
- if ( hasColumn( column ) )
- {
- int qt_alignment = Qt::Left;
-
- switch ( alignment )
- {
- case YTable::Left: qt_alignment = Qt::AlignLeft; break;
- case YTable::Center: qt_alignment = Qt::AlignCenter; break;
- case YTable::Right: qt_alignment = Qt::AlignRight; break;
- }
-
- _qt_listView->setColumnAlignment( column, qt_alignment );
- }
-}
-
-
-void
YQTable::setKeepSorting( bool keepSorting )
{
YTable::setKeepSorting( keepSorting );
@@ -110,9 +100,9 @@
{
YTableItem * item = dynamic_cast (yitem);
YUI_CHECK_PTR( item );
-
+
YTable::addItem( item );
-
+
YQTableListViewItem * clone = new YQTableListViewItem( this, _qt_listView, item );
YUI_CHECK_NEW( clone );
@@ -131,7 +121,7 @@
YTableItem * item = dynamic_cast (yitem);
YUI_CHECK_PTR( item );
-
+
YQTableListViewItem * clone = (YQTableListViewItem *) item->data();
YUI_CHECK_PTR( clone );
@@ -151,7 +141,7 @@
YQTable::deselectAllItems()
{
YQSignalBlocker sigBlocker( _qt_listView );
-
+
YTable::deselectAllItems();
_qt_listView->clearSelection();
}
@@ -195,7 +185,7 @@
YQTable::slotSelected( QListViewItem * listViewItem )
{
selectOrigItem( listViewItem );
-
+
if ( immediateMode() )
{
if ( ! YQUI::ui()->eventPendingFor( this ) )
@@ -212,7 +202,7 @@
YQTable::slotActivated( QListViewItem * listViewItem )
{
selectOrigItem( listViewItem );
-
+
if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::Activated ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQTable.h?rev=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTable.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQTable.h Thu Oct 25 16:21:39 2007
@@ -38,7 +38,7 @@
/**
* Constructor.
**/
- YQTable( YWidget * parent, int columns );
+ YQTable( YWidget * parent, YTableHeader * header );
/**
* Destructor.
@@ -46,21 +46,6 @@
virtual ~YQTable();
/**
- * Set the header text for the specified column (counting from 0 on).
- *
- * Reimplemented from YTableWidget.
- **/
- virtual void setHeader( int column, const string & text );
-
- /**
- * Set the alignment for the specified column (counting from 0 on):
- * YTable::Left, YTable::Center, YTable::Right
- *
- * Reimplemented from YTableWidget.
- **/
- virtual void setAlignment( int column, YTable::Alignment alignment );
-
- /**
* Switch between sorting by item insertion order (keepSorting: true) or
* allowing the user to sort by an arbitrary column (by clicking on the
* column header).
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=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Thu Oct 25 16:21:39 2007
@@ -181,9 +181,9 @@
YQTable *
-YQWidgetFactory::createTable( YWidget * parent, int columns )
+YQWidgetFactory::createTable( YWidget * parent, YTableHeader * header )
{
- YQTable * table = new YQTable( parent, columns );
+ YQTable * table = new YQTable( parent, header );
YUI_CHECK_NEW( table );
return table;
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=41573&r1=41572&r2=41573&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Thu Oct 25 16:21:39 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, int columns );
+ virtual YQTable * createTable ( YWidget * parent, YTableHeader * header );
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