small change

This commit is contained in:
oleting
2020-12-28 19:45:41 +01:00
parent 4df884055a
commit dfdfa49dff

View File

@@ -9,13 +9,38 @@ import secrets
import logging import logging
import time import time
#new popup
class layout_popup:
def __init__(self):
text_column = [
[
sg.Text('What should the program do if a file already exists?')
]
]
choices = [
[
sg.Button(button_text='skip', key='-SKIP-'),
sg.Button(button_text='overwrite', key='-OVERWRITE-'),
sg.Button(button_text='create expicit name', key='-EXPICIT-'),
]
]
self.layout = [
[
sg.Column(text_column),
sg.Column(choices),
]
]
class Gui: 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_layout = self.init_gui(theme=theme) window = self.init_gui(theme=theme)
self.show_gui(window=window, layout_popup=popup_3_layout) self.show_gui(window=window)
def get_debug_mode(self, mode: bool): def get_debug_mode(self, mode: bool):
loging_level = logging.INFO loging_level = logging.INFO
@@ -99,40 +124,15 @@ class Gui:
] ]
#new popup
class layout_popup:
def __init__(self):
text_column = [
[
sg.Text('What should the program do if a file already exists?')
]
]
choices = [
[
sg.Button(button_text='skip', key='-SKIP-'),
sg.Button(button_text='overwrite', key='-OVERWRITE-'),
sg.Button(button_text='create expicit name', key='-EXPICIT-'),
]
]
self.layout = [
[
sg.Column(text_column),
sg.Column(choices),
]
]
logging.debug('init layout GUI') logging.debug('init layout GUI')
window = sg.Window('Nassi Viewer', layout, resizable=True) window = sg.Window('Nassi Viewer', layout, resizable=True)
return window, layout_popup return window
def show_gui(self, window: sg.Window, layout_popup): def show_gui(self, window: sg.Window):
class Overwrite_behaviour(IntEnum): class Overwrite_behaviour(IntEnum):
SKIP = 0 SKIP = 0