1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPackageSelector.h
15 Author: Stefan Hundhammer <sh@suse.de>
20 #ifndef YQPackageSelector_h
21 #define YQPackageSelector_h
27 #include "YQPackageSelectorBase.h"
28 #include "YQPkgObjList.h"
41 class QY2ComboTabWidget;
43 class YQPkgChangeLogView;
44 class YQPkgDependenciesView;
45 class YQPkgDescriptionView;
46 class YQPkgDiskUsageList;
47 class YQPkgFileListView;
48 class YQPkgRepoFilterView;
51 class YQPkgPatternList;
52 class YQPkgRpmGroupTagsFilterView;
53 class YQPkgSearchFilterView;
55 class YQPkgStatusFilterView;
56 class YQPkgTechnicalDetailsView;
57 class YQPkgUpdateProblemFilterView;
58 class YQPkgVersionsView;
59 class YQPkgPatchFilterView;
62 class YQPackageSelector : public YQPackageSelectorBase
68 YQPackageSelector( YWidget * parent, long modeFlags = 0 );
74 * Resolve package dependencies manually.
76 * Returns QDialog::Accepted or QDialog::Rejected.
78 int manualResolvePackageDependencies();
81 * Automatically resolve package dependencies if desired
82 * (if the "auto check" checkbox is on).
84 void autoResolveDependencies();
87 * Export all current selection/package states
92 * Import selection/package states
97 * Install any -devel package for packages that are installed or marked for
100 void installDevelPkgs();
103 * Install any -debuginfo package for packages that are installed or marked
106 void installDebugInfoPkgs();
109 * Install any subpackage that ends with 'suffix' for packages that are
110 * installed or marked for installation
112 void installSubPkgs( const QString suffix );
115 * Enable or disable the package exclude rules (show or suppress -debuginfo
116 * or -devel packages) according to the current menu settings and apply the
119 void pkgExcludeRulesChanged();
122 * Display (generic) online help.
127 * Display online help about symbols (package status icons).
132 * Display online help about magic keys.
140 * Emitted once (!) when the dialog is about to be shown, when all widgets
141 * are created and all signal/slot connections are set up - when it makes
142 * sense to load data.
147 * Emitted when the internal data base might have changed and a refresh of
148 * all displayed data might be necessary - e.g., when saved (exported) pkg
149 * states are reimported.
157 * Animate the "Check" button when dependency resolving is in progress,
158 * i.e. change its background color
160 void animateCheckButton();
163 * Restore the normal background color of the "Check" button.
165 void restoreCheckButton();
168 * Add the "Patches" filter view, if it is not already there.
170 void addPatchFilterView();
173 * Add the "Patches" filter view upon hotkey (F2).
175 void hotkeyInsertPatchFilterView();
178 * Set the status of all installed packages (all in the pool, not only
179 * those currently displayed in the package list) to "update", if there is
180 * a candidate package that is newer than the installed package.
182 void globalUpdatePkg() { globalUpdatePkg( false ); }
185 * Set the status of all installed packages (all in the pool, not only
186 * those currently displayed in the package list) to "update", even if the
187 * candidate package is not newer than the installed package.
189 void globalUpdatePkgForce() { globalUpdatePkg( true ); }
192 * Show all products in a popup dialog.
200 // Layout methods - create and layout widgets
204 QWidget * layoutLeftPane ( QWidget *parent );
205 QWidget * layoutRightPane ( QWidget *parent );
206 void layoutFilters ( QWidget *parent );
207 void layoutPkgList ( QWidget *parent );
208 void layoutDetailsViews ( QWidget *parent );
209 void layoutButtons ( QWidget *parent );
210 void layoutMenuBar ( QWidget *parent );
213 * Establish Qt signal / slot connections.
215 * This really needs to be a separate method to make sure all affected
216 * wigets are created at this point.
218 void makeConnections();
221 * Add pulldown menus to the menu bar.
223 * This really needs to be a separate method to make sure all affected
224 * wigets are created at this point.
229 * Connect a filter view that provides the usual signals with a package
230 * list. By convention, filter views provide the following signals:
234 * updatePackages() (optional)
236 void connectFilter( QWidget * filter,
238 bool hasUpdateSignal = true );
241 * Connect the patch list. Caution: Possible bootstrap problem!
243 void connectPatchList();
246 * Set the status of all installed packages (all in the pool, not only
247 * those currently displayed in the package list) to "update" and switch to
248 * the "Installation Summary" view afterwards.
250 * 'force' indicates if this should also be done if the the candidate
251 * package is not newer than the installed package.
253 void globalUpdatePkg( bool force );
256 * Import one selectable: Set its status according to 'isWanted'
257 * based on its old status.
258 * 'kind' is 'package' or 'pattern' (used only for debug logging).
260 void importSelectable( ZyppSel selectable,
267 * Return HTML code describing a symbol (an icon).
269 QString symHelp( const QString & imgFileName,
270 const QString & summary,
271 const QString & explanation );
275 * Return HTML code describing a key.
277 QString keyHelp( const QString & key,
278 const QString & summary,
279 const QString & explanation );
282 * Basic HTML formatting: Embed text into <p> ... </p>
284 static QString para( const QString & text );
287 * Basic HTML formatting: Embed text into <li> ... </li>
289 static QString listItem( const QString & text );
294 QCheckBox * _autoDependenciesCheckBox;
295 QPushButton * _checkDependenciesButton;
296 QTabWidget * _detailsViews;
297 QY2ComboTabWidget * _filters;
298 YQPkgChangeLogView * _pkgChangeLogView;
299 YQPkgDependenciesView * _pkgDependenciesView;
300 YQPkgDescriptionView * _pkgDescriptionView;
301 YQPkgFileListView * _pkgFileListView;
302 YQPkgRepoFilterView * _repoFilterView;
303 YQPkgLangList * _langList;
304 YQPkgList * _pkgList;
305 YQPkgPatternList * _patternList;
306 YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
307 YQPkgSearchFilterView * _searchFilterView;
308 YQPkgSelList * _selList;
309 YQPkgStatusFilterView * _statusFilterView;
310 YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
311 YQPkgUpdateProblemFilterView * _updateProblemFilterView;
312 YQPkgVersionsView * _pkgVersionsView;
313 YQPkgPatchFilterView * _patchFilterView;
314 YQPkgPatchList * _patchList;
324 QAction *_showDevelAction;
325 QAction *_showDebugAction;
327 YQPkgObjList::ExcludeRule * _excludeDevelPkgs;
328 YQPkgObjList::ExcludeRule * _excludeDebugInfoPkgs;
330 QColor _normalButtonBackground;
335 #endif // YQPackageSelector_h