diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp
index a8a412721..aab081c7b 100644
--- a/src/app/tape/tmainwindow.cpp
+++ b/src/app/tape/tmainwindow.cpp
@@ -731,6 +731,24 @@ void TMainWindow::Remove()
}
}
+//---------------------------------------------------------------------------------------------------------------------
+void TMainWindow::MoveTop()
+{
+ const int row = ui->tableWidget->currentRow();
+
+ if (row == -1)
+ {
+ return;
+ }
+
+ const QTableWidgetItem *nameField = ui->tableWidget->item(row, ColumnName);
+ m->MoveTop(nameField->data(Qt::UserRole).toString());
+ MeasurementsWasSaved(false);
+ RefreshData();
+ search->RefreshList(ui->lineEditFind->text());
+ ui->tableWidget->selectRow(0);
+}
+
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::MoveUp()
{
@@ -767,6 +785,24 @@ void TMainWindow::MoveDown()
ui->tableWidget->selectRow(row+1);
}
+//---------------------------------------------------------------------------------------------------------------------
+void TMainWindow::MoveBottom()
+{
+ const int row = ui->tableWidget->currentRow();
+
+ if (row == -1)
+ {
+ return;
+ }
+
+ const QTableWidgetItem *nameField = ui->tableWidget->item(row, ColumnName);
+ m->MoveBottom(nameField->data(Qt::UserRole).toString());
+ MeasurementsWasSaved(false);
+ RefreshData();
+ search->RefreshList(ui->lineEditFind->text());
+ ui->tableWidget->selectRow(ui->tableWidget->rowCount()-1);
+}
+
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::Fx()
{
@@ -1712,8 +1748,10 @@ void TMainWindow::InitWindow()
#endif
connect(ui->toolButtonRemove, &QToolButton::clicked, this, &TMainWindow::Remove);
+ connect(ui->toolButtonTop, &QToolButton::clicked, this, &TMainWindow::MoveTop);
connect(ui->toolButtonUp, &QToolButton::clicked, this, &TMainWindow::MoveUp);
connect(ui->toolButtonDown, &QToolButton::clicked, this, &TMainWindow::MoveDown);
+ connect(ui->toolButtonBottom, &QToolButton::clicked, this, &TMainWindow::MoveBottom);
connect(ui->lineEditName, &QLineEdit::editingFinished, this, &TMainWindow::SaveMName);
connect(ui->plainTextEditDescription, &QPlainTextEdit::textChanged, this, &TMainWindow::SaveMDescription);
@@ -2020,8 +2058,10 @@ void TMainWindow::Controls()
if (m->ReadOnly())
{
ui->toolButtonRemove->setEnabled(false);
+ ui->toolButtonTop->setEnabled(false);
ui->toolButtonUp->setEnabled(false);
ui->toolButtonDown->setEnabled(false);
+ ui->toolButtonBottom->setEnabled(false);
return;
}
@@ -2038,24 +2078,32 @@ void TMainWindow::Controls()
{
if (ui->tableWidget->currentRow() == 0)
{
+ ui->toolButtonTop->setEnabled(false);
ui->toolButtonUp->setEnabled(false);
ui->toolButtonDown->setEnabled(true);
+ ui->toolButtonBottom->setEnabled(true);
}
else if (ui->tableWidget->currentRow() == ui->tableWidget->rowCount()-1)
{
+ ui->toolButtonTop->setEnabled(true);
ui->toolButtonUp->setEnabled(true);
ui->toolButtonDown->setEnabled(false);
+ ui->toolButtonBottom->setEnabled(false);
}
else
{
+ ui->toolButtonTop->setEnabled(true);
ui->toolButtonUp->setEnabled(true);
ui->toolButtonDown->setEnabled(true);
+ ui->toolButtonBottom->setEnabled(true);
}
}
else
{
+ ui->toolButtonTop->setEnabled(false);
ui->toolButtonUp->setEnabled(false);
ui->toolButtonDown->setEnabled(false);
+ ui->toolButtonBottom->setEnabled(false);
}
}
diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h
index 52566d089..3e717399f 100644
--- a/src/app/tape/tmainwindow.h
+++ b/src/app/tape/tmainwindow.h
@@ -89,8 +89,10 @@ private slots:
void ReadOnly(bool ro);
void Remove();
+ void MoveTop();
void MoveUp();
void MoveDown();
+ void MoveBottom();
void Fx();
void AddCustom();
diff --git a/src/app/tape/tmainwindow.ui b/src/app/tape/tmainwindow.ui
index 588e0f5f2..face1924b 100644
--- a/src/app/tape/tmainwindow.ui
+++ b/src/app/tape/tmainwindow.ui
@@ -326,6 +326,19 @@
-
+
-
+
+
+ false
+
+
+ ...
+
+
+
+
+
+
-
@@ -362,6 +375,19 @@
+ -
+
+
+ false
+
+
+ ...
+
+
+
+
+
+
-
diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp
index 9fd5e30f5..d4bf623af 100644
--- a/src/libs/vformat/vmeasurements.cpp
+++ b/src/libs/vformat/vmeasurements.cpp
@@ -137,6 +137,25 @@ void VMeasurements::Remove(const QString &name)
list.at(0).removeChild(FindM(name));
}
+//---------------------------------------------------------------------------------------------------------------------
+void VMeasurements::MoveTop(const QString &name)
+{
+ const QDomElement node = FindM(name);
+ if (not node.isNull())
+ {
+ const QDomNodeList mList = elementsByTagName(TagMeasurement);
+ if (mList.size() >= 2)
+ {
+ const QDomNode top = mList.at(0);
+ if (not top.isNull())
+ {
+ const QDomNodeList list = elementsByTagName(TagBodyMeasurements);
+ list.at(0).insertBefore(node, top);
+ }
+ }
+ }
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VMeasurements::MoveUp(const QString &name)
{
@@ -167,6 +186,25 @@ void VMeasurements::MoveDown(const QString &name)
}
}
+//---------------------------------------------------------------------------------------------------------------------
+void VMeasurements::MoveBottom(const QString &name)
+{
+ const QDomElement node = FindM(name);
+ if (not node.isNull())
+ {
+ const QDomNodeList mList = elementsByTagName(TagMeasurement);
+ if (mList.size() >= 2)
+ {
+ const QDomNode bottom = mList.at(mList.size()-1);
+ if (not bottom.isNull())
+ {
+ const QDomNodeList list = elementsByTagName(TagBodyMeasurements);
+ list.at(0).insertAfter(node, bottom);
+ }
+ }
+ }
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VMeasurements::ReadMeasurements() const
{
diff --git a/src/libs/vformat/vmeasurements.h b/src/libs/vformat/vmeasurements.h
index bf64a8129..39efb7e95 100644
--- a/src/libs/vformat/vmeasurements.h
+++ b/src/libs/vformat/vmeasurements.h
@@ -48,8 +48,10 @@ public:
void AddEmpty(const QString &name, const QString &formula = QString());
void AddEmptyAfter(const QString &after, const QString &name, const QString &formula = QString());
void Remove(const QString &name);
+ void MoveTop(const QString &name);
void MoveUp(const QString &name);
void MoveDown(const QString &name);
+ void MoveBottom(const QString &name);
void ReadMeasurements() const;
diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/actions/go-bottom.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/actions/go-bottom.png
new file mode 100755
index 000000000..a273b51f4
Binary files /dev/null and b/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/actions/go-bottom.png differ
diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/actions/go-top.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/actions/go-top.png
new file mode 100755
index 000000000..8faea0efc
Binary files /dev/null and b/src/libs/vmisc/share/resources/icons/win.icon.theme/16x16/actions/go-top.png differ
diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/24x24/actions/go-bottom.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/24x24/actions/go-bottom.png
new file mode 100755
index 000000000..a49839467
Binary files /dev/null and b/src/libs/vmisc/share/resources/icons/win.icon.theme/24x24/actions/go-bottom.png differ
diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/24x24/actions/go-top.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/24x24/actions/go-top.png
new file mode 100755
index 000000000..e2e4f2bf0
Binary files /dev/null and b/src/libs/vmisc/share/resources/icons/win.icon.theme/24x24/actions/go-top.png differ
diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/32x32/actions/go-bottom.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/32x32/actions/go-bottom.png
new file mode 100755
index 000000000..9302a5e91
Binary files /dev/null and b/src/libs/vmisc/share/resources/icons/win.icon.theme/32x32/actions/go-bottom.png differ
diff --git a/src/libs/vmisc/share/resources/icons/win.icon.theme/32x32/actions/go-top.png b/src/libs/vmisc/share/resources/icons/win.icon.theme/32x32/actions/go-top.png
new file mode 100755
index 000000000..46cd1a74f
Binary files /dev/null and b/src/libs/vmisc/share/resources/icons/win.icon.theme/32x32/actions/go-top.png differ
diff --git a/src/libs/vmisc/share/resources/theme.qrc b/src/libs/vmisc/share/resources/theme.qrc
index 12f35f3b4..ccae8e601 100644
--- a/src/libs/vmisc/share/resources/theme.qrc
+++ b/src/libs/vmisc/share/resources/theme.qrc
@@ -71,5 +71,11 @@
icons/win.icon.theme/16x16/actions/go-up.png
icons/win.icon.theme/24x24/actions/go-up.png
icons/win.icon.theme/32x32/actions/go-up.png
+ icons/win.icon.theme/16x16/actions/go-top.png
+ icons/win.icon.theme/24x24/actions/go-top.png
+ icons/win.icon.theme/32x32/actions/go-top.png
+ icons/win.icon.theme/16x16/actions/go-bottom.png
+ icons/win.icon.theme/24x24/actions/go-bottom.png
+ icons/win.icon.theme/32x32/actions/go-bottom.png