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