qt: Allow to inspect RPCConsole tabs

This commit is contained in:
João Barbosa 2018-12-11 13:13:48 +00:00
parent 5f23460c7e
commit 9ea38d0222
2 changed files with 15 additions and 0 deletions

View file

@ -1275,7 +1275,17 @@ void RPCConsole::showOrHideBanTableIfRequired()
ui->banHeading->setVisible(visible); ui->banHeading->setVisible(visible);
} }
RPCConsole::TabTypes RPCConsole::tabFocus() const
{
return (TabTypes) ui->tabWidget->currentIndex();
}
void RPCConsole::setTabFocus(enum TabTypes tabType) void RPCConsole::setTabFocus(enum TabTypes tabType)
{ {
ui->tabWidget->setCurrentIndex(tabType); ui->tabWidget->setCurrentIndex(tabType);
} }
QString RPCConsole::tabTitle(TabTypes tab_type) const
{
return ui->tabWidget->tabText(tab_type);
}

View file

@ -65,6 +65,11 @@ public:
TAB_PEERS = 3 TAB_PEERS = 3
}; };
std::vector<TabTypes> tabs() const { return {TAB_INFO, TAB_CONSOLE, TAB_GRAPH, TAB_PEERS}; }
TabTypes tabFocus() const;
QString tabTitle(TabTypes tab_type) const;
protected: protected:
virtual bool eventFilter(QObject* obj, QEvent *event); virtual bool eventFilter(QObject* obj, QEvent *event);
void keyPressEvent(QKeyEvent *); void keyPressEvent(QKeyEvent *);