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();
191 return dynamic_cast<YQPkgSelListItem *> (item);
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() );
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
void applyExcludeRules()
Apply all exclude rules of this list to all items, including those that are currently excluded.
virtual void setStatusIcon()
Set a status icon according to the package's status.
void addPkgSelItem(ZyppSel selectable, ZyppSelection selection)
Add a selection to the list.
virtual ~YQPkgSelListItem()
Destructor.
void solveResolvableCollections()
Do a "small" solver run for all "resolvable collections", i.e., for selections, patterns,...
ZyppSelection zyppSelection() const
Returns the original object within the package manager backend.
YQPkgSelListItem(YQPkgSelList *pkgSelList, ZyppSel selectable, ZyppSelection zyppSelection)
Constructor.
void filter()
Filter according to the view's rules and current selection.
void filterFinished()
Emitted when filtering is finished.
ZyppSel selectable() const
Returns the original selectable within the package manager backend.
void setText(int column, const string text)
Set a column text via STL string.
Display a list of zypp::Selection objects.
virtual int compare(QTreeWidgetItem *other, int col, bool ascending) const
Comparison function used for sorting the list.
void fillList()
Fill the selection list.
void filterStart()
Emitted when the filtering starts.
YQPkgSelList(QWidget *parent, bool autoFill=true, bool autoFilter=true)
Constructor.
virtual ~YQPkgSelList()
Destructor.
virtual void clear()
Reimplemented from QY2ListView: Emit currentItemChanged() signal after clearing the list.
YQPkgSelListItem * selection() const
Returns the currently selected item or 0 if there is none.
virtual void applyChanges()
Propagate status changes in this list to other lists: Have the solver transact all selections.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter.
void currentItemChanged(ZyppSel selectable)
Emitted when a zypp::ui::Selectable is selected.
Abstract base class to display a list of zypp::ResObjects.