Skip to content

Commit

Permalink
corrections for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexproust committed Sep 28, 2024
1 parent 09230fd commit cb484dd
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 42 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ qt_add_qml_module(appGestionnaire_dressing
QML_FILES
RESOURCES Data/Photos/Pas-dimage-disponible.jpg Theme/QUANTUM/Fonts/Roboto/LICENSE.txt Theme/QUANTUM/Fonts/Roboto/Roboto-Black.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-BlackItalic.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-Bold.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-BoldItalic.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-Italic.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-Light.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-LightItalic.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-Medium.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-MediumItalic.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-Regular.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-Thin.ttf Theme/QUANTUM/Fonts/Roboto/Roboto-ThinItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-Bold.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-BoldItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-ExtraLight.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-ExtraLightItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-Italic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-Light.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-LightItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-Medium.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-MediumItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-Regular.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-SemiBold.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-SemiBoldItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-Thin.ttf Theme/QUANTUM/Fonts/Roboto-Mono/static/RobotoMono-ThinItalic.ttf Theme/QUANTUM/Fonts/Roboto-Mono/LICENSE.txt Theme/QUANTUM/Fonts/Roboto-Mono/README.txt Theme/QUANTUM/Fonts/Roboto-Mono/RobotoMono-Italic-VariableFont_wght.ttf Theme/QUANTUM/Fonts/Roboto-Mono/RobotoMono-VariableFont_wght.ttf Theme/QUANTUM/Images/Material_Icons.woff2 Theme/QUANTUM/Images/Material_Icons_Outlined.woff2 Theme/QUANTUM/Images/Material_Icons_Round.woff2 Theme/QUANTUM/Images/Material_Icons_Sharp.woff2 Theme/QUANTUM/Images/Material_Icons_Two_Tone.woff2 Theme/QUANTUM/qmldir
QML_FILES Data/filter.json Theme/QUANTUM/Controls/AppliQuantum.qml Theme/QUANTUM/Controls/Button.qml Theme/QUANTUM/Controls/Header.qml Theme/QUANTUM/Controls/Switch.qml Theme/QUANTUM/Controls/Tag.qml Theme/QUANTUM/Colors.qml Theme/QUANTUM/Fonts.qml Database.js DemoDetail.qml DemoTile.qml Filters.qml JSONLoader.qml
RESOURCES Data/Photos/logo.png
)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
Expand Down
Binary file added Data/Photos/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 45 additions & 9 deletions DemoDetail.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ Rectangle {

Tag {
id: modificationButton
text: isSelected ? "Annuler" : "Modifier"
text: demoDetail.editMode ? "Annuler" : "Modifier"
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: 16
onClicked: {
demoDetail.editMode = !demoDetail.editMode
isSelected: demoDetail.editMode
onIsSelectedChanged: {
demoDetail.editMode = isSelected
}
}
Tag {
Expand Down Expand Up @@ -96,7 +97,7 @@ Rectangle {
spacing: 12
Text {
Layout.fillWidth: true
text: "Id: " + costumeSelected.id
text: "Identifiant: " + costumeSelected.id
font: Fonts.subtitle1
}

Expand All @@ -109,16 +110,23 @@ Rectangle {
font: Fonts.body1
wrapMode: Text.WordWrap
}

ComboBox {
id: typeSelected
Layout.fillWidth: true
Layout.preferredHeight: 64
visible: demoDetail.editMode
model: filter.type
onCurrentIndexChanged: {
console.log("onCurrentIndexChanged " + filter.type[currentIndex])
costumeSelected.type = filter.type[currentIndex]
}
onActivated: {
console.log("onActivated " + filter.type[currentIndex])
costumeSelected.type = filter.type[currentIndex]
}
onVisibleChanged: {
currentIndex = indexOfValue(costumeSelected.type)
}
}
}

Expand All @@ -132,7 +140,7 @@ Rectangle {
}
TextArea {
id: descriptionInput
text: costumeSelected.description ? costumeSelected.description : "Undefined"
text: costumeSelected.description ? costumeSelected.description : ""
Layout.fillWidth: true
Layout.preferredHeight: 64
visible: demoDetail.editMode
Expand Down Expand Up @@ -161,6 +169,13 @@ Rectangle {
onCurrentIndexChanged: {
costumeSelected.genre = filter.genre[currentIndex]
}
onActivated: {
console.log("onActivated " + filter.genre[currentIndex])
costumeSelected.genre = filter.genre[currentIndex]
}
onVisibleChanged: {
currentIndex = indexOfValue(costumeSelected.genre)
}
}
}

Expand All @@ -174,7 +189,7 @@ Rectangle {
}
TextField {
id: modeInput
text: costumeSelected.mode ? costumeSelected.mode : "Undefined"
text: costumeSelected.mode ? costumeSelected.mode : ""
Layout.fillWidth: true
Layout.preferredHeight: 64
visible: demoDetail.editMode
Expand All @@ -194,7 +209,7 @@ Rectangle {
}
TextField {
id: epoqueInput
text: costumeSelected.epoque ? costumeSelected.epoque : "Undefined"
text: costumeSelected.epoque ? costumeSelected.epoque : ""
Layout.fillWidth: true
Layout.preferredHeight: 64
visible: demoDetail.editMode
Expand Down Expand Up @@ -223,6 +238,13 @@ Rectangle {
onCurrentIndexChanged: {
costumeSelected.couleur = filter.couleur[currentIndex]
}
onActivated: {
console.log("onActivated " + filter.couleur[currentIndex])
costumeSelected.couleur = filter.couleur[currentIndex]
}
onVisibleChanged: {
currentIndex = indexOfValue(costumeSelected.couleur)
}
}
}

Expand All @@ -245,6 +267,13 @@ Rectangle {
onCurrentIndexChanged: {
costumeSelected.taille = filter.taille[currentIndex]
}
onActivated: {
console.log("onActivated " + filter.taille[currentIndex])
costumeSelected.taille = filter.taille[currentIndex]
}
onVisibleChanged: {
currentIndex = indexOfValue(costumeSelected.taille)
}
}
}

Expand All @@ -267,6 +296,13 @@ Rectangle {
onCurrentIndexChanged: {
costumeSelected.etat = filter.etat[currentIndex]
}
onActivated: {
console.log("onActivated " + filter.etat[currentIndex])
costumeSelected.etat = filter.etat[currentIndex]
}
onVisibleChanged: {
currentIndex = indexOfValue(costumeSelected.etat)
}
}
}

Expand All @@ -280,7 +316,7 @@ Rectangle {
}
TextField {
id: placementInput
text: costumeSelected.emplacement ? costumeSelected.emplacement : "Undefined"
text: costumeSelected.emplacement ? costumeSelected.emplacement : ""
Layout.fillWidth: true
Layout.preferredHeight: 64
visible: demoDetail.editMode
Expand Down
3 changes: 2 additions & 1 deletion DemoTile.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Rectangle {
Layout.preferredHeight: 2* tile.height / 3
Layout.maximumWidth: tile.width
Layout.fillWidth: true
Layout.leftMargin: -col.anchors.leftMargin
// Layout.leftMargin: -col.anchors.leftMargin
Layout.alignment: verticalAlignment
fillMode: Image.PreserveAspectFit
source: costume.photos ? "./Data/Photos/" + costume.id + "/" + costume.photos[0].path : "./Data/Photos/Pas-dimage-disponible.jpg"
}
Expand Down
13 changes: 7 additions & 6 deletions Theme/QUANTUM/Controls/Header.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ RowLayout {
}

/* LOGO */
// Image {
// Layout.alignment: Qt.AlignVCenter
// Layout.preferredHeight: 15
// Layout.preferredWidth: 117
// source: "../Images/Thales.svg"
// }
Image {
Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true
fillMode: Image.PreserveAspectFit
Layout.preferredWidth: 100
source: "../../../Data/Photos/logo.png"
}

Text {
Layout.alignment: Qt.AlignVCenter
Expand Down
37 changes: 11 additions & 26 deletions main.qml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls 2.15
import QtQuick.LocalStorage
import QtQuick.LocalStorage 2.0
import "Database.js" as JS

import Theme.QUANTUM 1.0

AppliQuantum {
id: root
title: "Gestionnaire dressing"
title: qsTr("Gestionnaire dressing")
visible: true
property var model: ({})
property var filterTemplate: ({})
Expand Down Expand Up @@ -51,30 +51,10 @@ AppliQuantum {
onAddSelect: {
let rowid = JS.dbInsert()
JS.dbUpdate(rowid,"","","","","","","","","","");
JS.dbReadAll()
for (var i = 0; i < listModel.count; i++ ) {
var key = i;
model[key] = {};
model[key].id =listModel.get(i).id
model[key].type =listModel.get(i).type
model[key].description =listModel.get(i).description
model[key].genre =listModel.get(i).genre
model[key].mode =listModel.get(i).mode
model[key].epoque =listModel.get(i).epoque
model[key].couleur =listModel.get(i).couleur
model[key].taille =listModel.get(i).taille
model[key].etat =listModel.get(i).etat
model[key].emprunteur =listModel.get(i).emprunteur
model[key].emplacement =listModel.get(i).emplacement
model[key].date_versement_caution =listModel.get(i).date_versement_caution
model[key].date_emprunt =listModel.get(i).date_emprunt
model[key].date_retour =listModel.get(i).date_retour
model[key].date_remboursement_caution =listModel.get(i).date_remboursement_caution
model[key].commentaires =listModel.get(i).commentaires
}
modelChanged();
listModel.update()
demoDetail.costumeSelected = Object.values(model)[0]
demoDetail.visible = true
demoDetail.editMode = true
}

onFilteredModelChanged: {
Expand Down Expand Up @@ -113,7 +93,13 @@ AppliQuantum {
ListModel {
id: listModel
Component.onCompleted: {
listModel.update()
}

function update(){
JS.dbReadAll()
console.log("Udpate database : nb items found : " + listModel.count)
model = ({})
for (var i = 0; i < listModel.count; i++ ) {
var key = i;
model[key] = {};
Expand Down Expand Up @@ -159,9 +145,8 @@ AppliQuantum {
}
onDeleteCostume: {
JS.dbDeleteRow(costumeSelected.id)
delete model[costumeSelected.id];
modelChanged();
demoDetail.visible = false
listModel.update()
}
}

Expand Down

0 comments on commit cb484dd

Please sign in to comment.