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
25 #include <q3popupmenu.h>
28 class YQPkgConflictList;
36 * @short Dialog that takes care of dependency checking and resolving
39 class YQPkgConflictDialog: public QDialog
46 * Constructor. Does not pop up a dialog yet.
47 * Use solveAndShowConflicts().
49 YQPkgConflictDialog( QWidget * parent );
54 virtual ~YQPkgConflictDialog();
57 * Reimplemented from QWidget:
58 * Reserve a reasonable amount of space.
60 virtual QSize sizeHint() const;
63 * Returns the average time in seconds used for solving or 0 if solving
64 * hasn't taken place yet.
66 double averageSolveTime() const;
69 * Returns the total amount of time in seconds used for solving.
71 double totalSolveTime() const { return _totalSolveTime; }
74 * Returns the times solving has taken place (with this dialog).
76 int solveCount() const { return _solveCount; }
79 * Reset all previously ignored dependency problems.
81 static void resetIgnoredDependencyProblems();
87 * Run the package dependency solver for the current package set and open
88 * the conflict dialog if there are any conflicts.
89 * Returns only when the conflict dialog is closed.
91 * Returns QDialog::Accepted or QDialog::Rejected.
93 int solveAndShowConflicts();
96 * Run the package dependency solver for the currently installed system
97 * plus the packages that are marked for installation (or update or...) and
98 * open the conflict dialog if there are any conflicts.
99 * Returns only when the conflict dialog is closed.
101 * Returns QDialog::Accepted or QDialog::Rejected.
106 * Mini-wizard to generate solver test case:
108 * - Inform user what this is all about
109 * - Tell user where the files will go
110 * - Generate test case
111 * - Ask user if he would like to pack it all into y2logs.tgz
112 * - Prompt user for path for y2logs.tgz
115 void askCreateSolverTestCase();
121 * Update package states - they may have changed.
123 void updatePackages();
129 * Initialize solving: Post "busy" popup etc.
131 void prepareSolving();
134 * Process the result of solving: Post conflict dialog, if neccessary.
135 * 'success' is the return value of the preceding solver call.
136 * Returns either QDialog::Accepted or QDialog::Rejected.
138 int processSolverResult( bool success );
141 * Event handler for keyboard input.
142 * Only very special keys are processed here.
144 * Inherited from QWidget.
146 void keyPressEvent( QKeyEvent * e );
154 YQPkgConflictList * _conflictList;
155 Q3PopupMenu * _expertMenu;
158 double _totalSolveTime;
164 #endif // ifndef YQPkgConflictDialog_h