summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/filterdlg.h
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/filterdlg.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/filterdlg.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/filterdlg.h b/noncore/settings/packagemanager/filterdlg.h
new file mode 100644
index 0000000..42bae8b
--- a/dev/null
+++ b/noncore/settings/packagemanager/filterdlg.h
@@ -0,0 +1,101 @@
1/*
2                This file is part of the OPIE Project
3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org>
5             .=l.
6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
29
30#ifndef FILTERDLG_H
31#define FILTERDLG_H
32
33#include <qcheckbox.h>
34#include <qdialog.h>
35#include <qcombobox.h>
36#include <qlayout.h>
37#include <qlineedit.h>
38#include <qscrollview.h>
39
40#include "opackagemanager.h"
41
42class FilterDlg : public QDialog
43{
44 Q_OBJECT
45
46public:
47 FilterDlg( QWidget *parent = 0x0, OPackageManager *pm = 0x0, const QString &name = 0x0,
48 const QString &server = 0x0, const QString &destination = 0x0,
49 OPackageManager::Status status = OPackageManager::All,
50 const QString &category = 0x0 );
51
52 const QString &name()
53 { return m_nameCB->isChecked() ? m_name->text() : QString::null; };
54 const QString &server()
55 { return m_serverCB->isChecked() ? m_server->currentText() : QString::null; };
56 const QString &destination()
57 { return m_destCB->isChecked() ? m_destination->currentText() : QString::null; };
58 OPackageManager::Status status()
59 {
60 if ( m_statusCB->isChecked() )
61 {
62 if ( m_status->currentText() == tr( "All" ) )
63 return OPackageManager::All;
64 else if ( m_status->currentText() == tr( "Installed" ) )
65 return OPackageManager::Installed;
66 else if ( m_status->currentText() == tr( "Not installed" ) )
67 return OPackageManager::NotInstalled;
68 else if ( m_status->currentText() == tr( "Updated" ) )
69 return OPackageManager::Updated;
70 }
71 else
72 return OPackageManager::NotDefined;
73 };
74 const QString &category()
75 { return m_categoryCB->isChecked() ? m_category->currentText() : QString::null; };
76
77private:
78 QCheckBox *m_nameCB;
79 QCheckBox *m_serverCB;
80 QCheckBox *m_destCB;
81 QCheckBox *m_statusCB;
82 QCheckBox *m_categoryCB;
83
84 QLineEdit *m_name;
85 QComboBox *m_server;
86 QComboBox *m_destination;
87 QComboBox *m_status;
88 QComboBox *m_category;
89
90 void initItem( QComboBox *comboBox, QCheckBox *checkBox, const QString &selection );
91
92private slots:
93 void slotNameSelected( bool );
94 void slotServerSelected( bool );
95 void slotDestSelected( bool );
96 void slotStatusSelected( bool );
97 void slotStatusChanged( const QString & );
98 void slotCategorySelected( bool );
99};
100
101#endif