1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPkgConflictDialog.h
15 Author: Stefan Hundhammer <sh@suse.de>
20 #ifndef YQPkgConflictDialog_h
21 #define YQPkgConflictDialog_h
27 class YQPkgConflictList;
35 * @short Dialog that takes care of dependency checking and resolving
38 class YQPkgConflictDialog: public QDialog
45 * Constructor. Does not pop up a dialog yet.
46 * Use solveAndShowConflicts().
48 YQPkgConflictDialog( QWidget * parent );
53 virtual ~YQPkgConflictDialog();
56 * Reimplemented from QWidget:
57 * Reserve a reasonable amount of space.
59 virtual QSize sizeHint() const;
62 * Returns the average time in seconds used for solving or 0 if solving
63 * hasn't taken place yet.
65 double averageSolveTime() const;
68 * Returns the total amount of time in seconds used for solving.
70 double totalSolveTime() const { return _totalSolveTime; }
73 * Returns the times solving has taken place (with this dialog).
75 int solveCount() const { return _solveCount; }
78 * Reset all previously ignored dependency problems.
80 static void resetIgnoredDependencyProblems();
86 * Run the package dependency solver for the current package set and open
87 * the conflict dialog if there are any conflicts.
88 * Returns only when the conflict dialog is closed.
90 * Returns QDialog::Accepted or QDialog::Rejected.
92 int solveAndShowConflicts();
95 * Run the package dependency solver for the currently installed system
96 * plus the packages that are marked for installation (or update or...) and
97 * open the conflict dialog if there are any conflicts.
98 * Returns only when the conflict dialog is closed.
100 * Returns QDialog::Accepted or QDialog::Rejected.
105 * Mini-wizard to generate solver test case:
107 * - Inform user what this is all about
108 * - Tell user where the files will go
109 * - Generate test case
110 * - Ask user if he would like to pack it all into y2logs.tgz
111 * - Prompt user for path for y2logs.tgz
114 void askCreateSolverTestCase();
120 * Update package states - they may have changed.
122 void updatePackages();
128 * Initialize solving: Post "busy" popup etc.
130 void prepareSolving();
133 * Process the result of solving: Post conflict dialog, if neccessary.
134 * 'success' is the return value of the preceding solver call.
135 * Returns either QDialog::Accepted or QDialog::Rejected.
137 int processSolverResult( bool success );
140 * Event handler for keyboard input.
141 * Only very special keys are processed here.
143 * Inherited from QWidget.
145 void keyPressEvent( QKeyEvent * e );
153 YQPkgConflictList * _conflictList;
157 double _totalSolveTime;
163 #endif // ifndef YQPkgConflictDialog_h