organize code
This commit is contained in:
78
gui/gui.py
78
gui/gui.py
@@ -92,7 +92,6 @@ class Gui:
|
||||
sg.VSeparator(),
|
||||
sg.Column(file_list_column),
|
||||
sg.VSeparator(),
|
||||
|
||||
sg.Column(diagramm_viewer_column),
|
||||
]
|
||||
]
|
||||
@@ -112,45 +111,12 @@ class Gui:
|
||||
while True:
|
||||
logging.info('test')
|
||||
event, values = window.read()
|
||||
|
||||
if event == 'Exit' or event == sg.WIN_CLOSED:
|
||||
logging.debug(('Exit GUI'))
|
||||
break
|
||||
|
||||
|
||||
if event == '-SET OUTPUT NAME-':
|
||||
output_name = values['-OUTPUT NAME-']
|
||||
|
||||
if event == '-CREDITS-':
|
||||
sg.popup(
|
||||
'This is made by Plexx, Weckyy and Oleting. Used PySimpleGUI and Pillow', title='Credits')
|
||||
|
||||
if event == '-DONATE-':
|
||||
logging.debug(('event = ' + str(event)))
|
||||
sg.popup_notify(
|
||||
('You donated $' + str(random.randint(500, 100000000)) + '.'), title='Thanks')
|
||||
|
||||
if event == '-OUTPUT FOLDER-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-OUTPUT FOLDER-'])))
|
||||
fnames = output(values)
|
||||
window['-OUTPUT FILE LIST-'].update(fnames)
|
||||
elif event == '-OUTPUT FILE LIST-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
||||
try:
|
||||
filename = os.path.join(
|
||||
values["-OUTPUT FOLDER-"], values["-OUTPUT FILE LIST-"][0]
|
||||
)
|
||||
window["-TOUT-"].update(filename)
|
||||
window["-IMAGE-"].update(filename=filename)
|
||||
except:
|
||||
pass
|
||||
if event == '-JAVA FOLDER-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-JAVA FOLDER-'])))
|
||||
folder = values['-JAVA FOLDER-']
|
||||
window['-JAVA FOLDER-'].update(values['-JAVA FILE-'])
|
||||
|
||||
# execute Column
|
||||
if event == '-CREATE-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
'values = ' + str(values)))
|
||||
@@ -168,7 +134,6 @@ class Gui:
|
||||
if file_there((output_path + '/' + output_name)) is True:
|
||||
proceed = sg.popup_yes_no(
|
||||
'File already exist! Continue?', title='File alreday exist!')
|
||||
print(proceed)
|
||||
if proceed == 'Yes':
|
||||
nassi(filepath=file_path, output_path=output_path, outputname=output_name, gui=self,
|
||||
font_filepath=font_filepath)
|
||||
@@ -227,6 +192,45 @@ class Gui:
|
||||
except:
|
||||
pass
|
||||
|
||||
if event == '-CREDITS-':
|
||||
sg.popup(
|
||||
'This is made by Plexx, Weckyy and Oleting. Used PySimpleGUI and Pillow', title='Credits')
|
||||
|
||||
if event == '-DONATE-':
|
||||
logging.debug(('event = ' + str(event)))
|
||||
sg.popup_notify(
|
||||
('You donated $' + str(random.randint(500, 100000000)) + '.'), title='Thanks')
|
||||
|
||||
# needed Input
|
||||
|
||||
if event == '-OUTPUT FOLDER-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-OUTPUT FOLDER-'])))
|
||||
fnames = output(values)
|
||||
window['-OUTPUT FILE LIST-'].update(fnames)
|
||||
elif event == '-OUTPUT FILE LIST-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
||||
try:
|
||||
filename = os.path.join(
|
||||
values["-OUTPUT FOLDER-"], values["-OUTPUT FILE LIST-"][0]
|
||||
)
|
||||
window["-TOUT-"].update(filename)
|
||||
window["-IMAGE-"].update(filename=filename)
|
||||
except:
|
||||
pass
|
||||
|
||||
if event == '-JAVA FOLDER-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-JAVA FOLDER-'])))
|
||||
folder = values['-JAVA FOLDER-']
|
||||
window['-JAVA FOLDER-'].update(values['-JAVA FILE-'])
|
||||
|
||||
# optional Input
|
||||
|
||||
if event == '-SET OUTPUT NAME-':
|
||||
output_name = values['-OUTPUT NAME-']
|
||||
|
||||
if event == '-TTF FOLDER-':
|
||||
logging.debug(('event = ' + str(event) +
|
||||
' value = ' + str(values['-TTF FOLDER-'])))
|
||||
|
||||
Reference in New Issue
Block a user