additional "apply" button in calkit dialog
This commit is contained in:
parent
2c8df0eb83
commit
069f68a5d0
@ -193,12 +193,12 @@ Calkit Calkit::fromFile(QString filename)
|
||||
return c;
|
||||
}
|
||||
|
||||
void Calkit::edit(std::function<void (void)> done)
|
||||
void Calkit::edit(std::function<void (void)> updateCal)
|
||||
{
|
||||
auto dialog = new CalkitDialog(*this);
|
||||
if(done) {
|
||||
QObject::connect(dialog, &QDialog::accepted, [=](){
|
||||
done();
|
||||
if(updateCal) {
|
||||
QObject::connect(dialog, &CalkitDialog::settingsChanged, [=](){
|
||||
updateCal();
|
||||
});
|
||||
}
|
||||
dialog->show();
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
void toFile(QString filename);
|
||||
static Calkit fromFile(QString filename);
|
||||
void edit(std::function<void(void)> done = nullptr);
|
||||
void edit(std::function<void(void)> updateCal = nullptr);
|
||||
bool hasSeparateMaleFemaleStandards();
|
||||
SOLT toSOLT(double frequency, bool male_standards = true);
|
||||
TRL toTRL(double frequency);
|
||||
|
@ -172,9 +172,15 @@ CalkitDialog::CalkitDialog(Calkit &c, QWidget *parent) :
|
||||
UpdateStatus();
|
||||
});
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, [this]() {
|
||||
parseEntries();
|
||||
editKit = ownKit;
|
||||
emit settingsChanged();
|
||||
});
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, [this]() {
|
||||
parseEntries();
|
||||
editKit = ownKit;
|
||||
emit settingsChanged();
|
||||
accept();
|
||||
});
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [this]() {
|
||||
|
@ -20,6 +20,8 @@ public:
|
||||
explicit CalkitDialog(Calkit &c, QWidget *parent = nullptr);
|
||||
~CalkitDialog();
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
private:
|
||||
void parseEntries();
|
||||
void updateEntries();
|
||||
|
@ -1310,7 +1310,7 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open|QDialogButtonBox::Save</set>
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Open|QDialogButtonBox::Save</set>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<bool>false</bool>
|
||||
@ -1456,13 +1456,13 @@
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="OpenType"/>
|
||||
<buttongroup name="ThroughType"/>
|
||||
<buttongroup name="LoadType"/>
|
||||
<buttongroup name="ShortType_f"/>
|
||||
<buttongroup name="TRL_Rtype"/>
|
||||
<buttongroup name="LoadType_f"/>
|
||||
<buttongroup name="OpenType_f"/>
|
||||
<buttongroup name="ShortType"/>
|
||||
<buttongroup name="ThroughType"/>
|
||||
<buttongroup name="OpenType"/>
|
||||
<buttongroup name="TRL_Rtype"/>
|
||||
<buttongroup name="ShortType_f"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -73,6 +73,8 @@ QVariant MeasurementModel::data(const QModelIndex &index, int role) const
|
||||
case ColIndex::Date:
|
||||
return info.timestamp.toString("dd.MM.yyyy hh:mm:ss");
|
||||
break;
|
||||
case ColIndex::Last:
|
||||
return "";
|
||||
}
|
||||
} else if(role == Qt::SizeHintRole) {
|
||||
switch((ColIndex) index.column()) {
|
||||
|
Loading…
Reference in New Issue
Block a user