Skip to content

Commit

Permalink
Merge pull request #7000
Browse files Browse the repository at this point in the history
773ae46 [Qt] add shortcurts for debug-/console-window (Jonas Schnelli)
  • Loading branch information
jonasschnelli committed Nov 16, 2015
2 parents b632145 + 773ae46 commit 814697c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <QProgressBar>
#include <QProgressDialog>
#include <QSettings>
#include <QShortcut>
#include <QStackedWidget>
#include <QStatusBar>
#include <QStyle>
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -597,6 +601,12 @@ void BitcoinGUI::showDebugWindow()
rpcConsole->activateWindow();
}

void BitcoinGUI::showDebugWindowActivateConsole()
{
rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE);
showDebugWindow();
}

void BitcoinGUI::showHelpMessageClicked()
{
helpMessageDialog->show();
Expand Down
2 changes: 2 additions & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
9 changes: 9 additions & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ class RPCConsole: public QWidget
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 *);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 814697c

Please sign in to comment.