Skip to content

Commit

Permalink
- Made window slightly wider to better fit most of the output
Browse files Browse the repository at this point in the history
- Made version and language selection also disable during patching
- Codestyle changes
  • Loading branch information
DJSchaffner committed Sep 6, 2020
1 parent 6075101 commit d27e491
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
# Set up GUI
self.window = tk.Tk()
self.window.title("AoE2DE Patch Reverter")
self.window.minsize(width=700, height=500)
self.window.minsize(width=750, height=500)
self.window.resizable(0, 0)

def on_closing():
Expand Down Expand Up @@ -85,7 +85,6 @@ def on_closing():

def start(self):
"""Start the application."""

self.window.mainloop()

def __select_game_dir(self):
Expand All @@ -98,7 +97,6 @@ def __select_game_dir(self):

def __patch(self):
"""Start patching the game with the downloaded files."""

# Retrieve selected patch
selected_patch = next((p for p in self.patch_list if p['version'] in self.selected_patch_title.get()), None)
# Retrieve selected language
Expand All @@ -113,8 +111,7 @@ def work():
t.start()

def __restore(self):
"""Restores the game directory using the backed up files and downloaded files."""

"""Restores the game directory using the backed up files and downloaded files."""
def work():
self.__disable_input()
self.logic.restore()
Expand All @@ -125,7 +122,8 @@ def work():

def __disable_input(self):
"""Disables User input for certain Buttons / Entries"""

self.opt_select_patch.config(state="disabled")
self.opt_select_language.config(state="disabled")
self.btn_patch.config(state="disabled")
self.btn_restore.config(state="disabled")
self.btn_game_dir.config(state="disabled")
Expand All @@ -134,7 +132,8 @@ def __disable_input(self):

def __enable_input(self):
"""Enables User input for certain Buttons / Entries"""

self.opt_select_patch.config(state="enabled")
self.opt_select_language.config(state="enabled")
self.btn_patch.config(state="enabled")
self.btn_restore.config(state="enabled")
self.btn_game_dir.config(state="enabled")
Expand Down

0 comments on commit d27e491

Please sign in to comment.