xref: /glogg/src/filtersdialog.h (revision bb02e0acf44ddb4e4f83d6127a1e488789162922)
1 /*
2  * Copyright (C) 2009, 2010 Nicolas Bonnefon and other contributors
3  *
4  * This file is part of glogg.
5  *
6  * glogg is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * glogg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with glogg.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef FILTERSDIALOG_H
21 #define FILTERSDIALOG_H
22 
23 #include <QDialog>
24 
25 #include "filterset.h"
26 #if QT_VERSION > 0x040400
27 #include "ui_filtersdialog.h"
28 #else
29 #include "ui_filtersdialog_old.h"
30 #endif
31 
32 class FiltersDialog : public QDialog, public Ui::FiltersDialog
33 {
34   Q_OBJECT
35 
36   public:
37     FiltersDialog( QWidget* parent = 0 );
38 
39   signals:
40     // Is emitted when new settings must be used
41     void optionsChanged();
42 
43   private slots:
44     void on_addFilterButton_clicked();
45     void on_removeFilterButton_clicked();
46     void on_buttonBox_clicked( QAbstractButton* button );
47     void on_upFilterButton_clicked();
48     void on_downFilterButton_clicked();
49     // Update the property (pattern, color...) fields from the
50     // selected Filter.
51     void updatePropertyFields();
52     // Update the selected Filter from the values in the property fields.
53     void updateFilterProperties();
54 
55   private:
56     // Temporary filterset modified by the dialog
57     // it is copied from the one in Config()
58     FilterSet filterSet;
59 
60     // Index of the row currently selected or -1 if none.
61     int selectedRow_;
62 
63     void populateColors();
64     void populateFilterList();
65 };
66 
67 #endif
68