43 #define YUILogComponent "qt-pkg" 46 #include <zypp/ZYppFactory.h> 47 #include <zypp/Resolver.h> 51 #include "YQPkgSelList.h" 59 yuiDebug() <<
"Creating selection list" << endl;
63 addColumn(
"" ); _statusCol = numCol++;
64 addColumn( _(
"Selection" ) ); _summaryCol = numCol++;
65 setAllColumnsShowFocus(
true );
68 _satisfiedIconCol = _summaryCol;
69 _brokenIconCol = _summaryCol;
83 yuiDebug() <<
"Creating selection list done" << endl;
97 yuiDebug() <<
"Filling selection list" << endl;
100 for ( ZyppPoolIterator it = zyppSelectionsBegin();
101 it != zyppSelectionsEnd();
104 ZyppSelection zyppSelection = tryCastToZyppSelection( (*it)->theObj() );
108 if ( zyppSelection->visible() && ! zyppSelection->isBase() )
115 yuiError() <<
"Found non-Selection selectable" << endl;
119 yuiDebug() <<
"Selection list filled" << endl;
142 set<string> wanted = zyppSelection->install_packages();
144 for ( ZyppPoolIterator it = zyppPkgBegin();
148 string name = (*it)->theObj()->name();
150 if ( contains( wanted, name ) )
152 ZyppPkg zyppPkg = tryCastToZyppPkg( (*it)->theObj() );
169 ZyppSelection zyppSelection )
173 yuiError() <<
"NULL ZyppSel!" << endl;
186 QTreeWidgetItem * item = selectedItem();
204 ZyppSelection zyppSelection )
206 , _pkgSelList( pkgSelList )
207 , _zyppSelection( zyppSelection )
209 if ( ! _zyppSelection )
210 _zyppSelection = tryCastToZyppSelection( selectable->theObj() );
212 QString text = fromUTF8( _zyppSelection->summary() );
215 text.replace( QRegExp(
"Graphical Basis System" ),
"Graphical Base System" );
216 text.replace( QRegExp(
"Gnome" ),
"GNOME" );
247 bool ascending )
const 251 if ( ! _zyppSelection || ! other || ! other->
zyppSelection() )
254 return _zyppSelection->order().compare( other->
zyppSelection()->order() );
259 #include "YQPkgSelList.moc" Abstract base class to display a list of zypp::ResObjects.
void setText(int column, const string text)
Set a column text via STL string.
void fillList()
Fill the selection list.
Display a list of zypp::Selection objects.
void addPkgSelItem(ZyppSel selectable, ZyppSelection selection)
Add a selection to the list.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter.
virtual void applyChanges()
Propagate status changes in this list to other lists: Have the solver transact all selections...
void filterStart()
Emitted when the filtering starts.
virtual void clear()
Reimplemented from QY2ListView: Emit currentItemChanged() signal after clearing the list...
void filter()
Filter according to the view's rules and current selection.
virtual int compare(QTreeWidgetItem *other, int col, bool ascending) const
Comparison function used for sorting the list.
virtual ~YQPkgSelListItem()
Destructor.
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
virtual ~YQPkgSelList()
Destructor.
void applyExcludeRules()
Apply all exclude rules of this list to all items, including those that are currently excluded...
void filterFinished()
Emitted when filtering is finished.
void currentItemChanged(ZyppSel selectable)
Emitted when a zypp::ui::Selectable is selected.
ZyppSelection zyppSelection() const
Returns the original object within the package manager backend.
YQPkgSelListItem * selection() const
Returns the currently selected item or 0 if there is none.
void solveResolvableCollections()
Do a "small" solver run for all "resolvable collections", i.e., for selections, patterns, languages, patches.
YQPkgSelList(QWidget *parent, bool autoFill=true, bool autoFilter=true)
Constructor.
YQPkgSelListItem(YQPkgSelList *pkgSelList, ZyppSel selectable, ZyppSelection zyppSelection)
Constructor.
virtual void setStatusIcon()
Set a status icon according to the package's status.