aboutsummaryrefslogtreecommitdiff
path: root/qdeduper/preferencedialog.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'qdeduper/preferencedialog.hpp')
-rw-r--r--qdeduper/preferencedialog.hpp20
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