libyui-qt-pkg
 
Loading...
Searching...
No Matches
YQPkgVersionsView.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: YQPkgVersionsView.h
21 Author: Stefan Hundhammer <shundhammer.de>
22*/
23
24
25#ifndef YQPkgVersionsView_h
26#define YQPkgVersionsView_h
27
28#include <QScrollArea>
29#include <QRadioButton>
30#include <QCheckBox>
31#include <QButtonGroup>
32#include <QBoxLayout>
33#include <QLabel>
34#include <QList>
35
36#include "YQZypp.h"
37
38
39class QTabWidget;
41class YQPkgVersion;
42
43
49class YQPkgVersionsView: public QScrollArea
50{
51 Q_OBJECT
52
53public:
54
58 YQPkgVersionsView( QWidget * parent );
59
63 virtual ~YQPkgVersionsView();
64
69 virtual QSize minimumSizeHint() const;
70
76 static bool isMixedMultiVersion( ZyppSel selectable );
77
81 bool isMixedMultiVersion() const { return _isMixedMultiVersion; }
82
91 bool handleMixedMultiVersion( YQPkgMultiVersion * newSelected );
92
96 ZyppSel selectable() const { return _selectable; }
97
101 static void setRetractedColor( QWidget * widget );
102
108 static bool installedIsRetracted( ZyppSel selectable, ZyppObj installed );
109
110
111public slots:
112
118 void showDetailsIfVisible( ZyppSel selectable );
119
120 // slot clear() inherited from QListView
121
122
126 void reload( int newCurrent );
127
128
129signals:
130
134 void candidateChanged( ZyppObj newCandidate );
135
140
141
142protected slots:
143
148
149
150protected:
151
155 void showDetails( ZyppSel selectable );
156
161 bool mixedMultiVersionPopup( bool multiversion ) const;
162
167 bool anyMultiVersionToInstall( bool multiversion ) const;
168
173
174 // Data members
175
176 QTabWidget * _parentTab;
177 ZyppSel _selectable;
178 bool _isMixedMultiVersion;
179 QButtonGroup * _buttonGroup;
180 QVBoxLayout * _layout;
181};
182
183
184class YQPkgVersion: public QRadioButton
185{
186public:
187
192 YQPkgVersion( QWidget * parent,
193 ZyppSel selectable,
194 ZyppObj zyppObj );
195
199 virtual ~YQPkgVersion();
200
204 ZyppObj zyppObj() const { return _zyppObj; }
205
209 ZyppSel selectable() const { return _selectable; }
210
217 virtual QString toolTip( int column );
218
219
220protected:
221
222 // Data members
223
224 ZyppSel _selectable;
225 ZyppObj _zyppObj;
226};
227
228
229
230class YQPkgMultiVersion: public QCheckBox
231{
232 Q_OBJECT
233
234public:
235
240 ZyppSel selectable,
241 ZyppPoolItem zyppPoolItem );
242
246 virtual ~YQPkgMultiVersion();
247
251 ZyppPoolItem zyppPoolItem() const { return _zyppPoolItem; }
252
256 ZyppSel selectable() const { return _selectable; }
257
261 void paintEvent(QPaintEvent *);
262
263signals:
264
269
270
271protected slots:
272 void slotIconClicked();
273
274
275protected:
276
280 void cycleStatus();
281
282 void setStatus( ZyppStatus newStatus );
283 QPixmap statusIcon( ZyppStatus status );
284
285 //
286 // Data members
287 //
288
289 YQPkgVersionsView * _parent;
290 ZyppSel _selectable;
291 ZyppPoolItem _zyppPoolItem;
292};
293
294
295
296
297#endif // ifndef YQPkgVersionsView_h
Definition YQPkgVersionsView.h:231
void cycleStatus()
Definition YQPkgVersionsView.cc:640
virtual ~YQPkgMultiVersion()
Definition YQPkgVersionsView.cc:624
void paintEvent(QPaintEvent *)
Definition YQPkgVersionsView.cc:707
ZyppPoolItem zyppPoolItem() const
Definition YQPkgVersionsView.h:251
YQPkgMultiVersion(YQPkgVersionsView *parent, ZyppSel selectable, ZyppPoolItem zyppPoolItem)
Definition YQPkgVersionsView.cc:604
ZyppSel selectable() const
Definition YQPkgVersionsView.h:256
Definition YQPkgVersionsView.h:185
virtual QString toolTip(int column)
Definition YQPkgVersionsView.cc:591
virtual ~YQPkgVersion()
Definition YQPkgVersionsView.cc:584
ZyppObj zyppObj() const
Definition YQPkgVersionsView.h:204
ZyppSel selectable() const
Definition YQPkgVersionsView.h:209
YQPkgVersion(QWidget *parent, ZyppSel selectable, ZyppObj zyppObj)
Definition YQPkgVersionsView.cc:536
Package version selector: Display a list of available versions from all the different installation so...
Definition YQPkgVersionsView.h:50
bool anyMultiVersionToInstall(bool multiversion) const
Definition YQPkgVersionsView.cc:441
bool handleMixedMultiVersion(YQPkgMultiVersion *newSelected)
Definition YQPkgVersionsView.cc:360
bool isMixedMultiVersion() const
Definition YQPkgVersionsView.h:81
ZyppSel selectable() const
Definition YQPkgVersionsView.h:96
virtual ~YQPkgVersionsView()
Definition YQPkgVersionsView.cc:71
void showDetails(ZyppSel selectable)
Definition YQPkgVersionsView.cc:104
static bool installedIsRetracted(ZyppSel selectable, ZyppObj installed)
Definition YQPkgVersionsView.cc:263
void checkForChangedCandidate()
Definition YQPkgVersionsView.cc:287
static void setRetractedColor(QWidget *widget)
Definition YQPkgVersionsView.cc:255
void reload(int newCurrent)
Definition YQPkgVersionsView.cc:78
void candidateChanged(ZyppObj newCandidate)
void showDetailsIfVisible(ZyppSel selectable)
Definition YQPkgVersionsView.cc:86
void unselectAllMultiVersion()
Definition YQPkgVersionsView.cc:475
YQPkgVersionsView(QWidget *parent)
Definition YQPkgVersionsView.cc:54
virtual QSize minimumSizeHint() const
Definition YQPkgVersionsView.cc:353
bool mixedMultiVersionPopup(bool multiversion) const
Definition YQPkgVersionsView.cc:398