+ settings work for now
This commit is contained in:
31
gui/gui.py
31
gui/gui.py
@@ -1,5 +1,5 @@
|
|||||||
from gui.utils import nassi, output
|
from gui.utils import nassi, output
|
||||||
from gui.new_window_layouts import Layout_popup, Layout_std, Layout_settings
|
from gui.new_window_layouts import Layout_std, Layout_settings
|
||||||
from errors.custom import JavaSyntaxError, ScopeNotFoundException, InterpreterException, NoPathError
|
from errors.custom import JavaSyntaxError, ScopeNotFoundException, InterpreterException, NoPathError
|
||||||
from interpreter.NassiShneidermann import OB
|
from interpreter.NassiShneidermann import OB
|
||||||
|
|
||||||
@@ -67,27 +67,18 @@ class Gui:
|
|||||||
window_settings = sg.Window(title='Settings', layout=layout_settings.layout, resizable=False)
|
window_settings = sg.Window(title='Settings', layout=layout_settings.layout, resizable=False)
|
||||||
event_settings, values_settings = window_settings.read()
|
event_settings, values_settings = window_settings.read()
|
||||||
while event_settings != '-EXIT-':
|
while event_settings != '-EXIT-':
|
||||||
if event_settings == '-CONFLICT_BEHAVIOUR-':
|
if event_settings == '-OVERWRITE-' and exists_choice != OB.OVERWWRITE:
|
||||||
layout_p = Layout_popup()
|
exists_choice = OB.OVERWWRITE
|
||||||
popup_3_choice = sg.Window(
|
break
|
||||||
title='', no_titlebar=True, layout=layout_p.layout, resizable=False)
|
if event_settings == '-EXPICIT-' and exists_choice != OB.RANDOM_NAME:
|
||||||
event_popup, values_popup = popup_3_choice.read()
|
exists_choice = OB.RANDOM_NAME
|
||||||
|
break
|
||||||
while event_popup != '-OVERWRITE-' or event_popup != '-EXPICIT-' or event_popup != '-SKIP-':
|
if event_settings == '-SKIP-' and exists_choice != OB.SKIP:
|
||||||
if event_popup == '-OVERWRITE-':
|
exists_choice = OB.SKIP
|
||||||
exists_choice = OB.OVERWWRITE
|
break
|
||||||
break
|
|
||||||
if event_popup == '-EXPICIT-':
|
|
||||||
exists_choice = OB.RANDOM_NAME
|
|
||||||
break
|
|
||||||
if event_popup == '-SKIP-':
|
|
||||||
exists_choice = OB.SKIP
|
|
||||||
break
|
|
||||||
if event_popup == sg.WIN_CLOSED or event == 'Exit':
|
|
||||||
break
|
|
||||||
popup_3_choice.close()
|
|
||||||
if event_settings == sg.WIN_CLOSED or event == 'Quit':
|
if event_settings == sg.WIN_CLOSED or event == 'Quit':
|
||||||
break
|
break
|
||||||
|
|
||||||
window_settings.close()
|
window_settings.close()
|
||||||
if event == '-CREATE-':
|
if event == '-CREATE-':
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
|
|||||||
@@ -123,28 +123,8 @@ class Layout_settings():
|
|||||||
]
|
]
|
||||||
|
|
||||||
choices = [
|
choices = [
|
||||||
[
|
[
|
||||||
sg.Button(button_text='conflict_behaviour', key='-CONFLICT_BEHAVIOUR-'),
|
sg.Text('What should the program do if a file already exist?'),
|
||||||
]
|
|
||||||
]
|
|
||||||
self.layout = [
|
|
||||||
[
|
|
||||||
sg.Column(text_column),
|
|
||||||
sg.Column(choices),
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class Layout_popup:
|
|
||||||
def __init__(self):
|
|
||||||
text_column = [
|
|
||||||
[
|
|
||||||
sg.Text('What should the program do if a file already exist?')
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
choices = [
|
|
||||||
[
|
|
||||||
sg.Button(button_text='skip', key='-SKIP-'),
|
sg.Button(button_text='skip', key='-SKIP-'),
|
||||||
sg.Button(button_text='overwrite', key='-OVERWRITE-'),
|
sg.Button(button_text='overwrite', key='-OVERWRITE-'),
|
||||||
sg.Button(button_text='create expicit name', key='-EXPICIT-'),
|
sg.Button(button_text='create expicit name', key='-EXPICIT-'),
|
||||||
@@ -157,3 +137,6 @@ class Layout_popup:
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user