44 #include <YQPkgObjList.h>
46 #include <QResizeEvent>
73 int srpmStatusCol()
const {
return _srpmStatusCol; }
81 void exportList(
const QString filename,
bool interactive )
const;
143 QTreeWidgetItem * item,
145 const QPoint & pos );
168 void setInstallCurrentSourceRpm() { setInstallCurrentSourceRpm(
true ); }
169 void setDontInstallCurrentSourceRpm() { setInstallCurrentSourceRpm(
false ); }
171 void setInstallListSourceRpms() { setInstallListSourceRpms(
true ); }
172 void setDontInstallListSourceRpms() { setInstallListSourceRpms(
false ); }
224 void setInstallCurrentSourceRpm(
bool inst,
bool selectNextItem =
false );
229 void setInstallListSourceRpms(
bool inst );
258 QMenu * _sourceRpmContextMenu;
260 int _optimalColWidth_statusIcon;
261 int _optimalColWidth_name;
262 int _optimalColWidth_summary;
263 int _optimalColWidth_version;
264 int _optimalColWidth_instVersion;
265 int _optimalColWidth_size;
270 QAction * actionInstallSourceRpm;
271 QAction * actionDontInstallSourceRpm;
272 QAction * actionInstallListSourceRpms;
273 QAction * actionDontInstallListSourceRpms;
303 ZyppPkg
zyppPkg()
const {
return _zyppPkg; }
329 virtual bool operator< (
const QTreeWidgetItem & other )
const;
345 virtual QString
toolTip(
int column );
351 bool isDimmed()
const {
return _dimmed; }
356 void setDimmed(
bool d =
true ) { _dimmed = d; }
361 int srpmStatusCol()
const {
return _pkgList->srpmStatusCol(); }
380 #endif // ifndef YQPkgList_h
virtual QSize sizeHint() const
Reimplemented from QListView / QWidget: Reserve a reasonable amount of space.
void createSourceRpmContextMenu()
Create context menu for source RPMs.
virtual QString toolTip(int column)
Returns a tool tip text for a specific column of this item.
YQPkgList(QWidget *parent)
Constructor.
void createActions()
Create ( additional ) actions for the context menus.
static bool haveInstalledPkgs()
Returns 'true' if there are any installed packages.
void addPkgItemDimmed(ZyppSel selectable, ZyppPkg zyppPkg)
Add a pkg to the list, but display it dimmed (grey text foreground rather than normal black).
void exportList(const QString filename, bool interactive) const
Save the pkg list to a file.
bool hasSourceRpm() const
Returns whether or not a source RPM is available for this package.
void optimizeColumnWidths()
Optimizes the column widths depending on content and the available horizontal space.
void setDimmed(bool d=true)
Set the 'dimmed' flag.
void clear()
Clears the tree-widgets content, resets the optimal column width values.
virtual ~YQPkgListItem()
Destructor.
void setInstallSourceRpm(bool installSourceRpm)
Set the source RPM status.
void setSourceRpmIcon()
Set the suitable icon for the source RPM status.
virtual void createInstalledContextMenu()
Create the context menu for installed items.
ZyppSel selectable() const
Returns the original selectable within the package manager backend.
virtual void updateData()
Update this item's data completely.
virtual ~YQPkgList()
Destructor.
virtual void createNotInstalledContextMenu()
Create the context menu for items that are not installed.
void updateOptimalColumnWidthValues(ZyppSel selectable, ZyppPkg zyppPkg)
Set and save optimal column widths depending on content only There is currently no way to get the opt...
void resetOptimalColumnWidthValues()
Resets the optimal column width values.
int globalSetPkgStatus(ZyppStatus newStatus, bool force, bool countOnly)
Set the status of all packages in the pool to a new value.
Display a list of zypp::Package objects.
void askExportList() const
Ask for a file name and save the current pkg list to file.
YQPkgList * pkgList()
Returns the parent package list.
bool isDimmed() const
Returns true if this package is to be displayed dimmed, i.e.
ZyppPkg zyppPkg() const
Returns the original object within the package manager backend.
void toggleSourceRpmStatus()
Cycle the source package status to the next valid value.
virtual void pkgObjClicked(int button, QTreeWidgetItem *item, int col, const QPoint &pos)
Dispatcher slot for mouse click: Take care of source RPM status.
void addPkgItem(ZyppSel selectable, ZyppPkg zyppPkg)
Add a pkg to the list.
virtual QMenu * addAllInListSubMenu(QMenu *menu)
Add a submenu "All in this list..." to 'menu'.
virtual bool operator<(const QTreeWidgetItem &other) const
sorting function
void selectNextItem()
Select the next item, i.e.
YQPkgListItem(YQPkgList *pkgList, ZyppSel selectable, ZyppPkg zyppPkg)
Constructor.
Abstract base class to display a list of zypp::ResObjects.
void resort()
Sort the tree widget again according to the column selected and its current sort order.
bool installSourceRpm() const
Returns the source RPM package status: Should the source RPM be installed?
virtual void updateActions(YQPkgObjListItem *item)
Update the internal actions: What actions are available for 'item'?
void resizeEvent(QResizeEvent *event)
Handler for resize events.