| 302 | } |
| 303 | |
| 304 | void Calibration::on_abort() |
| 305 | { |
| 306 | this->hide(); |
| 307 | QFuture<void> future; |
| 308 | |
| 309 | future = QtConcurrent::run([&]{ |
| 310 | _device_agent->set_config_bool(SR_CONF_ZERO_LOAD, true); |
| 311 | reload_value(); |
| 312 | }); |
| 313 | |
| 314 | Qt::WindowFlags flags = Qt::CustomizeWindowHint; |
| 315 | QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_RELOAD_CALIBRATION_RESULTS), |
| 316 | "Reload last calibration results... It can take a while."), |
| 317 | L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); |
| 318 | dlg.setWindowModality(Qt::WindowModal); |
| 319 | dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | |
| 320 | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); |
| 321 | dlg.setCancelButton(NULL); |
| 322 | |
| 323 | QFutureWatcher<void> watcher; |
| 324 | connect(&watcher,SIGNAL(finished()),&dlg,SLOT(cancel())); |
| 325 | watcher.setFuture(future); |
| 326 | |
| 327 | dlg.exec(); |
| 328 | this->show(); |
| 329 | } |
| 330 | |
| 331 | void Calibration::reload_value() |
| 332 | { |
nothing calls this directly
no test coverage detected