Implement source filtering

This commit is contained in:
kramo
2023-07-07 21:25:08 +02:00
parent 2d00d3a1bc
commit e7d27cc1c4
8 changed files with 135 additions and 24 deletions

View File

@@ -53,6 +53,7 @@ from src.window import CartridgesWindow
class CartridgesApplication(Adw.Application):
state = shared.AppState.DEFAULT
win = None
def __init__(self):
@@ -86,7 +87,10 @@ class CartridgesApplication(Adw.Application):
# Load games from disk
shared.store.add_manager(FileManager(), False)
shared.store.add_manager(DisplayManager())
self.state = shared.AppState.LOAD_FROM_DISK
self.load_games_from_disk()
self.state = shared.AppState.DEFAULT
self.win.create_source_rows()
# Add rest of the managers for game imports
shared.store.add_manager(LocalCoverManager())
@@ -141,6 +145,9 @@ class CartridgesApplication(Adw.Application):
game = Game(data)
shared.store.add_game(game, {"skip_save": True})
def get_source_name(self, source_id):
return globals()[f"{source_id.title()}Source"].name
def on_about_action(self, *_args):
# Get the debug info from the log files
debug_str = ""