Skip to content

Commit

Permalink
qt: Allow to inspect RPCConsole tabs
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#14573
Rebased-From: 9ea38d0
  • Loading branch information
promag authored and luke-jr committed Dec 21, 2018
1 parent 8a9ffec commit a484918
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,17 @@ void RPCConsole::showOrHideBanTableIfRequired()
ui->banHeading->setVisible(visible);
}

RPCConsole::TabTypes RPCConsole::tabFocus() const
{
return (TabTypes) ui->tabWidget->currentIndex();
}

void RPCConsole::setTabFocus(enum TabTypes tabType)
{
ui->tabWidget->setCurrentIndex(tabType);
}

QString RPCConsole::tabTitle(TabTypes tab_type) const
{
return ui->tabWidget->tabText(tab_type);
}
5 changes: 5 additions & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class RPCConsole: public QWidget
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:
virtual bool eventFilter(QObject* obj, QEvent *event);
void keyPressEvent(QKeyEvent *);
Expand Down

0 comments on commit a484918

Please sign in to comment.