コード例 #1
0
class ConfigPanel(Panel):
    def __init__(self, parent):
        super().__init__(parent)
        Skin.set_background_color(self)
        self.layout = VerticalLayout()
        self.config_widget_factory = ConfigWidgetFactory()

    def add_option(self, name, fill=True):
        self.layout.add(
            self.config_widget_factory.create(self, name),
            fill=fill,
            margin=10,
            margin_bottom=0,
        )

    def add_amiga_option(self, name, fill=True, parent=None):
        if parent is None:
            parent = self
        parent.layout.add(
            self.config_widget_factory.create(parent,
                                              name,
                                              platforms=AMIGA_PLATFORMS),
            fill=fill,
            margin=10,
            margin_bottom=0,
        )
コード例 #2
0
ファイル: configpanel.py プロジェクト: jelmer/fs-uae-debian
class ConfigPanel(Panel):
    def __init__(self, parent):
        super().__init__(parent)
        Skin.set_background_color(self)
        self.layout = VerticalLayout()
        self.config_widget_factory = ConfigWidgetFactory()

    def add_option(self, name, fill=True):
        self.layout.add(self.config_widget_factory.create(
            self, name), fill=fill, margin=10, margin_bottom=0)
コード例 #3
0
 def __init__(self, parent):
     fsui.Group.__init__(self, parent)
     self.layout = fsui.VerticalLayout()
     self.hori_layout = None
     self.widgets = 0
     config_widget_factory = ConfigWidgetFactory()
     self.add_widget(config_widget_factory.create(self, Option.CHIP_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.MOTHERBOARD_RAM))
     self.add_widget(config_widget_factory.create(self, Option.SLOW_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.ZORRO_III_MEMORY))
     self.add_widget(config_widget_factory.create(self, Option.FAST_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.ACCELERATOR_MEMORY))
     self.add_widget(fsui.Label(self, ""))
     self.add_widget(
         config_widget_factory.create(self, Option.GRAPHICS_MEMORY))
コード例 #4
0
    def __init__(self, parent, drives=2, cd_mode=False):
        fsui.Group.__init__(self, parent)
        self.layout = fsui.VerticalLayout()

        self.cd_mode = cd_mode
        self.num_drives = drives

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

        if cd_mode:
            title = gettext("CD-ROM Drive")
            drive_count_option = Option.CDROM_DRIVE_COUNT
        else:
            title = gettext("Floppy Drives")
            drive_count_option = Option.FLOPPY_DRIVE_COUNT

        self.label = fsui.HeadingLabel(self, title)
        hori_layout.add(self.label, margin=10)
        hori_layout.add_spacer(0, expand=True)

        hori_layout.add(ConfigWidgetFactory().create(
            self, drive_count_option, text=gettext("Drive Count")),
                        fill=True,
                        margin_right=20)

        self.multi_select_button = fsui.Button(self,
                                               gettext("Multi-Select..."))
        if self.cd_mode:
            self.multi_select_button.set_tooltip(
                gettext("Add Multiple CD-ROMs at Once"))
        else:
            self.multi_select_button.set_tooltip(
                gettext("Add Multiple Floppies at Once"))
        AmigaEnableBehavior(self.multi_select_button)
        self.multi_select_button.activated.connect(self.on_multi_select_button)

        hori_layout.add(self.multi_select_button, margin_right=10)

        self.layout.add_spacer(0)

        self.selectors = []
        for i in range(drives):
            selector = FloppySelector(parent, i)
            if cd_mode:
                selector.set_cd_mode(True)
            self.selectors.append(selector)
            self.layout.add(selector, fill=True, margin=10, margin_bottom=0)
コード例 #5
0
ファイル: romram.py プロジェクト: EdwardBetts/fs-uae-launcher
 def __init__(self, parent):
     fsui.Group.__init__(self, parent)
     self.layout = fsui.VerticalLayout()
     self.hori_layout = None
     self.widgets = 0
     config_widget_factory = ConfigWidgetFactory()
     self.add_widget(
         config_widget_factory.create(self, Option.CHIP_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.MOTHERBOARD_RAM))
     self.add_widget(
         config_widget_factory.create(self, Option.SLOW_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.ZORRO_III_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.FAST_MEMORY))
     self.add_widget(
         config_widget_factory.create(self, Option.ACCELERATOR_MEMORY))
     self.add_widget(fsui.Label(self, ""))
     self.add_widget(
         config_widget_factory.create(self, Option.GRAPHICS_MEMORY))
コード例 #6
0
    def __init__(self, parent, drives=2, cd_mode=False, removable_media=False):
        super().__init__(parent)
        self.layout = fsui.VerticalLayout()

        self.cd_mode = cd_mode
        self.num_drives = drives

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

        self.mode = self.FLOPPY_MODE
        if cd_mode:
            self.mode = self.CD_MODE

        if self.mode == self.CD_MODE:
            title = gettext("CD-ROM Drive")
            drive_count_option = Option.CDROM_DRIVE_COUNT
            behavior_class = CDEnableBehavior
        elif self.mode == self.TAPE_MODE:
            title = gettext("Tape Drive")
            drive_count_option = None
            behavior_class = None
        elif self.mode == self.CARTRIDGE_MODE:
            title = gettext("Cartridge")
            drive_count_option = None
            behavior_class = None
        else:
            title = gettext("Floppy Drives")
            drive_count_option = Option.FLOPPY_DRIVE_COUNT
            behavior_class = FloppyEnableBehavior

        if removable_media:
            # Removable media group will change type dynamically
            behavior_class = None

        self.label = fsui.HeadingLabel(self, title)
        hori_layout.add(self.label, margin=10)
        hori_layout.add_spacer(0, expand=True)

        if drive_count_option and not removable_media:
            # FIXME: Drive count option does not work on the main page when
            # changing to CD mode. Workaround for now is to not include it.
            hori_layout.add(
                ConfigWidgetFactory().create(
                    self,
                    drive_count_option,
                    text=gettext("Drive count"),
                    platforms=AMIGA_PLATFORMS,
                ),
                fill=True,
                margin_right=20,
            )

        self.multi_select_button = fsui.Button(self,
                                               gettext("Multi-select..."))
        if self.cd_mode:
            self.multi_select_button.set_tooltip(
                gettext("Add multiple CD-ROMs at once"))
        else:
            self.multi_select_button.set_tooltip(
                gettext("Add multiple floppies at once"))
        if behavior_class:
            behavior_class(self.multi_select_button)
        self.multi_select_button.activated.connect(self.on_multi_select_button)

        hori_layout.add(self.multi_select_button, margin_right=10)

        self.layout.add_spacer(0)

        self.selectors = []
        for i in range(drives):
            selector = FloppySelector(self, i, show_path=not removable_media)
            if behavior_class:
                behavior_class(selector)
            selector.set_mode(self.mode)
            self.selectors.append(selector)
            self.layout.add(selector, fill=True, margin=10, margin_bottom=0)
コード例 #7
0
ファイル: configpanel.py プロジェクト: jelmer/fs-uae-debian
 def __init__(self, parent):
     super().__init__(parent)
     Skin.set_background_color(self)
     self.layout = VerticalLayout()
     self.config_widget_factory = ConfigWidgetFactory()
コード例 #8
0
ファイル: modelgroup.py プロジェクト: hroncok/fs-uae-launcher
    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