From 64a4fc1fb07863f35289b2dc050d30ecc96aaac6 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 2 Oct 2022 02:04:05 -0400 Subject: Add shortcut settings for item actions. Implement check for ambiguous shortcuts. Make preference dialog wider by default. --- qdeduper/preferencedialog.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'qdeduper/preferencedialog.hpp') diff --git a/qdeduper/preferencedialog.hpp b/qdeduper/preferencedialog.hpp index 8efefde..78e78c5 100644 --- a/qdeduper/preferencedialog.hpp +++ b/qdeduper/preferencedialog.hpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -17,6 +18,20 @@ class QDialogButtonBox; class QTableView; class QStandardItemModel; +class ModifierEdit : public QPushButton +{ + Q_OBJECT +public: + ModifierEdit(QWidget *par = nullptr); + Qt::Modifier get_modifier(); + void set_modifier(Qt::Modifier mod); + bool event(QEvent *e) override; +protected: + void keyPressEvent(QKeyEvent *e) override; +private: + Qt::Modifier mod; +}; + class PreferenceDialog : public QDialog { Q_OBJECT @@ -27,9 +42,12 @@ public: void load_widget_status(); void save_widget_status(); +public Q_SLOTS: void open() override; void accept() override; private: + int verify_shortcuts(QKeySequence *bks); + SettingsRegistry *sr; QTabWidget *tw; std::vector tabs; @@ -38,6 +56,7 @@ private: QStandardItemModel *hkim = nullptr; std::map defmap; std::map actmap; + std::vector mes; }; class ShortcutEditorDelegate : public QStyledItemDelegate -- cgit v1.2.3