Commit 778cfc08 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

unique ptr trigSave,..

parent 253631c1
Pipeline #15304 failed with stage
in 6 minutes and 9 seconds
......@@ -17,7 +17,7 @@
#include "core/io/export.h"
#include "gui/dialogs/file_dialog.h"
#include "gui/mainwin.h"
//#include <QCR/base/debug.h>
#include <QCR/base/debug.h>
#include <QGroupBox>
namespace {
......@@ -121,8 +121,11 @@ DialogSave::DialogSave(const QString& _name, const QString& _title, const QStrin
ftypeGrid->addWidget(rb);
}
auto* cancelBtn = new QcrTextTriggerButton{&trigCancel_};
auto* saveBtn = new QcrTextTriggerButton{&trigSave_};
trigSave_.reset(new QcrTrigger{"save", "Save"});
trigCancel_.reset(new QcrTrigger{"cancel", "Cancel"});
auto* saveBtn = new QcrTextTriggerButton{trigSave_.get()};
auto* cancelBtn = new QcrTextTriggerButton{trigCancel_.get()};
auto updateSaveable = [this, actSave = saveBtn->trigger()](const QString) {
actSave->setEnabled(!pathField_->stem().isEmpty());
......@@ -157,12 +160,15 @@ DialogSave::DialogSave(const QString& _name, const QString& _title, const QStrin
//! To be called after intantiation of child class
void DialogSave::initDialogSave()
{
trigCancel_.setTriggerHook([this]() { close(); });
trigSave_.setTriggerHook([this]() {
progressBar_.show();
save();
close();
});
trigCancel_->setTriggerHook([this]() { close(); });
trigSave_->setTriggerHook([this]() {
qDebug() << "TS-> 0";
progressBar_.show();
save();
qDebug() << "TS-> saved";
close();
qDebug() << "TS-> closed";
});
}
void DialogSave::saveCurrent()
......
......@@ -50,8 +50,8 @@ class DialogSave : public QcrModalDialog {
std::map<QString, QcrRadioButton*> fmt2button_;
private:
QcrTrigger trigSave_{"save", "Save"};
QcrTrigger trigCancel_{"cancel", "Cancel"};
std::unique_ptr<QcrTrigger> trigSave_;
std::unique_ptr<QcrTrigger> trigCancel_;
QString saveFmt_{"dat"}; //!< setting: default format for data export
};
......
......@@ -14,7 +14,6 @@
#include "gui/export/bigtable.h"
#include "core/io/export.h"
#include <QCR/base/debug.h>
ExportBigtable::ExportBigtable(
const QStringList& headers, const std::vector<std::vector<QVariant>>& data)
......@@ -22,14 +21,10 @@ ExportBigtable::ExportBigtable(
, headers_{headers}
, data_{data}
{
qDebug() << "DEBUG 0";
initDialogSave();
qDebug() << "DEBUG 1";
}
void ExportBigtable::writeCurrent(QTextStream& stream)
{
qDebug() << "DEBUG 2";
data_export::writeBigtable(stream, data_export::separator(format()), headers_, data_);
qDebug() << "DEBUG 3";
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment