Add --replayhost command line option for qrenderdoc

This allows users to specify which remote host to connect to on startup.
This commit is contained in:
Haiyu Zhen
2019-02-07 23:46:33 +00:00
committed by Baldur Karlsson
parent 4699b459e5
commit ca54a910f5
6 changed files with 52 additions and 16 deletions
+15 -13
View File
@@ -1772,21 +1772,9 @@ void MainWindow::FillRemotesMenu(QMenu *menu, bool includeLocalhost)
}
}
void MainWindow::switchContext()
void MainWindow::setRemoteHost(int hostIdx)
{
QAction *item = qobject_cast<QAction *>(QObject::sender());
if(!item)
return;
bool ok = false;
int hostIdx = item->data().toInt(&ok);
if(!ok)
return;
RemoteHost *host = NULL;
if(hostIdx >= 0 && hostIdx < m_Ctx.Config().RemoteHosts.count())
{
host = m_Ctx.Config().RemoteHosts[hostIdx];
@@ -1933,6 +1921,20 @@ void MainWindow::switchContext()
}
}
void MainWindow::switchContext()
{
QAction *item = qobject_cast<QAction *>(QObject::sender());
if(!item)
return;
bool ok = false;
int hostIdx = item->data().toInt(&ok);
if(ok)
setRemoteHost(hostIdx);
}
void MainWindow::contextChooser_menuShowing()
{
FillRemotesMenu(contextChooserMenu, true);