Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexproust committed Oct 29, 2024
2 parents 4812bb1 + c24fdee commit cbfc29f
Show file tree
Hide file tree
Showing 11 changed files with 498 additions and 269 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ CMakeLists.txt.user*
*.dll
*.exe


build

Theme/QUANTUM/Fonts/Roboto-Mono/static/Zone.sav
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ qt_add_qml_module(appGestionnaire_dressing
QML_FILES
Main.qml
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
RESOURCES Data/Photos/Pas-dimage-disponible.jpg Data/Photos/logo.png 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 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
SOURCES filevalidator.h filevalidator.cpp
QML_FILES SortFilterModel.qml
)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
Expand Down
12 changes: 10 additions & 2 deletions Data/filter.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"filter": {
"type" : [
"chale",
"gilet",
"pantalon",
"jupe",
Expand All @@ -12,6 +11,7 @@
"caraco",
"tablier",
"tablier à bavette",
"chale",
"faux-culs",
"foulard",
"mouchoir",
Expand All @@ -23,6 +23,13 @@
"sabots",
"bijoux",
"livres",
"cavate",
"noeud",
"guêtres",
"corselet",
"blouse",
"vareuse",
"bonnet",
"autres"
],
"genre": [
Expand Down Expand Up @@ -71,7 +78,8 @@
"neuf",
"bon état",
"état moyen",
"usagé"
"usagé",
"détruit"
]
}
}
34 changes: 20 additions & 14 deletions Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,37 @@ function dbReadAll()
listModel.clear()
for (let i = 0; i < results.rows.length; i++) {
listModel.append({
id: results.rows.item(i).rowid,
type:results.rows.item(i).type,
description:results.rows.item(i).description,
genre:results.rows.item(i).genre,
mode:results.rows.item(i).mode,
epoque:results.rows.item(i).epoque,
couleur:results.rows.item(i).couleur,
taille:results.rows.item(i).taille,
etat:results.rows.item(i).etat,
emplacement:results.rows.item(i).emplacement,
emprunteur:results.rows.item(i).emprunteur
"id": results.rows.item(i).rowid,
"type":results.rows.item(i).type,
"description":results.rows.item(i).description,
"genre":results.rows.item(i).genre,
"mode":results.rows.item(i).mode,
"epoque":results.rows.item(i).epoque,
"couleur":results.rows.item(i).couleur,
"taille":results.rows.item(i).taille,
"etat":results.rows.item(i).etat,
"emplacement":results.rows.item(i).emplacement,
"emprunteur":results.rows.item(i).emprunteur,
"date_versement_caution": results.rows.item(i).date_versement_caution,
"date_emprunt": results.rows.item(i).date_emprunt,
"date_retour": results.rows.item(i).date_retour,
"date_remboursement_caution": results.rows.item(i).date_remoursement_caution,
"commentaires": results.rows.item(i).commentaires
})
console.log("Find in db: " + listModel.get(listModel.count-1).type)
}
console.log("db size after update: " + listModel.count)
})
}

function dbUpdate(id, type, description, genre, mode, epoque, couleur, taille, etat, emplacement, emprunteur)
function dbUpdate(costume)
{
let db = dbGetHandle()
console.log("Change in db the id " + id)
console.log("Change in db the id " + costume.id + " type : " + costume.type)
db.transaction(function (tx) {
tx.executeSql(
'update costume set id=?, type=?, description=?, genre=?, mode=?, epoque=?, couleur=?, taille=?, etat=?, emplacement=?, emprunteur=?, date_emprunt=?, date_versement_caution=?, date_retour=?, date_remoursement_caution=?, commentaires=? where rowid = ?',
[id, type, description, genre, mode, epoque, couleur, taille, etat, emplacement, emprunteur, "", "", "", "", "", id])
[costume.id, costume.type, costume.description, costume.genre, costume.mode, costume.epoque, costume.couleur, costume.taille, costume.etat, costume.emplacement, costume.emprunteur, "", "", "", "", "", costume.id])
})
}

Expand Down
17 changes: 9 additions & 8 deletions DemoDetail.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import QtQuick.Controls
import QtQuick.Layouts

import Theme.QUANTUM 1.0
import Gestionnaire_dressing 1.0

Rectangle {
id: demoDetail
Expand All @@ -28,7 +29,13 @@ Rectangle {
onClicked: {
// parent.visible = false
}
z: z-1
z: demoDetail.z-1
}

FileValidator {
id: validator
url: "file:Data/Photos/" + costumeSelected.id + ".png"
treatAsImage: true
}

Button {
Expand Down Expand Up @@ -79,13 +86,7 @@ Rectangle {
Layout.preferredWidth: row.width / 2
Layout.margins: -col.anchors.leftMargin
fillMode: Image.PreserveAspectFit
source: costumeSelected.photos ? "./Data/Photos/" + costumeSelected.id + "/" + costumeSelected.photos[0].path : "./Data/Photos/Pas-dimage-disponible.jpg"
Button{
visible: demoDetail.editMode
text: "Ajouter une photo"
anchors.left: itemImage.left
anchors.top: itemImage.top
}
source: validator.fileValid ? validator.url : "file:Data/Photos/Pas-dimage-disponible.jpg"
}

ColumnLayout {
Expand Down
38 changes: 26 additions & 12 deletions DemoTile.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ import QtQuick

import QtQuick.Layouts

// import QtGraphicalEffects 1.15
import Theme.QUANTUM 1.0
import Gestionnaire_dressing 1.0

Rectangle {
id: tile
width: 260
height: 280

signal tileSelect()

property var costume: ({})

layer.enabled: true

Component.onCompleted: {
console.log(couleur, genre, id, taille, type, etat )
}

MouseArea {
id: ma
anchors.fill: parent
Expand Down Expand Up @@ -54,42 +55,55 @@ Rectangle {
RowLayout{
Text {
Layout.fillWidth: true
text: costume.id
text: id
font: Fonts.subtitle1
}

Text {
Layout.fillWidth: true
text: costume.type ? costume.type : ""
font: Fonts.body1
text: type ? type : ""
font: Fonts.subtitle1
wrapMode: Text.WordWrap
}
}

FileValidator {
id: validator
url: "file:Data/Photos/" + id + ".png"
treatAsImage: true
}

Image {
Layout.preferredHeight: 2* tile.height / 3
Layout.maximumWidth: tile.width
Layout.fillWidth: true
// 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"
source: validator.fileValid ? validator.url : "file:Data/Photos/Pas-dimage-disponible.jpg"
}

RowLayout{
Layout.fillWidth: true
Text {
Layout.fillWidth: true
Layout.preferredHeight: 64
text: costume.genre ? costume.genre : ""
font: Fonts.body1
text: genre ? genre : ""
font: Fonts.body2
wrapMode: Text.WordWrap
}
Text {
Layout.fillWidth: true
Layout.preferredHeight: 64
text: taille ? taille : ""
font: Fonts.body2
wrapMode: Text.WordWrap
}
Text {
Layout.fillWidth: true
Layout.preferredHeight: 64
text: costume.taille ? costume.taille : ""
font: Fonts.body1
text: couleur ? couleur : ""
font: Fonts.body2
wrapMode: Text.WordWrap
}
}
Expand Down
Loading

0 comments on commit cbfc29f

Please sign in to comment.