File indexing completed on 2024-06-23 04:25:45

0001 /*
0002  *  SPDX-FileCopyrightText: 2016 Michael Abrahams <miabraha@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #include <QHBoxLayout>
0008 #include <QString>
0009 #include <QHash>
0010 
0011 class KisShortcutsDialog;
0012 class QPushButton;
0013 class QComboBox;
0014 
0015 class KisKShortcutSchemesEditor: public QHBoxLayout
0016 {
0017     Q_OBJECT
0018 public:
0019     KisKShortcutSchemesEditor(KisShortcutsDialog *parent);
0020 
0021     /** @return the currently selected scheme in the editor (may differ from current app's scheme.*/
0022     QString currentScheme();
0023 
0024 private Q_SLOTS:
0025     void newScheme();
0026     void deleteScheme();
0027     void importShortcutsScheme();
0028     void exportShortcutsScheme();
0029     void loadCustomShortcuts();
0030     void saveCustomShortcuts();
0031     // void saveAsDefaultsForScheme();  //Not implemented
0032 
0033 Q_SIGNALS:
0034     void shortcutsSchemeChanged(const QString &);
0035 
0036 protected:
0037     void updateDeleteButton();
0038 
0039 private:
0040     QPushButton *m_newScheme {nullptr};
0041     QPushButton *m_deleteScheme {nullptr};
0042     QPushButton *m_exportScheme {nullptr};
0043     QComboBox *m_schemesList {nullptr};
0044 
0045     KisShortcutsDialog *m_dialog {nullptr};
0046     QHash<QString, QString> m_schemeFileLocations;
0047 };
0048