Пример #1
0
    from syncthing_gtk.tools import init_logging, init_locale, IS_WINDOWS
    init_logging()

    if IS_WINDOWS:
        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
Пример #2
0
	init_logging()
	
	if IS_WINDOWS:
		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"))
	
Пример #3
0
            os.makedirs(config_dir)
        os.environ["LOCALAPPDATA"] = data_path
        os.environ["APPDATA"] = data_path
        os.environ["XDG_CONFIG_HOME"] = data_path
    else:
        # Running from /program files
        path = "."
        if not os.path.exists("./app.glade"):
            # Usually
            from syncthing_gtk.tools import get_install_path
            path = get_install_path()
            os.chdir(path)

    from syncthing_gtk.tools import init_logging, init_locale
    from syncthing_gtk import windows
    windows.enable_localization()
    init_logging()
    init_locale(os.path.join(path, "locale"))

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

    if portable:
        # Enable portable mode
        from syncthing_gtk.tools import make_portable, get_config_dir
        make_portable()

    # Initialize stuff
    from syncthing_gtk.tools import init_logging
    init_logging()
    if portable:
Пример #4
0
		os.environ["APPDATA"] = data_path
		os.environ["XDG_CONFIG_HOME"] = data_path
	else:
		# Running from /program files
		path = "."
		if not os.path.exists("./app.glade"):
			# Usually
			from syncthing_gtk.tools import get_install_path
			path = get_install_path()
			os.chdir(path)
		os.environ["PATH"] = path
		sys.path = [ path ]
	
	from syncthing_gtk.tools import init_logging, init_locale
	from syncthing_gtk import windows
	windows.enable_localization()
	init_logging()
	init_locale(os.path.join(path, "locale"))
	
	# Tell cx_Freeze that I really need this library
	gi.require_foreign('cairo')
	
	if portable:
		# Enable portable mode
		from syncthing_gtk.tools import make_portable, get_config_dir
		make_portable()
	
	# Initialize stuff
	from syncthing_gtk.tools import init_logging
	init_logging()
	if portable: