libyui-qt-pkg  2.42.13
 All Classes Functions Variables Enumerations
YQPackageSelector.h
1 /**************************************************************************
2 Copyright (C) 2000 - 2010 Novell, Inc.
3 All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 **************************************************************************/
20 
21 
22 
23 /*---------------------------------------------------------------------\
24 | |
25 | __ __ ____ _____ ____ |
26 | \ \ / /_ _/ ___|_ _|___ \ |
27 | \ V / _` \___ \ | | __) | |
28 | | | (_| |___) || | / __/ |
29 | |_|\__,_|____/ |_| |_____| |
30 | |
31 | core system |
32 | (C) SuSE GmbH |
33 \----------------------------------------------------------------------/
34 
35  File: YQPackageSelector.h
36 
37  Author: Stefan Hundhammer <sh@suse.de>
38 
39 /-*/
40 
41 
42 #ifndef YQPackageSelector_h
43 #define YQPackageSelector_h
44 
45 #include <QColor>
46 #include <QLabel>
47 #include <QMenu>
48 
49 #include "YQPackageSelectorBase.h"
50 #include "YQPkgObjList.h"
51 
52 class QCheckBox;
53 class QComboBox;
54 class QLabel;
55 class QListWidget;
56 class QProgressBar;
57 class QPushButton;
58 class QSplitter;
59 class QTabWidget;
60 class QMenu;
61 class QMenuBar;
62 
63 class QY2ComboTabWidget;
64 
65 class YQPkgChangeLogView;
68 class YQPkgFileListView;
69 class YQPkgFilterTab;
70 class YQPkgLangList;
71 class YQPkgList;
74 class YQPkgPatchList;
75 class YQPkgPatternList;
79 class YQPkgSelList;
83 class YQPkgVersionsView;
84 
86 {
87  Q_OBJECT
88 
89 public:
90 
91  YQPackageSelector( YWidget * parent, long modeFlags = 0 );
93 
94 
95 public slots:
96 
97  /**
98  * Resolve package dependencies manually.
99  *
100  * Returns QDialog::Accepted or QDialog::Rejected.
101  **/
103 
104  /**
105  * Automatically resolve package dependencies if desired
106  * (if the "auto check" checkbox is on).
107  **/
109 
110  /**
111  * Export all current selection/package states
112  **/
113  void pkgExport();
114 
115  /**
116  * Import selection/package states
117  **/
118  void pkgImport();
119 
120  /**
121  * Install any -devel package for packages that are installed or marked for
122  * installation
123  **/
124  void installDevelPkgs();
125 
126  /**
127  * Install available -debuginfo packages for packages that are installed or
128  * marked for installation
129  **/
130  void installDebugInfoPkgs();
131 
132  /**
133  * Install available -debugsource packages for packages that are installed or
134  * marked for installation
135  **/
136  void installDebugSourcePkgs();
137 
138  /**
139  * Install any subpackage that ends with 'suffix' for packages that are
140  * installed or marked for installation
141  **/
142  void installSubPkgs( const QString & suffix );
143 
144  /**
145  * Enable or disable the package exclude rules (show or suppress -debuginfo
146  * or -devel packages) according to the current menu settings and apply the
147  * exclude rules.
148  **/
149  void pkgExcludeDebugChanged( bool on );
150  void pkgExcludeDevelChanged( bool on );
151 
152 
153  /*
154  * Enable or disable verify system mode of the solver
155  */
156  void pkgVerifySytemModeChanged( bool on );
157 
158  /*
159  * Ignore recommended packages for already installed packages
160  */
161  void pkgIgnoreAlreadyRecommendedChanged( bool on );
162 
163  /*
164  * Enable or disable CleandepsOnRemove of the solver (=Cleanup when deleting packages)
165  */
166  void pkgCleanDepsOnRemoveChanged( bool on );
167 
168  /*
169  * Enable or disable vendor change allowed of the solver
170  */
171  void pkgAllowVendorChangeChanged( bool on );
172 
173 
174 
175  /**
176  * Display (generic) online help.
177  **/
178  void help();
179 
180  /**
181  * Display online help about symbols (package status icons).
182  **/
183  void symbolHelp();
184 
185  /**
186  * Display online help about magic keys.
187  **/
188  void keyboardHelp();
189 
190  /**
191  * hides or shows the repository upgrade message
192  */
194 
195  /**
196  * loads settings for the checkboxes in the option menu
197  */
198  void loadSettings();
199 
200  /**
201  * saves settings of the checkboxes in the option menu
202  */
203  void saveSettings();
204 
205 signals:
206 
207  /**
208  * Emitted once (!) when the dialog is about to be shown, when all widgets
209  * are created and all signal/slot connections are set up - when it makes
210  * sense to load data.
211  **/
212  void loadData();
213 
214  /**
215  * Emitted when the internal data base might have changed and a refresh of
216  * all displayed data might be necessary - e.g., when saved (exported) pkg
217  * states are reimported.
218  **/
219  void refresh();
220 
221 
222 protected slots:
223 
224  /**
225  * Add the "Patches" filter view, if it is not already there.
226  **/
227  void addPatchFilterView();
228 
229  /**
230  * Add the "Patches" filter view upon hotkey (F2).
231  **/
233 
234  /**
235  * Set the status of all installed packages (all in the pool, not only
236  * those currently displayed in the package list) to "update", if there is
237  * a candidate package that is newer than the installed package.
238  **/
239  void globalUpdatePkg() { globalUpdatePkg( false ); }
240 
241  /**
242  * Set the status of all installed packages (all in the pool, not only
243  * those currently displayed in the package list) to "update", even if the
244  * candidate package is not newer than the installed package.
245  **/
247 
248  /**
249  * Show all products in a popup dialog.
250  **/
251  void showProducts();
252 
253  /**
254  * Show dialog for pkgmgr history
255  */
256  void showHistory();
257 
258  /**
259  * a link in the repo upgrade label was clicked
260  */
261  void slotRepoUpgradeLabelLinkClicked(const QString &link);
262 
263 public:
264  /**
265  * returns the full path for an icon of a given size
266  */
267  static std::string iconPath( const std::string &name, int size );
268 
269 protected:
270 
271  // Layout methods - create and layout widgets
272 
273  void basicLayout();
274 
275  QWidget * layoutRightPane ( QWidget *parent );
276  void layoutFilters ( QWidget *parent );
277  void layoutPkgList ( QWidget *parent );
278  void layoutDetailsViews ( QWidget *parent );
279  void layoutButtons ( QWidget *parent );
280  void layoutMenuBar ( QWidget *parent );
281 
282  /**
283  * Establish Qt signal / slot connections.
284  *
285  * This really needs to be a separate method to make sure all affected
286  * wigets are created at this point.
287  **/
288  void makeConnections();
289 
290  /**
291  * Add pulldown menus to the menu bar.
292  *
293  * This really needs to be a separate method to make sure all affected
294  * wigets are created at this point.
295  **/
296  void addMenus();
297 
298  /**
299  * Connect a filter view that provides the usual signals with a package
300  * list. By convention, filter views provide the following signals:
301  * filterStart()
302  * filterMatch()
303  * filterFinished()
304  * updatePackages() (optional)
305  **/
306  void connectFilter( QWidget * filter,
307  QWidget * pkgList,
308  bool hasUpdateSignal = true );
309 
310  /**
311  * Connect the patch list. Caution: Possible bootstrap problem!
312  **/
313  void connectPatchList();
314 
315  /**
316  * Set the status of all installed packages (all in the pool, not only
317  * those currently displayed in the package list) to "update" and switch to
318  * the "Installation Summary" view afterwards.
319  *
320  * 'force' indicates if this should also be done if the the candidate
321  * package is not newer than the installed package.
322  **/
323  void globalUpdatePkg( bool force );
324 
325  /**
326  * Import one selectable: Set its status according to 'isWanted'
327  * based on its old status.
328  * 'kind' is 'package' or 'pattern' (used only for debug logging).
329  **/
330  void importSelectable( ZyppSel selectable,
331  bool isWanted,
332  const char * kind );
333 
334 
335 
336  /**
337  * Return HTML code describing a symbol (an icon).
338  **/
339  QString symHelp( const QString & imgFileName,
340  const QString & summary,
341  const QString & explanation );
342 
343 
344  /**
345  * Return HTML code describing a key.
346  **/
347  QString keyHelp( const QString & key,
348  const QString & summary,
349  const QString & explanation );
350 
351  /**
352  * Basic HTML formatting: Embed text into <p> ... </p>
353  **/
354  static QString para( const QString & text );
355 
356  /**
357  * Basic HTML formatting: Embed text into <li> ... </li>
358  **/
359  static QString listItem( const QString & text );
360 
361 
362  // Data members
363 
364  QAction * _autoDependenciesAction;
365  QPushButton * _checkDependenciesButton;
366  QTabWidget * _detailsViews;
367  YQPkgFilterTab * _filters;
368  YQPkgChangeLogView * _pkgChangeLogView;
369  YQPkgDependenciesView * _pkgDependenciesView;
370  YQPkgDescriptionView * _pkgDescriptionView;
371  YQPkgFileListView * _pkgFileListView;
372  QLabel * _repoUpgradeLabel;
373  QLabel * _repoUpgradingLabel;
374  QWidget * _notificationsContainer;
375  YQPkgRepoFilterView * _repoFilterView;
376  YQPkgLangList * _langList;
377  YQPkgList * _pkgList;
378  YQPkgPatternList * _patternList;
379  YQPkgPackageKitGroupsFilterView * _packageKitGroupsFilterView;
380  YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
381  YQPkgSearchFilterView * _searchFilterView;
382  YQPkgStatusFilterView * _statusFilterView;
383  YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
384  YQPkgUpdateProblemFilterView * _updateProblemFilterView;
385  YQPkgVersionsView * _pkgVersionsView;
386  YQPkgPatchFilterView * _patchFilterView;
387  YQPkgPatchList * _patchList;
388 
389  QMenuBar * _menuBar;
390  QMenu * _fileMenu;
391  QMenu * _pkgMenu;
392  QMenu * _patchMenu;
393  QMenu * _configMenu;
394  QMenu * _dependencyMenu;
395  QMenu * _optionsMenu;
396  QMenu * _extrasMenu;
397  QMenu * _helpMenu;
398 
399  QAction *_showDevelAction;
400  QAction *_showDebugAction;
401  QAction *_verifySystemModeAction;
402  QAction *_ignoreAlreadyRecommendAction;
403  QAction *_cleanDepsOnRemoveAction;
404  QAction *_allowVendorChangeAction;
405 
406  YQPkgObjList::ExcludeRule * _excludeDevelPkgs;
407  YQPkgObjList::ExcludeRule * _excludeDebugInfoPkgs;
408 
409  QColor _normalButtonBackground;
410 };
411 
412 
413 
414 #endif // YQPackageSelector_h
Display the description of a ZyppObj derived object along with its name and summary.
Display a list of zypp::Patch objects.
Display a list of zypp::Selection objects.
Definition: YQPkgSelList.h:53
RPM group tags filter view: Display the RPM group tags tree and emit signals if any group tag is sele...
void connectFilter(QWidget *filter, QWidget *pkgList, bool hasUpdateSignal=true)
Filter view for packages that made problems during update.
void importSelectable(ZyppSel selectable, bool isWanted, const char *kind)
QString keyHelp(const QString &key, const QString &summary, const QString &explanation)
QString symHelp(const QString &imgFileName, const QString &summary, const QString &explanation)
Display a list of zypp::Patch objects and ( below ) details about the currently selected patch...
void slotRepoUpgradeLabelLinkClicked(const QString &link)
Display a pkg&#39;s file list.
static std::string iconPath(const std::string &name, int size)
Display a list of zypp::Package objects.
Definition: YQPkgList.h:54
Display a list of zypp::Pattern objects.
Filter view for searching within packages.
Display technical details (very much like &#39;rpm -qi&#39;) for a ZYPP object - the installed instance...
static QString listItem(const QString &text)
Filter view for packages that made problems during update.
Package version selector: Display a list of available versions from all the different installation so...
static QString para(const QString &text)
Display a list of zypp::Selection objects.
Definition: YQPkgLangList.h:52
void installSubPkgs(const QString &suffix)
Display technical details ( very much like &#39;rpm -qi&#39; ) for a zypp::Package object - the installed ins...
void pkgExcludeDebugChanged(bool on)
Display a pkg&#39;s file list.