libyui-qt-pkg  2.45.27
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;
78 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 recommended packages for packages that are installed
140  **/
141  void installRecommendedPkgs();
142 
143  /**
144  * Install any subpackage that ends with 'suffix' for packages that are
145  * installed or marked for installation
146  **/
147  void installSubPkgs( const QString & suffix );
148 
149  /**
150  * Enable or disable the package exclude rules (show or suppress -debuginfo
151  * or -devel packages) according to the current menu settings and apply the
152  * exclude rules.
153  **/
154  void pkgExcludeDebugChanged( bool on );
155  void pkgExcludeDevelChanged( bool on );
156 
157 
158  /*
159  * Enable or disable verify system mode of the solver
160  */
161  void pkgVerifySytemModeChanged( bool on );
162 
163  /*
164  * Install recommended packages
165  */
166  void pkgInstallRecommendedChanged( bool on );
167 
168  /*
169  * Enable or disable CleandepsOnRemove of the solver (=Cleanup when deleting packages)
170  */
171  void pkgCleanDepsOnRemoveChanged( bool on );
172 
173  /*
174  * Enable or disable vendor change allowed of the solver
175  */
176  void pkgAllowVendorChangeChanged( bool on );
177 
178 
179 
180  /**
181  * Display (generic) online help.
182  **/
183  void help();
184 
185  /**
186  * Display online help about symbols (package status icons).
187  **/
188  void symbolHelp();
189 
190  /**
191  * Display online help about magic keys.
192  **/
193  void keyboardHelp();
194 
195  /**
196  * hides or shows the repository upgrade message
197  */
199 
200  /**
201  * loads settings for the checkboxes in the option menu
202  */
203  void loadSettings();
204 
205  /**
206  * saves settings of the checkboxes in the option menu
207  */
208  void saveSettings();
209 
210 private:
211 
212  /**
213  * loads settings that are shared with other frontends
214  */
215  void loadCommonSettings();
216 
217  /**
218  * saves settings that are shared with other frontends
219  */
220  void saveCommonSettings();
221 
222 signals:
223 
224  /**
225  * Emitted once (!) when the dialog is about to be shown, when all widgets
226  * are created and all signal/slot connections are set up - when it makes
227  * sense to load data.
228  **/
229  void loadData();
230 
231  /**
232  * Emitted when the internal data base might have changed and a refresh of
233  * all displayed data might be necessary - e.g., when saved (exported) pkg
234  * states are reimported.
235  **/
236  void refresh();
237 
238 
239 protected slots:
240 
241  /**
242  * Add the "Patches" filter view, if it is not already there.
243  **/
244  void addPatchFilterView();
245 
246  /**
247  * Add the "Patches" filter view upon hotkey (F2).
248  **/
250 
251  /**
252  * Set the status of all installed packages (all in the pool, not only
253  * those currently displayed in the package list) to "update", if there is
254  * a candidate package that is newer than the installed package.
255  **/
256  void globalUpdatePkg() { globalUpdatePkg( false ); }
257 
258  /**
259  * Set the status of all installed packages (all in the pool, not only
260  * those currently displayed in the package list) to "update", even if the
261  * candidate package is not newer than the installed package.
262  **/
264 
265  /**
266  * Show all products in a popup dialog.
267  **/
268  void showProducts();
269 
270  /**
271  * Show dialog for pkgmgr history
272  */
273  void showHistory();
274 
275  /**
276  * a link in the repo upgrade label was clicked
277  */
278  void slotRepoUpgradeLabelLinkClicked(const QString &link);
279 
280  /**
281  * Show the busy cursor (clock)
282  */
283  void busyCursor();
284 
285  /**
286  * Show the standard cursor (arrow)
287  */
288  void normalCursor();
289 
290 protected:
291 
292  // Layout methods - create and layout widgets
293 
294  void basicLayout();
295 
296  QWidget * layoutRightPane ( QWidget *parent );
297  void layoutFilters ( QWidget *parent );
298  void layoutPkgList ( QWidget *parent );
299  void layoutDetailsViews ( QWidget *parent );
300  void layoutButtons ( QWidget *parent );
301  void layoutMenuBar ( QWidget *parent );
302 
303  /**
304  * Establish Qt signal / slot connections.
305  *
306  * This really needs to be a separate method to make sure all affected
307  * wigets are created at this point.
308  **/
309  void makeConnections();
310 
311  /**
312  * Add pulldown menus to the menu bar.
313  *
314  * This really needs to be a separate method to make sure all affected
315  * wigets are created at this point.
316  **/
317  void addMenus();
318 
319  /**
320  * Connect a filter view that provides the usual signals with a package
321  * list. By convention, filter views provide the following signals:
322  * filterStart()
323  * filterMatch()
324  * filterFinished()
325  * updatePackages() (optional)
326  **/
327  void connectFilter( QWidget * filter,
328  QWidget * pkgList,
329  bool hasUpdateSignal = true );
330 
331  /**
332  * Connect the patch list. Caution: Possible bootstrap problem!
333  **/
334  void connectPatchList();
335 
336  /**
337  * Set the status of all installed packages (all in the pool, not only
338  * those currently displayed in the package list) to "update" and switch to
339  * the "Installation Summary" view afterwards.
340  *
341  * 'force' indicates if this should also be done if the the candidate
342  * package is not newer than the installed package.
343  **/
344  void globalUpdatePkg( bool force );
345 
346  /**
347  * Import one selectable: Set its status according to 'isWanted'
348  * based on its old status.
349  * 'kind' is 'package' or 'pattern' (used only for debug logging).
350  **/
351  void importSelectable( ZyppSel selectable,
352  bool isWanted,
353  const char * kind );
354 
355 
356 
357  /**
358  * Return HTML code describing a symbol (an icon).
359  **/
360  QString symHelp( const QString & imgFileName,
361  const QString & summary,
362  const QString & explanation );
363 
364 
365  /**
366  * Return HTML code describing a key.
367  **/
368  QString keyHelp( const QString & key,
369  const QString & summary,
370  const QString & explanation );
371 
372  /**
373  * Basic HTML formatting: Embed text into <p> ... </p>
374  **/
375  static QString para( const QString & text );
376 
377  /**
378  * Basic HTML formatting: Embed text into <li> ... </li>
379  **/
380  static QString listItem( const QString & text );
381 
382 
383  // Data members
384 
385  QAction * _autoDependenciesAction;
386  QPushButton * _checkDependenciesButton;
387  QTabWidget * _detailsViews;
388  YQPkgFilterTab * _filters;
389  YQPkgChangeLogView * _pkgChangeLogView;
390  YQPkgDependenciesView * _pkgDependenciesView;
391  YQPkgDescriptionView * _pkgDescriptionView;
392  YQPkgFileListView * _pkgFileListView;
393  QLabel * _repoUpgradeLabel;
394  QLabel * _repoUpgradingLabel;
395  QWidget * _notificationsContainer;
396  YQPkgRepoFilterView * _repoFilterView;
397  YQPkgServiceFilterView * _serviceFilterView;
398  YQPkgLangList * _langList;
399  YQPkgList * _pkgList;
400  YQPkgPatternList * _patternList;
401  YQPkgPackageKitGroupsFilterView * _packageKitGroupsFilterView;
402  YQPkgSearchFilterView * _searchFilterView;
403  YQPkgStatusFilterView * _statusFilterView;
404  YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
405  YQPkgUpdateProblemFilterView * _updateProblemFilterView;
406  YQPkgVersionsView * _pkgVersionsView;
407  YQPkgPatchFilterView * _patchFilterView;
408  YQPkgPatchList * _patchList;
409 
410  QMenuBar * _menuBar;
411  QMenu * _fileMenu;
412  QMenu * _pkgMenu;
413  QMenu * _patchMenu;
414  QMenu * _configMenu;
415  QMenu * _dependencyMenu;
416  QMenu * _optionsMenu;
417  QMenu * _extrasMenu;
418  QMenu * _helpMenu;
419 
420  QAction *_showDevelAction;
421  QAction *_showDebugAction;
422  QAction *_verifySystemModeAction;
423  QAction *_installRecommendedAction;
424  QAction *_cleanDepsOnRemoveAction;
425  QAction *_allowVendorChangeAction;
426 
427  YQPkgObjList::ExcludeRule * _excludeDevelPkgs;
428  YQPkgObjList::ExcludeRule * _excludeDebugInfoPkgs;
429 
430  QColor _normalButtonBackground;
431 };
432 
433 
434 
435 #endif // YQPackageSelector_h
Display the description of a ZyppObj derived object along with its name and summary.
void addPatchFilterView()
Add the "Patches" filter view, if it is not already there.
Display a list of zypp::Patch objects.
void loadData()
Emitted once (!) when the dialog is about to be shown, when all widgets are created and all signal/sl...
Display a list of zypp::Selection objects.
Definition: YQPkgSelList.h:53
void globalUpdatePkg()
Set the status of all installed packages (all in the pool, not only those currently displayed in the ...
void connectFilter(QWidget *filter, QWidget *pkgList, bool hasUpdateSignal=true)
Connect a filter view that provides the usual signals with a package list.
void normalCursor()
Show the standard cursor (arrow)
Filter view for PackageKit groups.
void showProducts()
Show all products in a popup dialog.
void busyCursor()
Show the busy cursor (clock)
Filter view for packages that made problems during update.
Widget for "tabbed browsing" in packages:
void importSelectable(ZyppSel selectable, bool isWanted, const char *kind)
Import one selectable: Set its status according to 'isWanted' based on its old status.
void updateRepositoryUpgradeLabel()
hides or shows the repository upgrade message
QString keyHelp(const QString &key, const QString &summary, const QString &explanation)
Return HTML code describing a key.
QString symHelp(const QString &imgFileName, const QString &summary, const QString &explanation)
Return HTML code describing a symbol (an icon).
void saveSettings()
saves settings of the checkboxes in the option menu
int manualResolvePackageDependencies()
Resolve package dependencies manually.
void keyboardHelp()
Display online help about magic keys.
Display a list of zypp::Patch objects and ( below ) details about the currently selected patch.
void slotRepoUpgradeLabelLinkClicked(const QString &link)
a link in the repo upgrade label was clicked
Display a pkg's file list.
Display a list of zypp::Package objects.
Definition: YQPkgList.h:54
Display a list of zypp::Pattern objects.
Filter view for searching within packages.
void symbolHelp()
Display online help about symbols (package status icons).
void installDebugInfoPkgs()
Install available -debuginfo packages for packages that are installed or marked for installation.
void connectPatchList()
Connect the patch list.
Display technical details (very much like 'rpm -qi') for a ZYPP object - the installed instance,...
void pkgExport()
Export all current selection/package states.
static QString listItem(const QString &text)
Basic HTML formatting: Embed text into ...
Filter view for packages that made problems during update.
void help()
Display (generic) online help.
Package version selector: Display a list of available versions from all the different installation so...
void autoResolveDependencies()
Automatically resolve package dependencies if desired (if the "auto check" checkbox is on).
static QString para(const QString &text)
Basic HTML formatting: Embed text into.
void addMenus()
Add pulldown menus to the menu bar.
Display a list of zypp::Selection objects.
Definition: YQPkgLangList.h:52
void installDevelPkgs()
Install any -devel package for packages that are installed or marked for installation.
void loadSettings()
loads settings for the checkboxes in the option menu
A widget to display a libzypp servic filter view.
void refresh()
Emitted when the internal data base might have changed and a refresh of all displayed data might be n...
void installDebugSourcePkgs()
Install available -debugsource packages for packages that are installed or marked for installation.
Abstract base class for package selectors.
void hotkeyInsertPatchFilterView()
Add the "Patches" filter view upon hotkey (F2).
void installSubPkgs(const QString &suffix)
Install any subpackage that ends with 'suffix' for packages that are installed or marked for installa...
void installRecommendedPkgs()
Install recommended packages for packages that are installed.
void makeConnections()
Establish Qt signal / slot connections.
Display technical details ( very much like 'rpm -qi' ) for a zypp::Package object - the installed ins...
void showHistory()
Show dialog for pkgmgr history.
void pkgImport()
Import selection/package states.
void pkgExcludeDebugChanged(bool on)
Enable or disable the package exclude rules (show or suppress -debuginfo or -devel packages) accordin...
void globalUpdatePkgForce()
Set the status of all installed packages (all in the pool, not only those currently displayed in the ...
Display a pkg's file list.