当前位置: 首页>>代码示例>>Python>>正文


Python launcher_settings.LauncherSettings类代码示例

本文整理汇总了Python中launcher.launcher_settings.LauncherSettings的典型用法代码示例。如果您正苦于以下问题:Python LauncherSettings类的具体用法?Python LauncherSettings怎么用?Python LauncherSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LauncherSettings类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent):
        StatusElement.__init__(self, parent)
        self.error_icon = Image("launcher:res/16/error.png")
        self.warning_icon = Image("launcher:res/16/warning_3.png")
        self.notice_icon = Image("launcher:res/16/information.png")
        self.icons = [
            self.error_icon,
            self.warning_icon,
            self.notice_icon,
        ]
        self.coordinates = []
        self.warnings = []
        self.game_notice = ""
        self.variant_notice = ""
        self.variant_warning = ""
        self.variant_error = ""
        self.joy_emu_conflict = ""
        self.using_joy_emu = False
        self.kickstart_file = ""
        self.x_kickstart_file_sha1 = ""
        self.update_available = ""
        self.__error = ""
        self.x_missing_files = ""
        self.download_page = ""
        self.download_file = ""
        self.amiga_model = ""
        self.amiga_model_calculated = ""
        self.chip_memory = ""
        self.chip_memory_calculated = 0
        self.outdated_plugins = []
        self.custom_config = set()
        self.custom_uae_config = set()
        self.settings_config_keys = set()

        plugin_manager = PluginManager.instance()
        for plugin in plugin_manager.plugins():
            if plugin.outdated:
                self.outdated_plugins.append(plugin.name)

        ConfigBehavior(self, [
            "x_game_notice", "x_variant_notice", "x_variant_warning",
            "x_variant_error", "x_joy_emu_conflict", "amiga_model",
            "x_kickstart_file_sha1", "kickstart_file", "download_page",
            "download_file", "x_missing_files", "__error",
            "chip_memory", "jit_compiler"])
        SettingsBehavior(self, ["__update_available"])

        LauncherConfig.add_listener(self)
        for key in JOYSTICK_KEYS:
            self.on_config(key, LauncherConfig.get(key))
        for key in LauncherConfig.keys():
            if LauncherConfig.is_custom_uae_option(key):
                self.on_config(key, LauncherConfig.get(key))
            elif LauncherConfig.is_custom_option(key):
                self.on_config(key, LauncherConfig.get(key))

        LauncherSettings.add_listener(self)
        for key in LauncherSettings.keys():
            if LauncherConfig.is_config_only_option(key):
                self.on_setting(key, LauncherSettings.get(key))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:60,代码来源:WarningsElement.py

示例2: center_window

    def center_window(cls, args, env):
        # FIXME: does not really belong here (dependency loop)
        from launcher.launcher_config import LauncherConfig
        from launcher.launcher_settings import LauncherSettings
        width = (LauncherConfig.get("window_width") or
                 LauncherSettings.get("window_width"))
        height = (LauncherConfig.get("window_height") or
                  LauncherSettings.get("window_height"))
        try:
            width = int(width)
        except:
            width = 960
        try:
            height = int(height)
        except:
            height = 540
        from launcher.ui.launcher_window import LauncherWindow
        if LauncherWindow.current() is None:
            return

        main_w, main_h = LauncherWindow.current().get_size()
        main_x, main_y = LauncherWindow.current().get_position()

        x = main_x + (main_w - width) // 2
        y = main_y + (main_h - height) // 2

        # FIXME: re-implement without wx
        # if windows:
        #     import wx
        #    y += wx.SystemSettings_GetMetric(wx.SYS_CAPTION_Y)

        env[str("SDL_VIDEO_WINDOW_POS")] = str("{0},{1}".format(x, y))
        args.append("--window-x={0}".format(x))
        args.append("--window-y={0}".format(y))
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:34,代码来源:FSUAE.py

示例3: __init__

 def __init__(self, parent, names):
     parent.__settings_enable_behavior = self
     self._parent = weakref.ref(parent)
     self._names = set(names)
     LauncherSettings.add_listener(self)
     try:
         parent.destroyed.connect(self.on_parent_destroyed)
     except AttributeError:
         print("WARNING: SettingsBehavior without remove_listener "
               "implementation")
     for name in names:
         # Broadcast initial value
         self.on_setting(name, LauncherSettings.get(name))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:13,代码来源:settingsbehavior.py

示例4: on_remove_button

 def on_remove_button(self):
     path = self.list_view.get_item(self.list_view.get_index())
     search_path = LauncherSettings.get("search_path")
     search_path = [x.strip() for x in search_path.split(";") if x.strip()]
     for i in range(len(search_path)):
         if search_path[i].startswith("-"):
             if path == search_path[i][1:]:
                 # Already removed.
                 break
         else:
             if search_path[i] == path:
                 search_path.remove(search_path[i])
                 break
     default_paths = FSGSDirectories.get_default_search_path()
     if path in default_paths:
         search_path.append("-" + path)
     LauncherSettings.set("search_path", ";".join(search_path))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:17,代码来源:scan_paths_group.py

示例5: on_add_button

 def on_add_button(self):
     search_path = LauncherSettings.get("search_path")
     search_path = [x.strip() for x in search_path.split(";") if x.strip()]
     path = fsui.pick_directory(parent=self.get_window())
     if path:
         for i in range(len(search_path)):
             if search_path[i].startswith("-"):
                 if path == search_path[i][1:]:
                     search_path.remove(search_path[i])
                     break
             else:
                 if search_path[i] == path:
                     # Already added.
                     break
         else:
             default_paths = FSGSDirectories.get_default_search_path()
             if path not in default_paths:
                 search_path.append(path)
         LauncherSettings.set("search_path", ";".join(search_path))
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:19,代码来源:scan_paths_group.py

示例6: update_environment_with_centering_info

    def update_environment_with_centering_info(self, env):
        # FIXME: does not really belong here (dependency loop)
        from launcher.launcher_config import LauncherConfig
        from launcher.launcher_settings import LauncherSettings

        width = LauncherConfig.get("window_width") or LauncherSettings.get(
            "window_width"
        )
        height = LauncherConfig.get("window_height") or LauncherSettings.get(
            "window_height"
        )
        try:
            width = int(width)
        except:
            width = 960
        try:
            height = int(height)
        except:
            height = 540
        from launcher.ui.launcherwindow import LauncherWindow

        if LauncherWindow.current() is None:
            return

        main_w, main_h = LauncherWindow.current().get_size()
        main_x, main_y = LauncherWindow.current().get_position()

        x = main_x + (main_w - width) // 2
        y = main_y + (main_h - height) // 2

        # FIXME: REMOVE
        env["FSGS_WINDOW_X"] = str(x)
        env["FSGS_WINDOW_Y"] = str(y)

        # FIXME: REMOVE
        env["SDL_VIDEO_WINDOW_POS"] = str("{0},{1}".format(x, y))
        env["FSGS_WINDOW_POS"] = str("{0},{1}".format(x, y))

        env["FSGS_WINDOW_CENTER"] = "{0},{1}".format(
            main_x + main_w // 2, main_y + main_h // 2
        )
开发者ID:FrodeSolheim,项目名称:fs-uae-launcher,代码行数:41,代码来源:gamedriver.py

示例7: update_widgets

    def update_widgets(self):
        value = LauncherSettings.get("video_sync")
        vblank = value in ["1", "auto", "full", "vblank"]
        full = value in ["1", "auto", "full"]

        # self.full_sync_checkbox.enable(vblank)
        self.sync_method_group.label.enable(vblank)
        self.sync_method_group.widget.enable(vblank)
        self.sync_method_group.help_button.enable(vblank)
        self.sync_method_label.enable(vblank)
        # self.smooth_label.enable(vblank)
        self.low_latency_group.label.enable(full)
        self.low_latency_group.widget.enable(full)
        self.low_latency_group.help_button.enable(full)
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:14,代码来源:video_sync_settings_page.py

示例8: load_settings

    def load_settings(cls):
        if cls.settings_loaded:
            return
        cls.settings_loaded = True

        settings = Settings.instance()
        settings.load()
        path = settings.path
        # path = app.get_settings_path()
        print("loading last config from " + repr(path))
        if not os.path.exists(path):
            print("settings file does not exist")
        # noinspection PyArgumentList
        cp = ConfigParser(interpolation=None)
        try:
            cp.read([path])
        except Exception as e:
            print(repr(e))
            return

        for key in LauncherSettings.old_keys:
            if app.settings.get(key):
                print("[SETTINGS] Removing old key", key)
                app.settings.set(key, "")

        if fsgs.config.add_from_argv():
            print("[CONFIG] Configuration specified via command line")
            # Prevent the launcher from loading the last used game
            LauncherSettings.set("parent_uuid", "")
        elif LauncherSettings.get("config_path"):
            if LauncherConfig.load_file(LauncherSettings.get("config_path")):
                print("[CONFIG] Loaded last configuration file")
            else:
                print("[CONFIG] Failed to load last configuration file")
                LauncherConfig.load_default_config()

            pass
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:37,代码来源:fs_uae_launcher.py

示例9: __init__

    def __init__(self, parent):
        fsui.Choice.__init__(self, parent)
        # FIXME: include in () what language is currently the automatic one

        selected_language = LauncherSettings.get("language")
        k = 0
        selected_index = 0
        for label, language_key, icon_name in LANGUAGE_ITEMS:
            self.add_item(label, fsui.Image(
                "workspace:res/16/flag-{0}.png".format(icon_name)))
            if language_key == selected_language:
                selected_index = k
            k += 1
        if selected_index > 0:
            self.set_index(selected_index)
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:15,代码来源:language_settings_page.py

示例10: expand_path

 def expand_path(cls, path, default_dir=None):
     if path and path[0] == "$":
         cmp_path = path.upper().replace("\\", "/")
         if cmp_path.startswith("$BASE/"):
             return cls.join(cls.get_base_dir(), path[6:])
         if cmp_path.startswith("$CONFIG/"):
             # FIXME: dependency loop, have FS-UAE Launcher register
             # this prefix with this class instead
             from launcher.launcher_settings import LauncherSettings
             config_path = LauncherSettings.get("config_path")
             if config_path:
                 return cls.join(os.path.dirname(config_path), path[8:])
         if cmp_path.startswith("$HOME/"):
             return cls.join(cls.get_home_dir(), path[6:])
         # FIXME: $base_dir is deprecated
         if cmp_path.startswith("$BASE_DIR/"):
             return cls.join(cls.get_base_dir(), path[10:])
     elif not os.path.isabs(path) and default_dir is not None:
         return os.path.join(default_dir, path)
     return path
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:20,代码来源:paths.py

示例11: get_search_path

 def get_search_path(cls):
     paths = FSGSDirectories.get_default_search_path()
     search_path = LauncherSettings.get("search_path")
     for p in search_path.split(";"):
         p = p.strip()
         if not p:
             continue
         elif p[0] == "-":
             p = p[1:]
             if p in paths:
                 paths.remove(p)
         else:
             if p not in paths:
                 paths.append(p)
     # The Configurations dir is always scanned on startup (whenever
     # modification time has changed). If we don't include it here too
     # always, the result will be that the configs sometimes appear (on
     # startup) and disappear (on scan).
     if not FSGSDirectories.get_configurations_dir() in paths:
         paths.append(FSGSDirectories.get_configurations_dir())
     # Likewise, we force the Kickstarts directory to always be scanned.
     if not FSGSDirectories.get_kickstarts_dir() in paths:
         paths.append(FSGSDirectories.get_kickstarts_dir())
     return paths
开发者ID:EdwardBetts,项目名称:fs-uae-launcher,代码行数:24,代码来源:scan_paths_group.py

示例12: on_destroy

 def on_destroy(self):
     LauncherSettings.remove_listener(self)
开发者ID:glaubitz,项目名称:fs-uae-debian,代码行数:2,代码来源:launch.py


注:本文中的launcher.launcher_settings.LauncherSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。