-
Notifications
You must be signed in to change notification settings - Fork 0
/
brmbarsap.py
executable file
·102 lines (88 loc) · 2.13 KB
/
brmbarsap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/python
import sys
import sqlite3
from fce import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
DEBUG=1
app=QApplication(sys.argv)
msg=QLabel("")
t=QTimer()
def brmStock():
if DEBUG: print("brmStock")
rc=os.system(str("python ./brmstock.py"))
brmParseRC(rc,msg,t)
return
def brmUsers():
if DEBUG: print("brmUsers")
rc=os.system(str("python ./brmusers.py"))
brmParseRC(rc,msg,t)
return
def brmBuy(wat=""):
if DEBUG: print("brmBuy: '"+wat+"'")
rc=os.system(str("python ./brmbuy.py '"+wat+"'"))
brmParseRC(rc,msg,t)
return
def brmTransfer():
if DEBUG: print("brmTransfer")
rc=os.system(str("python ./brmtrans.py"))
brmParseRC(rc,msg,t)
return
def brmDonate():
if DEBUG: print("brmTansfer")
rc=os.system(str("python ./brmdon.py"))
brmParseRC(rc,msg,t)
return
def brmReceipt():
if DEBUG: print("brmReceipt")
rc=os.system(str("python ./brmrec.py"))
brmParseRC(rc,msg,t)
return
mainWidget=QWidget()
mainWidget.resize(1280,1024)
mainWidget.setWindowTitle("BrmbarSAP")
mainWidget.setStyleSheet(STYLE_WIDGET)
v1=QVBoxLayout()
brmAddButton(v1,"Stock",brmStock)
v1.addStretch(1)
brmAddButton(v1,"Users",brmUsers)
v2=QVBoxLayout()
v2.addStretch(1)
brmAddButton(v2,"Receipt",brmReceipt)
v2.addStretch(1)
v3=QVBoxLayout()
brmAddButton(v3,"Transfer",brmTransfer)
v3.addStretch(1)
brmAddButton(v3,"Donation",brmDonate)
bbox=QHBoxLayout()
bbox.addStretch(1)
bbox.addLayout(v1)
bbox.addStretch(1)
bbox.addLayout(v2)
bbox.addStretch(1)
bbox.addLayout(v3)
bbox.addStretch(1)
msgbox=QHBoxLayout()
msgbox.addStretch(1)
msg.setStyleSheet(STYLE_MSG)
msgbox.addWidget(msg)
msgbox.addStretch(1)
hbox=QHBoxLayout()
hbox.addStretch(1)
hlp=QLabel("Buy item by scanning its barcode\n\n"
"Read the buttons and gues what they do :)")
hlp.setStyleSheet(STYLE_HELP)
hbox.addWidget(hlp)
hbox.addStretch(1)
screenbox=QVBoxLayout()
brmLabelBox(screenbox,"Welcome in BrmBar!")
screenbox.addLayout(msgbox)
screenbox.addStretch(1)
screenbox.addLayout(hbox)
screenbox.addStretch(3)
screenbox.addLayout(bbox)
screenbox.addStretch(1)
brmAddLine(screenbox,"",'T',STYLE_LE,brmBuy,c=1,foc=1)
mainWidget.setLayout(screenbox)
mainWidget.showFullScreen()
app.exec_()