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