feat: complete settings view + signatures + signatures DAO + icons
- SettingsView: complete UI with tabs for Accounts, Categories, Rules, Templates, Signatures, General, Appearance - Categories: QTreeWidget with hierarchical view, color picker, parent categories - Rules: QListWidget with RuleEditorDialog integration, toggle enabled - Templates: QListWidget with TemplateEditorDialog integration - Signatures: QListWidget with SignatureEditorDialog integration - SignatureDao: full CRUD with default signature support - common_structs.h: QColor for Category, all structs centralized - icons.qrc: updated with Linear/Outline/Bold icons from resources - Category: QColor instead of QString for color - EmailTreeModel/DateGroupProxyModel: email grouping by date - MailListView: QTreeView with date grouping combo - ReaderView: subject frame with shadow, avatar in header, body inside header - MainWindow: frameless with rounded corners, 1px border, edge resize, no status bar - icons.qrc: complete icon set from resources/icons/SVG
This commit is contained in:
@@ -12,7 +12,12 @@
|
||||
#include <QRadioButton>
|
||||
#include <QButtonGroup>
|
||||
#include <QVariant>
|
||||
#include <QTreeWidget>
|
||||
#include <QLineEdit>
|
||||
#include <QDialog>
|
||||
#include <QColorDialog>
|
||||
#include "services/accountservice.h"
|
||||
#include "db/dao/common_structs.h"
|
||||
|
||||
class SettingsView : public QWidget {
|
||||
Q_OBJECT
|
||||
@@ -29,6 +34,26 @@ signals:
|
||||
void accountDeleteRequested(int accountId);
|
||||
void themeChanged(const QString &theme);
|
||||
void settingChanged(const QString &key, const QVariant &value);
|
||||
|
||||
// Categories
|
||||
void categoryAddRequested(const Category &cat);
|
||||
void categoryEditRequested(const Category &cat);
|
||||
void categoryDeleteRequested(qint64 categoryId);
|
||||
|
||||
// Rules
|
||||
void ruleAddRequested(const Rule &rule);
|
||||
void ruleEditRequested(const Rule &rule);
|
||||
void ruleDeleteRequested(qint64 ruleId);
|
||||
|
||||
// Templates
|
||||
void templateAddRequested(const Template &tmpl);
|
||||
void templateEditRequested(const Template &tmpl);
|
||||
void templateDeleteRequested(qint64 templateId);
|
||||
|
||||
// Signatures
|
||||
void signatureAddRequested(const Signature &sig);
|
||||
void signatureEditRequested(const Signature &sig);
|
||||
void signatureDeleteRequested(qint64 signatureId);
|
||||
|
||||
private slots:
|
||||
void onAccountListChanged();
|
||||
@@ -36,12 +61,58 @@ private slots:
|
||||
void onEditClicked();
|
||||
void onDeleteClicked();
|
||||
void onAccountSelectionChanged();
|
||||
|
||||
// Categories
|
||||
void onCategorySelectionChanged();
|
||||
void onCategoryAddClicked();
|
||||
void onCategoryEditClicked();
|
||||
void onCategoryDeleteClicked();
|
||||
|
||||
// Rules
|
||||
void onRuleSelectionChanged();
|
||||
void onRuleAddClicked();
|
||||
void onRuleEditClicked();
|
||||
void onRuleDeleteClicked();
|
||||
void onRuleToggleEnabled();
|
||||
|
||||
// Templates
|
||||
void onTemplateSelectionChanged();
|
||||
void onTemplateAddClicked();
|
||||
void onTemplateEditClicked();
|
||||
void onTemplateDeleteClicked();
|
||||
|
||||
// Signatures
|
||||
void onSignatureSelectionChanged();
|
||||
void onSignatureAddClicked();
|
||||
void onSignatureEditClicked();
|
||||
void onSignatureDeleteClicked();
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
QWidget* createAccountsTab();
|
||||
QWidget* createGeneralTab();
|
||||
QWidget* createAppearanceTab();
|
||||
QWidget* createCategoriesTab();
|
||||
QWidget* createRulesTab();
|
||||
QWidget* createTemplatesTab();
|
||||
QWidget* createSignaturesTab();
|
||||
|
||||
// Category helpers
|
||||
void loadCategories();
|
||||
void refreshCategoryTree();
|
||||
QTreeWidgetItem* createCategoryTreeItem(const Category &cat, QTreeWidgetItem *parent = nullptr);
|
||||
|
||||
// Rule helpers
|
||||
void loadRules();
|
||||
QString ruleToString(const Rule &rule) const;
|
||||
|
||||
// Template helpers
|
||||
void loadTemplates();
|
||||
QString templateToString(const Template &tmpl) const;
|
||||
|
||||
// Signature helpers
|
||||
void loadSignatures();
|
||||
QString signatureToString(const Signature &sig) const;
|
||||
|
||||
QTabWidget *m_tabWidget;
|
||||
QListWidget *m_accountList;
|
||||
@@ -53,4 +124,29 @@ private:
|
||||
|
||||
AccountService *m_accountService;
|
||||
int m_selectedAccountId;
|
||||
|
||||
// Categories
|
||||
QTreeWidget *m_categoryTree;
|
||||
QPushButton *m_categoryAddBtn;
|
||||
QPushButton *m_categoryEditBtn;
|
||||
QPushButton *m_categoryDeleteBtn;
|
||||
|
||||
// Rules
|
||||
QListWidget *m_ruleList;
|
||||
QPushButton *m_ruleAddBtn;
|
||||
QPushButton *m_ruleEditBtn;
|
||||
QPushButton *m_ruleDeleteBtn;
|
||||
QPushButton *m_ruleToggleBtn;
|
||||
|
||||
// Templates
|
||||
QListWidget *m_templateList;
|
||||
QPushButton *m_templateAddBtn;
|
||||
QPushButton *m_templateEditBtn;
|
||||
QPushButton *m_templateDeleteBtn;
|
||||
|
||||
// Signatures
|
||||
QListWidget *m_signatureList;
|
||||
QPushButton *m_signatureAddBtn;
|
||||
QPushButton *m_signatureEditBtn;
|
||||
QPushButton *m_signatureDeleteBtn;
|
||||
};
|
||||
Reference in New Issue
Block a user