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