43 #define YUILogComponent "qt-pkg" 45 #include <YUIException.h> 47 #include <QVBoxLayout> 51 #include "QY2ComboTabWidget.h" 52 #include "QY2LayoutUtils.h" 53 #include "YQPkgRepoFilterView.h" 54 #include "YQPkgRepoList.h" 55 #include "YQPkgRpmGroupTagsFilterView.h" 56 #include "YQPkgSearchFilterView.h" 57 #include "YQPkgStatusFilterView.h" 64 QHBoxLayout *layout =
new QHBoxLayout(
this);
65 layout->setContentsMargins(0,0,0,0);
67 QSplitter * splitter =
new QSplitter( Qt::Vertical,
this );
68 YUI_CHECK_NEW( splitter );
70 layout->addWidget( splitter );
73 splitter->addWidget(_repoList);
75 YUI_CHECK_NEW( _repoList );
76 _repoList->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Expanding ) );
90 connect( _repoList, SIGNAL(
filterMatch ( ZyppSel, ZyppPkg ) ),
98 splitter->setStretchFactor(0, 5);
99 splitter->setStretchFactor(1, 1);
100 splitter->setStretchFactor(2, 3);
115 if ( selection && selection->
zyppRepo() )
117 return zypp::Repository::noRepository;
123 QWidget *vbox =
new QWidget( parent );
124 YUI_CHECK_NEW( vbox );
126 QVBoxLayout *layout =
new QVBoxLayout();
127 YUI_CHECK_NEW( layout );
129 vbox->setLayout( layout );
130 layout->setContentsMargins( 0, 0, 0, 0 );
139 _secondaryFilters =
new QY2ComboTabWidget( _(
"&Secondary Filter:" ));
140 YUI_CHECK_NEW( _secondaryFilters );
141 layout->addWidget(_secondaryFilters);
147 _allPackages =
new QWidget(
this );
148 YUI_CHECK_NEW( _allPackages );
149 _secondaryFilters->addPage( _(
"All Packages" ), _allPackages );
155 _unmaintainedPackages =
new QWidget(
this );
156 YUI_CHECK_NEW( _unmaintainedPackages );
157 _secondaryFilters->addPage( _(
"Unmaintained Packages" ), _unmaintainedPackages );
164 YUI_CHECK_NEW( _rpmGroupTagsFilterView );
165 _secondaryFilters->addPage( _(
"Package Groups" ), _rpmGroupTagsFilterView );
167 connect( _rpmGroupTagsFilterView, SIGNAL(
filterStart() ),
168 _repoList, SLOT (
filter() ) );
176 YUI_CHECK_NEW( _searchFilterView );
177 _secondaryFilters->addPage( _(
"Search" ), _searchFilterView );
179 connect( _searchFilterView, SIGNAL(
filterStart() ),
180 _repoList, SLOT (
filter() ) );
182 connect( _secondaryFilters, &QY2ComboTabWidget::currentChanged,
191 YUI_CHECK_NEW( _statusFilterView );
192 _secondaryFilters->addPage( _(
"Installation Summary" ), _statusFilterView );
194 connect( _statusFilterView, SIGNAL(
filterStart() ),
195 _repoList, SLOT (
filter() ) );
198 return _secondaryFilters;
234 if ( _allPackages->isVisible() )
238 else if ( _unmaintainedPackages->isVisible() )
240 return ( selectable->availableSize() == 0 );
242 else if ( _rpmGroupTagsFilterView->isVisible() )
244 return _rpmGroupTagsFilterView->
check( selectable, pkg );
246 else if ( _searchFilterView->isVisible() )
248 return _searchFilterView->
check( selectable, pkg );
250 else if ( _statusFilterView->isVisible() )
252 return _statusFilterView->
check( selectable, pkg );
265 #include "YQPkgRepoFilterView.moc"
zypp::Repository selectedRepo() const
Current selected repository, or if nothing is selected.
void filter()
Filter according to the view's rules and current selection.
void filterNearMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter and the candidate package does not come...
YQPkgRepoListItem * selection() const
Returns the currently selected item or 0 if there is none.
ZyppRepo zyppRepo() const
Returns the ZYPP repository this item corresponds to.
void filterFinished()
Emitted when filtering is finished.
bool check(ZyppSel selectable, ZyppObj zyppObj)
Check one ResObject against the currently selected values.
QWidget * layoutSecondaryFilters(QWidget *parent)
Widget layout for the secondary filters.
YQPkgRepoFilterView(QWidget *parent)
Constructor.
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
Filter view for searching within packages.
void filter()
Filter according to the view's rules and current selection.
Filter view for packages that made problems during update.
Display a list of zypp::Selection objects.
bool secondaryFilterMatch(ZyppSel selectable, ZyppPkg pkg)
Check if pkg matches the the currently selected secondary filter.
void primaryFilterMatch(ZyppSel selectable, ZyppPkg pkg)
Propagate a filter match from the primary filter and appy any selected secondary filter(s) to it...
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter and the candidate package comes from th...
void primaryFilterNearMatch(ZyppSel selectable, ZyppPkg pkg)
Propagate a filter near match from the primary filter and appy any selected secondary filter(s) to it...
void filterStart()
Emitted when the filtering starts.
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
virtual ~YQPkgRepoFilterView()
Destructor.
bool check(ZyppSel selectable, ZyppObj pkg)
Check if pkg matches the filter criteria.