aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2015-11-16 08:39:04 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2015-11-16 08:39:42 +0100
commit814697c5569c760c8bdb426ea8ffb6bd74686cfa (patch)
treec5c054bf89c781e8e3801826d293c206ff8251bf /src
parentb632145edeb376b4d1597f192ca00634f7d2866c (diff)
parent773ae4654ecc9272b32b6a7480b16fc30a5269f3 (diff)
Merge pull request #7000
773ae46 [Qt] add shortcurts for debug-/console-window (Jonas Schnelli)
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoingui.cpp10
-rw-r--r--src/qt/bitcoingui.h2
-rw-r--r--src/qt/rpcconsole.cpp5
-rw-r--r--src/qt/rpcconsole.h9
4 files changed, 26 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index d930d15953..6f9f6e90d6 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -44,6 +44,7 @@
#include <QProgressBar>
#include <QProgressDialog>
#include <QSettings>
+#include <QShortcut>
#include <QStackedWidget>
#include <QStatusBar>
#include <QStyle>
@@ -364,6 +365,9 @@ void BitcoinGUI::createActions()
connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));
}
#endif // ENABLE_WALLET
+
+ new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this, SLOT(showDebugWindowActivateConsole()));
+ new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this, SLOT(showDebugWindow()));
}
void BitcoinGUI::createMenuBar()
@@ -597,6 +601,12 @@ void BitcoinGUI::showDebugWindow()
rpcConsole->activateWindow();
}
+void BitcoinGUI::showDebugWindowActivateConsole()
+{
+ rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE);
+ showDebugWindow();
+}
+
void BitcoinGUI::showHelpMessageClicked()
{
helpMessageDialog->show();
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 717f2bd12d..2b98dabc56 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -198,6 +198,8 @@ private Q_SLOTS:
void aboutClicked();
/** Show debug window */
void showDebugWindow();
+ /** Show debug window and set focus to the console */
+ void showDebugWindowActivateConsole();
/** Show help message dialog */
void showHelpMessageClicked();
#ifndef Q_OS_MAC
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 8401701821..4554281e0f 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -856,3 +856,8 @@ void RPCConsole::showOrHideBanTableIfRequired()
ui->banlistWidget->setVisible(visible);
ui->banHeading->setVisible(visible);
}
+
+void RPCConsole::setTabFocus(enum TabTypes tabType)
+{
+ ui->tabWidget->setCurrentIndex(tabType);
+}
diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h
index d5932ff149..0914612c3e 100644
--- a/src/qt/rpcconsole.h
+++ b/src/qt/rpcconsole.h
@@ -44,6 +44,13 @@ public:
CMD_ERROR
};
+ enum TabTypes {
+ TAB_INFO = 0,
+ TAB_CONSOLE = 1,
+ TAB_GRAPH = 2,
+ TAB_PEERS = 3
+ };
+
protected:
virtual bool eventFilter(QObject* obj, QEvent *event);
void keyPressEvent(QKeyEvent *);
@@ -91,6 +98,8 @@ public Q_SLOTS:
void banSelectedNode(int bantime);
/** Unban a selected node on the Bans tab */
void unbanSelectedNode();
+ /** set which tab has the focus (is visible) */
+ void setTabFocus(enum TabTypes tabType);
Q_SIGNALS:
// For RPC command executor