1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPkgProductList.cc
15 Author: Stefan Hundhammer <sh@suse.de>
17 Textdomain "packages-qt"
22 #define y2log_component "qt-pkg"
23 #include <ycp/y2log.h>
28 #include "YQPkgProductList.h"
34 YQPkgProductList::YQPkgProductList( QWidget * parent )
35 : YQPkgObjList( parent )
38 y2debug( "Creating product list" );
42 addColumn( "" ); _statusCol = numCol++;
43 addColumn( _( "Product" ) ); _nameCol = numCol++;
44 addColumn( _( "Summary" ) ); _summaryCol = numCol++;
45 addColumn( _( "Version" ) ); _versionCol = numCol++;
46 addColumn( _( "Vendor" ) ); _vendorCol = numCol++;
47 setAllColumnsShowFocus( true );
48 setColumnAlignment( sizeCol(), Qt::AlignRight );
50 setSorting( nameCol() );
55 y2debug( "Creating product list done" );
59 YQPkgProductList::~YQPkgProductList()
66 YQPkgProductList::fillList()
69 y2debug( "Filling product list" );
71 for ( ZyppPoolIterator it = zyppProductsBegin();
72 it != zyppProductsEnd();
75 ZyppProduct zyppProduct = tryCastToZyppProduct( (*it)->theObj() );
79 addProductItem( *it, zyppProduct );
83 y2error( "Found non-product selectable" );
87 y2debug( "product list filled" );
92 YQPkgProductList::addProductItem( ZyppSel selectable,
93 ZyppProduct zyppProduct )
97 y2error( "NULL ZyppSel!" );
101 new YQPkgProductListItem( this, selectable, zyppProduct );
109 YQPkgProductListItem::YQPkgProductListItem( YQPkgProductList * productList,
111 ZyppProduct zyppProduct )
112 : YQPkgObjListItem( productList, selectable, zyppProduct )
113 , _productList( productList )
114 , _zyppProduct( zyppProduct )
116 if ( ! _zyppProduct )
117 _zyppProduct = tryCastToZyppProduct( selectable->theObj() );
119 if ( ! _zyppProduct )
124 if ( vendorCol() > -1 )
125 setText( vendorCol(), zyppProduct->vendor() );
130 YQPkgProductListItem::~YQPkgProductListItem()
139 YQPkgProductListItem::applyChanges()
141 solveResolvableCollections();
146 #include "YQPkgProductList.moc"