Skip to content

Commit 814697c

Browse files
committed
Merge pull request #7000
773ae46 [Qt] add shortcurts for debug-/console-window (Jonas Schnelli)
2 parents b632145 + 773ae46 commit 814697c

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

src/qt/bitcoingui.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <QProgressBar>
4545
#include <QProgressDialog>
4646
#include <QSettings>
47+
#include <QShortcut>
4748
#include <QStackedWidget>
4849
#include <QStatusBar>
4950
#include <QStyle>
@@ -364,6 +365,9 @@ void BitcoinGUI::createActions()
364365
connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));
365366
}
366367
#endif // ENABLE_WALLET
368+
369+
new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this, SLOT(showDebugWindowActivateConsole()));
370+
new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this, SLOT(showDebugWindow()));
367371
}
368372

369373
void BitcoinGUI::createMenuBar()
@@ -597,6 +601,12 @@ void BitcoinGUI::showDebugWindow()
597601
rpcConsole->activateWindow();
598602
}
599603

604+
void BitcoinGUI::showDebugWindowActivateConsole()
605+
{
606+
rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE);
607+
showDebugWindow();
608+
}
609+
600610
void BitcoinGUI::showHelpMessageClicked()
601611
{
602612
helpMessageDialog->show();

src/qt/bitcoingui.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ private Q_SLOTS:
198198
void aboutClicked();
199199
/** Show debug window */
200200
void showDebugWindow();
201+
/** Show debug window and set focus to the console */
202+
void showDebugWindowActivateConsole();
201203
/** Show help message dialog */
202204
void showHelpMessageClicked();
203205
#ifndef Q_OS_MAC

src/qt/rpcconsole.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,3 +856,8 @@ void RPCConsole::showOrHideBanTableIfRequired()
856856
ui->banlistWidget->setVisible(visible);
857857
ui->banHeading->setVisible(visible);
858858
}
859+
860+
void RPCConsole::setTabFocus(enum TabTypes tabType)
861+
{
862+
ui->tabWidget->setCurrentIndex(tabType);
863+
}

src/qt/rpcconsole.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class RPCConsole: public QWidget
4444
CMD_ERROR
4545
};
4646

47+
enum TabTypes {
48+
TAB_INFO = 0,
49+
TAB_CONSOLE = 1,
50+
TAB_GRAPH = 2,
51+
TAB_PEERS = 3
52+
};
53+
4754
protected:
4855
virtual bool eventFilter(QObject* obj, QEvent *event);
4956
void keyPressEvent(QKeyEvent *);
@@ -91,6 +98,8 @@ public Q_SLOTS:
9198
void banSelectedNode(int bantime);
9299
/** Unban a selected node on the Bans tab */
93100
void unbanSelectedNode();
101+
/** set which tab has the focus (is visible) */
102+
void setTabFocus(enum TabTypes tabType);
94103

95104
Q_SIGNALS:
96105
// For RPC command executor

0 commit comments

Comments
 (0)