def __init__(self, parent):
     super().__init__(parent, gettext("Include Save Disk"))
     self.set_tooltip(
         gettext(
             "When checked, include a save disk in FS-UAE's floppy swap list"
         ))
     ConfigBehavior(self, [Option.SAVE_DISK])
    def __init__(self, parent, drives, main=False):
        super().__init__(parent, drives, removable_media=True)
        self.layout3 = fsui.HorizontalLayout()
        self.layout.add(self.layout3, fill=True)
        self.layout3.add_spacer(0, expand=True)
        self.cd_mode = False
        self.__platform = ""
        self.__amiga_model = ""
        self._main = main
        self._c64_model = ""
        self._cpc_model = ""
        self._spectrum_model = ""

        self._ines_header_widget = INesHeaderWidget(self)
        self._ines_header_widget.hide()
        self.layout.add(self._ines_header_widget, fill=True)
        self._a78_header_widget = A78HeaderWidget(self)
        self._a78_header_widget.hide()
        self.layout.add(self._a78_header_widget, fill=True)
        self._command_widget = CommandWidget(self)
        self._command_widget.hide()
        self.layout.add(self._command_widget, fill=True)

        self.update_media_type()

        ConfigBehavior(
            self,
            [
                Option.PLATFORM,
                Option.AMIGA_MODEL,
                Option.C64_MODEL,
                Option.CPC_MODEL,
                Option.SPECTRUM_MODEL,
            ],
        )
Example #3
0
    def __init__(self, parent, drives, main=False):
        FloppiesGroup.__init__(self, parent, drives, removable_media=True)
        self.layout3 = fsui.HorizontalLayout()
        self.layout.add(self.layout3, fill=True)
        self.layout3.add_spacer(0, expand=True)
        self.cd_mode = False
        self.__platform = ""
        self.__amiga_model = ""
        self._main = main
        self._c64_model = ""
        self._zxs_model = ""

        self._ines_header_widget = INesHeaderWidget(self)
        self._ines_header_widget.hide()
        self.layout.add(self._ines_header_widget, fill=True)
        self._a78_header_widget = A78HeaderWidget(self)
        self._a78_header_widget.hide()
        self.layout.add(self._a78_header_widget, fill=True)

        self.update_media_type()

        ConfigBehavior(self, [
            Option.PLATFORM, Option.AMIGA_MODEL, Option.C64_MODEL,
            Option.ZXS_MODEL
        ])
Example #4
0
 def __init__(self, parent, name):
     fsui.ImageView.__init__(self, parent,
                             fsui.Image("launcher:res/16x16/warning_2.png"))
     setattr(self, "on_{0}_config".format(name), self.on_config)
     ConfigBehavior(self, [name])
     text = gettext(
         "Option {name} is overridden by current configuration".format(
             name=name))
     self.set_tool_tip(text)
 def __init__(self, parent):
     self.active_icon = 1
     super().__init__(parent, [])
     self.add_item(gettext("Unrated"), Image("launcher:res/16/bullet.png"))
     self.add_item(gettext("Best Variant"),
                   Image("launcher:res/16/rating_fav_2.png"))
     self.add_item(gettext("Good Variant"),
                   Image("launcher:res/16/thumb_up_2.png"))
     self.add_item(gettext("Bad Variant"),
                   Image("launcher:res/16/thumb_down_2.png"))
     ConfigBehavior(self, ["variant_rating", "variant_uuid"])
Example #6
0
    def __init__(self, parent, with_more_button=True):
        unused(with_more_button)
        fsui.Group.__init__(self, parent)
        self.layout = fsui.VerticalLayout()

        self.model_ids = [
            x["id"] for x in Amiga.models if "/" not in x["id"]]
        self.model_titles = [
            x["title"] for x in Amiga.models if "/" not in x["id"]]

        self.sub_model_ids = []
        self.sub_model_titles = []
        self.sub_model_updating = False

        self.model_choice = fsui.Choice(self, self.model_titles)
        AmigaEnableBehavior(self.model_choice)
        self.sub_model_choice = fsui.Choice(self, self.sub_model_titles)
        AmigaEnableBehavior(self.sub_model_choice)
        self.accuracy_label = fsui.Label(self, gettext("Accuracy:"))
        self.accuracy_choice = fsui.Choice(self, [
            gettext("High"),
            gettext("Medium"),
            gettext("Low")])
        AmigaEnableBehavior(self.accuracy_choice)
        self.ntsc_checkbox = ConfigCheckBox(self, "NTSC", "ntsc_mode")
        AmigaEnableBehavior(self.ntsc_checkbox)

        # if fs_uae_launcher.ui.get_screen_size()[1] > 768:
        # self.layout.add(heading_label, margin=10)
        # self.layout.add_spacer(0)

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True)

        heading_label = fsui.HeadingLabel(self, gettext("Amiga Model"))
        hori_layout.add(heading_label, margin=10)
        hori_layout.add_spacer(10)
        hori_layout.add(self.ntsc_checkbox, expand=False,
                        margin_left=10, margin_right=10)
        hori_layout.add_spacer(0, expand=True)

        hori_layout.add(self.accuracy_label, margin_right=10)
        hori_layout.add(self.accuracy_choice, margin_right=10)

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True)
        hori_layout.add(self.model_choice, expand=False, margin=10)
        hori_layout.add(self.sub_model_choice, expand=True, margin=10)

        ConfigBehavior(self, ["accuracy", "amiga_model"])

        self.model_choice.on_changed = self.on_model_changed
        self.sub_model_choice.on_changed = self.on_sub_model_changed
        self.accuracy_choice.on_changed = self.on_accuracy_changed
Example #7
0
 def __init__(self, parent):
     self.active_icon = 1
     super().__init__(parent, [], cursor_keys=False)
     with self.changed.inhibit:
         self.add_item(gettext("Rate Variant"),
                       Image("launcher:res/16/bullet.png"))
         self.add_item(gettext("Best Variant"),
                       Image("launcher:res/16/rating_fav_2.png"))
         self.add_item(gettext("Good Variant"),
                       Image("launcher:res/16/thumb_up_2.png"))
         self.add_item(gettext("Bad Variant"),
                       Image("launcher:res/16/thumb_down_2.png"))
     ConfigBehavior(self, ["variant_rating", "variant_uuid"])
Example #8
0
    def __init__(self, parent):
        fsui.Panel.__init__(self, parent)
        self.layout = fsui.VerticalLayout()
        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True, margin=10)

        self.text_field = fsui.TextField(self, "")
        self.text_field.on_changed = self.on_text_changed
        self.text_field.disable()
        hori_layout.add(self.text_field, expand=True)

        # self.help_button = HelpButton(
        #     self, "https://fs-uae.net/docs/options/nes-ines-header")
        # hori_layout.add(self.help_button, margin_left=10)

        ConfigBehavior(self, [Option.A7800_A78_HEADER])
    def __init__(self, parent):
        fsui.Panel.__init__(self, parent)
        self.layout = fsui.VerticalLayout()
        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True, margin=10, margin_bottom=0)

        label = fsui.Label(self, gettext("Command:"))
        hori_layout.add(label, fill=True, margin_right=10)

        self.text_field = fsui.TextField(self, "")
        self.text_field.on_changed = self.on_text_changed
        # self.text_field.set_enabled(False)
        hori_layout.add(self.text_field, expand=True)

        # self.help_button = HelpButton(
        #     self, "https://fs-uae.net/docs/options/nes-ines-header")
        # hori_layout.add(self.help_button, margin_left=10)

        ConfigBehavior(self, [Option.COMMAND])
Example #10
0
    def __init__(self, parent, fsgc):
        self.fsgc = fsgc
        super().__init__(parent)
        self.layout = fsui.VerticalLayout()

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True)
        heading_label = fsui.HeadingLabel(self, gettext("Settings"))
        hori_layout.add(heading_label, margin=10)
        hori_layout.add_spacer(0, expand=True)
        settings_button = IconButton(self, "16x16/more.png")
        settings_button.activated.connect(self.on_settings_button)
        hori_layout.add(settings_button, margin_right=10)
        self.layout.add_spacer(0)

        # button = fsui.Button(self, "Platform Settings")
        # button.activated.connect(self.on_platform_settings_button)
        # self.layout.add(button, margin=10, fill=True)

        # self.add_option(Option.KEEP_ASPECT, text=gettext("Keep Aspect"),
        #                 platforms=AMIGA_PLATFORMS)
        self.add_option(Option.SCALE, text=None, enable=SCALING)
        self.add_option(Option.STRETCH, text=None, enable=STRETCHING)
        self.add_option(Option.BEZEL, text=None, enable=BEZEL)

        self.add_option(Option.EFFECT, text=None, enable=EFFECTS)

        self.add_option(Option.ZOOM, text=None, platforms=AMIGA_PLATFORMS)
        self.add_option(Option.BORDER, text=None, platforms=BORDER)

        # self.add_option(Option.SMOOTHING, text=None, platforms=SMOOTHING)

        # self.add_option(Option.CROP, text=None, platforms=CROPPING)

        # if fsgc.settings[Option.DEVELOPER_MODE] == "1":
        #     pass
        #     # self.add_option(Option.ZXS_DRIVER, [Platform.ZXS])
        #     # self.add_option(Option.DOS_EMULATOR, [Platform.DOS])
        # self.add_option(Option.NES_EMULATOR, [Platform.NES])

        self.add_option(Option.AUTO_LOAD, [Platform.DOS, Platform.ZXS])
        self.add_option(Option.AUTO_QUIT, [Platform.DOS])
        self.add_option(Option.TURBO_LOAD, [Platform.ZXS])

        # self.add_option(Option.FRAME, text=None, platforms=BEZEL)
        # self.add_option(Option.BEZEL, text=None, platforms=BEZEL)

        # self.add_option(Option.CHEATS, platforms=CHEATS)

        quick_settings = fsgc.settings[Option.QUICK_SETTINGS_OPTIONS]
        for option in quick_settings.split(","):
            option = option.strip().lower()
            if "[" in option:
                # For future use of e.g.:
                # option1[platform1,platform2],option2[platform,...]
                option, platforms = option.split("[", 1)
            else:
                platforms = []
            if option in options:
                try:
                    self.add_option(option)
                except Exception:
                    print("Error adding quick setting")
                    traceback.print_exc()

        self.layout.add_spacer(expand=True)

        hori_layout = fsui.HorizontalLayout()
        hori_layout.add_spacer(expand=True)
        self.platform_settings_button = fsui.Button(self, "Platform Settings")
        self.platform_settings_button.activated.connect(
            self.on_platform_settings_button)
        hori_layout.add(self.platform_settings_button, margin=10)
        self.layout.add(hori_layout, fill=True)

        hori_layout = fsui.HorizontalLayout()
        hori_layout.add_spacer(expand=True)
        self.video_sync_checkbox = VideoSyncCheckBox(self)
        hori_layout.add(self.video_sync_checkbox, margin_right=10)
        self.layout.add(hori_layout, fill=True)
        self.monitor_button = MonitorButton(self)
        hori_layout.add(self.monitor_button, fill=True, margin_right=10)
        self.fullscreen_mode_button = FullscreenModeButton(self)
        hori_layout.add(self.fullscreen_mode_button, fill=True, margin_right=10)
        self.layout.add_spacer(10)

        ConfigBehavior(self, [Option.PLATFORM])
        SettingsBehavior(self, [Option.G_SYNC])
Example #11
0
    def add_behavior(self, instance, options):
        # FIXME: Move to fsgs
        from launcher.ui.behaviors.configbehavior import ConfigBehavior

        ConfigBehavior(instance, options)
Example #12
0
    def __init__(self, parent, with_more_button=True):
        unused(with_more_button)
        fsui.Group.__init__(self, parent)
        self.layout = fsui.VerticalLayout()

        self.model_ids = [x["id"] for x in Amiga.models if "/" not in x["id"]]
        self.model_titles = [
            x["title"] for x in Amiga.models if "/" not in x["id"]
        ]

        self.sub_model_ids = []
        self.sub_model_titles = []
        self.sub_model_updating = False

        self.model_choice = fsui.Choice(self, self.model_titles)
        # AmigaEnableBehavior(self.model_choice)
        self.sub_model_choice = fsui.Choice(self, self.sub_model_titles)
        # AmigaEnableBehavior(self.sub_model_choice)
        self.accuracy_label = fsui.Label(self, gettext("Accuracy:"))
        self.accuracy_choice = fsui.Choice(
            self, [gettext("High"),
                   gettext("Medium"),
                   gettext("Low")])
        # AmigaEnableBehavior(self.accuracy_choice)
        self.ntsc_checkbox = ConfigCheckBox(self, "NTSC", Option.NTSC_MODE)

        AmigaShowBehavior(self.accuracy_label)
        AmigaShowBehavior(self.accuracy_choice)
        AmigaShowBehavior(self.ntsc_checkbox)

        # if fs_uae_launcher.ui.get_screen_size()[1] > 768:
        # self.layout.add(heading_label, margin=10)
        # self.layout.add_spacer(0)

        self.model_title_layout = fsui.HorizontalLayout()
        self.layout.add(self.model_title_layout, fill=True)

        if openretro or settings.get(Option.PLATFORMS_FEATURE) == "1":
            heading_label = fsui.HeadingLabel(self,
                                              gettext("Platform & Model"))
            self.model_title_layout.add(heading_label, margin=10)
            # platform_group = ConfigWidgetFactory(
            #     check=False, label=False).create(self, Option.PLATFORM)
            # self.model_title_layout.add(platform_group, margin_left=20)
            # Adding label to get the vertical spacing correct.
            # heading_label = fsui.HeadingLabel(self, "")
            # self.model_title_layout.add(heading_label, margin=10)
        else:
            heading_label = fsui.HeadingLabel(self, gettext("Amiga Model"))
            self.model_title_layout.add(heading_label, margin=10)

        self.model_title_layout.add_spacer(0, expand=True)
        self.model_title_layout.add(self.ntsc_checkbox,
                                    expand=False,
                                    margin_left=10,
                                    margin_right=10)
        self.model_title_layout.add_spacer(20)

        self.model_title_layout.add(self.accuracy_label, margin_right=10)
        self.model_title_layout.add(self.accuracy_choice, margin_right=10)
        self.model_title_layout.add(CustomConfigButton(self), margin_right=10)

        self.model_layout = fsui.HorizontalLayout()

        def dummy_min_width():
            return 0

        # Not sure why this is needed, but on startup, the min width
        # seems to be set too large due to something in the model layout.
        self.model_layout.get_min_width = dummy_min_width
        self.layout.add(self.model_layout, fill=True)

        if openretro or settings.get(Option.PLATFORMS_FEATURE) == "1":
            platform_group = ConfigWidgetFactory(check=False,
                                                 label=False).create(
                                                     self, Option.PLATFORM)
            self.model_layout.add(platform_group, margin=10)
            pass

        self.other_model_choice = ModelChoice(self)
        self.model_layout.add(self.other_model_choice, expand=True, margin=10)

        self.model_layout.add(self.model_choice, expand=False, margin=10)
        AmigaShowBehavior(self.model_choice)
        self.model_layout.add(self.sub_model_choice, expand=True, margin=10)
        AmigaShowBehavior(self.sub_model_choice)

        ConfigBehavior(self,
                       [Option.ACCURACY, Option.AMIGA_MODEL, Option.PLATFORM])

        self.model_choice.on_changed = self.on_model_changed
        self.sub_model_choice.on_changed = self.on_sub_model_changed
        self.accuracy_choice.on_changed = self.on_accuracy_changed
Example #13
0
    def __init__(self, parent):
        StatusElement.__init__(self, parent)
        self.error_icon = Image("launcher:res/16x16/error.png")
        self.warning_icon = Image("launcher:res/16x16/warning_3.png")
        self.notice_icon = Image("launcher:res/16x16/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.platform = ""
        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",
                "platform",
            ],
        )
        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))