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
26 #include <ycp/YCPString.h>
28 #include "YQPackageSelectorBase.h"
29 #include "YQPkgObjList.h"
42 class QY2ComboTabWidget;
44 class YQPkgChangeLogView;
45 class YQPkgDependenciesView;
46 class YQPkgDescriptionView;
47 class YQPkgDiskUsageList;
48 class YQPkgFileListView;
49 class YQPkgRepoFilterView;
52 class YQPkgPatternList;
53 class YQPkgRpmGroupTagsFilterView;
54 class YQPkgSearchFilterView;
56 class YQPkgStatusFilterView;
57 class YQPkgTechnicalDetailsView;
58 class YQPkgUpdateProblemFilterView;
59 class YQPkgVersionsView;
60 class YQPkgPatchFilterView;
63 class YQPackageSelector : public YQPackageSelectorBase
69 YQPackageSelector( YWidget * parent, long modeFlags = 0 );
75 * Resolve package dependencies manually.
77 * Returns QDialog::Accepted or QDialog::Rejected.
79 int manualResolvePackageDependencies();
82 * Automatically resolve package dependencies if desired
83 * (if the "auto check" checkbox is on).
85 void autoResolveDependencies();
88 * Export all current selection/package states
93 * Import selection/package states
98 * Install any -devel package for packages that are installed or marked for
101 void installDevelPkgs();
104 * Install any -debuginfo package for packages that are installed or marked
107 void installDebugInfoPkgs();
110 * Install any subpackage that ends with 'suffix' for packages that are
111 * installed or marked for installation
113 void installSubPkgs( const QString suffix );
116 * Enable or disable the package exclude rules (show or suppress -debuginfo
117 * or -devel packages) according to the current menu settings and apply the
120 void pkgExcludeRulesChanged( int menuItemID );
123 * Display (generic) online help.
128 * Display online help about symbols (package status icons).
133 * Display online help about magic keys.
141 * Emitted once (!) when the dialog is about to be shown, when all widgets
142 * are created and all signal/slot connections are set up - when it makes
143 * sense to load data.
148 * Emitted when the internal data base might have changed and a refresh of
149 * all displayed data might be necessary - e.g., when saved (exported) pkg
150 * states are reimported.
158 * Animate the "Check" button when dependency resolving is in progress,
159 * i.e. change its background color
161 void animateCheckButton();
164 * Restore the normal background color of the "Check" button.
166 void restoreCheckButton();
169 * Add the "Patches" filter view, if it is not already there.
171 void addPatchFilterView();
174 * Add the "Patches" filter view upon hotkey (F2).
176 void hotkeyInsertPatchFilterView();
179 * Set the status of all installed packages (all in the pool, not only
180 * those currently displayed in the package list) to "update", if there is
181 * a candidate package that is newer than the installed package.
183 void globalUpdatePkg() { globalUpdatePkg( false ); }
186 * Set the status of all installed packages (all in the pool, not only
187 * those currently displayed in the package list) to "update", even if the
188 * candidate package is not newer than the installed package.
190 void globalUpdatePkgForce() { globalUpdatePkg( true ); }
193 * Show all products in a popup dialog.
201 // Layout methods - create and layout widgets
205 QWidget * layoutLeftPane ( QWidget *parent );
206 QWidget * layoutRightPane ( QWidget *parent );
207 void layoutFilters ( QWidget *parent );
208 void layoutPkgList ( QWidget *parent );
209 void layoutDetailsViews ( QWidget *parent );
210 void layoutButtons ( QWidget *parent );
211 void layoutMenuBar ( QWidget *parent );
214 * Establish Qt signal / slot connections.
216 * This really needs to be a separate method to make sure all affected
217 * wigets are created at this point.
219 void makeConnections();
222 * Add pulldown menus to the menu bar.
224 * This really needs to be a separate method to make sure all affected
225 * wigets are created at this point.
230 * Connect a filter view that provides the usual signals with a package
231 * list. By convention, filter views provide the following signals:
235 * updatePackages() (optional)
237 void connectFilter( QWidget * filter,
239 bool hasUpdateSignal = true );
242 * Connect the patch list. Caution: Possible bootstrap problem!
244 void connectPatchList();
247 * Set the status of all installed packages (all in the pool, not only
248 * those currently displayed in the package list) to "update" and switch to
249 * the "Installation Summary" view afterwards.
251 * 'force' indicates if this should also be done if the the candidate
252 * package is not newer than the installed package.
254 void globalUpdatePkg( bool force );
257 * Import one selectable: Set its status according to 'isWanted'
258 * based on its old status.
259 * 'kind' is 'package' or 'pattern' (used only for debug logging).
261 void importSelectable( ZyppSel selectable,
268 * Return HTML code describing a symbol (an icon).
270 QString symHelp( const QString & imgFileName,
271 const QString & summary,
272 const QString & explanation );
276 * Return HTML code describing a key.
278 QString keyHelp( const QString & key,
279 const QString & summary,
280 const QString & explanation );
283 * Basic HTML formatting: Embed text into <p> ... </p>
285 static QString para( const QString & text );
288 * Basic HTML formatting: Embed text into <li> ... </li>
290 static QString listItem( const QString & text );
295 QCheckBox * _autoDependenciesCheckBox;
296 QPushButton * _checkDependenciesButton;
297 QTabWidget * _detailsViews;
298 QY2ComboTabWidget * _filters;
299 YQPkgChangeLogView * _pkgChangeLogView;
300 YQPkgDependenciesView * _pkgDependenciesView;
301 YQPkgDescriptionView * _pkgDescriptionView;
302 YQPkgFileListView * _pkgFileListView;
303 YQPkgRepoFilterView * _repoFilterView;
304 YQPkgLangList * _langList;
305 YQPkgList * _pkgList;
306 YQPkgPatternList * _patternList;
307 YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
308 YQPkgSearchFilterView * _searchFilterView;
309 YQPkgSelList * _selList;
310 YQPkgStatusFilterView * _statusFilterView;
311 YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
312 YQPkgUpdateProblemFilterView * _updateProblemFilterView;
313 YQPkgVersionsView * _pkgVersionsView;
314 YQPkgPatchFilterView * _patchFilterView;
315 YQPkgPatchList * _patchList;
325 int _viewShowDevelID;
326 int _viewShowDebugInfoID;
328 YQPkgObjList::ExcludeRule * _excludeDevelPkgs;
329 YQPkgObjList::ExcludeRule * _excludeDebugInfoPkgs;
331 QColor _normalButtonBackground;
336 #endif // YQPackageSelector_h