MCPcopy Create free account
hub / github.com/baldurk/renderdoc / setRemoteHost

Method setRemoteHost

qrenderdoc/Windows/MainWindow.cpp:1994–2201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1992}
1993
1994void MainWindow::setRemoteHost(int hostIdx)
1995{
1996 if(!PromptCloseCapture())
1997 return;
1998
1999 // we only want to block once before the initial remoteProbe has happened. After that once we can
2000 // acquire once, we re-release so the next one can happen
2001 m_RemoteInitialProbeReady.acquire();
2002 m_RemoteInitialProbeReady.release();
2003
2004 rdcarray<RemoteHost> hosts = m_Ctx.Config().GetRemoteHosts();
2005
2006 RemoteHost host;
2007 if(hostIdx >= 0 && hostIdx < hosts.count())
2008 host = hosts[hostIdx];
2009
2010 bool noToAll = false;
2011
2012 QList<LiveCapture *> liveCaptures = m_LiveCaptures;
2013
2014 int unsavedCaps = 0;
2015 for(LiveCapture *live : liveCaptures)
2016 unsavedCaps += live->unsavedCaptureCount();
2017
2018 for(LiveCapture *live : liveCaptures)
2019 {
2020 // allow live captures to this host to stay open, that way
2021 // we can connect to a live capture, then switch into that
2022 // context
2023 if(host.IsValid() && live->hostname() == host.Hostname())
2024 continue;
2025
2026 // if the user previously selected 'no to all' in the save prompts below, apply that to all
2027 // subsequent live captures by skipping the check and unconditionally cleaning all captures
2028 if(!noToAll)
2029 {
2030 if(!live->checkAllowClose(unsavedCaps, noToAll))
2031 return;
2032 }
2033
2034 live->cleanItems();
2035 live->close();
2036 }
2037
2038 m_Ctx.Replay().DisconnectFromRemoteServer();
2039
2040 if(!host.IsValid())
2041 {
2042 contextChooser->setIcon(Icons::house());
2043 contextChooser->setText(tr("Replay Context: %1").arg(tr("Local")));
2044
2045 ui->action_Inject_into_Process->setEnabled(true);
2046
2047 statusText->setText(QString());
2048
2049 SetTitle();
2050
2051 if(m_Ctx.HasCaptureDialog())

Callers 2

ConnectToRemoteServerMethod · 0.80
SetRemoteHostMethod · 0.80

Calls 15

connectFunction · 0.85
disconnectFunction · 0.85
criticalFunction · 0.85
questionFunction · 0.85
ShowProgressDialogFunction · 0.85
unsavedCaptureCountMethod · 0.80
cleanItemsMethod · 0.80
UpdateRemoteHostMethod · 0.80
NameMethod · 0.80
IsSupportedMethod · 0.80
GetProtocolNameMethod · 0.80

Tested by

no test coverage detected