diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-04-05 16:20:57 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-10-02 01:28:16 +0100 |
commit | 091747b46ecf06244ce2650028f1833b2e7c5062 (patch) | |
tree | 08b60d9bf0f5f3b83d820d29383028d36349e181 /src | |
parent | 4b51ed89cfce9870a20d75001fae3b68ac1dfd86 (diff) |
gui: Add shortcuts for tab tools
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/bitcoingui.cpp | 1 | ||||
-rw-r--r-- | src/qt/rpcconsole.cpp | 10 | ||||
-rw-r--r-- | src/qt/rpcconsole.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 7671fde705..5a801b7f4c 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -493,6 +493,7 @@ void BitcoinGUI::createMenuBar() window_menu->addSeparator(); for (RPCConsole::TabTypes tab_type : rpcConsole->tabs()) { QAction* tab_action = window_menu->addAction(rpcConsole->tabTitle(tab_type)); + tab_action->setShortcut(rpcConsole->tabShortcut(tab_type)); connect(tab_action, &QAction::triggered, [this, tab_type] { rpcConsole->setTabFocus(tab_type); showDebugWindow(); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index eccc34e12f..4f6629bfe1 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1276,6 +1276,16 @@ QString RPCConsole::tabTitle(TabTypes tab_type) const return ui->tabWidget->tabText(tab_type); } +QKeySequence RPCConsole::tabShortcut(TabTypes tab_type) const +{ + switch (tab_type) { + case TAB_INFO: return QKeySequence(Qt::CTRL + Qt::Key_I); + case TAB_CONSOLE: return QKeySequence(Qt::CTRL + Qt::Key_T); + case TAB_GRAPH: return QKeySequence(Qt::CTRL + Qt::Key_N); + case TAB_PEERS: return QKeySequence(Qt::CTRL + Qt::Key_P); + } +} + void RPCConsole::updateAlerts(const QString& warnings) { this->ui->label_alerts->setVisible(!warnings.isEmpty()); diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 3f7a74ba03..6b0f07baf1 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -68,6 +68,7 @@ public: std::vector<TabTypes> tabs() const { return {TAB_INFO, TAB_CONSOLE, TAB_GRAPH, TAB_PEERS}; } QString tabTitle(TabTypes tab_type) const; + QKeySequence tabShortcut(TabTypes tab_type) const; protected: virtual bool eventFilter(QObject* obj, QEvent *event); |