fixed one error in gui, one unfixed
This commit is contained in:
44
gui/gui.py
44
gui/gui.py
@@ -14,8 +14,8 @@ class Gui:
|
|||||||
|
|
||||||
def __init__(self, theme: str, debug_mode: bool):
|
def __init__(self, theme: str, debug_mode: bool):
|
||||||
self.debug_mode = debug_mode
|
self.debug_mode = debug_mode
|
||||||
window, popup_3_choice = self.init_gui(theme=theme)
|
window, popup_3_layout = self.init_gui(theme=theme)
|
||||||
self.show_gui(window=window, popup_3_choice=popup_3_choice)
|
self.show_gui(window=window, layout_popup=popup_3_layout)
|
||||||
|
|
||||||
def get_debug_mode(self, mode: bool):
|
def get_debug_mode(self, mode: bool):
|
||||||
loging_level = logging.INFO
|
loging_level = logging.INFO
|
||||||
@@ -115,7 +115,9 @@ class Gui:
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
layout_popup = [
|
class layout_popup:
|
||||||
|
def __init__(self):
|
||||||
|
self.layout = [
|
||||||
[
|
[
|
||||||
sg.Column(text_column),
|
sg.Column(text_column),
|
||||||
sg.Column(choices),
|
sg.Column(choices),
|
||||||
@@ -126,10 +128,10 @@ class Gui:
|
|||||||
|
|
||||||
window = sg.Window('Nassi Viewer', layout, resizable=True)
|
window = sg.Window('Nassi Viewer', layout, resizable=True)
|
||||||
|
|
||||||
popup_3_choice = sg.Window(title='',no_titlebar=True, layout=layout_popup, resizable=False)
|
|
||||||
return window, popup_3_choice
|
|
||||||
|
|
||||||
def show_gui(self, window: sg.Window, popup_3_choice: sg.Window):
|
return window, layout_popup
|
||||||
|
|
||||||
|
def show_gui(self, window: sg.Window, layout_popup):
|
||||||
|
|
||||||
class Overwrite_behaviour(IntEnum):
|
class Overwrite_behaviour(IntEnum):
|
||||||
SKIP = 0
|
SKIP = 0
|
||||||
@@ -152,21 +154,32 @@ class Gui:
|
|||||||
|
|
||||||
# execute Column
|
# execute Column
|
||||||
if event == '-CREATE-':
|
if event == '-CREATE-':
|
||||||
event_popup, values_popup = popup_3_choice.read()
|
|
||||||
while event_popup != '-OVERWRITE-' or event_popup != '-EXPICIT-' or event_popup != '-SKIP-':
|
|
||||||
if event_popup is '-OVERWRITE-':
|
|
||||||
exists_choice = Overwrite_behaviour(1)
|
|
||||||
if event_popup is '-EXPICIT-':
|
|
||||||
exists_choice = Overwrite_behaviour(2)
|
|
||||||
if event_popup is '-SKIP-':
|
|
||||||
exists_choice = Overwrite_behaviour(0)
|
|
||||||
break
|
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
'values = ' + str(values)))
|
'values = ' + str(values)))
|
||||||
try:
|
try:
|
||||||
if values['-JAVA FOLDER-'] and values['-OUTPUT FOLDER-']:
|
if values['-JAVA FOLDER-'] and values['-OUTPUT FOLDER-']:
|
||||||
logging.debug(
|
logging.debug(
|
||||||
('Try create Image with values = ' + str(values)))
|
('Try create Image with values = ' + str(values)))
|
||||||
|
|
||||||
|
layout_p = layout_popup()
|
||||||
|
popup_3_choice = sg.Window(title='',no_titlebar=True, layout=layout_p.layout, resizable=False)
|
||||||
|
event_popup, values_popup = popup_3_choice.read()
|
||||||
|
|
||||||
|
while event_popup != '-OVERWRITE-' or event_popup != '-EXPICIT-' or event_popup != '-SKIP-':
|
||||||
|
if event_popup is '-OVERWRITE-':
|
||||||
|
exists_choice = Overwrite_behaviour(1)
|
||||||
|
break
|
||||||
|
if event_popup is '-EXPICIT-':
|
||||||
|
exists_choice = Overwrite_behaviour(2)
|
||||||
|
break
|
||||||
|
if event_popup is '-SKIP-':
|
||||||
|
exists_choice = Overwrite_behaviour(0)
|
||||||
|
break
|
||||||
|
if event == sg.WIN_CLOSED or event == 'Quit':
|
||||||
|
break
|
||||||
|
|
||||||
|
print(exists_choice)
|
||||||
|
popup_3_choice.close()
|
||||||
try:
|
try:
|
||||||
file_path = os.path.join(
|
file_path = os.path.join(
|
||||||
values["-JAVA FOLDER-"],
|
values["-JAVA FOLDER-"],
|
||||||
@@ -268,3 +281,4 @@ class Gui:
|
|||||||
font_filepath = values['-TTF FILE-']
|
font_filepath = values['-TTF FILE-']
|
||||||
|
|
||||||
window.close()
|
window.close()
|
||||||
|
popup_3_choice.close()
|
||||||
Reference in New Issue
Block a user