X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdialogs%2Fstoreprogress.cpp;h=0bcfbf2c75ca772510068b0309a4053e74fef5a3;hb=HEAD;hp=8699ccefdfbcca6fe2bae451f9c34072d0848717;hpb=c3c07a5f4bed7fea98ad07ca1cce34c9e5409f0b;p=pulseview.git diff --git a/pv/dialogs/storeprogress.cpp b/pv/dialogs/storeprogress.cpp index 8699ccef..0bcfbf2c 100644 --- a/pv/dialogs/storeprogress.cpp +++ b/pv/dialogs/storeprogress.cpp @@ -50,6 +50,7 @@ StoreProgress::StoreProgress(const QString &file_name, this, SLOT(on_progress_updated())); connect(&session_, SIGNAL(store_successful()), &session, SLOT(on_data_saved())); + connect(this, SIGNAL(canceled()), this, SLOT(on_cancel())); // Since we're not setting any progress in case of an error, the dialog // will pop up after the minimumDuration time has been reached - 4000 ms @@ -112,10 +113,17 @@ void StoreProgress::on_progress_updated() setMaximum(p.second); } else { const QString err = session_.error(); - if (!err.isEmpty() && !showing_error_) + if (err.isEmpty()) + close(); + else if (!showing_error_) show_error(); } } +void StoreProgress::on_cancel() +{ + session_.cancel(); +} + } // namespace dialogs } // namespace pv