Delete measurement.
--HG-- branch : feature
This commit is contained in:
parent
b79807a8ef
commit
a74bfd9c42
|
@ -355,6 +355,24 @@ void TMainWindow::ReadOnly(bool ro)
|
|||
ui->groupBoxDetails->setDisabled(ro);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TMainWindow::Remove()
|
||||
{
|
||||
const int row = ui->tableWidget->currentRow();
|
||||
|
||||
if (row == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QTableWidgetItem *nameField = ui->tableWidget->item(ui->tableWidget->currentRow(), 0);
|
||||
m->Remove(nameField->text());
|
||||
|
||||
MeasurementsWasSaved(false);
|
||||
|
||||
RefreshData();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TMainWindow::AddCustom()
|
||||
{
|
||||
|
@ -655,6 +673,8 @@ void TMainWindow::InitWindow()
|
|||
ui->actionReadOnly->setEnabled(true);
|
||||
ui->actionSaveAs->setEnabled(true);
|
||||
|
||||
connect(ui->toolButtonRemove, &QToolButton::clicked, this, &TMainWindow::Remove);
|
||||
|
||||
InitTable();
|
||||
}
|
||||
|
||||
|
|
|
@ -70,6 +70,7 @@ private slots:
|
|||
void SaveBirthDate(const QDate & date);
|
||||
void SaveNotes();
|
||||
void ReadOnly(bool ro);
|
||||
void Remove();
|
||||
|
||||
void AddCustom();
|
||||
void AddKnown();
|
||||
|
|
|
@ -120,6 +120,13 @@ void VMeasurements::AddEmptyAfter(const QString &after, const QString &name)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMeasurements::Remove(const QString &name)
|
||||
{
|
||||
const QDomNodeList list = elementsByTagName(TagBodyMeasurements);
|
||||
list.at(0).removeChild(FindM(name));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MeasurementsType VMeasurements::Type() const
|
||||
{
|
||||
|
|
|
@ -45,6 +45,7 @@ public:
|
|||
|
||||
void AddEmpty(const QString &name);
|
||||
void AddEmptyAfter(const QString &after, const QString &name);
|
||||
void Remove(const QString &name);
|
||||
|
||||
MeasurementsType Type() const;
|
||||
Unit MUnit() const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user