From c0341a086c1ae495fb8df196d3d38c56ae4b49b8 Mon Sep 17 00:00:00 2001 From: Ronan Le Tiec Date: Wed, 28 Jun 2017 20:19:20 +0200 Subject: [PATCH] Resolved issue #693, sort the groups, details and pattern pieces alphabeticaly und change the caption of group to details in Detail Mode --HG-- branch : develop --- src/app/valentina/dialogs/vwidgetdetails.cpp | 1 + src/app/valentina/dialogs/vwidgetgroups.cpp | 3 +++ src/app/valentina/mainwindow.cpp | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/valentina/dialogs/vwidgetdetails.cpp b/src/app/valentina/dialogs/vwidgetdetails.cpp index a04ab5b3f..33b572f9b 100644 --- a/src/app/valentina/dialogs/vwidgetdetails.cpp +++ b/src/app/valentina/dialogs/vwidgetdetails.cpp @@ -149,6 +149,7 @@ void VWidgetDetails::FillTable(const QHash *details) ui->tableWidget->setItem(currentRow, 1, item); ++i; } + ui->tableWidget->sortItems(1,Qt::AscendingOrder); ui->tableWidget->resizeColumnsToContents(); ui->tableWidget->resizeRowsToContents(); diff --git a/src/app/valentina/dialogs/vwidgetgroups.cpp b/src/app/valentina/dialogs/vwidgetgroups.cpp index a647786ea..b70134bc3 100644 --- a/src/app/valentina/dialogs/vwidgetgroups.cpp +++ b/src/app/valentina/dialogs/vwidgetgroups.cpp @@ -88,6 +88,8 @@ void VWidgetGroups::RenameGroup(int row, int column) const quint32 id = ui->tableWidget->item(row, 0)->data(Qt::UserRole).toUInt(); doc->SetGroupName(id, ui->tableWidget->item(row, column)->text()); + + UpdateGroups(); } //--------------------------------------------------------------------------------------------------------------------- @@ -174,6 +176,7 @@ void VWidgetGroups::FillTable(const QMap > &groups ui->tableWidget->setItem(currentRow, 1, item); ++i; } + ui->tableWidget->sortItems(1,Qt::AscendingOrder); ui->tableWidget->resizeColumnsToContents(); ui->tableWidget->resizeRowsToContents(); ui->tableWidget->blockSignals(false); diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 84796d5b8..5d874a04e 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2306,6 +2306,7 @@ void MainWindow::ActionDraw(bool checked) ui->dockWidgetToolOptions->setVisible(isDockToolOptionsVisible); ui->dockWidgetGroups->setWidget(groupsWidget); + ui->dockWidgetGroups->setWindowTitle(tr("Group")); ui->dockWidgetGroups->setVisible(isDockGroupsVisible); ui->dockWidgetGroups->setToolTip(tr("Contains all visibility groups")); } @@ -2380,6 +2381,7 @@ void MainWindow::ActionDetails(bool checked) ui->dockWidgetToolOptions->setVisible(isDockToolOptionsVisible); ui->dockWidgetGroups->setWidget(detailsWidget); + ui->dockWidgetGroups->setWindowTitle(tr("Details")); ui->dockWidgetGroups->setVisible(isDockGroupsVisible); ui->dockWidgetGroups->setToolTip(tr("Show which details will go in layout")); @@ -2906,7 +2908,11 @@ void MainWindow::FullParseFile() } comboBoxDraws->blockSignals(true); comboBoxDraws->clear(); - comboBoxDraws->addItems(doc->getPatternPieces()); + + QStringList patternPieceNames = doc->getPatternPieces(); + patternPieceNames.sort(); + comboBoxDraws->addItems(patternPieceNames); + if (not drawMode) { comboBoxDraws->setCurrentIndex(comboBoxDraws->count()-1);