xref: /glogg/src/filtersdialog.h (revision 821cac888d515a4e41b5d4ba4130c56db4463501)
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 #include "ui_filtersdialog.h"
27 
28 class FiltersDialog : public QDialog, public Ui::FiltersDialog
29 {
30   Q_OBJECT
31 
32   public:
33     FiltersDialog( QWidget* parent = 0 );
34 
35   signals:
36     // Is emitted when new settings must be used
37     void optionsChanged();
38 
39   private slots:
40     void on_addFilterButton_clicked();
41     void on_removeFilterButton_clicked();
42     void on_buttonBox_clicked( QAbstractButton* button );
43     void on_upFilterButton_clicked();
44     void on_downFilterButton_clicked();
45     // Update the property (pattern, color...) fields from the
46     // selected Filter.
47     void updatePropertyFields();
48     // Update the selected Filter from the values in the property fields.
49     void updateFilterProperties();
50 
51   private:
52     // Temporary filterset modified by the dialog
53     // it is copied from the one in Config()
54     FilterSet filterSet;
55 
56     // Index of the row currently selected or -1 if none.
57     int selectedRow_;
58 
59     void populateColors();
60     void populateFilterList();
61 };
62 
63 #endif
64