[Qt] add shortcurts for debug-/console-window

This commit is contained in:
Jonas Schnelli 2015-11-12 12:59:26 +01:00
parent 5fcc14ee05
commit 773ae4654e
No known key found for this signature in database
GPG key ID: 29D4BCB6416F53EC
4 changed files with 26 additions and 0 deletions

View file

@ -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();

View file

@ -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

View file

@ -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);
}

View file

@ -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