Commit 30fac859 authored by André Hoarau's avatar André Hoarau
Browse files

fix selection update in field map

parent 70d0cf56
......@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- *Planting dialog* − Show density field even if the beds aren't standardized.
### Fixed
- *Field map* − Fix selection update after adding sublocations.
- Use "system" as the default language setting.
- *Calendar* − Fix bad month name.
- *Planting dialog* − Fix bad seeds numbers for direct seeded planting
......
......@@ -5,6 +5,8 @@ Tous les changements importants seront documentés dans ce fichier.
## Non publiés
### Corrections
- *Parcellaire* − Correction de la mise à jour de la sélection lors de l'ajout
de sous-emplacements.
- Utiliser « système » comme paramètre de langue par défaut.
- *Dialogue des séries* − Afficher le champs densité même si les planches
ne sont pas standardisées.
......
......@@ -316,7 +316,7 @@ int main(int argc, char *argv[])
QApplication::setOrganizationName("AH");
QApplication::setOrganizationDomain("io.qrop");
QApplication::setApplicationDisplayName("Qrop");
QApplication::setApplicationVersion("0.4.1");
QApplication::setApplicationVersion("0.4.4");
QApplication::setWindowIcon(QIcon(":/icon.png"));
QTranslator translator;
......
......@@ -47,7 +47,7 @@ Item {
property alias showOnlyGreenhouseLocations: locationModel.showOnlyGreenhouseLocations
property alias selectedIndexes: selectionModel.selectedIndexes
property var selectedIdList: selectedLocationIds()
property bool hasSelection: selectedIdList.length > 0
property bool hasSelection: selectedIndexes.length
property bool showFamilyColor: false
property int treeViewHeight: listView.contentItem.height
......@@ -249,11 +249,13 @@ Item {
}
function addLocations(name, length, width, quantity, greenhouse) {
if (root.hasSelection)
locationModel.addLocations(name, length, width, quantity, greenhouse, selectionModel.selectedIndexes);
else
if (root.hasSelection) {
var indexes = selectionModel.selectedIndexes;
clearSelection();
locationModel.addLocations(name, length, width, quantity, greenhouse, indexes);
} else {
locationModel.addLocations(name, length, width, quantity, greenhouse);
clearSelection();
}
}
function updateIndexes(map, indexes) {
......
......@@ -30,6 +30,7 @@ Page {
property alias year: seasonSpinBox.year
property alias season: seasonSpinBox.season
property alias hasSelection: locationView.hasSelection
onHasSelectionChanged: console.log("hasSelection", hasSelection)
property alias rowCount: locationView.rowCount
property bool showPlantingsPane: true
......@@ -262,8 +263,8 @@ Page {
locationIdList: locationView.selectedIdList
onAccepted: {
locationView.updateSelected(editDialog.editedValues());
locationView.clearSelection();
locationView.updateSelected(editDialog.editedValues());
}
onRejected: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment