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" );
41 addColumn( "" ); _statusCol = numCol++;
42 addColumn( _( "Product" ) ); _nameCol = numCol++;
43 addColumn( _( "Summary" ) ); _summaryCol = numCol++;
44 addColumn( _( "Version" ) ); _versionCol = numCol++;
45 addColumn( _( "Vendor" ) ); _vendorCol = numCol++;
46 setAllColumnsShowFocus( true );
47 setColumnAlignment( sizeCol(), Qt::AlignRight );
49 setSorting( nameCol() );
53 y2debug( "Creating product list done" );
57 YQPkgProductList::~YQPkgProductList()
64 YQPkgProductList::fillList()
67 y2debug( "Filling product list" );
69 for ( ZyppPoolIterator it = zyppProductsBegin();
70 it != zyppProductsEnd();
73 ZyppProduct zyppProduct = tryCastToZyppProduct( (*it)->theObj() );
77 addProductItem( *it, zyppProduct );
81 y2error( "Found non-product selectable" );
85 y2debug( "product list filled" );
90 YQPkgProductList::addProductItem( ZyppSel selectable,
91 ZyppProduct zyppProduct )
95 y2error( "NULL ZyppSel!" );
99 new YQPkgProductListItem( this, selectable, zyppProduct );
107 YQPkgProductListItem::YQPkgProductListItem( YQPkgProductList * productList,
109 ZyppProduct zyppProduct )
110 : YQPkgObjListItem( productList, selectable, zyppProduct )
111 , _productList( productList )
112 , _zyppProduct( zyppProduct )
114 if ( ! _zyppProduct )
115 _zyppProduct = tryCastToZyppProduct( selectable->theObj() );
117 if ( ! _zyppProduct )
122 if ( vendorCol() > -1 )
123 setText( vendorCol(), zyppProduct->vendor() );
128 YQPkgProductListItem::~YQPkgProductListItem()
137 YQPkgProductListItem::applyChanges()
139 solveResolvableCollections();
144 #include "YQPkgProductList.moc"