#!/usr/bin/env python2
import os, sys, signal

def sigint(*a):
	print("\n*break*")
	sys.exit(0)

if __name__ == "__main__":
	signal.signal(signal.SIGINT, sigint)
	
	from syncthing_gtk.tools import init_logging, IS_WINDOWS
	init_logging()
	if IS_WINDOWS:
		from syncthing_gtk import windows, Configuration
		config = Configuration()
		if config["force_dark_theme"]:
			os.environ["GTK_THEME"] = "Adwaita:dark"
		windows.fix_localized_system_error_messages()
		windows.dont_use_localization_in_gtk()
		windows.override_menu_borders()
		from gi.repository import Gtk
		Gtk.IconTheme.get_default().prepend_search_path(os.path.abspath(os.path.join(os.getcwd(), "icons", "32x32", "apps")))
		Gtk.IconTheme.get_default().prepend_search_path(os.path.abspath(os.path.join(os.getcwd(), "icons")))
	
	from gi.repository import Gtk
	Gtk.IconTheme.get_default().append_search_path(os.path.join(os.getcwd(), "icons"))
	
	from syncthing_gtk import App
	App(".", "./icons").run(sys.argv)
Exemple #2
0
#!/c/Python27/python.exe
# Note: this one is used by Windows
import sys, os, gi, cairo, _winreg

if __name__ == "__main__":
    path = "."
    if not os.path.exists("./app.glade"):
        # Usually
        from syncthing_gtk.tools import get_install_path
        path = get_install_path()

    # Tell cx_Freeze that I really need this library
    gi.require_foreign('cairo')

    from syncthing_gtk.tools import init_logging
    init_logging()

    from syncthing_gtk import windows
    windows.fix_localized_system_error_messages()
    windows.dont_use_localization_in_gtk()
    windows.override_menu_borders()

    from syncthing_gtk import App
    App(path, os.path.join(path, "icons")).run(sys.argv)
                                           override_menu_borders)
        from syncthing_gtk.configuration import Configuration
        config = Configuration()
        if config["force_dark_theme"]:
            os.environ["GTK_THEME"] = "Adwaita:dark"
        if config["language"] not in ("", "None", None):
            os.environ["LANGUAGE"] = config["language"]

        enable_localization()

    init_locale("locale/")

    if IS_WINDOWS:
        from syncthing_gtk.windows import enable_localization
        fix_localized_system_error_messages()
        override_menu_borders()
        from gi.repository import Gtk
        Gtk.IconTheme.get_default().prepend_search_path(
            os.path.abspath(os.path.join(os.getcwd(), "icons", "32x32",
                                         "apps")))
        Gtk.IconTheme.get_default().prepend_search_path(
            os.path.abspath(os.path.join(os.getcwd(), "icons")))

    from gi.repository import Gtk
    Gtk.IconTheme.get_default().prepend_search_path(
        os.path.join(os.getcwd(), "icons"))
    Gtk.IconTheme.get_default().prepend_search_path(
        os.path.join(os.getcwd(), "icons/32x32/status"))

    from syncthing_gtk.app import App
    App("./glade", "./icons").run(sys.argv)
		from syncthing_gtk.windows import (
			enable_localization,
			fix_localized_system_error_messages,
			override_menu_borders
		)
		from syncthing_gtk.configuration import Configuration
		config = Configuration()
		if config["force_dark_theme"]:
			os.environ["GTK_THEME"] = "Adwaita:dark"
		if config["language"] not in ("", "None", None):
			os.environ["LANGUAGE"] = config["language"]
		
		enable_localization()
	
	init_locale("locale/")
	
	if IS_WINDOWS:
		from syncthing_gtk.windows import enable_localization
		fix_localized_system_error_messages()
		override_menu_borders()
		from gi.repository import Gtk
		Gtk.IconTheme.get_default().prepend_search_path(os.path.abspath(os.path.join(os.getcwd(), "icons", "32x32", "apps")))
		Gtk.IconTheme.get_default().prepend_search_path(os.path.abspath(os.path.join(os.getcwd(), "icons")))
	
	from gi.repository import Gtk
	Gtk.IconTheme.get_default().prepend_search_path(os.path.join(os.getcwd(), "icons"))
	Gtk.IconTheme.get_default().prepend_search_path(os.path.join(os.getcwd(), "icons/32x32/status"))
	
	from syncthing_gtk.app import App
	App("./glade", "./icons").run(sys.argv)