mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Distinguish between friendly and real hostnames for remote hosts
* This means we don't pass a friendly hostname internally to connect to, and we don't display a hostname where we want a friendly hostname.
This commit is contained in:
@@ -70,7 +70,7 @@ CaptureContext::CaptureContext(QString paramFilename, QString remoteHost, uint32
|
||||
if(remoteIdent != 0)
|
||||
{
|
||||
m_MainWindow->ShowLiveCapture(
|
||||
new LiveCapture(*this, remoteHost, remoteIdent, m_MainWindow, m_MainWindow));
|
||||
new LiveCapture(*this, remoteHost, remoteHost, remoteIdent, m_MainWindow, m_MainWindow));
|
||||
}
|
||||
|
||||
if(!paramFilename.isEmpty())
|
||||
|
||||
@@ -78,12 +78,13 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
LiveCapture::LiveCapture(ICaptureContext &ctx, const QString &hostname, uint32_t ident,
|
||||
MainWindow *main, QWidget *parent)
|
||||
LiveCapture::LiveCapture(ICaptureContext &ctx, const QString &hostname, const QString &friendlyname,
|
||||
uint32_t ident, MainWindow *main, QWidget *parent)
|
||||
: QFrame(parent),
|
||||
ui(new Ui::LiveCapture),
|
||||
m_Ctx(ctx),
|
||||
m_Hostname(hostname),
|
||||
m_HostFriendlyname(friendlyname),
|
||||
m_RemoteIdent(ident),
|
||||
m_Main(main)
|
||||
{
|
||||
@@ -255,7 +256,8 @@ void LiveCapture::on_childProcesses_itemActivated(QListWidgetItem *item)
|
||||
uint32_t ident = sel[0]->data(IdentRole).toUInt();
|
||||
if(ident > 0)
|
||||
{
|
||||
LiveCapture *live = new LiveCapture(m_Ctx, m_Hostname, ident, m_Main, m_Main);
|
||||
LiveCapture *live =
|
||||
new LiveCapture(m_Ctx, m_Hostname, m_HostFriendlyname, ident, m_Main, m_Main);
|
||||
m_Main->ShowLiveCapture(live);
|
||||
}
|
||||
}
|
||||
@@ -492,7 +494,8 @@ void LiveCapture::killThread()
|
||||
|
||||
void LiveCapture::setTitle(const QString &title)
|
||||
{
|
||||
setWindowTitle((!m_Hostname.isEmpty() ? (m_Hostname + lit(" - ")) : QString()) + title);
|
||||
setWindowTitle((!m_HostFriendlyname.isEmpty() ? (m_HostFriendlyname + lit(" - ")) : QString()) +
|
||||
title);
|
||||
}
|
||||
|
||||
LiveCapture::CaptureLog *LiveCapture::GetLog(QListWidgetItem *item)
|
||||
@@ -622,7 +625,7 @@ bool LiveCapture::checkAllowClose()
|
||||
this, tr("No active replay context"),
|
||||
tr("This capture is on remote host %1 and there is no active replay context on that "
|
||||
"host.\n")
|
||||
.arg(m_Hostname) +
|
||||
.arg(m_HostFriendlyname) +
|
||||
tr("Without an active replay context the capture cannot be %1.\n\n")
|
||||
.arg(tr(res == QMessageBox::Yes ? "saved" : "deleted")) +
|
||||
tr("Would you like to continue and discard this capture and any others, to be left "
|
||||
@@ -967,7 +970,8 @@ void LiveCapture::connectionClosed()
|
||||
// only one capture
|
||||
if(ui->captures->count() == 0 && m_Children.count() == 1)
|
||||
{
|
||||
LiveCapture *live = new LiveCapture(m_Ctx, m_Hostname, m_Children[0].ident, m_Main);
|
||||
LiveCapture *live =
|
||||
new LiveCapture(m_Ctx, m_Hostname, m_HostFriendlyname, m_Children[0].ident, m_Main);
|
||||
m_Main->ShowLiveCapture(live);
|
||||
ToolWindowManager::closeToolWindow(this);
|
||||
return;
|
||||
|
||||
@@ -49,8 +49,8 @@ class LiveCapture : public QFrame
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LiveCapture(ICaptureContext &ctx, const QString &host, uint32_t ident, MainWindow *main,
|
||||
QWidget *parent = 0);
|
||||
explicit LiveCapture(ICaptureContext &ctx, const QString &hostname, const QString &friendlyname,
|
||||
uint32_t ident, MainWindow *main, QWidget *parent = 0);
|
||||
|
||||
~LiveCapture();
|
||||
|
||||
@@ -136,6 +136,7 @@ private:
|
||||
Ui::LiveCapture *ui;
|
||||
ICaptureContext &m_Ctx;
|
||||
QString m_Hostname;
|
||||
QString m_HostFriendlyname;
|
||||
uint32_t m_RemoteIdent;
|
||||
MainWindow *m_Main;
|
||||
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
struct RemoteConnect
|
||||
{
|
||||
RemoteConnect() {}
|
||||
RemoteConnect(const QString &h, uint32_t i) : host(h), ident(i) {}
|
||||
RemoteConnect(const QString &h, const QString &f, uint32_t i) : host(h), friendly(f), ident(i) {}
|
||||
QString host;
|
||||
QString friendly;
|
||||
uint32_t ident = 0;
|
||||
};
|
||||
|
||||
@@ -216,8 +217,6 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node)
|
||||
// this function looks up the remote connections and for each one open
|
||||
// queries it for the API, target (usually executable name) and if any user is already connected
|
||||
LambdaThread *th = new LambdaThread([this, node, host]() {
|
||||
QString hostname = node->text(0);
|
||||
|
||||
QByteArray username = GetSystemUsername().toUtf8();
|
||||
|
||||
host->CheckStatus();
|
||||
@@ -225,7 +224,7 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node)
|
||||
GUIInvoke::call(
|
||||
[this, node, host]() { setRemoteServerLive(node, host->ServerRunning, host->Busy); });
|
||||
|
||||
QByteArray hostnameBytes = hostname.toUtf8();
|
||||
QByteArray hostnameBytes = host->Hostname.toUtf8();
|
||||
|
||||
uint32_t nextIdent = 0;
|
||||
|
||||
@@ -255,7 +254,7 @@ void RemoteManager::refreshHost(RDTreeWidgetItem *node)
|
||||
else
|
||||
running = tr("Running %1").arg(api);
|
||||
|
||||
RemoteConnect tag(hostname, nextIdent);
|
||||
RemoteConnect tag(host->Hostname, host->Name(), nextIdent);
|
||||
|
||||
GUIInvoke::call([this, node, target, running, tag]() {
|
||||
RDTreeWidgetItem *child = new RDTreeWidgetItem({target, running});
|
||||
@@ -311,7 +310,8 @@ void RemoteManager::connectToApp(RDTreeWidgetItem *node)
|
||||
|
||||
if(connect.ident > 0)
|
||||
{
|
||||
LiveCapture *live = new LiveCapture(m_Ctx, connect.host, connect.ident, m_Main, m_Main);
|
||||
LiveCapture *live =
|
||||
new LiveCapture(m_Ctx, connect.host, connect.friendly, connect.ident, m_Main, m_Main);
|
||||
m_Main->ShowLiveCapture(live);
|
||||
accept();
|
||||
}
|
||||
|
||||
@@ -316,7 +316,8 @@ void MainWindow::OnCaptureTrigger(const QString &exe, const QString &workingDir,
|
||||
LiveCapture *live = new LiveCapture(
|
||||
m_Ctx,
|
||||
m_Ctx.Replay().CurrentRemote() ? m_Ctx.Replay().CurrentRemote()->Hostname : QString(),
|
||||
ret, this, this);
|
||||
m_Ctx.Replay().CurrentRemote() ? m_Ctx.Replay().CurrentRemote()->Name() : QString(), ret,
|
||||
this, this);
|
||||
ShowLiveCapture(live);
|
||||
callback(live);
|
||||
});
|
||||
@@ -357,7 +358,7 @@ void MainWindow::OnInjectTrigger(uint32_t PID, const QList<EnvironmentModificati
|
||||
return;
|
||||
}
|
||||
|
||||
LiveCapture *live = new LiveCapture(m_Ctx, QString(), ret, this, this);
|
||||
LiveCapture *live = new LiveCapture(m_Ctx, QString(), QString(), ret, this, this);
|
||||
ShowLiveCapture(live);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user