libyui-qt-pkg  2.45.6
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 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 public:
281  /**
282  * returns the full path for an icon of a given size
283  */
284  static std::string iconPath( const std::string &name, int size );
285 
286 protected:
287 
288  // Layout methods - create and layout widgets
289 
290  void basicLayout();
291 
292  QWidget * layoutRightPane ( QWidget *parent );
293  void layoutFilters ( QWidget *parent );
294  void layoutPkgList ( QWidget *parent );
295  void layoutDetailsViews ( QWidget *parent );
296  void layoutButtons ( QWidget *parent );
297  void layoutMenuBar ( QWidget *parent );
298 
299  /**
300  * Establish Qt signal / slot connections.
301  *
302  * This really needs to be a separate method to make sure all affected
303  * wigets are created at this point.
304  **/
305  void makeConnections();
306 
307  /**
308  * Add pulldown menus to the menu bar.
309  *
310  * This really needs to be a separate method to make sure all affected
311  * wigets are created at this point.
312  **/
313  void addMenus();
314 
315  /**
316  * Connect a filter view that provides the usual signals with a package
317  * list. By convention, filter views provide the following signals:
318  * filterStart()
319  * filterMatch()
320  * filterFinished()
321  * updatePackages() (optional)
322  **/
323  void connectFilter( QWidget * filter,
324  QWidget * pkgList,
325  bool hasUpdateSignal = true );
326 
327  /**
328  * Connect the patch list. Caution: Possible bootstrap problem!
329  **/
330  void connectPatchList();
331 
332  /**
333  * Set the status of all installed packages (all in the pool, not only
334  * those currently displayed in the package list) to "update" and switch to
335  * the "Installation Summary" view afterwards.
336  *
337  * 'force' indicates if this should also be done if the the candidate
338  * package is not newer than the installed package.
339  **/
340  void globalUpdatePkg( bool force );
341 
342  /**
343  * Import one selectable: Set its status according to 'isWanted'
344  * based on its old status.
345  * 'kind' is 'package' or 'pattern' (used only for debug logging).
346  **/
347  void importSelectable( ZyppSel selectable,
348  bool isWanted,
349  const char * kind );
350 
351 
352 
353  /**
354  * Return HTML code describing a symbol (an icon).
355  **/
356  QString symHelp( const QString & imgFileName,
357  const QString & summary,
358  const QString & explanation );
359 
360 
361  /**
362  * Return HTML code describing a key.
363  **/
364  QString keyHelp( const QString & key,
365  const QString & summary,
366  const QString & explanation );
367 
368  /**
369  * Basic HTML formatting: Embed text into <p> ... </p>
370  **/
371  static QString para( const QString & text );
372 
373  /**
374  * Basic HTML formatting: Embed text into <li> ... </li>
375  **/
376  static QString listItem( const QString & text );
377 
378 
379  // Data members
380 
381  QAction * _autoDependenciesAction;
382  QPushButton * _checkDependenciesButton;
383  QTabWidget * _detailsViews;
384  YQPkgFilterTab * _filters;
385  YQPkgChangeLogView * _pkgChangeLogView;
386  YQPkgDependenciesView * _pkgDependenciesView;
387  YQPkgDescriptionView * _pkgDescriptionView;
388  YQPkgFileListView * _pkgFileListView;
389  QLabel * _repoUpgradeLabel;
390  QLabel * _repoUpgradingLabel;
391  QWidget * _notificationsContainer;
392  YQPkgRepoFilterView * _repoFilterView;
393  YQPkgLangList * _langList;
394  YQPkgList * _pkgList;
395  YQPkgPatternList * _patternList;
396  YQPkgPackageKitGroupsFilterView * _packageKitGroupsFilterView;
397  YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
398  YQPkgSearchFilterView * _searchFilterView;
399  YQPkgStatusFilterView * _statusFilterView;
400  YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
401  YQPkgUpdateProblemFilterView * _updateProblemFilterView;
402  YQPkgVersionsView * _pkgVersionsView;
403  YQPkgPatchFilterView * _patchFilterView;
404  YQPkgPatchList * _patchList;
405 
406  QMenuBar * _menuBar;
407  QMenu * _fileMenu;
408  QMenu * _pkgMenu;
409  QMenu * _patchMenu;
410  QMenu * _configMenu;
411  QMenu * _dependencyMenu;
412  QMenu * _optionsMenu;
413  QMenu * _extrasMenu;
414  QMenu * _helpMenu;
415 
416  QAction *_showDevelAction;
417  QAction *_showDebugAction;
418  QAction *_verifySystemModeAction;
419  QAction *_installRecommendedAction;
420  QAction *_cleanDepsOnRemoveAction;
421  QAction *_allowVendorChangeAction;
422 
423  YQPkgObjList::ExcludeRule * _excludeDevelPkgs;
424  YQPkgObjList::ExcludeRule * _excludeDebugInfoPkgs;
425 
426  QColor _normalButtonBackground;
427 };
428 
429 
430 
431 #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.
Filter view for PackageKit groups.
void showProducts()
Show all products in a popup dialog.
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
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.