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

Method on_update_clicked

qrenderdoc/Windows/Dialogs/UpdateDialog.cpp:125–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void UpdateDialog::on_update_clicked()
126{
127 QMessageBox::StandardButton res =
128 RDDialog::question(this, tr("RenderDoc Update"),
129 tr("This will close RenderDoc immediately - if you have any "
130 "unsaved work, save it first!\n"
131 "Continue?"),
132 QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
133
134 if(res == QMessageBox::Yes)
135 {
136 QString runningPrograms;
137 int running = 0;
138
139 uint32_t nextIdent = 0;
140
141 QString localhost = lit("localhost");
142
143 for(;;)
144 {
145 // just a sanity check to make sure we don't hit some unexpected case and infinite loop
146 uint32_t prevIdent = nextIdent;
147
148 nextIdent = RENDERDOC_EnumerateRemoteTargets("localhost", nextIdent);
149
150 if(nextIdent == 0 || prevIdent >= nextIdent)
151 break;
152
153 running++;
154
155 ITargetControl *conn = RENDERDOC_CreateTargetControl("localhost", nextIdent, "updater", false);
156
157 if(conn)
158 {
159 if(!runningPrograms.isEmpty())
160 runningPrograms += lit("\n");
161
162 runningPrograms += tr("%1 running %2").arg(conn->GetTarget()).arg(conn->GetAPI());
163
164 conn->Shutdown();
165 }
166 }
167
168 if(running > 0)
169 {
170 RDDialog::critical(
171 this, tr("RenderDoc in use"),
172 tr("RenderDoc is currently capturing, cannot update until the program%1 closed:\n\n")
173 .arg(running > 1 ? lit("s are") : lit(" is")) +
174 runningPrograms);
175 return;
176 }
177
178 ui->metadataFrame->setVisible(false);
179 ui->progressBar->setVisible(true);
180 ui->progressText->setVisible(true);
181
182 ui->progressBar->setMaximum(10000);

Callers

nothing calls this directly

Calls 15

questionFunction · 0.85
criticalFunction · 0.85
QNetworkRequestClass · 0.85
connectFunction · 0.85
UpdateTransferProgressFunction · 0.85
RunProcessAsAdminFunction · 0.85
GetTargetMethod · 0.80
GetAPIMethod · 0.80
setMaximumMethod · 0.80
errorStringMethod · 0.80

Tested by

no test coverage detected