]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/pkg/YQPkgStatusFilterView.h
don't create QObjects in ycp thread - make timeouts work
[duncan/yast2-qt4.git] / src / pkg / YQPkgStatusFilterView.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQPkgStatusFilterView.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQPkgStatusFilterView_h
21 #define YQPkgStatusFilterView_h
22
23 #include "YQZypp.h"
24 #include <QWidget>
25 #include <QRegExp>
26 #include <QPixmap>
27
28
29 class QComboBox;
30 class QCheckBox;
31 class QPushButton;
32
33
34 /**
35  * @short Filter view for packages that made problems during update
36  **/
37 class YQPkgStatusFilterView : public QWidget
38 {
39     Q_OBJECT
40
41 public:
42
43     /**
44      * Constructor
45      **/
46     YQPkgStatusFilterView( QWidget * parent );
47
48     /**
49      * Destructor
50      **/
51     virtual ~YQPkgStatusFilterView();
52
53     /**
54      * Returns the minimum size required for this widget.
55      * Inherited from QWidget.
56      **/
57     virtual QSize minimumSizeHint() const;
58
59     /**
60      * Check if pkg matches the filter criteria.
61      **/
62     bool check( ZyppSel selectable,
63                 ZyppObj         pkg );
64
65
66 public slots:
67
68     /**
69      * Filter according to the view's rules and current selection.
70      * Emits those signals:
71      *    filterStart()
72      *    filterMatch() for each pkg that matches the filter
73      *    filterFinished()
74      **/
75     void filter();
76
77     /**
78      * Same as filter(), but only if this widget is currently visible.
79      **/
80     void filterIfVisible();
81
82
83     /**
84      * Reset all check boxes (set them all to "off")
85      **/
86     void clear();
87     
88     /**
89      * Set up the check boxes so all pending transactions are displayed.
90      **/
91     void showTransactions();
92
93     /**
94      * Set up the check boxes so pending manual transactions (no "auto" states)
95      * are displayed.
96      **/
97     void showManualTransactions();
98     
99     /**
100      * Set up the check boxes so pending automatic transactions (the "auto" states)
101      * are displayed.
102      **/
103     void showAutoTransactions();
104
105     /**
106      * Set the check boxes for locked packages ("Taboo" and "Protected") to "on".
107      **/
108     void showLocks();
109
110     /**
111      * Set the check box for installed packages to "on".
112      **/
113     void showInstalled();
114
115     /**
116      * Set the check box for not installed packages to "on".
117      **/
118     void showNotInstalled();
119
120     
121 signals:
122
123     /**
124      * Emitted when the filtering starts. Use this to clear package lists
125      * etc. prior to adding new entries.
126      **/
127     void filterStart();
128
129     /**
130      * Emitted during filtering for each pkg that matches the filter.
131      **/
132     void filterMatch( ZyppSel   selectable,
133                       ZyppPkg   pkg );
134
135     /**
136      * Emitted when filtering is finished.
137      **/
138     void filterFinished();
139
140
141 protected:
142
143     /**
144      * Add a check box
145      **/
146     QCheckBox * addStatusCheckBox( QWidget *            parent,
147                                    const QString &      label,
148                                    const QPixmap &      icon,
149                                    bool                 initiallyChecked );
150
151     // Data members
152
153     QCheckBox *         _showAutoDel;
154     QCheckBox *         _showAutoInstall;
155     QCheckBox *         _showAutoUpdate;
156     QCheckBox *         _showDel;
157     QCheckBox *         _showInstall;
158     QCheckBox *         _showKeepInstalled;
159     QCheckBox *         _showNoInst;
160     QCheckBox *         _showTaboo;
161     QCheckBox *         _showProtected;
162     QCheckBox *         _showUpdate;
163
164     QPushButton *       _refreshButton;
165 };
166
167
168
169 #endif // ifndef YQPkgStatusFilterView_h