Release 3.9.1 & 1.1.2

This commit is contained in:
MikeTheWatchGuy 2018-10-08 13:30:33 -04:00
parent 8f7356f425
commit 91da5ed7b2
23 changed files with 487 additions and 150 deletions

View file

@ -16,16 +16,16 @@ sg.SetOptions(element_padding=(0,0))
layout = [[sg.T('User:', pad=((3,0),0)), sg.OptionMenu(values = ('User 1', 'User 2'), size=(20,1)), sg.T('0', size=(8,1))],
[sg.T('Customer:', pad=((3,0),0)), sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20,1)), sg.T('1', size=(8,1))],
[sg.T('Notes:', pad=((3,0),0)), sg.In(size=(44,1), background_color='white', text_color='black')],
[sg.ReadButton('Start', button_color=('white', 'black'), key='Start'),
sg.ReadButton('Stop', button_color=('white', 'black'), key='Stop'),
sg.ReadButton('Reset', button_color=('white', 'firebrick3'), key='Reset'),
sg.ReadButton('Submit', button_color=('white', 'springgreen4'), key='Submit')]]
[sg.ReadButton('Start', button_color=('white', 'black'), key='_Start_'),
sg.ReadButton('Stop', button_color=('white', 'black'), key='_Stop_'),
sg.ReadButton('Reset', button_color=('white', 'firebrick3'), key='_Reset_'),
sg.ReadButton('Submit', button_color=('white', 'springgreen4'), key='_Submit_')]]
window = sg.Window("Time Tracker", default_element_size=(12,1), text_justification='r', auto_size_text=False, auto_size_buttons=False,
default_button_element_size=(12,1)).Layout(layout).Finalize()
for key, state in {'Start': False, 'Stop': True, 'Reset': True, 'Submit': True}.items():
for key, state in {'_Start_': False, '_Stop_': True, '_Reset_': True, '_Submit_': True}.items():
window.FindElement(key).Update(disabled=state)
recording = have_data = False
@ -34,18 +34,18 @@ while True:
print(button)
if button is None:
sys.exit(69)
if button is 'Start':
for key, state in {'Start':True, 'Stop':False, 'Reset':False, 'Submit':True}.items():
if button == '_Start_':
for key, state in {'_Start_':True, '_Stop_':False, '_Reset_':False, '_Submit_':True}.items():
window.FindElement(key).Update(disabled=state)
recording = True
elif button is 'Stop' and recording:
[window.FindElement(key).Update(disabled=value) for key,value in {'Start':False, 'Stop':True, 'Reset':False, 'Submit':False}.items()]
elif button == '_Stop_' and recording:
[window.FindElement(key).Update(disabled=value) for key,value in {'_Start_':False, '_Stop_':True, '_Reset_':False, '_Submit_':False}.items()]
recording = False
have_data = True
elif button is 'Reset':
[window.FindElement(key).Update(disabled=value) for key,value in {'Start':False, 'Stop':True, 'Reset':True, 'Submit':True}.items()]
elif button == '_Reset_':
[window.FindElement(key).Update(disabled=value) for key,value in {'_Start_':False, '_Stop_':True, '_Reset_':True, '_Submit_':True}.items()]
recording = False
have_data = False
elif button is 'Submit' and have_data:
[window.FindElement(key).Update(disabled=value) for key,value in {'Start':False, 'Stop':True, 'Reset':True, 'Submit':False}.items()]
elif button is '_Submit_' and have_data:
[window.FindElement(key).Update(disabled=value) for key,value in {'_Start_':False, '_Stop_':True, '_Reset_':True, '_Submit_':False}.items()]
recording = False