summaryrefslogtreecommitdiffstats
path: root/src/tagrulesdialog.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-13 11:20:40 +0200
committerDanilo M. <danix@danix.xyz>2026-08-13 11:20:40 +0200
commit88d19a61227150dc58f7e6915a4c401001545d7e (patch)
tree1a093f504f45c633cb6ea5a0c850245d6671f6b2 /src/tagrulesdialog.h
parentd8bb09415630c219271a01478393d43c1a2f28f0 (diff)
downloadqtmaildir-88d19a61227150dc58f7e6915a4c401001545d7e.tar.gz
qtmaildir-88d19a61227150dc58f7e6915a4c401001545d7e.zip
feat(rules): add the builder row widgets
Diffstat (limited to 'src/tagrulesdialog.h')
-rw-r--r--src/tagrulesdialog.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/tagrulesdialog.h b/src/tagrulesdialog.h
index 0350bd5..b60b095 100644
--- a/src/tagrulesdialog.h
+++ b/src/tagrulesdialog.h
@@ -20,16 +20,20 @@
#include <QDialog>
+#include "rulequery.h"
#include "tagrules.h"
class QCheckBox;
+class QComboBox;
class QLabel;
class QLineEdit;
class QPlainTextEdit;
class QPushButton;
+class QRadioButton;
class QSpinBox;
class QTreeWidget;
class QTreeWidgetItem;
+class QVBoxLayout;
/// Views and edits the shared auto-tagging rules.
///
@@ -76,6 +80,24 @@ private:
/// applyEditsToCurrentRule() so the two cannot render a rule differently.
void fillItem(QTreeWidgetItem *item, const TagRule &rule) const;
+ /// One builder row's widgets, so a row can be removed as a unit.
+ struct Row
+ {
+ QWidget *container = nullptr;
+ QComboBox *field = nullptr;
+ QComboBox *op = nullptr;
+ QLineEdit *value = nullptr;
+ };
+
+ Row *addRow(bool exclusion);
+ void removeRow(bool exclusion, int index);
+ void populateOperators(bool exclusion);
+ void updateExclusionsVisibility();
+ void syncQueryLine();
+
+ QList<Row> m_rows;
+ QList<Row> m_exclusionRows;
+
TagRules m_rules;
QList<TagRule> m_working; ///< Edited copy; written only on Save.
@@ -95,4 +117,13 @@ private:
QCheckBox *m_enabled = nullptr;
QLabel *m_warningLabel = nullptr;
QPushButton *m_saveButton = nullptr;
+
+ QRadioButton *m_matchAll = nullptr;
+ QRadioButton *m_matchAny = nullptr;
+ QCheckBox *m_textMode = nullptr;
+ QWidget *m_builder = nullptr;
+ QVBoxLayout *m_rowsLayout = nullptr;
+ QVBoxLayout *m_exclusionsLayout = nullptr;
+ QLabel *m_exclusionsHeader = nullptr;
+ QPushButton *m_addExclusion = nullptr;
};