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 <q3popupmenu.h>
28 #include <ycp/YCPString.h>
30 #include "YQPackageSelectorBase.h"
31 #include "YQPkgObjList.h"
44 class QY2ComboTabWidget;
46 class YQPkgChangeLogView;
47 class YQPkgDependenciesView;
48 class YQPkgDescriptionView;
49 class YQPkgDiskUsageList;
50 class YQPkgFileListView;
51 class YQPkgRepoFilterView;
54 class YQPkgPatternList;
55 class YQPkgRpmGroupTagsFilterView;
56 class YQPkgSearchFilterView;
58 class YQPkgStatusFilterView;
59 class YQPkgTechnicalDetailsView;
60 class YQPkgUpdateProblemFilterView;
61 class YQPkgVersionsView;
62 class YQPkgPatchFilterView;
65 class YQPackageSelector : public YQPackageSelectorBase
71 YQPackageSelector( YWidget * parent, long modeFlags = 0 );
77 * Resolve package dependencies manually.
79 * Returns QDialog::Accepted or QDialog::Rejected.
81 int manualResolvePackageDependencies();
84 * Automatically resolve package dependencies if desired
85 * (if the "auto check" checkbox is on).
87 void autoResolveDependencies();
90 * Export all current selection/package states
95 * Import selection/package states
100 * Install any -devel package for packages that are installed or marked for
103 void installDevelPkgs();
106 * Install any -debuginfo package for packages that are installed or marked
109 void installDebugInfoPkgs();
112 * Install any subpackage that ends with 'suffix' for packages that are
113 * installed or marked for installation
115 void installSubPkgs( const QString suffix );
118 * Enable or disable the package exclude rules (show or suppress -debuginfo
119 * or -devel packages) according to the current menu settings and apply the
122 void pkgExcludeRulesChanged( int menuItemID );
125 * Display (generic) online help.
130 * Display online help about symbols (package status icons).
135 * Display online help about magic keys.
143 * Emitted once (!) when the dialog is about to be shown, when all widgets
144 * are created and all signal/slot connections are set up - when it makes
145 * sense to load data.
150 * Emitted when the internal data base might have changed and a refresh of
151 * all displayed data might be necessary - e.g., when saved (exported) pkg
152 * states are reimported.
160 * Animate the "Check" button when dependency resolving is in progress,
161 * i.e. change its background color
163 void animateCheckButton();
166 * Restore the normal background color of the "Check" button.
168 void restoreCheckButton();
171 * Add the "Patches" filter view, if it is not already there.
173 void addPatchFilterView();
176 * Add the "Patches" filter view upon hotkey (F2).
178 void hotkeyInsertPatchFilterView();
181 * Set the status of all installed packages (all in the pool, not only
182 * those currently displayed in the package list) to "update", if there is
183 * a candidate package that is newer than the installed package.
185 void globalUpdatePkg() { globalUpdatePkg( false ); }
188 * Set the status of all installed packages (all in the pool, not only
189 * those currently displayed in the package list) to "update", even if the
190 * candidate package is not newer than the installed package.
192 void globalUpdatePkgForce() { globalUpdatePkg( true ); }
195 * Show all products in a popup dialog.
203 // Layout methods - create and layout widgets
207 QWidget * layoutLeftPane ( QWidget * parent );
208 QWidget * layoutRightPane ( QWidget * parent );
209 void layoutFilters ( QWidget * parent );
210 void layoutPkgList ( QWidget * parent );
211 void layoutDetailsViews ( QWidget * parent );
212 void layoutButtons ( QWidget * parent );
213 void layoutMenuBar ( QWidget * parent );
216 * Establish Qt signal / slot connections.
218 * This really needs to be a separate method to make sure all affected
219 * wigets are created at this point.
221 void makeConnections();
224 * Add pulldown menus to the menu bar.
226 * This really needs to be a separate method to make sure all affected
227 * wigets are created at this point.
232 * Connect a filter view that provides the usual signals with a package
233 * list. By convention, filter views provide the following signals:
237 * updatePackages() (optional)
239 void connectFilter( QWidget * filter,
241 bool hasUpdateSignal = true );
244 * Connect the patch list. Caution: Possible bootstrap problem!
246 void connectPatchList();
249 * Set the status of all installed packages (all in the pool, not only
250 * those currently displayed in the package list) to "update" and switch to
251 * the "Installation Summary" view afterwards.
253 * 'force' indicates if this should also be done if the the candidate
254 * package is not newer than the installed package.
256 void globalUpdatePkg( bool force );
259 * Import one selectable: Set its status according to 'isWanted'
260 * based on its old status.
261 * 'kind' is 'package' or 'pattern' (used only for debug logging).
263 void importSelectable( ZyppSel selectable,
270 * Return HTML code describing a symbol (an icon).
272 QString symHelp( const QString & imgFileName,
273 const QString & summary,
274 const QString & explanation );
278 * Return HTML code describing a key.
280 QString keyHelp( const QString & key,
281 const QString & summary,
282 const QString & explanation );
285 * Basic HTML formatting: Embed text into <p> ... </p>
287 static QString para( const QString & text );
290 * Basic HTML formatting: Embed text into <li> ... </li>
292 static QString listItem( const QString & text );
297 QCheckBox * _autoDependenciesCheckBox;
298 QPushButton * _checkDependenciesButton;
299 QTabWidget * _detailsViews;
300 QY2ComboTabWidget * _filters;
301 YQPkgChangeLogView * _pkgChangeLogView;
302 YQPkgDependenciesView * _pkgDependenciesView;
303 YQPkgDescriptionView * _pkgDescriptionView;
304 YQPkgFileListView * _pkgFileListView;
305 YQPkgRepoFilterView * _repoFilterView;
306 YQPkgLangList * _langList;
307 YQPkgList * _pkgList;
308 YQPkgPatternList * _patternList;
309 YQPkgRpmGroupTagsFilterView * _rpmGroupTagsFilterView;
310 YQPkgSearchFilterView * _searchFilterView;
311 YQPkgSelList * _selList;
312 YQPkgStatusFilterView * _statusFilterView;
313 YQPkgTechnicalDetailsView * _pkgTechnicalDetailsView;
314 YQPkgUpdateProblemFilterView * _updateProblemFilterView;
315 YQPkgVersionsView * _pkgVersionsView;
316 YQPkgPatchFilterView * _patchFilterView;
317 YQPkgPatchList * _patchList;
320 Q3PopupMenu * _fileMenu;
321 Q3PopupMenu * _viewMenu;
322 Q3PopupMenu * _pkgMenu;
323 Q3PopupMenu * _patchMenu;
324 Q3PopupMenu * _extrasMenu;
325 Q3PopupMenu * _helpMenu;
327 int _viewShowDevelID;
328 int _viewShowDebugInfoID;
330 YQPkgObjList::ExcludeRule * _excludeDevelPkgs;
331 YQPkgObjList::ExcludeRule * _excludeDebugInfoPkgs;
333 QColor _normalButtonBackground;
338 #endif // YQPackageSelector_h