libyui-qt-pkg
 
Loading...
Searching...
No Matches
YQPkgChangesDialog.h
1/*
2 Copyright (c) 2000 - 2010 Novell, Inc.
3 Copyright (c) 2021 SUSE LLC
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) version 3.0 of the License. This library
9 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 License for more details. You should have received a copy of the GNU
13 Lesser General Public License along with this library; if not, write
14 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
15 Floor, Boston, MA 02110-1301 USA
16*/
17
18
19/*
20 File: YQPkgChangesDialog.h
21 Author: Stefan Hundhammer <shundhammer.de>
22*/
23
24
25#ifndef YQPkgChangesDialog_h
26#define YQPkgChangesDialog_h
27
28#include <QDialog>
29#include <QComboBox>
30#include <QRegExp>
31#include <QFlags>
32
33#include "YQZypp.h"
34
35
36class YQPkgList;
37
43class YQPkgChangesDialog : public QDialog
44{
45 Q_OBJECT
46
47public:
48
53 {
54 FilterIndexAll = 0,
55 FilterIndexUser = 1,
56 FilterIndexAutomatic = 2
57 };
58
62 enum Filter
63 {
64 FilterNone = 0x0,
65 FilterUser = 0x1,
66 FilterAutomatic = 0x2,
67 FilterAll = 0x1 | 0x2
68 };
69 Q_DECLARE_FLAGS(Filters, Filter);
70
74 enum Option
75 {
76 OptionNone = 0x0,
77 OptionAutoAcceptIfEmpty = 0x1
78 };
79 Q_DECLARE_FLAGS(Options, Option);
80
86 void setFilter( Filters f );
87
93 void setFilter( const QRegExp &regexp, Filters f );
94
107 static bool showChangesDialog( QWidget * parent,
108 const QString & message,
109 const QString & acceptButtonLabel,
110 const QString & rejectButtonLabel = QString(),
111 Filters f = FilterAutomatic,
112 Options o = OptionAutoAcceptIfEmpty );
113
127 static bool showChangesDialog( QWidget * parent,
128 const QString & message,
129 const QRegExp & regexp,
130 const QString & acceptButtonLabel,
131 const QString & rejectButtonLabel = QString(),
132 Filters f = FilterAutomatic,
133 Options o = OptionAutoAcceptIfEmpty );
134
140 virtual QSize sizeHint () const;
141
142protected slots:
146 void slotFilterChanged( int index );
147
148protected:
160 YQPkgChangesDialog( QWidget * parent,
161 const QString & message,
162 const QString & acceptButtonLabel,
163 const QString & rejectButtonLabel = QString() );
164
171 void filter( Filters f = FilterAutomatic );
172
179 void filter( const QRegExp & regexp, Filters f = FilterAutomatic );
180
184 virtual bool extraFilter( ZyppSel sel, ZyppPkg pkg );
185
190 bool isEmpty() const;
191
192
193 // Data members
194 QComboBox *_filter;
195 YQPkgList * _pkgList;
196};
197
198Q_DECLARE_OPERATORS_FOR_FLAGS(YQPkgChangesDialog::Filters);
199Q_DECLARE_METATYPE(YQPkgChangesDialog::Filters);
200
201
203{
204public:
216 YQPkgUnsupportedPackagesDialog( QWidget * parent,
217 const QString &message,
218 const QString &acceptButtonLabel,
219 const QString &rejectButtonLabel = QString() );
220
233 static bool showUnsupportedPackagesDialog( QWidget * parent,
234 const QString & message,
235 const QString & acceptButtonLabel,
236 const QString & rejectButtonLabel = QString(),
237 Filters f = FilterAutomatic,
238 Options o = OptionAutoAcceptIfEmpty );
239protected:
243 virtual bool extraFilter( ZyppSel sel, ZyppPkg pkg );
244
245};
246
247
248#endif // ifndef YQPkgChangesDialog_h
FilterIndex
Definition YQPkgChangesDialog.h:53
virtual bool extraFilter(ZyppSel sel, ZyppPkg pkg)
Definition YQPkgChangesDialog.cc:290
void slotFilterChanged(int index)
Definition YQPkgChangesDialog.cc:161
virtual QSize sizeHint() const
Definition YQPkgChangesDialog.cc:303
YQPkgChangesDialog(QWidget *parent, const QString &message, const QString &acceptButtonLabel, const QString &rejectButtonLabel=QString())
Definition YQPkgChangesDialog.cc:58
bool isEmpty() const
Definition YQPkgChangesDialog.cc:296
Filter
Definition YQPkgChangesDialog.h:63
void setFilter(Filters f)
Definition YQPkgChangesDialog.cc:179
void filter(Filters f=FilterAutomatic)
Definition YQPkgChangesDialog.cc:155
Option
Definition YQPkgChangesDialog.h:75
static bool showChangesDialog(QWidget *parent, const QString &message, const QString &acceptButtonLabel, const QString &rejectButtonLabel=QString(), Filters f=FilterAutomatic, Options o=OptionAutoAcceptIfEmpty)
Definition YQPkgChangesDialog.cc:310
Display a list of zypp::Package objects.
Definition YQPkgList.h:39
static bool showUnsupportedPackagesDialog(QWidget *parent, const QString &message, const QString &acceptButtonLabel, const QString &rejectButtonLabel=QString(), Filters f=FilterAutomatic, Options o=OptionAutoAcceptIfEmpty)
Definition YQPkgChangesDialog.cc:381
YQPkgUnsupportedPackagesDialog(QWidget *parent, const QString &message, const QString &acceptButtonLabel, const QString &rejectButtonLabel=QString())
Definition YQPkgChangesDialog.cc:363
virtual bool extraFilter(ZyppSel sel, ZyppPkg pkg)
Definition YQPkgChangesDialog.cc:371