Skip to content

Commit

Permalink
Merge 5cb1d93 into merged_master (Bitcoin PR #15756)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Nov 9, 2020
2 parents 819ef42 + 5cb1d93 commit 581f592
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 10 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class RPCConsole: public QWidget
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);
Expand Down

0 comments on commit 581f592

Please sign in to comment.