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
This commit is contained in:
Ronan Le Tiec 2017-06-28 20:19:20 +02:00
parent d753ff4863
commit c0341a086c
3 changed files with 11 additions and 1 deletions

View File

@ -149,6 +149,7 @@ void VWidgetDetails::FillTable(const QHash<quint32, VPiece> *details)
ui->tableWidget->setItem(currentRow, 1, item); ui->tableWidget->setItem(currentRow, 1, item);
++i; ++i;
} }
ui->tableWidget->sortItems(1,Qt::AscendingOrder);
ui->tableWidget->resizeColumnsToContents(); ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->resizeRowsToContents(); ui->tableWidget->resizeRowsToContents();

View File

@ -88,6 +88,8 @@ void VWidgetGroups::RenameGroup(int row, int column)
const quint32 id = ui->tableWidget->item(row, 0)->data(Qt::UserRole).toUInt(); const quint32 id = ui->tableWidget->item(row, 0)->data(Qt::UserRole).toUInt();
doc->SetGroupName(id, ui->tableWidget->item(row, column)->text()); doc->SetGroupName(id, ui->tableWidget->item(row, column)->text());
UpdateGroups();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -174,6 +176,7 @@ void VWidgetGroups::FillTable(const QMap<quint32, QPair<QString, bool> > &groups
ui->tableWidget->setItem(currentRow, 1, item); ui->tableWidget->setItem(currentRow, 1, item);
++i; ++i;
} }
ui->tableWidget->sortItems(1,Qt::AscendingOrder);
ui->tableWidget->resizeColumnsToContents(); ui->tableWidget->resizeColumnsToContents();
ui->tableWidget->resizeRowsToContents(); ui->tableWidget->resizeRowsToContents();
ui->tableWidget->blockSignals(false); ui->tableWidget->blockSignals(false);

View File

@ -2306,6 +2306,7 @@ void MainWindow::ActionDraw(bool checked)
ui->dockWidgetToolOptions->setVisible(isDockToolOptionsVisible); ui->dockWidgetToolOptions->setVisible(isDockToolOptionsVisible);
ui->dockWidgetGroups->setWidget(groupsWidget); ui->dockWidgetGroups->setWidget(groupsWidget);
ui->dockWidgetGroups->setWindowTitle(tr("Group"));
ui->dockWidgetGroups->setVisible(isDockGroupsVisible); ui->dockWidgetGroups->setVisible(isDockGroupsVisible);
ui->dockWidgetGroups->setToolTip(tr("Contains all visibility groups")); ui->dockWidgetGroups->setToolTip(tr("Contains all visibility groups"));
} }
@ -2380,6 +2381,7 @@ void MainWindow::ActionDetails(bool checked)
ui->dockWidgetToolOptions->setVisible(isDockToolOptionsVisible); ui->dockWidgetToolOptions->setVisible(isDockToolOptionsVisible);
ui->dockWidgetGroups->setWidget(detailsWidget); ui->dockWidgetGroups->setWidget(detailsWidget);
ui->dockWidgetGroups->setWindowTitle(tr("Details"));
ui->dockWidgetGroups->setVisible(isDockGroupsVisible); ui->dockWidgetGroups->setVisible(isDockGroupsVisible);
ui->dockWidgetGroups->setToolTip(tr("Show which details will go in layout")); ui->dockWidgetGroups->setToolTip(tr("Show which details will go in layout"));
@ -2906,7 +2908,11 @@ void MainWindow::FullParseFile()
} }
comboBoxDraws->blockSignals(true); comboBoxDraws->blockSignals(true);
comboBoxDraws->clear(); comboBoxDraws->clear();
comboBoxDraws->addItems(doc->getPatternPieces());
QStringList patternPieceNames = doc->getPatternPieces();
patternPieceNames.sort();
comboBoxDraws->addItems(patternPieceNames);
if (not drawMode) if (not drawMode)
{ {
comboBoxDraws->setCurrentIndex(comboBoxDraws->count()-1); comboBoxDraws->setCurrentIndex(comboBoxDraws->count()-1);