libyui-qt-pkg
2.42.5
|
Abstract base class to display a list of zypp::ResObjects. Handles most generic stuff like setting status etc. More...
#include <YQPkgObjList.h>
Classes | |
class | ExcludedItems |
class | ExcludeRule |
Public Slots | |
void | addPkgObjItem (ZyppSel selectable, ZyppObj zyppObj=0) |
void | addPassiveItem (const QString &name, const QString &summary=QString::null, FSize size=-1) |
virtual void | pkgObjClicked (int button, QTreeWidgetItem *item, int col, const QPoint &pos) |
virtual void | clear () |
virtual void | updateActions (YQPkgObjListItem *item=0) |
void | sendUpdatePackages () |
void | selectNextItem () |
void | sendStatusChanged () |
virtual void | message (const QString &text) |
void | logExcludeStatistics () |
void | setCurrentInstall () |
void | setCurrentDontInstall () |
void | setCurrentKeepInstalled () |
void | setCurrentDelete () |
void | setCurrentUpdate () |
void | setCurrentUpdateForce () |
void | setCurrentTaboo () |
void | setCurrentProtected () |
void | showCurrentSolverInfo () |
void | setListInstall () |
void | setListDontInstall () |
void | setListKeepInstalled () |
void | setListDelete () |
void | setListUpdate () |
void | setListUpdateForce () |
void | setListTaboo () |
void | setListProtected () |
Signals | |
void | currentItemChanged (ZyppSel selectable) |
void | statusChanged () |
void | updatePackages () |
Public Member Functions | |
QTreeWidgetItem * | itemFromIndex (const QModelIndex &index) const |
int | iconCol () const |
int | statusCol () const |
int | nameCol () const |
int | summaryCol () const |
int | sizeCol () const |
int | versionCol () const |
int | instVersionCol () const |
int | brokenIconCol () const |
int | satisfiedIconCol () const |
bool | editable () const |
void | setEditable (bool editable=true) |
void | setCurrentStatus (ZyppStatus newStatus, bool selectNextItem=false, bool ifNewerOnly=false) |
void | showSolverInfo () |
void | setAllItemStatus (ZyppStatus newStatus, bool force=false) |
virtual QMenu * | addAllInListSubMenu (QMenu *menu) |
virtual QPixmap | statusIcon (ZyppStatus status, bool enabled=true, bool bySelection=false) |
virtual QString | statusText (ZyppStatus status) const |
void | addExcludeRule (YQPkgObjList::ExcludeRule *rule) |
void | applyExcludeRules () |
void | applyExcludeRules (QTreeWidgetItem *) |
void | exclude (YQPkgObjListItem *item, bool exclude) |
Public Attributes | |
QAction * | actionSetCurrentInstall |
QAction * | actionSetCurrentDontInstall |
QAction * | actionSetCurrentKeepInstalled |
QAction * | actionSetCurrentDelete |
QAction * | actionSetCurrentUpdate |
QAction * | actionSetCurrentUpdateForce |
QAction * | actionSetCurrentTaboo |
QAction * | actionSetCurrentProtected |
QAction * | actionShowCurrentSolverInfo |
QAction * | actionSetListInstall |
QAction * | actionSetListDontInstall |
QAction * | actionSetListKeepInstalled |
QAction * | actionSetListDelete |
QAction * | actionSetListUpdate |
QAction * | actionSetListUpdateForce |
QAction * | actionSetListTaboo |
QAction * | actionSetListProtected |
YQZyppSolverDialogPluginStub | _plugin |
Protected Types | |
typedef list< ExcludeRule * > | ExcludeRuleList |
Protected Slots | |
virtual void | currentItemChangedInternal (QTreeWidgetItem *item) |
void | slotCustomContextMenu (const QPoint &pos) |
Protected Member Functions | |
YQPkgObjList (QWidget *parent) | |
virtual | ~YQPkgObjList () |
virtual void | keyPressEvent (QKeyEvent *ev) |
virtual QMenu * | installedContextMenu () |
virtual QMenu * | notInstalledContextMenu () |
virtual void | createNotInstalledContextMenu () |
virtual void | createInstalledContextMenu () |
void | createActions () |
QAction * | createAction (ZyppStatus status, const QString &key=QString::null, bool enabled=false) |
QAction * | createAction (const QString &text, const QPixmap &icon=QPixmap(), const QPixmap &insensitiveIcon=QPixmap(), const QString &key=QString::null, bool enabled=false) |
Protected Attributes | |
int | _iconCol |
int | _statusCol |
int | _nameCol |
int | _summaryCol |
int | _sizeCol |
int | _versionCol |
int | _instVersionCol |
int | _brokenIconCol |
int | _satisfiedIconCol |
bool | _editable |
bool | _debug |
ExcludeRuleList | _excludeRules |
ExcludedItems * | _excludedItems |
QMenu * | _installedContextMenu |
QMenu * | _notInstalledContextMenu |
Abstract base class to display a list of zypp::ResObjects. Handles most generic stuff like setting status etc.
Definition at line 68 of file YQPkgObjList.h.
|
protected |
Constructor. Does not add any QListView columns!
Definition at line 71 of file YQPkgObjList.cc.
|
protectedvirtual |
Destructor
Definition at line 134 of file YQPkgObjList.cc.
|
virtual |
Add a submenu "All in this list..." to 'menu'. Returns the newly created submenu.
Reimplemented in YQPkgPatchList, and YQPkgList.
Definition at line 565 of file YQPkgObjList.cc.
void YQPkgObjList::addExcludeRule | ( | YQPkgObjList::ExcludeRule * | rule | ) |
Add an exclude rule to this list.
Definition at line 790 of file YQPkgObjList.cc.
|
slot |
Add a purely passive list item that has a name and optional summary and size.
Definition at line 156 of file YQPkgObjList.cc.
|
slot |
Add a zypp::ResObject to the list. Connect a filter's filterMatch() signal to this slot. Remember to connect filterStart() to clear() (inherited from QListView).
'zyppObj' has to be one of the objects of 'selectable'. If it is 0, selectable->theObject() will be used.
Intentionally NOT named addItem() so the calling class cannot confuse this method with overlaid methods of the same name that were simply forgotten to implement!
Definition at line 142 of file YQPkgObjList.cc.
void YQPkgObjList::applyExcludeRules | ( | ) |
Apply all exclude rules of this list to all items, including those that are currently excluded.
Definition at line 797 of file YQPkgObjList.cc.
void YQPkgObjList::applyExcludeRules | ( | QTreeWidgetItem * | listViewItem | ) |
Apply all exclude rules of this list to one item.
Definition at line 856 of file YQPkgObjList.cc.
|
virtualslot |
Reimplemented from QY2ListView: Emit currentItemChanged() signal after clearing the list.
Definition at line 210 of file YQPkgObjList.cc.
|
protected |
Create an action based on a zypp::ResObject status - automatically retrieve the corresponding status icons (both sensitive and insensitive) and text. 'key' is only a descriptive text, no true accelerator.
Definition at line 492 of file YQPkgObjList.cc.
|
protected |
Low-level: Create an action. 'key' is only a descriptive text, no true accelerator.
Definition at line 503 of file YQPkgObjList.cc.
|
protected |
Create the actions for the context menus. Note: This is intentionally not virtual!
Definition at line 408 of file YQPkgObjList.cc.
|
protectedvirtual |
Create the context menu for installed items.
Reimplemented in YQPkgPatchList, and YQPkgList.
Definition at line 549 of file YQPkgObjList.cc.
|
protectedvirtual |
Create the context menu for items that are not installed.
Reimplemented in YQPkgPatchList, and YQPkgList.
Definition at line 534 of file YQPkgObjList.cc.
|
signal |
Emitted when a zypp::ui::Selectable is selected. May be called with a null poiner if no zypp::ResObject is selected.
|
protectedvirtualslot |
Dispatcher slot for selection change - internal only.
Definition at line 201 of file YQPkgObjList.cc.
|
inline |
Return whether or not items in this list are generally editable, i.e. the user can change their status. Note that individual items can be set to non-editable even if the list is generally editable. Lists are editable by default.
Definition at line 110 of file YQPkgObjList.h.
void YQPkgObjList::exclude | ( | YQPkgObjListItem * | item, |
bool | exclude | ||
) |
Exclude or include an item, i.e. remove it from the visible items and add it to the internal exclude list or vice versa.
Definition at line 904 of file YQPkgObjList.cc.
|
protectedvirtual |
Returns the context menu for items that are not installed. Creates the menu upon the first call.
Definition at line 596 of file YQPkgObjList.cc.
|
protectedvirtual |
Event handler for keyboard input. Only very special keys are processed here.
Reimplemented from QListView / QWidget.
Reimplemented in YQPkgPatchList.
Definition at line 660 of file YQPkgObjList.cc.
|
slot |
Write statistics about excluded items to the log, if there are any.
Definition at line 833 of file YQPkgObjList.cc.
|
virtualslot |
Display a one-line message in the list.
Definition at line 779 of file YQPkgObjList.cc.
|
protectedvirtual |
Returns the context menu for items that are installed. Creates the menu upon the first call.
Definition at line 586 of file YQPkgObjList.cc.
|
virtualslot |
Dispatcher slot for mouse click: cycle status depending on column.
Definition at line 176 of file YQPkgObjList.cc.
|
slot |
Select the next item, i.e. move the selection one item further down the list.
Definition at line 391 of file YQPkgObjList.cc.
|
inlineslot |
Emit a statusChanged() signal for the specified zypp::ResObject.
Definition at line 248 of file YQPkgObjList.h.
|
inlineslot |
Emit an updatePackages() signal.
Definition at line 237 of file YQPkgObjList.h.
void YQPkgObjList::setAllItemStatus | ( | ZyppStatus | newStatus, |
bool | force = false |
||
) |
Sets the status of all (toplevel) list items to 'newStatus', if possible. Only one single statusChanged() signal is emitted.
'force' overrides sensible defaults like setting only zypp::ResObjects to 'update' that really come with a newer version.
Definition at line 343 of file YQPkgObjList.cc.
void YQPkgObjList::setCurrentStatus | ( | ZyppStatus | newStatus, |
bool | selectNextItem = false , |
||
bool | ifNewerOnly = false |
||
) |
Sets the currently selected item's status. Automatically selects the next item if 'selectNextItem' is 'true'.
Definition at line 291 of file YQPkgObjList.cc.
|
inline |
Set the list's editable status.
Definition at line 115 of file YQPkgObjList.h.
void YQPkgObjList::showSolverInfo | ( | ) |
Show solver information about the current selected item
Definition at line 326 of file YQPkgObjList.cc.
|
protectedslot |
slot that shows context menu when requested
Definition at line 1700 of file YQPkgObjList.cc.
|
signal |
Emitted when the status of a zypp::ResObject is changed.
|
virtual |
Returns the suitable icon for a zypp::ResObject status - the regular icon if 'enabled' is 'true' or the insensitive icon if 'enabled' is 'false. 'bySelection' is relevant only for auto-states: This uses the icon for 'auto-by-selection" rather than the default auto-icon.
Definition at line 220 of file YQPkgObjList.cc.
|
virtual |
Returns a short (one line) descriptive text for a zypp::ResObject status.
Definition at line 270 of file YQPkgObjList.cc.
|
virtualslot |
Update the internal actions for the currently selected item ( if any ). This only calls updateActions( YQPkgObjListItem * ) with the currently selected item as argument, so there is normally no need to reimplement this method, too, if the other one is reimplemented.
Definition at line 606 of file YQPkgObjList.cc.
|
signal |
Emitted when it's time to update displayed package information, e.g., package states.