libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgList Class Reference

Display a list of zypp::Package objects. More...

#include <YQPkgList.h>

Inheritance diagram for YQPkgList:
Collaboration diagram for YQPkgList:

Public Slots

void addPkgItem (ZyppSel selectable, ZyppPkg zyppPkg)
void addPkgItemDimmed (ZyppSel selectable, ZyppPkg zyppPkg)
void addPkgItem (ZyppSel selectable, ZyppPkg zyppPkg, bool dimmed)
virtual void pkgObjClicked (int button, QTreeWidgetItem *item, int col, const QPoint &pos)
virtual void updateActions (YQPkgObjListItem *item)
virtual QSize sizeHint () const
void askExportList () const
void setInstallCurrentSourceRpm ()
void setDontInstallCurrentSourceRpm ()
void setInstallListSourceRpms ()
void setDontInstallListSourceRpms ()
void clear ()
void resort ()
Public Slots inherited from YQPkgObjList
void addPkgObjItem (ZyppSel selectable, ZyppObj zyppObj=0)
void addPassiveItem (const QString &name, const QString &summary=QString(), 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 maybeSetFocus ()
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)
virtual ~YQPkgList ()
int srpmStatusCol () const
void exportList (const QString filename, bool interactive) const
virtual QMenu * addAllInListSubMenu (QMenu *menu)
int globalSetPkgStatus (ZyppStatus newStatus, bool force, bool countOnly)
Public Member Functions inherited from YQPkgObjList
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 setAllItemStatus (ZyppStatus newStatus, bool force=false)
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)

Static Public Member Functions

static bool haveInstalledPkgs ()

Public Attributes

QAction * actionInstallSourceRpm
QAction * actionDontInstallSourceRpm
QAction * actionInstallListSourceRpms
QAction * actionDontInstallListSourceRpms
Public Attributes inherited from YQPkgObjList
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 ()
virtual void createNotInstalledContextMenu ()
virtual void createInstalledContextMenu ()
void createSourceRpmContextMenu ()
void setInstallCurrentSourceRpm (bool inst, bool selectNextItem=false)
void setInstallListSourceRpms (bool inst)
void resetOptimalColumnWidthValues ()
void updateOptimalColumnWidthValues (ZyppSel selectable, ZyppPkg zyppPkg)
void optimizeColumnWidths ()
void resizeEvent (QResizeEvent *event)
Protected Member Functions inherited from YQPkgObjList
 YQPkgObjList (QWidget *parent)
virtual ~YQPkgObjList ()
virtual void keyPressEvent (QKeyEvent *ev)
virtual QMenu * installedContextMenu ()
virtual QMenu * notInstalledContextMenu ()
bool shouldKeepFocus (QWidget *widget) const
void createActions ()
QAction * createAction (ZyppStatus status, const QString &key=QString(), bool enabled=false)
QAction * createAction (const QString &text, const QPixmap &icon=QPixmap(), const QPixmap &insensitiveIcon=QPixmap(), const QString &key=QString(), bool enabled=false)

Protected Attributes

int _srpmStatusCol
QMenu * _sourceRpmContextMenu
int _optimalColWidth_statusIcon
int _optimalColWidth_name
int _optimalColWidth_summary
int _optimalColWidth_version
int _optimalColWidth_instVersion
int _optimalColWidth_size
Protected Attributes inherited from YQPkgObjList
int _iconCol
int _statusCol
int _nameCol
int _summaryCol
int _sizeCol
int _versionCol
int _instVersionCol
int _brokenIconCol
int _satisfiedIconCol
bool _editable
bool _debug
int _excludedItemsCount
ExcludeRuleList _excludeRules
QMenu * _installedContextMenu
QMenu * _notInstalledContextMenu

Additional Inherited Members

Signals inherited from YQPkgObjList
void currentItemChanged (ZyppSel selectable)
void statusChanged ()
void updatePackages ()
Protected Types inherited from YQPkgObjList
typedef list< ExcludeRule * > ExcludeRuleList
Protected Slots inherited from YQPkgObjList
virtual void currentItemChangedInternal (QTreeWidgetItem *item)
void slotCustomContextMenu (const QPoint &pos)

Detailed Description

Display a list of zypp::Package objects.

Constructor & Destructor Documentation

◆ YQPkgList()

YQPkgList::YQPkgList ( QWidget * parent)

Constructor

◆ ~YQPkgList()

YQPkgList::~YQPkgList ( )
virtual

Destructor

Member Function Documentation

◆ addAllInListSubMenu()

QMenu * YQPkgList::addAllInListSubMenu ( QMenu * menu)
virtual

Add a submenu "All in this list..." to 'menu'. Returns the newly created submenu.

Reimplemented from YQPkgObjList.

Reimplemented from YQPkgObjList.

◆ addPkgItem [1/2]

void YQPkgList::addPkgItem ( ZyppSel selectable,
ZyppPkg zyppPkg )
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).

◆ addPkgItem [2/2]

void YQPkgList::addPkgItem ( ZyppSel selectable,
ZyppPkg zyppPkg,
bool dimmed )
slot

Add a pkg to the list

◆ addPkgItemDimmed

void YQPkgList::addPkgItemDimmed ( ZyppSel selectable,
ZyppPkg zyppPkg )
slot

Add a pkg to the list, but display it dimmed (grey text foreground rather than normal black).

◆ askExportList

void YQPkgList::askExportList ( ) const
slot

Ask for a file name and save the current pkg list to file.

◆ clear

void YQPkgList::clear ( )
slot

Clears the tree-widgets content, resets the optimal column width values

Reimplemented from QPkgObjList, calls QPkgObjList::reset()

◆ createActions()

void YQPkgList::createActions ( )
protected

Create ( additional ) actions for the context menus.

◆ createInstalledContextMenu()

void YQPkgList::createInstalledContextMenu ( )
protectedvirtual

Create the context menu for installed items.

Reimplemented from YQPkgObjList.

Reimplemented from YQPkgObjList.

◆ createNotInstalledContextMenu()

void YQPkgList::createNotInstalledContextMenu ( )
protectedvirtual

Create the context menu for items that are not installed.

Reimplemented from YQPkgObjList.

Reimplemented from YQPkgObjList.

◆ createSourceRpmContextMenu()

void YQPkgList::createSourceRpmContextMenu ( )
protected

Create context menu for source RPMs.

◆ exportList()

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 ).

◆ globalSetPkgStatus()

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

◆ haveInstalledPkgs()

bool YQPkgList::haveInstalledPkgs ( )
static

Returns 'true' if there are any installed packages.

◆ optimizeColumnWidths()

void YQPkgList::optimizeColumnWidths ( )
protected

Optimizes the column widths depending on content and the available horizontal space.

◆ pkgObjClicked

void YQPkgList::pkgObjClicked ( int button,
QTreeWidgetItem * item,
int col,
const QPoint & pos )
virtualslot

Dispatcher slot for mouse click: Take care of source RPM status. Let the parent class handle the normal status. Reimplemented from YQPkgObjList.

◆ resetOptimalColumnWidthValues()

void YQPkgList::resetOptimalColumnWidthValues ( )
protected

Resets the optimal column width values. Needed for empty list.

◆ resizeEvent()

void YQPkgList::resizeEvent ( QResizeEvent * event)
protected

Handler for resize events. Triggers column width optimization.

◆ resort

void YQPkgList::resort ( )
slot

Sort the tree widget again according to the column selected and its current sort order.

◆ setInstallCurrentSourceRpm()

void YQPkgList::setInstallCurrentSourceRpm ( bool inst,
bool selectNextItem = false )
protected

Sets the currently selected item's source RPM status. Automatically selects the next item if 'selectNextItem' is 'true'.

◆ setInstallListSourceRpms()

void YQPkgList::setInstallListSourceRpms ( bool inst)
protected

Sets the source RPM status of all items in this list.

◆ sizeHint

QSize YQPkgList::sizeHint ( ) const
virtualslot

Reimplemented from QListView / QWidget: Reserve a reasonable amount of space.

◆ updateActions

void YQPkgList::updateActions ( YQPkgObjListItem * item)
virtualslot

Update the internal actions: What actions are available for 'item'?

Reimplemented from YQPkgObjList

◆ updateOptimalColumnWidthValues()

void YQPkgList::updateOptimalColumnWidthValues ( ZyppSel selectable,
ZyppPkg zyppPkg )
protected

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.


The documentation for this class was generated from the following files:
  • /builddir/build/BUILD/libyui-4.6.2-build/libyui-4.6.2/libyui-qt-pkg/src/YQPkgList.h
  • /builddir/build/BUILD/libyui-4.6.2-build/libyui-4.6.2/libyui-qt-pkg/src/YQPkgList.cc