| 126 | } |
| 127 | |
| 128 | void WaitingDialog::reject() |
| 129 | { |
| 130 | using namespace Qt; |
| 131 | |
| 132 | movie->stop(); |
| 133 | timer->stop(); |
| 134 | QDialog::reject(); |
| 135 | |
| 136 | QFuture<void> future; |
| 137 | future = QtConcurrent::run([&]{ |
| 138 | _device_agent->set_config_bool(_key, false); |
| 139 | _device_agent->set_config_bool(SR_CONF_ZERO_LOAD, true); |
| 140 | }); |
| 141 | |
| 142 | Qt::WindowFlags flags = Qt::CustomizeWindowHint; |
| 143 | QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_LOAD_CURRENT_SETTING), "Load current setting... It can take a while."), |
| 144 | L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); |
| 145 | dlg.setWindowModality(Qt::WindowModal); |
| 146 | dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | |
| 147 | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); |
| 148 | dlg.setCancelButton(NULL); |
| 149 | |
| 150 | QFutureWatcher<void> watcher; |
| 151 | connect(&watcher,SIGNAL(finished()),&dlg,SLOT(cancel())); |
| 152 | watcher.setFuture(future); |
| 153 | |
| 154 | dlg.exec(); |
| 155 | } |
| 156 | |
| 157 | void WaitingDialog::stop() |
| 158 | { |
nothing calls this directly
no test coverage detected