23 #define YUILogComponent "qt-pkg" 25 #include <YUIException.h> 27 #include <QVBoxLayout> 30 #include "QY2ComboTabWidget.h" 31 #include "QY2LayoutUtils.h" 32 #include "YQPkgSecondaryFilterView.h" 33 #include "YQPkgRpmGroupTagsFilterView.h" 34 #include "YQPkgSearchFilterView.h" 35 #include "YQPkgStatusFilterView.h" 46 QHBoxLayout *layout =
new QHBoxLayout(
this);
47 YUI_CHECK_NEW( layout );
48 layout->setContentsMargins(0,0,0,0);
50 QSplitter * splitter =
new QSplitter( Qt::Vertical,
this );
51 YUI_CHECK_NEW( splitter );
53 layout->addWidget( splitter );
54 splitter->addWidget(primary_widget);
56 primary_widget->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Expanding ) );
67 connect( primary_widget, SIGNAL(
filterMatch ( ZyppSel, ZyppPkg ) ),
70 connect( primary_widget, SIGNAL(
filterNearMatch ( ZyppSel, ZyppPkg ) ),
75 splitter->setStretchFactor(0, 5);
76 splitter->setStretchFactor(1, 1);
77 splitter->setStretchFactor(2, 3);
88 QWidget *vbox =
new QWidget( parent );
89 YUI_CHECK_NEW( vbox );
91 QVBoxLayout *layout =
new QVBoxLayout();
92 YUI_CHECK_NEW( layout );
94 vbox->setLayout( layout );
95 layout->setContentsMargins( 0, 0, 0, 0 );
104 _secondaryFilters =
new QY2ComboTabWidget( _(
"&Secondary Filter:" ));
105 YUI_CHECK_NEW( _secondaryFilters );
106 layout->addWidget(_secondaryFilters);
111 _allPackages =
new QWidget(
this );
112 YUI_CHECK_NEW( _allPackages );
113 _secondaryFilters->addPage( _(
"All Packages" ), _allPackages );
118 _unmaintainedPackages =
new QWidget(
this );
119 YUI_CHECK_NEW( _unmaintainedPackages );
120 _secondaryFilters->addPage( _(
"Unmaintained Packages" ), _unmaintainedPackages );
126 YUI_CHECK_NEW( _rpmGroupTagsFilterView );
127 _secondaryFilters->addPage( _(
"Package Groups" ), _rpmGroupTagsFilterView );
129 connect( _rpmGroupTagsFilterView, SIGNAL(
filterStart() ),
130 primary_widget, SLOT (
filter() ) );
137 YUI_CHECK_NEW( _searchFilterView );
138 _secondaryFilters->addPage( _(
"Search" ), _searchFilterView );
140 connect( _searchFilterView, SIGNAL(
filterStart() ),
141 primary_widget, SLOT (
filter() ) );
143 connect( _secondaryFilters, &QY2ComboTabWidget::currentChanged,
150 YUI_CHECK_NEW( _statusFilterView );
151 _secondaryFilters->addPage( _(
"Installation Summary" ), _statusFilterView );
153 connect( _statusFilterView, SIGNAL(
filterStart() ),
154 primary_widget, SLOT (
filter() ) );
156 return _secondaryFilters;
166 primaryFilterIfVisible();
187 if ( _allPackages->isVisible() )
191 else if ( _unmaintainedPackages->isVisible() )
193 return ( selectable->availableSize() == 0 );
195 else if ( _rpmGroupTagsFilterView->isVisible() )
197 return _rpmGroupTagsFilterView->
check( selectable, pkg );
199 else if ( _searchFilterView->isVisible() )
201 return _searchFilterView->
check( selectable, pkg );
203 else if ( _statusFilterView->isVisible() )
205 return _statusFilterView->
check( selectable, pkg );
211 #include "YQPkgSecondaryFilterView.moc" void filterNearMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter and the candidate package does not come...
bool check(ZyppSel selectable, ZyppObj zyppObj)
Check one ResObject against the currently selected values.
void filter()
Filter according to the view's rules and current selection.
QWidget * layoutSecondaryFilters(QWidget *parent, QWidget *primary_widget)
Widget layout for the secondary filters.
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 init(QWidget *primary_widget)
Initialize the primary widget.
void primaryFilterMatch(ZyppSel selectable, ZyppPkg pkg)
Propagate a filter match from the primary filter and appy any selected secondary filter(s) to it...
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
Filter view for searching within packages.
void filterStart()
Emitted when the filtering starts.
void filterFinished()
Emitted when filtering is finished.
YQPkgSecondaryFilterView(QWidget *parent)
Constructor Because of the circular dependencies you have to call the init() method later with the ne...
Filter view for packages that made problems during update.
void filterMatch(ZyppSel selectable, ZyppPkg pkg)
Emitted during filtering for each pkg that matches the filter and the candidate package comes from th...
bool secondaryFilterMatch(ZyppSel selectable, ZyppPkg pkg)
Check if pkg matches the the currently selected secondary filter.
virtual ~YQPkgSecondaryFilterView()
Destructor.
bool check(ZyppSel selectable, ZyppObj pkg)
Check if pkg matches the filter criteria.