mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 21:33:59 +02:00
Brmbar v3: Support for simple GUI
All the CLI functionality implemented in the GUI.
This commit is contained in:
parent
049271118d
commit
e428d28e20
15 changed files with 973 additions and 2 deletions
28
brmbar3/brmbar-gui-qt4/main.qml
Normal file
28
brmbar3/brmbar-gui-qt4/main.qml
Normal file
|
@ -0,0 +1,28 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
BasePage {
|
||||
id: canvas
|
||||
|
||||
property variant page: Qt.createComponent("MainPage.qml").createObject(canvas)
|
||||
function loadPage(name, properties) {
|
||||
status_text.hideStatus()
|
||||
name += ".qml"
|
||||
page.destroy();
|
||||
if (typeof(properties) == "undefined") {
|
||||
page = Qt.createComponent(name).createObject(canvas)
|
||||
} else {
|
||||
page = Qt.createComponent(name).createObject(canvas, properties)
|
||||
}
|
||||
}
|
||||
|
||||
function loadPageByAcct(acct) {
|
||||
if (acct.acctype == "inventory") {
|
||||
loadPage("ItemInfo", { name: acct["name"], dbid: acct["id"], price: acct["price"] })
|
||||
} else if (acct.acctype == "debt") {
|
||||
loadPage("UserInfo", { name: acct["name"], dbid: acct["id"], negbalance: acct["negbalance"] })
|
||||
} else if (acct.acctype == "recharge") {
|
||||
loadPage("ChargeCredit", { amount: acct["amount"] })
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue