mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 13:24:01 +02:00
brmbar v3 ItemEdit: New view for editing/restocking items (actual editing not supported yet)
This commit is contained in:
parent
db6d2fb372
commit
780395f877
2 changed files with 183 additions and 0 deletions
178
brmbar3/brmbar-gui-qt4/ItemEdit.qml
Normal file
178
brmbar3/brmbar-gui-qt4/ItemEdit.qml
Normal file
|
@ -0,0 +1,178 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant name: ""
|
||||
property variant dbid: ""
|
||||
property variant info: ""
|
||||
|
||||
Text {
|
||||
id: item_name
|
||||
x: 65
|
||||
y: 156
|
||||
width: 537
|
||||
height: 60
|
||||
color: "#ffff7c"
|
||||
text: parent.name
|
||||
wrapMode: Text.WordWrap
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: item_name_edit
|
||||
x: 599
|
||||
y: 156
|
||||
width: 240
|
||||
height: 60
|
||||
fontSize: 34
|
||||
text: "Edit"
|
||||
}
|
||||
|
||||
Text {
|
||||
id: item_buyprice_label
|
||||
x: 65
|
||||
y: 226
|
||||
height: 60
|
||||
width: 200
|
||||
color: "#ffffff"
|
||||
text: "Buy price:"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
Text {
|
||||
id: item_buyprice
|
||||
x: 265
|
||||
y: 226
|
||||
height: 60
|
||||
width: 248
|
||||
color: "#ffff7c"
|
||||
text: info.buy_price
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: item_buyprice_edit
|
||||
x: 599
|
||||
y: 226
|
||||
width: 240
|
||||
height: 60
|
||||
fontSize: 34
|
||||
text: "Edit"
|
||||
}
|
||||
|
||||
Text {
|
||||
id: item_sellprice_label
|
||||
x: 65
|
||||
y: 296
|
||||
height: 60
|
||||
width: 200
|
||||
color: "#ffffff"
|
||||
text: "Sell price:"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
Text {
|
||||
id: item_sellprice
|
||||
x: 265
|
||||
y: 296
|
||||
height: 60
|
||||
width: 248
|
||||
color: "#ffff7c"
|
||||
text: info.price
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: item_sellprice_edit
|
||||
x: 599
|
||||
y: 296
|
||||
width: 240
|
||||
height: 60
|
||||
fontSize: 34
|
||||
text: "Edit"
|
||||
}
|
||||
|
||||
Text {
|
||||
id: item_balance_label
|
||||
x: 65
|
||||
y: 366
|
||||
height: 60
|
||||
width: 200
|
||||
color: "#ffffff"
|
||||
text: "Quantity:"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
Text {
|
||||
id: item_balance
|
||||
x: 265
|
||||
y: 366
|
||||
height: 60
|
||||
width: 248
|
||||
color: "#ffff7c"
|
||||
text: info.balance
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pointSize: 34
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: item_balance_restock
|
||||
x: 599
|
||||
y: 366
|
||||
width: 240
|
||||
height: 60
|
||||
fontSize: 34
|
||||
text: "Restock"
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: add_barcode
|
||||
x: 65
|
||||
y: 476
|
||||
width: 360
|
||||
text: "Add Barcode"
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: save
|
||||
x: 65
|
||||
y: 582
|
||||
width: 360
|
||||
text: "Save"
|
||||
onButtonClick: {
|
||||
info["name"] = name
|
||||
shop.saveAccount(dbid, info)
|
||||
status_text.setStatus("Changes saved", "#ffff7c")
|
||||
loadPage("StockMgmt")
|
||||
}
|
||||
}
|
||||
|
||||
BarButton {
|
||||
id: cancel
|
||||
x: 599
|
||||
y: 582
|
||||
width: 360
|
||||
text: "Cancel"
|
||||
onButtonClick: {
|
||||
status_text.setStatus("Edit cancelled", "#ff4444")
|
||||
loadPage("StockMgmt")
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
info = shop.loadAccount(dbid)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue