aboutsummaryrefslogtreecommitdiff
path: root/src/qt/rpcconsole.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-10-11 01:50:49 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-10-15 13:46:34 +0100
commit8019b6b150ff7444195a238470414c9deec5bf74 (patch)
tree77654e46ea0477a01e0a077479e0c62d3ff5a897 /src/qt/rpcconsole.cpp
parent08ed87e8875d72a1d8b157b67bbd431253d7db24 (diff)
downloadbitcoin-8019b6b150ff7444195a238470414c9deec5bf74.tar.xz
gui: Make RPCConsole::TabTypes an enum class
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r--src/qt/rpcconsole.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 4f6629bfe1..3dd64c5273 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -1268,22 +1268,24 @@ void RPCConsole::showOrHideBanTableIfRequired()
void RPCConsole::setTabFocus(enum TabTypes tabType)
{
- ui->tabWidget->setCurrentIndex(tabType);
+ ui->tabWidget->setCurrentIndex(int(tabType));
}
QString RPCConsole::tabTitle(TabTypes tab_type) const
{
- return ui->tabWidget->tabText(tab_type);
+ return ui->tabWidget->tabText(int(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);
- }
+ case TabTypes::INFO: return QKeySequence(Qt::CTRL + Qt::Key_I);
+ case TabTypes::CONSOLE: return QKeySequence(Qt::CTRL + Qt::Key_T);
+ case TabTypes::GRAPH: return QKeySequence(Qt::CTRL + Qt::Key_N);
+ case TabTypes::PEERS: return QKeySequence(Qt::CTRL + Qt::Key_P);
+ } // no default case, so the compiler can warn about missing cases
+
+ assert(false);
}
void RPCConsole::updateAlerts(const QString& warnings)