Пример #1
0
 def app_startup(gtk_app):
     nonlocal application
     try:
         application = Application()
         apply_application_actions(application, gtk_app)
     except Exception:
         gtk_app.quit()
         raise
Пример #2
0
def test_service_load():
    """Test loading services and querying utilities."""

    application = Application()
    session = application.new_session()

    assert (session.get_service("undo_manager")
            is not None), "Failed to load the undo manager service"

    assert (session.get_service("file_manager")
            is not None), "Failed to load the file manager service"

    application.shutdown()
Пример #3
0
    def app_startup(gtk_app):
        nonlocal application

        @event_handler(SessionCreated)
        def on_session_created(event):
            main_window = event.session.get_service("main_window")
            main_window.open(gtk_app)

        @event_handler(ApplicationShutdown)
        def on_quit(event):
            gtk_app.quit()

        try:
            application = Application()
            apply_application_actions(application, gtk_app)
            if macos_init:
                macos_init(application)
            event_manager = application.get_service("event_manager")
            event_manager.subscribe(on_session_created)
            event_manager.subscribe(on_quit)
        except Exception:
            gtk_app.quit()
            raise
Пример #4
0
def application():
    app = Application()
    yield app
    app.shutdown()
Пример #5
0
def application():
    application = Application()
    yield application
    application.shutdown()