libyui-qt-pkg
Loading...
Searching...
No Matches
YQPkgConflictList.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: YQPkgConflictList.h
21 Author: Stefan Hundhammer <shundhammer.de>
22*/
23
24
25#ifndef YQPkgConflictList_h
26#define YQPkgConflictList_h
27
28
29#include <stdio.h>
30#include <QMap>
31#include <QFile>
32#include <QScrollArea>
33
34#include <zypp/Resolver.h>
35#include <zypp/ResolverProblem.h>
36#include <zypp/ProblemSolution.h>
37
38class QVBoxLayout;
39class QRadioButton;
40class QAction;
41class YQPkgConflict;
42class YQPkgConflictResolution;
44
45
50class YQPkgConflictList : public QScrollArea
51{
52 Q_OBJECT
53
54public:
58 YQPkgConflictList( QWidget * parent );
59
63 virtual ~YQPkgConflictList();
64
68 void fill( zypp::ResolverProblemList problemList );
69
73 bool isEmpty() const { return count() == 0; }
74
78 int count() const { return _conflicts.count(); }
79
80
81public slots:
82
86 void applyResolutions();
87
91 void askSaveToFile() const;
92
93 void clear();
94
95 void relayout();
96
97public:
98
107 void saveToFile( const QString filename, bool interactive ) const;
108
109protected:
110
111 QList<YQPkgConflict*> _conflicts;
112 QVBoxLayout *_layout;
113
114signals:
115
120
121};
122
123
124
128class YQPkgConflict: public QFrame
129{
130 Q_OBJECT
131
132public:
133
137 YQPkgConflict( QWidget * parent,
138 zypp::ResolverProblem_Ptr problem );
139
143 virtual ~YQPkgConflict() {}
144
148 zypp::ResolverProblem_Ptr problem() const { return _problem; }
149
154 zypp::ProblemSolution_Ptr userSelectedResolution();
155
159 void saveToFile( QFile &file ) const;
160
161
162protected slots:
163
164 void detailsExpanded();
165
166signals:
167
168 void expanded();
169
170protected:
171
175 void formatHeading();
176
180 void addSolutions();
181
182 //
183 // Data members
184 //
185
186 zypp::ResolverProblem_Ptr _problem;
187 QLabel * _resolutionsHeader;
188 QList<zypp::ProblemSolution_Ptr> _resolutions;
189 QMap<QRadioButton *, zypp::ProblemSolution_Ptr> _solutions;
190 QMap<QLabel *, zypp::ProblemSolution_Ptr> _details;
191 QVBoxLayout * _layout;
192};
193
194#endif // ifndef YQPkgConflictList_h
Dialog that takes care of dependency checking and resolving conflicts.
Definition YQPkgConflictDialog.h:44
Display package dependency conflicts in a tree list and let the user choose how to resolve each confl...
Definition YQPkgConflictList.h:51
void applyResolutions()
Definition YQPkgConflictList.cc:145
void saveToFile(const QString filename, bool interactive) const
Definition YQPkgConflictList.cc:175
int count() const
Definition YQPkgConflictList.h:78
void fill(zypp::ResolverProblemList problemList)
Definition YQPkgConflictList.cc:105
void askSaveToFile() const
Definition YQPkgConflictList.cc:164
bool isEmpty() const
Definition YQPkgConflictList.h:73
virtual ~YQPkgConflictList()
Definition YQPkgConflictList.cc:83
Root item for each individual conflict.
Definition YQPkgConflictList.h:129
zypp::ResolverProblem_Ptr problem() const
Definition YQPkgConflictList.h:148
void formatHeading()
Definition YQPkgConflictList.cc:254
zypp::ProblemSolution_Ptr userSelectedResolution()
Definition YQPkgConflictList.cc:354
void addSolutions()
Definition YQPkgConflictList.cc:278
void saveToFile(QFile &file) const
Definition YQPkgConflictList.cc:375
virtual ~YQPkgConflict()
Definition YQPkgConflictList.h:143