const Session &session, QWidget *parent) :
QProgressDialog(tr("Saving..."), tr("Cancel"), 0, 0, parent),
session_(file_name.toStdString(), output_format, options, sample_range,
- session)
+ session),
+ showing_error_(false)
{
connect(&session_, SIGNAL(progress_updated()),
this, SLOT(on_progress_updated()));
void StoreProgress::show_error()
{
+ showing_error_ = true;
+
qDebug() << "Error trying to save:" << session_.error();
QMessageBox msg(parentWidget());
setMaximum(p.second);
} else {
const QString err = session_.error();
- if (!err.isEmpty())
+ if (!err.isEmpty() && !showing_error_)
show_error();
- close();
}
}
#ifndef PULSEVIEW_PV_DIALOGS_STOREPROGRESS_HPP
#define PULSEVIEW_PV_DIALOGS_STOREPROGRESS_HPP
+#include <atomic>
#include <memory>
#include <set>
#include <pv/storesession.hpp>
+using std::atomic;
using std::map;
using std::pair;
using std::shared_ptr;
private:
pv::StoreSession session_;
+ atomic<bool> showing_error_;
};
} // namespace dialogs