コード例 #1
0
    def on_application_activate(application):
        windows = application.get_windows()

        if windows:
            for window in windows:
                window.present()
        else:
            sonata = main.Base(args)
            sonata.window.set_application(application)
            sonata.window.show()
コード例 #2
0
ファイル: launcher.py プロジェクト: fstiewitz/sonata
    def on_application_activate(application):
        Gdk.threads_enter()
        windows = application.get_windows()

        if windows:
            for window in windows:
                window.present()
        else:
            sonata = main.Base(args)
            sonata.window.set_application(application)
        Gdk.threads_leave()
コード例 #3
0
    reload(sys) # hack access to setdefaultencoding
    sys.setdefaultencoding("utf-8")


## Global init:

from socket import setdefaulttimeout as socketsettimeout
socketsettimeout(5)

if not args.skip_gui:
    gtk.gdk.threads_init()

    # we don't use gtk.LinkButton, but gtk.AboutDialog does;
    # in gtk 2.16.0 without this, the about uri opens doubly:
    gtk.link_button_set_uri_hook(lambda *args:None)

## CLI actions:

args.execute_cmds()


## Load the main application:

from sonata import main

app = main.Base(args)
try:
    app.main()
except KeyboardInterrupt:
    pass