libyui-qt-pkg
2.45.27
|
Display a list of zypp::Package objects. More...
#include <YQPkgList.h>
Public Slots | |
void | addPkgItem (ZyppSel selectable, ZyppPkg zyppPkg) |
Add a pkg to the list. More... | |
void | addPkgItemDimmed (ZyppSel selectable, ZyppPkg zyppPkg) |
Add a pkg to the list, but display it dimmed (grey text foreground rather than normal black). | |
void | addPkgItem (ZyppSel selectable, ZyppPkg zyppPkg, bool dimmed) |
Add a pkg to the list. | |
virtual void | pkgObjClicked (int button, QTreeWidgetItem *item, int col, const QPoint &pos) |
Dispatcher slot for mouse click: Take care of source RPM status. More... | |
virtual void | updateActions (YQPkgObjListItem *item) |
Update the internal actions: What actions are available for 'item'? More... | |
virtual QSize | sizeHint () const |
Reimplemented from QListView / QWidget: Reserve a reasonable amount of space. | |
void | askExportList () const |
Ask for a file name and save the current pkg list to file. | |
void | setInstallCurrentSourceRpm () |
void | setDontInstallCurrentSourceRpm () |
void | setInstallListSourceRpms () |
void | setDontInstallListSourceRpms () |
void | clear () |
Clears the tree-widgets content, resets the optimal column width values. More... | |
void | resort () |
Sort the tree widget again according to the column selected and its current sort order. | |
![]() | |
void | addPkgObjItem (ZyppSel selectable, ZyppObj zyppObj=0) |
Add a zypp::ResObject to the list. More... | |
void | addPassiveItem (const QString &name, const QString &summary=QString::null, FSize size=-1) |
Add a purely passive list item that has a name and optional summary and size. | |
virtual void | pkgObjClicked (int button, QTreeWidgetItem *item, int col, const QPoint &pos) |
Dispatcher slot for mouse click: cycle status depending on column. | |
virtual void | clear () |
Reimplemented from QY2ListView: Emit currentItemChanged() signal after clearing the list. | |
virtual void | updateActions (YQPkgObjListItem *item=0) |
Update the internal actions for the currently selected item ( if any ). More... | |
void | sendUpdatePackages () |
Emit an updatePackages() signal. | |
void | selectNextItem () |
Select the next item, i.e. More... | |
void | sendStatusChanged () |
Emit a statusChanged() signal for the specified zypp::ResObject. | |
virtual void | message (const QString &text) |
Display a one-line message in the list. | |
void | logExcludeStatistics () |
Write statistics about excluded items to the log, if there are any. | |
void | setCurrentInstall () |
void | setCurrentDontInstall () |
void | setCurrentKeepInstalled () |
void | setCurrentDelete () |
void | setCurrentUpdate () |
void | setCurrentUpdateForce () |
void | setCurrentTaboo () |
void | setCurrentProtected () |
void | setListInstall () |
void | setListDontInstall () |
void | setListKeepInstalled () |
void | setListDelete () |
void | setListUpdate () |
void | setListUpdateForce () |
void | setListTaboo () |
void | setListProtected () |
Public Member Functions | |
YQPkgList (QWidget *parent) | |
Constructor. | |
virtual | ~YQPkgList () |
Destructor. | |
int | srpmStatusCol () const |
void | exportList (const QString filename, bool interactive) const |
Save the pkg list to a file. More... | |
virtual QMenu * | addAllInListSubMenu (QMenu *menu) |
Add a submenu "All in this list..." to 'menu'. More... | |
int | globalSetPkgStatus (ZyppStatus newStatus, bool force, bool countOnly) |
Set the status of all packages in the pool to a new value. More... | |
![]() | |
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 |
Return whether or not items in this list are generally editable, i.e. More... | |
void | setEditable (bool editable=true) |
Set the list's editable status. | |
void | setCurrentStatus (ZyppStatus newStatus, bool selectNextItem=false, bool ifNewerOnly=false) |
Sets the currently selected item's status. More... | |
void | setAllItemStatus (ZyppStatus newStatus, bool force=false) |
Sets the status of all (toplevel) list items to 'newStatus', if possible. More... | |
virtual QPixmap | statusIcon (ZyppStatus status, bool enabled=true, bool bySelection=false) |
Returns the suitable icon for a zypp::ResObject status - the regular icon if 'enabled' is 'true' or the insensitive icon if 'enabled' is 'false. More... | |
virtual QString | statusText (ZyppStatus status) const |
Returns a short (one line) descriptive text for a zypp::ResObject status. | |
void | addExcludeRule (YQPkgObjList::ExcludeRule *rule) |
Add an exclude rule to this list. | |
void | applyExcludeRules () |
Apply all exclude rules of this list to all items, including those that are currently excluded. | |
void | applyExcludeRules (QTreeWidgetItem *) |
Apply all exclude rules of this list to one item. | |
void | exclude (YQPkgObjListItem *item, bool exclude) |
Exclude or include an item, i.e. More... | |
Static Public Member Functions | |
static bool | haveInstalledPkgs () |
Returns 'true' if there are any installed packages. | |
Public Attributes | |
QAction * | actionInstallSourceRpm |
QAction * | actionDontInstallSourceRpm |
QAction * | actionInstallListSourceRpms |
QAction * | actionDontInstallListSourceRpms |
![]() | |
QAction * | actionSetCurrentInstall |
QAction * | actionSetCurrentDontInstall |
QAction * | actionSetCurrentKeepInstalled |
QAction * | actionSetCurrentDelete |
QAction * | actionSetCurrentUpdate |
QAction * | actionSetCurrentUpdateForce |
QAction * | actionSetCurrentTaboo |
QAction * | actionSetCurrentProtected |
QAction * | actionSetListInstall |
QAction * | actionSetListDontInstall |
QAction * | actionSetListKeepInstalled |
QAction * | actionSetListDelete |
QAction * | actionSetListUpdate |
QAction * | actionSetListUpdateForce |
QAction * | actionSetListTaboo |
QAction * | actionSetListProtected |
Protected Member Functions | |
void | createActions () |
Create ( additional ) actions for the context menus. | |
virtual void | createNotInstalledContextMenu () |
Create the context menu for items that are not installed. More... | |
virtual void | createInstalledContextMenu () |
Create the context menu for installed items. More... | |
void | createSourceRpmContextMenu () |
Create context menu for source RPMs. | |
void | setInstallCurrentSourceRpm (bool inst, bool selectNextItem=false) |
Sets the currently selected item's source RPM status. More... | |
void | setInstallListSourceRpms (bool inst) |
Sets the source RPM status of all items in this list. | |
void | resetOptimalColumnWidthValues () |
Resets the optimal column width values. More... | |
void | updateOptimalColumnWidthValues (ZyppSel selectable, ZyppPkg zyppPkg) |
Set and save optimal column widths depending on content only There is currently no way to get the optimal widths without setting them, so we have to do it. | |
void | optimizeColumnWidths () |
Optimizes the column widths depending on content and the available horizontal space. | |
void | resizeEvent (QResizeEvent *event) |
Handler for resize events. More... | |
![]() | |
YQPkgObjList (QWidget *parent) | |
Constructor. More... | |
virtual | ~YQPkgObjList () |
Destructor. | |
virtual void | keyPressEvent (QKeyEvent *ev) |
Event handler for keyboard input. More... | |
virtual QMenu * | installedContextMenu () |
Returns the context menu for items that are not installed. More... | |
virtual QMenu * | notInstalledContextMenu () |
Returns the context menu for items that are installed. More... | |
void | createActions () |
Create the actions for the context menus. More... | |
QAction * | createAction (ZyppStatus status, const QString &key=QString::null, bool enabled=false) |
Create an action based on a zypp::ResObject status - automatically retrieve the corresponding status icons (both sensitive and insensitive) and text. More... | |
QAction * | createAction (const QString &text, const QPixmap &icon=QPixmap(), const QPixmap &insensitiveIcon=QPixmap(), const QString &key=QString::null, bool enabled=false) |
Low-level: Create an action. More... | |
Protected Attributes | |
int | _srpmStatusCol |
QMenu * | _sourceRpmContextMenu |
int | _optimalColWidth_statusIcon |
int | _optimalColWidth_name |
int | _optimalColWidth_summary |
int | _optimalColWidth_version |
int | _optimalColWidth_instVersion |
int | _optimalColWidth_size |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
void | currentItemChanged (ZyppSel selectable) |
Emitted when a zypp::ui::Selectable is selected. More... | |
void | statusChanged () |
Emitted when the status of a zypp::ResObject is changed. | |
void | updatePackages () |
Emitted when it's time to update displayed package information, e.g., package states. | |
![]() | |
typedef list< ExcludeRule * > | ExcludeRuleList |
![]() | |
virtual void | currentItemChangedInternal (QTreeWidgetItem *item) |
Dispatcher slot for selection change - internal only. | |
void | slotCustomContextMenu (const QPoint &pos) |
slot that shows context menu when requested | |
Display a list of zypp::Package objects.
Definition at line 54 of file YQPkgList.h.
|
virtual |
Add a submenu "All in this list..." to 'menu'.
Returns the newly created submenu.
Reimplemented from YQPkgObjList.
Reimplemented from YQPkgObjList.
Definition at line 501 of file YQPkgList.cc.
|
slot |
Add a pkg to the list.
Connect a filter's filterMatch() signal to this slot. Remember to connect filterStart() to clear() (inherited from QListView).
Definition at line 140 of file YQPkgList.cc.
|
slot |
Clears the tree-widgets content, resets the optimal column width values.
Reimplemented from QPkgObjList, calls QPkgObjList::reset()
Definition at line 434 of file YQPkgList.cc.
|
protectedvirtual |
Create the context menu for installed items.
Reimplemented from YQPkgObjList.
Reimplemented from YQPkgObjList.
Definition at line 481 of file YQPkgList.cc.
|
protectedvirtual |
Create the context menu for items that are not installed.
Reimplemented from YQPkgObjList.
Reimplemented from YQPkgObjList.
Definition at line 463 of file YQPkgList.cc.
void YQPkgList::exportList | ( | const QString | filename, |
bool | interactive | ||
) | const |
Save the pkg list to a file.
Posts error popups if 'interactive' is 'true' ( only log entries otherwise ).
Definition at line 589 of file YQPkgList.cc.
int YQPkgList::globalSetPkgStatus | ( | ZyppStatus | newStatus, |
bool | force, | ||
bool | countOnly | ||
) |
Set the status of all packages in the pool to a new value.
This is not restricted to the current content of this package list. All selectables in the ZYPP pool are affected.
'force' indicates if it should be done even if it is not very useful, e.g., if packages should be updated even if there is no newer version.
If 'countOnly' is 'true', the status is not actually changed, only the number of packages that would be affected is return.
Return value: The number of status changes
Definition at line 678 of file YQPkgList.cc.
|
virtualslot |
Dispatcher slot for mouse click: Take care of source RPM status.
Let the parent class handle the normal status. Reimplemented from YQPkgObjList.
Definition at line 195 of file YQPkgList.cc.
|
protected |
Resets the optimal column width values.
Needed for empty list.
Definition at line 307 of file YQPkgList.cc.
|
protected |
Handler for resize events.
Triggers column width optimization.
Definition at line 452 of file YQPkgList.cc.
|
protected |
Sets the currently selected item's source RPM status.
Automatically selects the next item if 'selectNextItem' is 'true'.
Definition at line 257 of file YQPkgList.cc.
|
virtualslot |
Update the internal actions: What actions are available for 'item'?
Reimplemented from YQPkgObjList
Definition at line 558 of file YQPkgList.cc.