예제 #1
0
def app_main():
    if "--help" in sys.argv:
        print(help_text)
        return
    print("FS-UAE Launcher {0}".format(VERSION))

    from launcher.fs_uae_launcher import FSUAELauncher
    application = FSUAELauncher()
    try:
        application.start()
    except Exception as e:
        import fsui
        fsui.show_error(
            "An error occurred starting FS-UAE Launcher:\n\n" + repr(e) +
            "\n\nFS-UAE Launcher cannot start "
            "because of this.", "FS-UAE Launcher")
    else:
        application.run()
        application.save_settings()

    # from fs_uae_launcher.netplay.IRC import IRC
    # IRC.stop()

    from fsbc.signal import Signal
    Signal("quit").notify()
    print("app_main done")
예제 #2
0
def app_main():
    if "--help" in sys.argv:
        print(help_text)
        return
    print("FS-UAE Arcade {0}".format(VERSION))
    print(sys.argv)
    print(platform.uname())

    for i, arg in enumerate(sys.argv):
        if arg.startswith("--monitor="):
            sys.argv[i] = "--settings:monitor=" + arg[10:]
    try:
        import arcade.arcade_main

        arcade.arcade_main.main()
        print("main returned")

    finally:
        from fsbc.application import Application

        application = Application.instance()
        if application:
            print("calling Application stop")
            Application.get().stop()

        from fsbc.signal import Signal

        print("sending quit signal")
        Signal("quit").notify()
예제 #3
0
    def _run(self, database):
        context = SynchronizerContext()

        paths = [FSGSDirectories.downloads_dir()]
        scanner = FileScanner(
            paths,
            purge_other_dirs=False,
            on_status=self.on_status,
            stop_check=self.stop_check,
        )
        scanner.scan()

        scanner = GameScanner(context,
                              None,
                              on_status=self.on_status,
                              stop_check=self.stop_check)
        scanner.scan(database)

        # FIXME: review what signals should be sent when a scan is performed
        # FIXME: these should be removed soon
        app.settings["last_scan"] = str(time.time())
        app.settings["__config_refresh"] = str(time.time())
        # this must be called from main, since callbacks are broadcast
        # when settings are changed
        Signal("scan_done").notify()
예제 #4
0
 def set(self, key: str, value: str) -> None:
     if not self._loading:
         self.load()
     if self[key] == value:
         self.log_key_value(key, value, extra="(unchanged)")
         return
     if not self._loading and not self._atexit_registered:
         if self.verbose:
             print("[SETTINGS] Register atexit save path =", self.path)
         atexit.register(self.save)
         self._atexit_registered = True
     self.log_key_value(key, value)
     self.values[key] = value
     Signal("setting").notify(key, value)
예제 #5
0
def app_main():
    print("FS Game Center")

    from fsui import Application

    application = Application("fs-game-center")

    from fsgs.http.server import http_server_main
    import threading

    def http_server_thread():
        return http_server_main()

    threading.Thread(target=http_server_thread).start()

    if sys.platform.startswith("linux"):
        # Must load OpenGL to work around crash with Qt Quick on
        # Nvidia / Linux (due to libgl.so from mesa being loaded).
        import ctypes

        ctypes.CDLL("libGL.so.1", ctypes.RTLD_GLOBAL)

    from fsgs.ui.qwindow import GameCenterView

    window = GameCenterView()
    from fsui.qt import Qt

    # window.setFlags(Qt.FramelessWindowHint)
    window.setFlags(Qt.Window
                    | Qt.FramelessWindowHint
                    | Qt.WindowMinimizeButtonHint
                    | Qt.WindowSystemMenuHint)
    # window.show()
    window.showMaximized()
    # window.showFullScreen()
    # window.setWindowState(Qt.WindowFullScreen)
    # window.setVisible(True)

    # from fs_uae_launcher.FSUAELauncher import FSUAELauncher
    # application = FSUAELauncher()

    # if application.start():
    application.run()
    # application.save_settings()

    from fsbc.signal import Signal

    Signal("quit").notify()
예제 #6
0
def app_main():
    try:
        import arcade.arcade_main
        arcade.arcade_main.main()
        print("main returned")

    finally:
        from fsbc.application import Application
        application = Application.instance()
        if application:
            print("calling Application stop")
            Application.get().stop()

        from fsbc.signal import Signal
        print("sending quit signal")
        Signal("quit").notify()
예제 #7
0
def app_main():
    print("FS-UAE Launcher {0}".format(VERSION))

    from launcher.fs_uae_launcher import FSUAELauncher
    application = FSUAELauncher()

    if application.start():
        application.run()
    application.save_settings()

    # from fs_uae_launcher.netplay.IRC import IRC
    # IRC.stop()

    from fsbc.signal import Signal
    Signal("quit").notify()
    print("app_main done")
예제 #8
0
def app_main():
    if "--help" in sys.argv:
        print(help_text)
        return
    print("FS-UAE Launcher {0}".format(VERSION))
    print(sys.argv)
    print(platform.uname())

    for i, arg in enumerate(sys.argv[:]):
        if arg == "--fullscreen" or arg == "--fullscreen=1":
            sys.argv[i] = "--settings:fullscreen=1"
        elif arg == "--no-fullscreen" or arg == "--fullscreen=0":
            sys.argv[i] = "--settings:fullscreen=0"

    from launcher.launcherapp import LauncherApp

    app = LauncherApp()
    if "--no-auto-detect-game" in sys.argv:
        sys.argv.remove("--no-auto-detect-game")
        LauncherApp.auto_detect_game = False
    try:
        app.start()
    except Exception as e:
        traceback.print_exc(file=sys.stderr)
        import fsui

        if "--no-gui" in sys.argv:
            pass
        else:
            fsui.show_error(
                "An error occurred starting FS-UAE Launcher:\n\n" + repr(e) +
                "\n\nFS-UAE Launcher cannot start "
                "because of this.",
                "FS-UAE Launcher",
            )
            fsui.show_error(traceback.format_exc())
    else:
        app.run()
        app.save_settings()

    # from fs_uae_launcher.netplay.IRC import IRC
    # IRC.stop()

    from fsbc.signal import Signal

    Signal("quit").notify()
    print("app_main done")
예제 #9
0
    def _run(self, database):
        # FIXME, dependency on fs_uae_launcher
        # from fs_uae_launcher.Scanner import Scanner
        # Scanner.start([], scan_for_files=False, update_game_database=True)
        from fsgamesys.ogd.game_rating_synchronizer import (
            GameRatingSynchronizer, )
        from launcher.gamescanner import GameScanner

        context = SynchronizerContext()

        synchronizer = MetaSynchronizer(context,
                                        on_status=self.on_status,
                                        stop_check=self.stop_check)
        synchronizer.synchronize()

        synchronizer = GameRatingSynchronizer(
            context,
            database,
            on_status=self.on_status,
            stop_check=self.stop_check,
        )
        synchronizer.username = "******"
        synchronizer.password = app.settings["database_auth"]
        synchronizer.synchronize()

        synchronizer = ListsSynchronizer(context,
                                         on_status=self.on_status,
                                         stop_check=self.stop_check)
        synchronizer.synchronize()

        scanner = GameScanner(context,
                              None,
                              on_status=self.on_status,
                              stop_check=self.stop_check)
        scanner.update_game_database()
        scanner.scan(database)

        # FIXME: review what signals should be sent when a scan is performed
        # FIXME: these should be removed soon
        app.settings["last_scan"] = str(time.time())
        app.settings["__config_refresh"] = str(time.time())
        # this must be called from main, since callbacks are broadcast
        # when settings are changed
        Signal("scan_done").notify()
예제 #10
0
 def remove_listener(cls, listener):
     # deprecated
     Signal("fsgs:config").disconnect(getattr(listener, "on_config"))
예제 #11
0
 def add_listener(cls, listener):
     # deprecated
     Signal("fsgs:config").connect(getattr(listener, "on_config"))
예제 #12
0
 def emit(self, signal, args):
     Signal(self.signal_name(signal)).notify(*args)
예제 #13
0
 def disconnect(self, signal, listener):
     Signal(self.signal_name(signal)).disconnect(listener)