Ejemplo n.º 1
0
class ApplicationRunner:
    def __init__(self, name):
        self._app = Application(name)

        stream = Font.stream("NotoSans-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("Roboto-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("RobotoMono-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        font = Font("Roboto", 14)
        font.qfont().setPointSizeF(10.5)
        font.qfont().setHintingPreference(QFont.PreferNoHinting)
        self._app.qapplication.setFont(font.qfont())

    def run(self, application):
        # FIXME: Find a nicer way to make PyQT cooperate with Ctrl+C?
        signal.signal(signal.SIGINT, signal.SIG_DFL)

        args = sys.argv[1:]
        application.init(args)
        # if args:
        #     print(args)
        #     application.arguments(args)

        self._app.run()
class ApplicationRunner:
    def __init__(self, name):
        self._app = Application(name)

        stream = Font.stream("NotoSans-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("Roboto-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("RobotoMono-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        font = Font("Roboto", 14)
        font.qfont().setPointSizeF(10.5)
        font.qfont().setHintingPreference(QFont.PreferNoHinting)
        self._app.qapplication.setFont(font.qfont())

    def run(self, application):
        # FIXME: Find a nicer way to make PyQT cooperate with Ctrl+C?
        signal.signal(signal.SIGINT, signal.SIG_DFL)

        args = sys.argv[1:]
        application.init(args)
        # if args:
        #     print(args)
        #     application.arguments(args)

        self._app.run()
Ejemplo n.º 3
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()
Ejemplo n.º 4
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()
Ejemplo n.º 5
0
    def __init__(self, name):
        self._app = Application(name)

        stream = Font.stream("NotoSans-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("Roboto-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("RobotoMono-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        font = Font("Roboto", 14)
        font.qfont().setPointSizeF(10.5)
        font.qfont().setHintingPreference(QFont.PreferNoHinting)
        self._app.qapplication.setFont(font.qfont())
    def __init__(self, name):
        self._app = Application(name)

        stream = Font.stream("NotoSans-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("Roboto-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        stream = Font.stream("RobotoMono-Regular.ttf")
        # noinspection PyArgumentList
        QFontDatabase.addApplicationFontFromData(stream.read())

        font = Font("Roboto", 14)
        font.qfont().setPointSizeF(10.5)
        font.qfont().setHintingPreference(QFont.PreferNoHinting)
        self._app.qapplication.setFont(font.qfont())
Ejemplo n.º 7
0
 def __init__(self):
     BaseApplication.__init__(self, Application.name)