def __uninstall_game(self, game: Game = None): GLib.idle_add(self.__update_to_state, game.state.UNINSTALLING, game) # Remove game from sidebar if it is there if game.sidebar_tile is not None: self.installed_list.remove(game.sidebar_tile.get_parent()) game.sidebar_tile = None uninstall_game(game) GLib.idle_add(self.__update_to_state, game.state.DOWNLOADABLE, game)
def download_update(self, game: Game): if game.sidebar_tile is None: game.sidebar_tile = InstalledRow(self, game, self.api) GLib.idle_add(self.installed_list.prepend, game.sidebar_tile) # start download download_thread = threading.Thread(target=self.__download_update, args=[game]) download_thread.start()
def install_game(self, game: Game): # used to say that a game was installed # add to the sidebar if game.sidebar_tile is not None: return # add it to the sidebar game.sidebar_tile = InstalledRow(self, game, self.api) GLib.idle_add(self.installed_list.prepend, game.sidebar_tile) install_thread = threading.Thread(target=self.__install, args=[game]) install_thread.start()
def __cancel_download(self, game: Game = None): DownloadManager.cancel_download(game.downloads) GLib.idle_add(self.__reload_state, game) if game.state == game.state.DOWNLOADING: ## remove sidebar tile if game.sidebar_tile is not None: game.sidebar_tile.get_parent().get_parent().remove( game.sidebar_tile.get_parent()) game.sidebar_tile = None GLib.idle_add(self.__update_to_state, game.state.DOWNLOADABLE, game) elif game.state == game.state.UPDATE_DOWNLOADING: GLib.idle_add(self.__update_to_state, game.state.INSTALLED, game)