41 #ifndef YQPkgPatchList_h
42 #define YQPkgPatchList_h
45 #include "YQPkgObjList.h"
46 #include "YQPkgSelMapper.h"
47 #include <QTreeWidgetItem>
51 #define ENABLE_DELETING_PATCHES 1
58 enum YQPkgPatchCategory
62 YQPkgRecommendedPatch,
66 YQPkgUnknownPatchCategory = 9999
94 RelevantAndInstalledPatches,
121 ZyppPatch zyppPatch );
132 virtual void message(
const QString & text );
192 const QString & summary,
234 FilterCriteria _filterCriteria;
235 QMap<YQPkgPatchCategory, YQPkgPatchCategoryItem*> _categories;
260 ZyppPatch zyppPatch );
284 virtual QString
toolTip(
int column );
289 virtual bool operator< (
const QTreeWidgetItem & other )
const;
293 int statusCol()
const {
return _patchList->statusCol(); }
294 int summaryCol()
const {
return _patchList->summaryCol(); }
295 int categoryCol()
const {
return _patchList->
categoryCol(); }
316 ZyppPatch _zyppPatch;
317 YQPkgPatchCategory _patchCategory;
347 virtual bool operator< (
const QTreeWidgetItem & other )
const;
354 virtual void setExpanded(
bool open );
360 static YQPkgPatchCategory
patchCategory(
const string & category );
364 static QString
asString( YQPkgPatchCategory category );
370 YQPkgPatchCategory
category()
const {
return _category; }
389 YQPkgPatchCategory _category;
391 ZyppPatch _firstPatch;
395 #endif // ifndef YQPkgPatchList_h
ZyppSel selectable() const
Returns the original selectable within the package manager backend.
Abstract base class to display a list of zypp::ResObjects.
virtual bool operator<(const QTreeWidgetItem &other) const
sorting function
Display a list of zypp::Patch objects.
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
virtual void polish()
Delayed initialization after the dialog is fully created.
virtual void applyChanges()
Propagate status changes in this list to other lists: Have the solver transact all patches...
void filter()
Filter according to the view's rules and current selection.
virtual ~YQPkgPatchCategoryItem()
Destructor.
ZyppPatch zyppPatch() const
Returns the original zyppPatch object.
virtual ~YQPkgPatchListItem()
Destructor.
void fillList()
Fill the patch list according to filterCriteria().
YQPkgPatchListItem * selection() const
Returns the currently selected item or 0 if there is none.
virtual void keyPressEvent(QKeyEvent *ev)
Event handler for keyboard input.
virtual void cycleStatus()
Cycle the package status to the next valid value.
YQPkgPatchCategory category() const
Category (and order ) for this item.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter.
ZyppPatch firstPatch() const
Returns the first pattern.
YQPkgPatchList(QWidget *parent)
Constructor.
YQPkgPatchCategoryItem(YQPkgPatchCategory category, YQPkgPatchList *patternList)
Constructor.
virtual void createInstalledContextMenu()
Create the context menu for installed items.
virtual void message(const QString &text)
Display a one-line message in the list.
static QString asString(YQPkgPatchCategory category)
Converts a patch category to a user-readable (translated) string.
virtual void createNotInstalledContextMenu()
Create the context menu for items that are not installed.
void setTreeIcon(void)
Set a suitable tree open/close icon depending on this category's open/close status.
virtual ~YQPkgPatchList()
Destructor.
Mapping from ZyppPkg to the correspoinding ZyppSel.
FilterCriteria filterCriteria() const
Returns the current filter criteria.
virtual QMenu * addAllInListSubMenu(QMenu *menu)
Add a submenu "All in this list..." to 'menu'.
void filterFinished()
Emitted when filtering is finished.
int categoryCol() const
Returns the column for the patch category.
void filterStart()
Emitted when the filtering starts.
static YQPkgPatchCategory patchCategory(QString category)
Maps a string patch category to the corresponding enum.
void addPatchItem(ZyppSel selectable, ZyppPatch zyppPatch)
Add a patch to the list.
void addPatch(ZyppPatch patch)
Add a pattern to this category.
virtual bool operator<(const QTreeWidgetItem &other) const
sorting function
virtual QString toolTip(int column)
Returns a tool tip text for a specific column of this item.
void setFilterCriteria(FilterCriteria filterCriteria)
Set the filter criteria for fillList().
YQPkgPatchListItem(YQPkgPatchList *patchList, ZyppSel selectable, ZyppPatch zyppPatch)
Constructor.
YQPkgPatchCategoryItem * category(YQPkgPatchCategory category)
returns or creates a category item for a defined category
YQPkgPatchCategory patchCategory() const
Returns the category of this patch (security, recommended, ...).