- ReaderView: complete rewrite with CSS styling, headers, attachments, zoom, find, dark mode, image blocking - Categories: DAO + UI tree widget with colors, nested categories, assignment - Rules engine: DAO + evaluation + actions (move, mark read, flag, delete, category, forward) - Templates: DAO + editor + manager with variables support - Signatures: DAO + manager + auto-per-account + manual selector in compose - ComposeView: signature combo, template selector, auto-signature on new email - MainWindow: frameless with rounded corners, 1px border, resize from edges, no status bar - Database: new tables (Category, MailCategory, Rule, Template, Signature) with indexes
44 lines
1004 B
C++
44 lines
1004 B
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QTreeWidget>
|
|
#include <QPushButton>
|
|
#include <QVBoxLayout>
|
|
#include <QHBoxLayout>
|
|
#include "db/dao/ruledao.h"
|
|
#include "ruleditordialog.h"
|
|
|
|
class RulesManagerDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit RulesManagerDialog(qint64 accountId = -1, QWidget *parent = nullptr);
|
|
|
|
signals:
|
|
void rulesChanged();
|
|
|
|
private slots:
|
|
void onNewRule();
|
|
void onEditRule(QTreeWidgetItem* item);
|
|
void onDeleteRule(QTreeWidgetItem* item);
|
|
void onToggleEnabled(QTreeWidgetItem* item);
|
|
void onRunRules();
|
|
void onImportExport(bool import);
|
|
void onRuleSaved(const Rule& rule);
|
|
void refresh();
|
|
|
|
private:
|
|
qint64 m_accountId;
|
|
QTreeWidget* m_tree;
|
|
QPushButton* m_btnNew;
|
|
QPushButton* m_btnRun;
|
|
QPushButton* m_btnImport;
|
|
QPushButton* m_btnExport;
|
|
QPushButton* m_btnClose;
|
|
|
|
void setupUI();
|
|
void loadRules();
|
|
void addRuleToTree(const Rule& rule);
|
|
Rule itemToRule(QTreeWidgetItem* item) const;
|
|
}; |