Skip to content

Commit

Permalink
Merge pull request #19 from Nitro4542/dev
Browse files Browse the repository at this point in the history
Added View for completed actions
  • Loading branch information
Nitro4542 authored Sep 19, 2023
2 parents 9ef5187 + 4e893ec commit 700189f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/mc_mod_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self, **kwargs):

def backup_view_start_button_behaviour(self, *args):
mc_mod_tools.create_backup(None)
app.screen_manager.current = 'actionCompletedView'

def backup_view_cancel_button_behaviour(self, *args):
app.screen_manager.current = 'mainView'
Expand Down Expand Up @@ -141,6 +142,7 @@ def __init__(self, **kwargs):

def install_zip_start_button_behaviour(self, *args):
mc_mod_tools.install_mods_zip(self.zippathinput.text)
app.screen_manager.current = 'actionCompletedView'

def install_zip_cancel_button_behaviour(self, *args):
app.screen_manager.current = 'mainView'
Expand Down Expand Up @@ -175,6 +177,7 @@ def __init__(self, **kwargs):

def install_folder_start_button_behaviour(self, *args):
mc_mod_tools.install_mods(self.folderpathinput.text)
app.screen_manager.current = 'actionCompletedView'

def install_folder_cancel_button_behaviour(self, *args):
app.screen_manager.current = 'mainView'
Expand Down Expand Up @@ -206,11 +209,36 @@ def __init__(self, **kwargs):

def remove_view_start_button_behaviour(self, *args):
mc_mod_tools.delete_mods()
app.screen_manager.current = 'actionCompletedView'

def remove_view_cancel_button_behaviour(self, *args):
app.screen_manager.current = 'mainView'


class ActionCompletedView(GridLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.cols = 1
self.size_hint = (0.8, 0.8)
self.pos_hint = {
'center_x': 0.5,
'center_y': 0.5
}

self.mytitle = Label(text='Action completed.', font_size=32, bold=True)
self.add_widget(self.mytitle)

self.button_actions = GridLayout(cols=2, size_hint=(0.1, 0.1))
self.add_widget(self.button_actions)

self.action_completed_submit_button = Button(size_hint=(0.25, 0.25), text='Submit')
self.action_completed_submit_button.bind(on_press=self.action_completed_submit_button_behaviour)
self.button_actions.add_widget(self.action_completed_submit_button)

def action_completed_submit_button_behaviour(self, *args):
app.screen_manager.current = 'mainView'


class MyApp(App):
def build(self):
self.title = 'mc-mod-gui'
Expand Down Expand Up @@ -246,6 +274,11 @@ def build(self):
screen.add_widget(self.install_folder_view)
self.screen_manager.add_widget(screen)

self.action_completed_view = ActionCompletedView()
screen = Screen(name='actionCompletedView')
screen.add_widget(self.action_completed_view)
self.screen_manager.add_widget(screen)

return self.screen_manager


Expand Down

0 comments on commit 700189f

Please sign in to comment.