Commit 333b38a1 authored by André Hoarau's avatar André Hoarau 🍆
Browse files

Merge branch 'master' of framagit.org:ah/qrop

parents 8ef046b7 174c0cc2
......@@ -5,8 +5,10 @@ All notable changes to this project will be documented in this file.
## Unreleased
## Changed
- *Charts* : the whole view is now updated when the user search for a planting.
- *Calendar* : PDF output now follows the current view : week and
- *Plantings* − Always show seed company next to variety name if the feature is
activated (#176).
- *Charts* − the whole view is now updated when the user search for a planting.
- *Calendar* − PDF output now follows the current view : week and
done/due/overdue filters (#205).
- Improve filtering of plantings to show all plantings, or only the field or
greenhouse ones.
......
......@@ -5,6 +5,8 @@ Tous les changements importants seront documentés dans ce fichier.
## Non publiés
### Changements
- *Series* − Toujours afficher le nom du fournisseur si la fonctionnalité a été
activée (#176).
- *Graphique* : toutes les données de la vue sont mises à jour lorsque
l'utilisateurice effectue une recherche sur les séries.
- *Calendrier* : l'export PDF suit dorénavant la vue en cours : semaine et
......
......@@ -579,6 +579,7 @@ Flickable {
property int standardBedWidth
property int standardPathWidth
property string dateType
property bool showSeedCompanyBesideVariety
}
Settings {
......@@ -596,9 +597,11 @@ Flickable {
onCropIdChanged: {
varietyField.reset()
if (cropId < 0)
if (cropId < 0) {
return;
var defaultVarietyId = Variety.defaultVariety(cropId);
}
let defaultVarietyId = Variety.defaultVariety(cropId);
if (defaultVarietyId > 0) {
varietyField.setSelectedId(defaultVarietyId);
varietyField.text = Variety.varietyName(defaultVarietyId)
......@@ -613,7 +616,6 @@ Flickable {
width: control.width
spacing: Units.smallSpacing
padding: 0
// spacing: 0
FormGroupBox {
id: varietyBox
......@@ -627,7 +629,12 @@ Flickable {
id: varietyField
enabled: cropId > 0
Layout.topMargin: Units.mediumSpacing
textRole: function (model) { return model.variety; }
textRole: function (model) {
if (settings.showSeedCompanyBesideVariety) {
return "%1 (%2.)".arg(model.variety).arg(model.seed_company.slice(0,3));
}
return model.variety;
}
idRole: function (model) { return model.variety_id; }
showAddItem: true
addItemText: text ? qsTr('Add new variety "%1"').arg(text) : qsTr("Add new variety")
......
......@@ -30,6 +30,7 @@ Item {
property var map: validId ? Planting.mapFromId("planting_view", plantingId) : {}
property string crop: validId ? map['crop'] : ""
property string variety: validId ? map['variety'] : ""
property string seedCompany: validId ? map['seed_company'] : ""
property date sowingDate: validId ? map['sowing_date'] : ""
property date endHarvestDate: validId ? map['end_harvest_date'] : ""
property int rank: validId ? map['planting_rank'] : ""
......@@ -47,13 +48,21 @@ Item {
property bool useStandardBedLength
property int standardBedLength
property bool showPlantingSuccessionNumber
property bool showSeedCompanyBesideVariety
}
Column {
id: column
Text {
text: validId ? "%1, %2".arg(crop).arg(variety) : " "
text: {
if (!validId)
return ""
if (settings.showSeedCompanyBesideVariety)
return "%1, %2 (%3.)".arg(crop).arg(variety).arg(seedCompany.slice(0,3));
return "%1, %2".arg(crop).arg(variety);
}
font.family: "Roboto Regular"
font.pixelSize: Units.fontSizeTable
elide: Text.ElideRight
......@@ -64,7 +73,7 @@ Item {
if (!validId)
return ""
var txt = ""
let txt = ""
if (showRank && settings.showPlantingSuccessionNumber) {
txt += "#%1 ".arg(rank)
......
Markdown is supported
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