libyui-qt-pkg  2.45.6
 All Classes Functions Variables Enumerations
YQPkgStatusFilterView.h
1 /**************************************************************************
2 Copyright (C) 2000 - 2010 Novell, Inc.
3 All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 **************************************************************************/
20 
21 
22 /*---------------------------------------------------------------------\
23 | |
24 | __ __ ____ _____ ____ |
25 | \ \ / /_ _/ ___|_ _|___ \ |
26 | \ V / _` \___ \ | | __) | |
27 | | | (_| |___) || | / __/ |
28 | |_|\__,_|____/ |_| |_____| |
29 | |
30 | core system |
31 | (C) SuSE GmbH |
32 \----------------------------------------------------------------------/
33 
34  File: YQPkgStatusFilterView.h
35 
36  Author: Stefan Hundhammer <sh@suse.de>
37 
38 /-*/
39 
40 
41 #ifndef YQPkgStatusFilterView_h
42 #define YQPkgStatusFilterView_h
43 
44 #include "YQZypp.h"
45 #include <QWidget>
46 #include <QRegExp>
47 #include <QPixmap>
48 #include <QScrollArea>
49 
50 
51 class QComboBox;
52 class QCheckBox;
53 class QPushButton;
54 
55 
56 /**
57  * @short Filter view for packages that made problems during update
58  **/
59 class YQPkgStatusFilterView : public QScrollArea
60 {
61  Q_OBJECT
62 
63 public:
64 
65  /**
66  * Constructor
67  **/
68  YQPkgStatusFilterView( QWidget * parent );
69 
70  /**
71  * Destructor
72  **/
73  virtual ~YQPkgStatusFilterView();
74 
75  /**
76  * Returns the minimum size required for this widget.
77  * Inherited from QWidget.
78  **/
79  virtual QSize minimumSizeHint() const;
80 
81  /**
82  * Check if pkg matches the filter criteria.
83  **/
84  bool check( ZyppSel selectable,
85  ZyppObj pkg );
86 
87 
88 public slots:
89 
90  /**
91  * Filter according to the view's rules and current selection.
92  * Emits those signals:
93  * filterStart()
94  * filterMatch() for each pkg that matches the filter
95  * filterFinished()
96  **/
97  void filter();
98 
99  /**
100  * Same as filter(), but only if this widget is currently visible.
101  **/
102  void filterIfVisible();
103 
104 
105  /**
106  * Reset all check boxes (set them all to "off")
107  **/
108  void clear();
109 
110  /**
111  * Set up the check boxes so all pending transactions are displayed.
112  **/
113  void showTransactions();
114 
115  /**
116  * Set up the check boxes so pending manual transactions (no "auto" states)
117  * are displayed.
118  **/
119  void showManualTransactions();
120 
121  /**
122  * Set up the check boxes so pending automatic transactions (the "auto" states)
123  * are displayed.
124  **/
125  void showAutoTransactions();
126 
127  /**
128  * Set the check boxes for locked packages ("Taboo" and "Protected") to "on".
129  **/
130  void showLocks();
131 
132  /**
133  * Set the check box for installed packages to "on".
134  **/
135  void showInstalled();
136 
137  /**
138  * Set the check box for not installed packages to "on".
139  **/
140  void showNotInstalled();
141 
142 
143 signals:
144 
145  /**
146  * Emitted when the filtering starts. Use this to clear package lists
147  * etc. prior to adding new entries.
148  **/
149  void filterStart();
150 
151  /**
152  * Emitted during filtering for each pkg that matches the filter.
153  **/
154  void filterMatch( ZyppSel selectable,
155  ZyppPkg pkg );
156 
157  /**
158  * Emitted when filtering is finished.
159  **/
160  void filterFinished();
161 
162 
163 protected:
164 
165  /**
166  * Add a check box
167  **/
168  QCheckBox * addStatusCheckBox( QWidget * parent,
169  const QString & label,
170  const QPixmap & icon,
171  bool initiallyChecked );
172 
173  // Data members
174 
175  QCheckBox * _showAutoDel;
176  QCheckBox * _showAutoInstall;
177  QCheckBox * _showAutoUpdate;
178  QCheckBox * _showDel;
179  QCheckBox * _showInstall;
180  QCheckBox * _showKeepInstalled;
181  QCheckBox * _showNoInst;
182  QCheckBox * _showTaboo;
183  QCheckBox * _showProtected;
184  QCheckBox * _showUpdate;
185 
186  QPushButton * _refreshButton;
187 };
188 
189 
190 
191 #endif // ifndef YQPkgStatusFilterView_h
void filterStart()
Emitted when the filtering starts.
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
void filterFinished()
Emitted when filtering is finished.
virtual QSize minimumSizeHint() const
Returns the minimum size required for this widget.
QCheckBox * addStatusCheckBox(QWidget *parent, const QString &label, const QPixmap &icon, bool initiallyChecked)
Add a check box.
virtual ~YQPkgStatusFilterView()
Destructor.
void showManualTransactions()
Set up the check boxes so pending manual transactions (no "auto" states) are displayed.
void showLocks()
Set the check boxes for locked packages ("Taboo" and "Protected") to "on".
void showInstalled()
Set the check box for installed packages to "on".
void showAutoTransactions()
Set up the check boxes so pending automatic transactions (the "auto" states) are displayed.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter.
Filter view for packages that made problems during update.
void clear()
Reset all check boxes (set them all to "off")
void showTransactions()
Set up the check boxes so all pending transactions are displayed.
YQPkgStatusFilterView(QWidget *parent)
Constructor.
void filter()
Filter according to the view's rules and current selection.
void showNotInstalled()
Set the check box for not installed packages to "on".
bool check(ZyppSel selectable, ZyppObj pkg)
Check if pkg matches the filter criteria.