1 /* ============================================================ 2 * QuiteRSS is a open-source cross-platform RSS/Atom news feeds reader 3 * Copyright (C) 2011-2020 QuiteRSS Team <quiterssteam@gmail.com> 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <https://www.gnu.org/licenses/>. 17 * ============================================================ */ 18 #ifndef FILTERRULES_H 19 #define FILTERRULES_H 20 21 #include "dialog.h" 22 #include "itemcondition.h" 23 #include "itemaction.h" 24 25 class FilterRulesDialog : public Dialog 26 { 27 Q_OBJECT 28 public: 29 explicit FilterRulesDialog(QWidget *parent, int filterId, int feedId = -1); 30 31 LineEdit *filterName_; 32 int filterId_; 33 bool itemNotChecked_; 34 35 private slots: 36 void feedItemChanged(QTreeWidgetItem *item, int column); 37 void setCheckStateItem(QTreeWidgetItem *item, Qt::CheckState state); 38 void closeDialog(); 39 void acceptDialog(); 40 41 void filterNameChanged(const QString &text); 42 43 ItemCondition *addCondition(); 44 void deleteCondition(ItemCondition *item); 45 46 ItemAction *addAction(); 47 void deleteAction(ItemAction *item); 48 49 void selectMatch(int index); 50 51 private: 52 void setData(); 53 54 QTreeWidget *feedsTree_; 55 56 QComboBox *matchComboBox_; 57 58 QScrollArea *conditionScrollArea_; 59 QVBoxLayout *conditionLayout_; 60 QWidget *conditionWidget_; 61 62 QScrollArea *actionsScrollArea_; 63 QVBoxLayout *actionsLayout_; 64 QWidget *actionsWidget_; 65 66 QLabel *textWarning_; 67 QWidget *warningWidget_; 68 69 }; 70 71 #endif // FILTERRULES_H 72