diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-29 23:53:42 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-29 23:53:42 -0400 |
commit | 637334ba36d44239d501f13310dc4aa61fc45216 (patch) | |
tree | c8fe46a098eac8e2618bb5c5e515cde44ab67c71 /qdeduper/preferencedialog.hpp | |
parent | 54b0bb3e4225a301188d8518bc6d26328a7a7aa2 (diff) | |
download | deduper-637334ba36d44239d501f13310dc4aa61fc45216.tar.xz |
Customizable shortcuts, maybe.
Diffstat (limited to 'qdeduper/preferencedialog.hpp')
-rw-r--r-- | qdeduper/preferencedialog.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qdeduper/preferencedialog.hpp b/qdeduper/preferencedialog.hpp index 06977fd..8efefde 100644 --- a/qdeduper/preferencedialog.hpp +++ b/qdeduper/preferencedialog.hpp @@ -2,15 +2,20 @@ #define PREFERENCEDIALOG_HPP #include <vector> +#include <map> +#include <string> #include <QDialog> #include <QGridLayout> +#include <QStyledItemDelegate> #include "settings.hpp" class QTabWidget; class QGridLayout; class QDialogButtonBox; +class QTableView; +class QStandardItemModel; class PreferenceDialog : public QDialog { @@ -18,8 +23,10 @@ class PreferenceDialog : public QDialog public: PreferenceDialog(SettingsRegistry *sr, QWidget *parent = nullptr); void setup_widgets(); + void set_hkactions(int tab, std::map<std::string, QKeySequence> defmap, std::map<std::string, QAction*> actmap); void load_widget_status(); void save_widget_status(); + void open() override; void accept() override; private: @@ -27,6 +34,19 @@ private: QTabWidget *tw; std::vector<QGridLayout*> tabs; QDialogButtonBox *bb; + QTableView *hktv = nullptr; + QStandardItemModel *hkim = nullptr; + std::map<std::string, QKeySequence> defmap; + std::map<std::string, QAction*> actmap; +}; + +class ShortcutEditorDelegate : public QStyledItemDelegate +{ + Q_OBJECT +public: + QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + void setEditorData(QWidget *editor, const QModelIndex &index) const override; + void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; }; #endif |