libyui-qt-pkg  2.45.15.2
YQPkgRepoFilterView.cc
1 /**************************************************************************
2 Copyright (C) 2000 - 2010 Novell, Inc.
3 All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 
19 **************************************************************************/
20 
21 
22 /*---------------------------------------------------------------------\
23 | |
24 | __ __ ____ _____ ____ |
25 | \ \ / /_ _/ ___|_ _|___ \ |
26 | \ V / _` \___ \ | | __) | |
27 | | | (_| |___) || | / __/ |
28 | |_|\__,_|____/ |_| |_____| |
29 | |
30 | core system |
31 | (C) SuSE GmbH |
32 \----------------------------------------------------------------------/
33 
34  File: YQPkgRepoFilterView.cc
35 
36  Author: Stefan Hundhammer <sh@suse.de>
37 
38  Textdomain "qt-pkg"
39 
40 /-*/
41 
42 
43 #define YUILogComponent "qt-pkg"
44 #include <YUILog.h>
45 #include <YUIException.h>
46 
47 #include <QVBoxLayout>
48 #include <QSplitter>
49 
50 #include "QY2ComboTabWidget.h"
51 #include "QY2LayoutUtils.h"
52 #include "YQPkgRepoFilterView.h"
53 #include "YQPkgRepoList.h"
54 #include "YQPkgRpmGroupTagsFilterView.h"
55 #include "YQPkgSearchFilterView.h"
56 #include "YQPkgStatusFilterView.h"
57 #include "YQi18n.h"
58 #include "YQZypp.h"
59 
60 
62  : YQPkgSecondaryFilterView( parent )
63 {
64  _repoList = new YQPkgRepoList( this );
65  YUI_CHECK_NEW( _repoList );
66  init(_repoList);
67 }
68 
69 
71 {
72  // NOP
73 }
74 
75 ZyppRepo
77 {
78  YQPkgRepoListItem *selection = _repoList->selection();
79  if ( selection && selection->zyppRepo() )
80  return selection->zyppRepo();
81  return zypp::Repository::noRepository;
82 }
83 
84 
85 void YQPkgRepoFilterView::primaryFilter()
86 {
87  _repoList->filter();
88 }
89 
90 void YQPkgRepoFilterView::primaryFilterIfVisible()
91 {
92  _repoList->filterIfVisible();
93 }
94 
95 #include "YQPkgRepoFilterView.moc"
zypp::Repository selectedRepo() const
Current selected repository, or if nothing is selected.
void filter()
Filter according to the view&#39;s rules and current selection.
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.
YQPkgRepoFilterView(QWidget *parent)
Constructor.
This is a base class for filter views containing a secondary filter.
void init(QWidget *primary_widget)
Initialize the primary widget.
Display a list of libzypp repositories.
Definition: YQPkgRepoList.h:58
void filterIfVisible()
Same as filter(), but only if this widget is currently visible.
virtual ~YQPkgRepoFilterView()
Destructor.