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