예제 #1
0
    def __init__(self, parent):
        fsui.Panel.__init__(self, parent)
        self.layout = fsui.VerticalLayout()

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "You can write key = value pairs here to set FS-UAE options "
                "not currently supported by the user interface. This is only a "
                "temporary feature until the GUI supports all options "
                "directly."), 760)
        self.layout.add(label, fill=True, margin_bottom=10)
        label = fsui.MultiLineLabel(
            self,
            gettext(
                "The options specified here will apply to this configuration "
                "only."), 760)
        self.layout.add(label, fill=True, margin_bottom=10)

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

        # hor_layout.add_spacer(20)
        self.text_area = fsui.TextArea(self, font_family="monospace")
        self.text_area.set_min_width(760)
        self.text_area.set_min_height(400)
        self.text_area.set_text(initial_text())
        hor_layout.add(self.text_area, fill=True, expand=True)
        # hor_layout.add_spacer(20)

        # self.layout.add_spacer(20)

        self.get_window().add_close_listener(self.on_close_window)
예제 #2
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("settings", "pkg:workspace")
        gettext("Advanced")
        title = gettext("Advanced Settings")
        subtitle = gettext("Specify global options and settings which does "
                           "not have UI controls")
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "You can write key = value pairs here to set FS-UAE options "
                "not currently supported by the user interface. This is only a "
                "temporary feature until the GUI supports all options "
                "directly."), 640)
        self.layout.add(label, fill=True, margin_bottom=10)

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "The options specified here are global and will apply to all "
                "configurations. Config options such as hardware and memory "
                "options will be ignored. Options suitable here are options "
                "like theme options."), 640)
        self.layout.add(label, fill=True, margin_bottom=10)

        self.text_area = fsui.TextArea(self, font_family="monospace")
        self.text_area.set_text(self.get_initial_text())
        self.layout.add(self.text_area, fill=True, expand=True)
        self.text_area.changed.connect(self.update_settings)
예제 #3
0
    def __init__(self, parent):
        super().__init__(parent)
        self.layout = fsui.VerticalLayout()

        header = WizardHeader(self, fsui.Icon("fs-uae-launcher",
                                              "pkg:launcher"), "Welcome")
        self.layout.add(header, fill=True, margin_bottom=20)

        v_layout = fsui.VerticalLayout()
        self.layout.add(v_layout, margin=20)

        label = fsui.MultiLineLabel(
            self,
            gettext("Welcome to the setup wizard for FS-UAE Launcher!"),
            SetupWizardPage.WIDTH,
        )
        v_layout.add(label, fill=True, margin_top=0)

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "You can close this wizard at any time if you do not want to "
                "use it, and you can also run it again later."),
            SetupWizardPage.WIDTH,
        )
        v_layout.add(label, fill=True, margin_top=20)
예제 #4
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("settings", "pkg:workspace")
        # gettext("WHDLoad Settings")
        title = gettext("WHDLoad")
        subtitle = gettext("Options for WHDLoad support in FS-UAE Launcher")
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(self, gettext(
            "The following options only apply when you use the automatic "
            "WHDLoad support in FS-UAE Launcher, for example in relation with "
            "the online game database."), 640)
        self.layout.add(label, fill=True, margin_top=0)

        self.add_option("whdload_splash_delay")

        label = fsui.Label(
            self, gettext("Directory for WHDLoad.key file (if you have it):"))
        self.layout.add(label, margin_top=10)
        hor_layout = fsui.HorizontalLayout()
        self.layout.add(hor_layout, margin_top=4, fill=True)
        label = fsui.Label(
            self, FSGSDirectories.get_base_dir())
        hor_layout.add_spacer(0, expand=True)
        hor_layout.add(label)
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("video-settings", "pkg:workspace")
        gettext("Video Settings")
        title = gettext("Video")
        subtitle = ""
        self.add_header(icon, title, subtitle)

        self.add_option("fullscreen")
        self.add_option("monitor")

        self.add_section(gettext("Scaling & Filters"))
        self.add_option("zoom")
        self.add_option("keep_aspect")

        # self.add_section(gettext("Filters"))
        self.add_option("scanlines")
        self.add_option("rtg_scanlines")

        self.add_section(gettext("Video Synchronization"))
        # FIXME: Move 640 to constants
        label = fsui.MultiLineLabel(
            self,
            gettext(
                "Enabling the following option will synchronize the emulation "
                "to the display when the emulation refresh rate matches the "
                "screen refresh rate."),
            640,
        )
        self.layout.add(label, fill=True, margin_top=0)
        self.video_sync_group = self.add_option("video_sync")
예제 #6
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("video-settings", "pkg:workspace")
        gettext("Advanced Video Settings")
        title = gettext("Advanced Video")
        subtitle = ""
        self.add_header(icon, title, subtitle)

        self.add_option(Option.FULLSCREEN_MODE)
        self.add_option(Option.VIDEO_FORMAT)
        self.low_latency_group = self.add_option(Option.LOW_LATENCY_VSYNC)

        self.add_section(gettext("OpenGL Settings"))
        self.add_option(Option.FSAA)
        self.add_option(Option.TEXTURE_FILTER)
        self.add_option(Option.TEXTURE_FORMAT)

        # self.add_section(gettext("Video Synchronization"))
        self.sync_method_label = fsui.MultiLineLabel(self, gettext(
            "Depending on your OS and OpenGL drivers, video synchronization "
            "can use needlessly much CPU (esp. applies to "
            "Linux). You can experiment with different sync methods "
            "to improve performance."), 640)
        self.layout.add(self.sync_method_label, fill=True, margin_top=20)
        self.sync_method_group = self.add_option(Option.VIDEO_SYNC_METHOD)
예제 #7
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("fs-uae-launcher", "pkg:launcher")
        self.add_header(icon, "{} Launcher".format(fsgs.product))

        if fsboot.get("fws") == "1":
            # We omit the appearance settings, since they have no effect
            # when running under the workspace environment.
            pass
        else:
            self.add_option(Option.LAUNCHER_THEME)
            self.add_option(Option.LAUNCHER_FONT_SIZE)

        self.add_option(Option.LAUNCHER_CLOSE_BUTTONS)

        self.add_section(gettext("Experimental Features"))
        # Netplay feature is now enabled by default
        # self.add_option(Option.NETPLAY_FEATURE)
        if not openretro:
            self.add_option(Option.PLATFORMS_FEATURE)
        # self.add_option(Option.LAUNCHER_CONFIG_FEATURE)
        # self.add_option(Option.LAUNCHER_SETUP_WIZARD_FEATURE)

        self.add_section(gettext("Maintenance"))
        label = fsui.MultiLineLabel(
            self,
            gettext(
                "Defragmenting the databases will improve performance "
                "by ensuring that tables and indices are stored contiguously "
                "on disk. It will also reclaim some storage space."), 640)
        self.layout.add(label, fill=True, margin_top=20)
        button = fsui.Button(self, gettext("Defragment Databases"))
        button.activated.connect(self.on_defragment_button)
        self.layout.add(button, margin_top=20)
예제 #8
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("language-settings", "pkg:workspace")
        # gettext("Appearance")
        title = gettext("Language")
        # gettext("Set language and look for FS-UAE applications")
        subtitle = gettext("Set language for FS-UAE applications")
        self.add_header(icon, title, subtitle)

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True)
        # hori_layout.add(fsui.Label(self, gettext("Language:")))
        hori_layout.add(fsui.Label(self, gettext("Language:")))
        hori_layout.add_spacer(0, expand=True)
        self.language_choice = LanguageSettingChoice(self)
        hori_layout.add(self.language_choice)

        self.layout.add_spacer(20)

        information = ""
        # information = gettext(
        #     "A change of language will only affect applications "
        #     "which are restarted after the change.")
        # information += "\n\n"
        information += gettext(
            "When Automatic is specified, your preferred language is set "
            "based on information from the operating system (or English, "
            "if a supported language is not detected).")
        self.layout.add(fsui.MultiLineLabel(self, information, 640))
예제 #9
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("database-settings", "pkg:workspace")
        gettext("Game Database Settings")
        title = gettext("Game Database")
        subtitle = ""
        self.add_header(icon, title, subtitle)

        self.add_option(Option.DATABASE_SHOW_GAMES)
        self.add_option(Option.DATABASE_SHOW_ADULT)

        self.add_section(gettext("Additional Databases"))
        self.add_option(Option.DATABASE_GB, "Game Boy")
        self.add_option(Option.DATABASE_GBC, "Game Boy Color")
        self.add_option(Option.DATABASE_GBA, "Game Boy Advance")
        self.add_option(Option.DATABASE_NES, "Nintendo")
        self.add_option(Option.DATABASE_SNES, "Super Nintendo")
        label = fsui.MultiLineLabel(
            self,
            gettext("Note: Support for additional game databases is an "
                    "experimental feature and does not provide the "
                    "same level of maturity as Amiga/CDTV/CD32. "
                    "Also, additional plugins are needed to play the "
                    "games."), 640)
        self.layout.add(label, margin_top=20)
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("database-settings", "pkg:workspace")
        title = gettext("Game Platforms")
        subtitle = ""
        self.add_header(icon, title, subtitle)

        self.hori_layout = None
        self.hori_counter = 0

        if openretro or settings.get(Option.PLATFORMS_FEATURE) == "1":
            # self.add_section(gettext("Game Databases"))

            label = fsui.MultiLineLabel(
                self,
                gettext("Note: This is an experimental feature. "
                        "Additional plugins are needed."),
                640,
            )
            self.layout.add(label, margin_top=20, margin_bottom=20)

            self.add_database_option(Platform.CPC, Option.CPC_DATABASE,
                                     "Amstrad CPC")
            self.add_database_option(Platform.ARCADE, Option.ARCADE_DATABASE,
                                     "Arcade")
            self.add_database_option(Platform.A7800, Option.A7800_DATABASE,
                                     "Atari 7800")
            self.add_database_option(Platform.C64, Option.C64_DATABASE,
                                     "Commodore 64")
            self.add_database_option(Platform.DOS, Option.DOS_DATABASE, "DOS")
            self.add_database_option(Platform.GB, Option.GB_DATABASE,
                                     "Game Boy")
            self.add_database_option(Platform.GBA, Option.GBA_DATABASE,
                                     "Game Boy Advance")
            self.add_database_option(Platform.GBC, Option.GBC_DATABASE,
                                     "Game Boy Color")
            self.add_database_option(Platform.SMS, Option.SMS_DATABASE,
                                     "Master System")
            self.add_database_option(Platform.SMD, Option.SMD_DATABASE,
                                     "Mega Drive")
            self.add_database_option(Platform.NEOGEO, Option.NEOGEO_DATABASE,
                                     "Neo-Geo")
            self.add_database_option(Platform.NES, Option.NES_DATABASE,
                                     "Nintendo")
            self.add_database_option(Platform.PSX, Option.PSX_DATABASE,
                                     "PlayStation")
            self.add_database_option(Platform.SNES, Option.SNES_DATABASE,
                                     "Super Nintendo")
            self.add_database_option(Platform.ST, Option.ST_DATABASE,
                                     "Atari ST")
            self.add_database_option(Platform.TG16, Option.TG16_DATABASE,
                                     "TurboGrafx-16")
            self.add_database_option(Platform.TGCD, Option.TGCD_DATABASE,
                                     "TurboGrafx-CD")
            self.add_database_option(Platform.ZXS, Option.ZXS_DATABASE,
                                     "ZX Spectrum")
예제 #11
0
    def __init__(self, parent, fsgs):
        fsui.LegacyDialog.__init__(self, parent, gettext("Terms of Download"))
        self.fsgs = fsgs
        self.download_file = fsgs.config.get("download_file")
        self.download_terms = fsgs.config.get("download_terms")
        self.task = None

        self.layout = fsui.VerticalLayout()
        self.layout.set_padding(20, 20, 20, 20)

        self.icon_header = IconHeader(
            self,
            fsui.Icon("web-browser", "pkg:workspace"),
            gettext("Terms of Download"),
            gettext(
                "This game can be automatically downloaded if you "
                "accept the terms"
            ),
        )
        self.layout.add(self.icon_header, fill=True, margin_bottom=20)

        self.label = fsui.MultiLineLabel(self, gettext("Loading..."))
        self.label.set_min_width(600)
        self.label.set_min_height(100)
        self.layout.add(self.label)

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

        hori_layout.add_spacer(0, expand=True)

        self.reject_button = fsui.Button(self, gettext("Reject"))
        self.reject_button.activated.connect(self.on_reject_button)
        hori_layout.add(self.reject_button, margin_left=10)

        self.accept_button = fsui.Button(self, gettext("Accept"))
        self.accept_button.activated.connect(self.on_accept_button)
        hori_layout.add(self.accept_button, margin_left=10)

        self.accept_button.disable()
        self.reject_button.disable()

        self.task = DownloadTermsTask(self.download_terms)
        # self.task.progressed.connect(self.on_progress)
        self.task.failed.connect(self.on_failure)
        self.task.succeeded.connect(self.on_success)
        self.task.start()

        self.set_size(self.layout.get_min_size())
        self.center_on_parent()
예제 #12
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("fs-uae", "pkg:launcher")
        self.add_header(icon, "FS-UAE")

        label = fsui.MultiLineLabel(
            self,
            gettext("The following options may affect performance, "
                    "so only enable them when needed for testing or "
                    "debugging purposes."), 640)
        self.layout.add(label, fill=True, margin_top=20)

        self.add_option(Option.LOG_AUTOSCALE)
        self.add_option(Option.LOG_INPUT)
예제 #13
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("settings", "pkg:workspace")
        title = gettext("Logging")
        subtitle = ""
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(
            self,
            gettext("The following options may affect performance, "
                    "so only enable them when needed for testing or "
                    "debugging purposes."), 640)
        self.layout.add(label, fill=True, margin_top=20)

        self.add_option("log_autoscale")
        self.add_option("log_input")
예제 #14
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("maintenance", "pkg:workspace")
        title = gettext("Maintenance")
        subtitle = gettext("Miscellaneous functions to optimize {name}").format(
                           name="FS-UAE Launcher")
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(self, gettext(
            "Defragmenting the databases will improve performance "
            "by ensuring that tables and indices are stored contiguously "
            "on disk. It will also reclaim some storage space."), 640)
        self.layout.add(label, fill=True, margin_top=20)

        button = fsui.Button(self, gettext("Defragment Databases"))
        button.activated.connect(self.on_defragment_button)
        self.layout.add(button, margin_top=20)
예제 #15
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("indexing-settings", "pkg:workspace")
        gettext("File Database Settings")
        title = gettext("File Database")
        subtitle = gettext("Choose what folders you want to scan for Amiga "
                           "files")
        self.add_header(icon, title, subtitle)

        self.layout.add(fsui.MultiLineLabel(
            self,
            gettext("Choose what folders you want to scan for Amiga "
                    "files")),
                        fill=True,
                        margin_bottom=10)
        self.scan_paths_group = ScanPathsGroup(self)
        self.layout.add(self.scan_paths_group, fill=True, expand=True)
예제 #16
0
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("settings", "pkg:workspace")
        # gettext("WHDLoad Settings")
        title = gettext("WHDLoad")
        subtitle = gettext("Options for WHDLoad support in FS-UAE Launcher")
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "The following options only apply when you use the automatic "
                "WHDLoad support in FS-UAE Launcher, for example in relation with "
                "the online game database."), 640)
        self.layout.add(label, fill=True, margin_top=0)

        self.add_option("whdload_preload")
        self.add_option("whdload_splash_delay")
        self.add_option("whdload_quit_key")
    def __init__(self, parent):
        super().__init__(parent)
        # icon = fsui.Icon("language-settings", "pkg:workspace")
        # title = gettext("Language")
        # subtitle = gettext("Set language for FS-UAE applications")
        # self.add_header(icon, title, subtitle)

        PrefsNotWorkingWarningPanel(parent=self)
        self.layout.add_spacer(20)

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True)
        # hori_layout.add(fsui.Label(self, gettext("Language:")))
        hori_layout.add(fsui.Label(self, gettext("Language:")))
        hori_layout.add_spacer(0, expand=True)
        self.language_choice = LanguageSettingChoice(self)
        hori_layout.add(self.language_choice)

        self.layout.add_spacer(20)

        information = ""
        # information = gettext(
        #     "A change of language will only affect applications "
        #     "which are restarted after the change.")
        # information += "\n\n"
        information += gettext(
            "When Automatic is specified, your preferred language is set "
            "based on information from the operating system (or English, "
            "if a supported language is not detected)."
        )
        self.layout.add(fsui.MultiLineLabel(self, information, 500))

        label = fsui.Label(
            self, "You can help translate FS-UAE on crowdin.net:"
        )
        self.layout.add(label, margin_top=20)
        label = fsui.URLLabel(
            self,
            "https://crowdin.com/project/fs-uae",
            "https://crowdin.com/project/fs-uae",
        )
        self.layout.add(label, margin_top=5)
    def __init__(self, parent):
        super().__init__(parent)
        # icon = fsui.Icon("video-settings", "pkg:workspace")
        # gettext("Video Settings")
        # title = gettext("Video")
        # subtitle = ""
        # self.add_header(icon, title, subtitle)
        PrefsNotWorkingWarningPanel(parent=self)
        self.layout.add_spacer(20)

        self.add_option("fullscreen", margin_top=0)
        self.add_option("monitor")

        self.add_section(gettext("Scaling & Filters"))
        self.add_option("zoom")
        self.add_option("keep_aspect")

        # self.add_section(gettext("Filters"))
        self.add_option("scanlines")
        self.add_option("rtg_scanlines")

        self.add_section(gettext("Video Synchronization"))
        # FIXME: Move 640 to constants
        label = fsui.MultiLineLabel(
            self,
            gettext(
                "Enabling the following option will synchronize the emulation "
                "to the display when the emulation refresh rate matches the "
                "screen refresh rate."),
            640,
        )
        self.layout.add(label, fill=True, margin_top=0)
        self.video_sync_group = self.add_option("video_sync")

        self.add_section(gettext("Advanced"))
        self.add_option(Option.FULLSCREEN_MODE)
        self.add_option(Option.VIDEO_FORMAT)
        self.low_latency_group = self.add_option(Option.LOW_LATENCY_VSYNC,
                                                 margin_bottom=0)
    def __init__(self, parent):
        super().__init__(parent)

        PrefsNotWorkingWarningPanel(parent=self)
        self.layout.add_spacer(20)

        icon = fsui.Icon("settings", "pkg:workspace")
        title = gettext("Logging")
        subtitle = ""
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(
            self,
            gettext("The following options may affect performance, "
                    "so only enable them when needed for testing or "
                    "debugging purposes."),
            640,
        )
        self.layout.add(label, fill=True, margin_top=20)

        self.add_option(Option.LOG_AUTOSCALE)
        self.add_option(Option.LOG_INPUT)
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("video-settings", "pkg:workspace")
        gettext("Video Synchronization Settings")
        title = gettext("Synchronization")
        subtitle = gettext("Synchronize FS-UAE with your display for "
                           "smooth video")
        self.add_header(icon, title, subtitle)

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "Enabling the following option will synchronize the emulation "
                "to the display when the emulation refresh rate matches the"
                "screen refresh rate."), 640)
        self.layout.add(label, fill=True, margin_top=0)
        self.video_sync_group = self.add_option("video_sync")

        self.low_latency_group = self.add_option("low_latency_vsync")

        # label = fsui.MultiLineLabel(self, gettext(
        #     "Enabling the following option will prevent tearing from "
        #     "occurring, but will also use more CPU. Input latency "
        #     "may become slightly higher."), 640)
        # self.layout.add(label, fill=True, margin_top=0)
        # self.vblank_checkbox = fsui.HeadingCheckBox(self, gettext(
        #     "Synchronize buffer swaps with display (prevents tearing)"))
        # self.layout.add(self.vblank_checkbox, margin_top=20)

        self.sync_method_label = fsui.MultiLineLabel(
            self,
            gettext("Depending on your OS and OpenGL drivers, synchronizing "
                    "can use needlessly much CPU (esp. applies to "
                    "Linux). You can experiment with different sync methods "
                    "to improve performance."), 640)
        self.layout.add(self.sync_method_label, fill=True, margin_top=20)
        self.sync_method_group = self.add_option("video_sync_method")

        # self.smooth_label = fsui.MultiLineLabel(self, gettext(
        #     "In order to get really smooth Amiga graphics, you need to "
        #     "enable the following option, and also make sure your display "
        #     "is running at 50Hz (for PAL) or 60Hz (for NTSC)."), 640)
        # self.layout.add(self.smooth_label, fill=True, margin_top=20)
        # self.full_sync_checkbox = fsui.HeadingCheckBox(self, gettext(
        #     "Also synchronize emulation with display when possible "
        #     "(smooth scrolling)"))
        # self.layout.add(self.full_sync_checkbox, margin_top=20)

        self.layout.add_spacer(0, expand=True)

        hori_layout = fsui.HorizontalLayout()
        self.layout.add(hori_layout, fill=True, margin_top=10)
        hori_layout.add(
            fsui.ImageView(self,
                           fsui.Image("launcher:res/16x16/world_link.png")))
        label = fsui.URLLabel(
            self, gettext("How to achieve perfectly smooth scrolling"),
            "https://fs-uae.net/perfectly-smooth-scrolling")
        hori_layout.add(label, margin_left=6)

        text = gettext(
            "Synchronizing with the display can in some cases cause "
            "increased stuttering and low frame rates (esp. in some Linux "
            "desktop environments with compositing enabled).")
        link = (" <a href='https://fs-uae.net/video-synchronization-issues'>"
                "{0}</a>.".format(gettext("Read more")))

        label = fsui.MultiLineLabel(self, text + link, min_width=640)
        self.layout.add(label, fill=True, margin_top=20)

        LauncherSettings.add_listener(self)
        for key in ["video_sync"]:
            self.on_setting(key, LauncherSettings.get(key))
    def __init__(self, parent):
        super().__init__(parent)

        # label = fsui.MultiLineLabel(
        #     self,
        #     gettext(
        #         "These options only apply when you use the automatic WHDLoad "
        #         "support in FS-UAE Launcher & Arcade. (*)"
        #     ),
        #     self.WIDTH,
        # )
        # self.layout.add(label, fill=True, margin_top=0, margin_bottom=20)

        self.add_option(
            Option.WHDLOAD_VERSION,
            margin_top=0,
            warnings=[(key_path_override_warning, [Option.WHDLOAD_PATH])],
        )
        self.add_divider()
        # FIXME: Show units with grayed out text after the main label?
        # "Splash delay: [unit text in gray]"
        self.add_option(
            Option.WHDLOAD_SPLASH_DELAY,
            # gettext("Splash delay (1/50ths seconds)"),
            gettext("Splash delay"),
            # margin_top=20,
        )
        self.add_divider()
        self.add_option(
            Option.WHDLOAD_PRELOAD,
            gettext("Preload game into RAM"),
            # margin_top=20,
        )
        self.add_divider()
        self.add_option(
            Option.WHDLOAD_QUIT_KEY,
            gettext("Quit key"),
            # margin_top=20
        )
        self.add_divider()

        # FIXME: Label should have a flag to enable HTML-like markup.
        # markup=True. Should default to false and "escape" special chars.
        # label = fsui.Label(
        #     self,
        #     gettext("WHDLoad.key file (For WHDLoad < 18.3):").replace(
        #         "<", "&lt;"
        #     ),
        # )

        label = self.create_option_label(
            self,
            gettext("WHDLoad.key file"),
        )
        self.layout.add(label, margin_top=10)

        horilayout = fsui.HorizontalLayout()
        self.layout.add(horilayout, fill=True, margin_top=6)
        self.whdload_key_path_picker = FilePickerField(
            self,
            path=get_settings(self).get(Option.WHDLOAD_KEY_PATH),
            placeholder=gettext("Registration key For WHDLoad < 18.3"),
        )
        self.whdload_key_path_picker.changed.connect(
            self.__on_whdload_key_path_changed)
        horilayout.add(self.whdload_key_path_picker, expand=True)
        helpbutton = OptionHelpButton(self, Option.WHDLOAD_KEY_PATH)
        horilayout.add(helpbutton, fill=True, margin_left=10)

        self.add_divider()

        label = self.create_option_label(
            self,
            gettext("Custom WHDLoad executable"),
        )
        self.layout.add(label, margin_top=10)

        horilayout = fsui.HorizontalLayout()
        self.layout.add(horilayout, fill=True, margin_top=6)
        self.whdload_path_picker = FilePickerField(
            self,
            path=get_settings(self).get(Option.WHDLOAD_PATH),
            placeholder=gettext("Overrides WHDLoad version"),
        )
        self.whdload_path_picker.changed.connect(
            self.__on_whdload_path_changed)
        horilayout.add(self.whdload_path_picker, expand=True)
        helpbutton = OptionHelpButton(self, Option.WHDLOAD_PATH)
        horilayout.add(helpbutton, fill=True, margin_left=10)

        # self.add_divider()

        label = fsui.MultiLineLabel(
            self,
            gettext(
                "These options only apply when you use the automatic WHDLoad "
                "support in FS-UAE Launcher & Arcade, for example when "
                "running WHDLoad variants from the online game database."),
            self.WIDTH,
        )
        self.layout.add(label, fill=True, margin_top=20)

        self.layout.add(
            DefaultPrefsButton(
                self,
                options=[
                    Option.WHDLOAD_KEY_PATH,
                    Option.WHDLOAD_PATH,
                    Option.WHDLOAD_PRELOAD,
                    Option.WHDLOAD_QUIT_KEY,
                    Option.WHDLOAD_SPLASH_DELAY,
                    Option.WHDLOAD_VERSION,
                ],
            ),
            margin_top=20,
        )
예제 #22
0
    def __init__(self, parent, fsgs):
        fsui.Window.__init__(self, parent, gettext("Download Game Manually"))
        self.fsgs = fsgs
        self.download_page = fsgs.config.get("download_page")
        self.download_notice = fsgs.config.get("download_notice")
        self.task = None

        self.layout = fsui.VerticalLayout()
        self.layout.set_padding(20, 20, 20, 20)

        self.icon_header = IconHeader(
            self, fsui.Icon("web-browser", "pkg:workspace"),
            gettext("Download Game Manually"),
            gettext("This game must be downloaded before you can play it"))
        self.layout.add(self.icon_header, fill=True, margin_bottom=20)

        label = fsui.HeadingLabel(
            self,
            gettext("Please open the following web page and download the "
                    "game from there:"))
        label.set_min_width(500)
        self.layout.add(label)

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

        hori_layout.add(
            fsui.ImageView(self,
                           fsui.Image("launcher:res/16x16/world_link.png")))

        label = fsui.URLLabel(self, self.download_page, self.download_page)
        hori_layout.add(label, margin_left=6)

        if self.download_notice:
            label = fsui.MultiLineLabel(self, self.download_notice)
            label.set_min_width(500)
            self.layout.add(label, margin_top=20)

        label = fsui.HeadingLabel(
            self,
            gettext("Download to the following directory, and then "
                    "click '{0}':".format(gettext("Scan Downloads"))))
        label.set_min_width(500)
        self.layout.add(label, margin_top=20)

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

        hori_layout.add(
            fsui.ImageView(self, fsui.Image("launcher:res/16x16/folder.png")))

        label = fsui.Label(self, FSGSDirectories.ensure_downloads_dir())
        hori_layout.add(label, margin_left=6)

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

        self.status_label = fsui.Label(self, "")
        hori_layout.add(self.status_label, expand=True)

        self.scan_button = fsui.Button(self, gettext("Scan Downloads"))
        self.scan_button.activated.connect(self.on_scan_files)
        hori_layout.add(self.scan_button, margin_left=20)

        self.close_button = fsui.Button(self, gettext("Close"))
        self.close_button.activated.connect(self.on_close)
        hori_layout.add(self.close_button, margin_left=10)

        self.set_size(self.layout.get_min_size())
        self.center_on_parent()