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 "YQPkgSearchFilterView.h" 34 #include "YQPkgStatusFilterView.h" 45 QHBoxLayout *layout =
new QHBoxLayout(
this);
46 YUI_CHECK_NEW( layout );
47 layout->setContentsMargins(0,0,0,0);
49 QSplitter * splitter =
new QSplitter( Qt::Vertical,
this );
50 YUI_CHECK_NEW( splitter );
52 layout->addWidget( splitter );
53 splitter->addWidget(primary_widget);
55 primary_widget->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Expanding ) );
66 connect( primary_widget, SIGNAL(
filterMatch ( ZyppSel, ZyppPkg ) ),
69 connect( primary_widget, SIGNAL(
filterNearMatch ( ZyppSel, ZyppPkg ) ),
74 splitter->setStretchFactor(0, 5);
75 splitter->setStretchFactor(1, 1);
76 splitter->setStretchFactor(2, 3);
87 QWidget *vbox =
new QWidget( parent );
88 YUI_CHECK_NEW( vbox );
90 QVBoxLayout *layout =
new QVBoxLayout();
91 YUI_CHECK_NEW( layout );
93 vbox->setLayout( layout );
94 layout->setContentsMargins( 0, 0, 0, 0 );
103 _secondaryFilters =
new QY2ComboTabWidget( _(
"&Secondary Filter:" ));
104 YUI_CHECK_NEW( _secondaryFilters );
105 layout->addWidget(_secondaryFilters);
110 _allPackages =
new QWidget(
this );
111 YUI_CHECK_NEW( _allPackages );
112 _secondaryFilters->addPage( _(
"All Packages" ), _allPackages );
117 _unmaintainedPackages =
new QWidget(
this );
118 YUI_CHECK_NEW( _unmaintainedPackages );
119 _secondaryFilters->addPage( _(
"Unmaintained Packages" ), _unmaintainedPackages );
126 YUI_CHECK_NEW( _searchFilterView );
127 _secondaryFilters->addPage( _(
"Search" ), _searchFilterView );
129 connect( _searchFilterView, SIGNAL(
filterStart() ),
130 primary_widget, SLOT (
filter() ) );
132 connect( _secondaryFilters, &QY2ComboTabWidget::currentChanged,
139 YUI_CHECK_NEW( _statusFilterView );
140 _secondaryFilters->addPage( _(
"Installation Summary" ), _statusFilterView );
142 connect( _statusFilterView, SIGNAL(
filterStart() ),
143 primary_widget, SLOT (
filter() ) );
145 return _secondaryFilters;
155 primaryFilterIfVisible();
176 if ( _allPackages->isVisible() )
180 else if ( _unmaintainedPackages->isVisible() )
182 return ( selectable->availableSize() == 0 );
184 else if ( _searchFilterView->isVisible() )
186 return _searchFilterView->
check( selectable, pkg );
188 else if ( _statusFilterView->isVisible() )
190 return _statusFilterView->
check( selectable, pkg );
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.