| 123 | } |
| 124 | |
| 125 | void 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); |
nothing calls this directly
no test coverage detected