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;
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 );
370 YQPkgPatchCategory
category()
const {
return _category; }
389 YQPkgPatchCategory _category;
391 ZyppPatch _firstPatch;
395 #endif // ifndef YQPkgPatchList_h ZyppPatch firstPatch() const
Returns the first pattern.
Abstract base class to display a list of zypp::ResObjects.
Display a list of zypp::Patch objects.
FilterCriteria filterCriteria() const
Returns the current filter criteria.
virtual bool operator<(const QTreeWidgetItem &other) const
sorting function
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...
ZyppPatch zyppPatch() const
Returns the original zyppPatch object.
void filter()
Filter according to the view's rules and current selection.
virtual ~YQPkgPatchCategoryItem()
Destructor.
virtual ~YQPkgPatchListItem()
Destructor.
void fillList()
Fill the patch list according to filterCriteria().
virtual void keyPressEvent(QKeyEvent *ev)
Event handler for keyboard input.
virtual void cycleStatus()
Cycle the package status to the next valid value.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter.
YQPkgPatchList(QWidget *parent)
Constructor.
virtual bool operator<(const QTreeWidgetItem &other) const
sorting function
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.
ZyppSel selectable() const
Returns the original selectable within the package manager backend.
Mapping from ZyppPkg to the correspoinding ZyppSel.
virtual QMenu * addAllInListSubMenu(QMenu *menu)
Add a submenu "All in this list..." to 'menu'.
void filterFinished()
Emitted when filtering is finished.
void filterStart()
Emitted when the filtering starts.
YQPkgPatchCategory category() const
Category (and order ) for this item.
int categoryCol() const
Returns the column for the patch category.
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.
YQPkgPatchCategory patchCategory() const
Returns the category of this patch (security, recommended, ...).
YQPkgPatchListItem * selection() const
Returns the currently selected item or 0 if there is none.
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