| 99 | } |
| 100 | |
| 101 | void WaitingDialog::accept() |
| 102 | { |
| 103 | using namespace Qt; |
| 104 | movie->stop(); |
| 105 | timer->stop(); |
| 106 | QDialog::accept(); |
| 107 | |
| 108 | QFuture<void> future; |
| 109 | future = QtConcurrent::run([&]{ |
| 110 | _device_agent->set_config_bool(SR_CONF_ZERO_SET, true); |
| 111 | }); |
| 112 | |
| 113 | Qt::WindowFlags flags = Qt::CustomizeWindowHint; |
| 114 | QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAVE_CALIBRATION_RESULTS), "Save calibration results... It can take a while."), |
| 115 | L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); |
| 116 | dlg.setWindowModality(Qt::WindowModal); |
| 117 | dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | |
| 118 | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); |
| 119 | dlg.setCancelButton(NULL); |
| 120 | |
| 121 | QFutureWatcher<void> watcher; |
| 122 | connect(&watcher,SIGNAL(finished()),&dlg,SLOT(cancel())); |
| 123 | watcher.setFuture(future); |
| 124 | |
| 125 | dlg.exec(); |
| 126 | } |
| 127 | |
| 128 | void WaitingDialog::reject() |
| 129 | { |
nothing calls this directly
no test coverage detected