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) # For reset to defaults function self.options_on_page.add(Option.SEARCH_PATH)
def on_browse_button(self, extended=False): default_dir = FSGSDirectories.get_kickstarts_dir() if extended: title = gettext("Choose Extended ROM") key = "kickstart_ext_file" else: title = gettext("Choose Kickstart ROM") key = "kickstart_file" dialog = LauncherFilePicker(self.get_window(), title, "rom", LauncherConfig.get(key)) if not dialog.show_modal(): return path = dialog.get_path() checksum_tool = ChecksumTool(self.get_window()) sha1 = checksum_tool.checksum_rom(path) dir_path, file = os.path.split(path) if extended: self.ext_text_field.set_text(file) else: self.text_field.set_text(file) if os.path.normcase(os.path.normpath(dir_path)) == \ os.path.normcase(os.path.normpath(default_dir)): path = file if extended: LauncherConfig.set_multiple([("kickstart_ext_file", path), ("x_kickstart_ext_file", path), ("x_kickstart_ext_file_sha1", sha1)]) else: LauncherConfig.set_multiple([("kickstart_file", path), ("x_kickstart_file", path), ("x_kickstart_file_sha1", sha1)])
def __init__(self, parent): # # FIXME: parent not needed? super().__init__() self.add_item( gettext("Execute command..."), self.__on_execute_command, ) self.add_separator() self.add_item( gettext("Trigger exception..."), self.__on_cause_exception, ) self.add_item( gettext("Trigger exception (chained)..."), self.__on_cause_chained_exception, ) self.add_item( gettext("Trigger exception (double handlers)..."), self.__on_cause_exception_doubled_handled, ) self.add_separator() self.add_item(gettext("New Launcher window"), self.__on_new_window) self.add_item(gettext("Preferences"), self.__on_preferences) self.add_item(gettext("Tools"), self.__on_tools) self.add_item(gettext("Utilities"), self.__on_utilities) self.add_separator() self.add_about_item(gettext("About..."), self.__on_about) self.add_item(gettext("Quit..."), self.__on_quit)
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): super().__init__(parent) icon = fsui.Icon("joystick-settings", "pkg:workspace") # gettext("Joystick Settings") title = gettext("Joysticks & Gamepads") subtitle = gettext("Configure joysticks and set preferred joystick " "devices") self.add_header(icon, title, subtitle) self.list_view = fsui.ListView(self) self.list_view.set_min_height(140) self.list_view.item_activated.connect(self.on_joystick_activated) image = fsui.Image("workspace:res/16/gamepad.png") for device_name in DeviceManager.get_joystick_names(): if DeviceManager.is_joystick(device_name): self.list_view.add_item(device_name, icon=image) self.layout.add(self.list_view, fill=True, expand=True) label = fsui.Label( self, gettext("Double-click a device entry to configure it (map " "joystick buttons).")) self.layout.add(label, margin_top=10) self.layout.add_spacer(20) self.pref_group = PreferredJoysticksGroup(self) self.layout.add(self.pref_group, fill=True)
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)
def __init__(self, parent): super().__init__( parent, title=gettext("Execute a file"), maximizable=False, minimizable=False, escape=True, ) vertlayout = VerticalLayout(20) self.layout.add(vertlayout, fill=True, expand=True) vertlayout.add(Label(self, gettext("Enter command and its arguments:"))) horilayout = HorizontalLayout() vertlayout.add(horilayout, fill=True, margin_top=10) horilayout.add(Label(self, gettext("Command:")), fill=True) self.textfield = TextField(self) self.textfield.set_min_width(300) self.textfield.activated.connect(self.__on_execute) horilayout.add(self.textfield, expand=True, fill=True, margin_left=10) # Creating execute button first, so it will become default for when # the user presses return in the text field. This only applies when # this dialog is implemented as an actual Dialog though. self.executebutton = Button(self, gettext("Execute")) self.executebutton.activated.connect(self.__on_execute) self.cancelbutton = Button(self, gettext("Cancel")) self.cancelbutton.activated.connect(self.__on_cancel) horilayout = HorizontalLayout() vertlayout.add(horilayout, fill=True, margin_top=20) horilayout.add_spacer(0, expand=True) horilayout.add(self.cancelbutton, margin_left=10) horilayout.add(self.executebutton, margin_left=10) self._command = ""
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, ("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, ("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)
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)
def on_add_button(self): existing_items = self.create_list() default_dir = FSGSDirectories.get_floppies_dir() if self.cd_mode: dialog = LauncherFilePicker(self.get_window(), gettext("Select Multiple CD-ROMs"), "cd", multiple=True) else: dialog = LauncherFilePicker(self.get_window(), gettext("Select Multiple Floppies"), "floppy", multiple=True) if not dialog.show_modal(): print("dialog.show returned false") return print("dialog.show returned true") paths = dialog.get_paths() paths.sort() print(paths) checksum_tool = ChecksumTool(self.get_window()) for i, path in enumerate(paths): sha1 = checksum_tool.checksum(path) path = Paths.contract_path(path, default_dir) dir, file = os.path.split(path) if os.path.normcase(os.path.normpath(dir)) == \ os.path.normcase(os.path.normpath(default_dir)): path = file existing_items.append((path, sha1)) self.set_new_config(existing_items)
def add_game_warnings(self): if is_warning(self.x_missing_files): if self.download_file: text = gettext("Auto-Download") self.warnings.append((NOTICE_LEVEL, text, "")) elif self.download_page: text = gettext("Download Game") self.warnings.append((WARNING_LEVEL, text, "on_download_page")) else: text = gettext("Missing Game Files") self.warnings.append((ERROR_LEVEL, text, "")) for name in ["variant_notice", "game_notice"]: value = getattr(self, name) if not value: continue if value.startswith("WARNING: "): level = WARNING_LEVEL message = value[9:] else: level = NOTICE_LEVEL message = value self.warnings.append((level, message, "")) if self.variant_warning: self.warnings.append((WARNING_LEVEL, self.variant_warning, "")) if self.variant_error: self.warnings.append((ERROR_LEVEL, self.variant_error, ""))
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)
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)
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.HorizontalLayout() # self.layout.padding_left = 10 # self.layout.padding_right = 10 # image = fsui.Image("launcher:res/joystick.png") # self.image_view = fsui.ImageView(self, image) # self.layout.add(self.image_view, valign=0.0) # self.layout.add_spacer(20) self.layout2 = fsui.VerticalLayout() self.layout.add(self.layout2, fill=True, expand=True) heading = gettext("Preferred Controllers") label = fsui.HeadingLabel(self, heading) self.layout2.add(label) self.layout2.add_spacer(20) label = fsui.Label(self, gettext("Preferred controller (if present):")) self.layout2.add(label) self.layout2.add_spacer(6) selector = PreferredJoystickSelector(self, 0) self.layout2.add(selector, fill=True) self.layout2.add_spacer(20) label = fsui.Label( self, gettext("Preferred device for secondary controller:")) self.layout2.add(label) self.layout2.add_spacer(6) selector = PreferredJoystickSelector(self, 1) self.layout2.add(selector, fill=True)
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)
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 on_add_button(self): existing_items = self.create_list() default_dir = FSGSDirectories.get_floppies_dir() if self.cd_mode: dialog = LauncherFilePicker( self.get_window(), gettext("Select Multiple CD-ROMs"), "cd", multiple=True) else: dialog = LauncherFilePicker( self.get_window(), gettext("Select Multiple Floppies"), "floppy", multiple=True) if not dialog.show_modal(): print("dialog.show returned false") return print("dialog.show returned true") paths = dialog.get_paths() paths.sort() print(paths) checksum_tool = ChecksumTool(self.get_window()) for i, path in enumerate(paths): sha1 = checksum_tool.checksum(path) path = Paths.contract_path(path, default_dir) dir, file = os.path.split(path) if os.path.normcase(os.path.normpath(dir)) == \ os.path.normcase(os.path.normpath(default_dir)): path = file existing_items.append((path, sha1)) self.set_new_config(existing_items)
def on_timer(self): if not Scanner.running: if self.has_started_scan: if Scanner.error: self.set_scan_title(gettext("Scan error")) self.set_scan_status(Scanner.error) else: if not self.interactive: self.end_modal(True) return self.set_scan_title(gettext("Scan complete")) self.set_scan_status( gettext("Click 'Scan' button if you want to re-scan")) else: self.set_scan_title(gettext("No scan in progress")) self.set_scan_status( gettext("Click 'Scan' button to start scan")) if self.scan_button is not None: self.scan_button.enable() self.stop_button.disable() # self.close_button.enable() return status = Scanner.status self.set_scan_title(status[0]) self.set_scan_status(status[1])
def __init__(self, parent): super().__init__(parent) icon = fsui.Icon("joystick-settings", "pkg:workspace") # gettext("Joystick Settings") title = gettext("Controllers") subtitle = gettext( "Configure joysticks and set preferred joystick " "devices" ) self.add_header(icon, title, subtitle) label = fsui.Label( self, gettext("Double-click a controller to configure it:") ) self.layout.add(label, margin_bottom=10) self.list_view = fsui.ListView(self) self.list_view.set_min_height(140) self.list_view.item_activated.connect(self.on_joystick_activated) image = fsui.Image("workspace:res/16x16/gamepad.png") for device_name in DeviceManager.get_joystick_names(): if DeviceManager.is_joystick(device_name): self.list_view.add_item(device_name, icon=image) self.layout.add(self.list_view, fill=True, expand=True) self.layout.add_spacer(20) self.pref_group = PreferredJoysticksGroup(self) self.layout.add(self.pref_group, fill=True) # For reset to defaults function self.options_on_page.add(Option.PRIMARY_JOYSTICK) self.options_on_page.add(Option.SECONDARY_JOYSTICK)
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, ( "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, ( "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)
def on_config(self, key, value): if key == "protection": print(" -- protection --", value) if value != self.protection: self.protection = value if not value: self.icon = self.protection_icon self.active = False self.text = self.na_text elif value.lower() == "none": # self.icon = self.disabled_icon # self.active = True self.icon = self.protection_icon self.active = False self.text = gettext("No Protection") elif value.lower() in ["dongle"]: # self.icon = self.disabled_icon # self.active = True self.icon = self.protection_icon self.active = False self.text = gettext("Dongle") else: self.icon = self.protection_icon self.active = True self.text = value self.refresh()
def rebuild_warnings(self): self.warnings = [] if self.using_joy_emu and self.joy_emu_conflict: self.warnings.append((WARNING_LEVEL, self.joy_emu_conflict, "")) self.add_option_warnings() self.add_game_warnings() if self.update_available: text = gettext("Update available: {version}").format( version=self.update_available) self.warnings.append((NOTICE_LEVEL, text, "on_update")) if self.outdated_plugins: text = gettext("Outdated plugins: {0}".format( ", ".join(self.outdated_plugins))) self.warnings.append((ERROR_LEVEL, text, "on_outdated_plugins")) if self.x_kickstart_file_sha1 == Amiga.INTERNAL_ROM_SHA1 and \ self.kickstart_file != "internal": # text = gettext("Compatibility Issue") # self.warnings.append((ERROR_LEVEL, text, "on_kickstart_warning")) text = gettext("Using Kickstart ROM replacement") self.warnings.append((WARNING_LEVEL, text, "on_kickstart_warning")) text = gettext("Click to import Kickstart ROMs") self.warnings.append((NOTICE_LEVEL, text, "on_import_kickstarts")) if self.__error: self.warnings.append((ERROR_LEVEL, self.__error, "")) self.add_config_warnings() self.warnings.sort(key=itemgetter(0))
def add_game_warnings(self): if is_warning(self.x_missing_files): if self.download_file: text = gettext("Auto-download") self.warnings.append((NOTICE_LEVEL, text, "")) elif self.download_page: text = gettext("Download game") self.warnings.append((WARNING_LEVEL, text, "on_download_page")) else: text = gettext("Missing game files") self.warnings.append((ERROR_LEVEL, text, "")) for name in ["variant_notice", "game_notice"]: value = getattr(self, name) if not value: continue if value.startswith("WARNING: "): level = WARNING_LEVEL message = value[9:] else: level = NOTICE_LEVEL message = value self.warnings.append((level, message, "")) if self.variant_warning: self.warnings.append((WARNING_LEVEL, self.variant_warning, "")) if self.variant_error: self.warnings.append((ERROR_LEVEL, self.variant_error, ""))
def __init__(self, parent, options, key, use_checkbox=False): choices = [("1", gettext("Enabled")), ("0", gettext("Disabled"))] # if not use_checkbox: # choices.insert(0, ("", gettext("Auto"))) super().__init__( parent, options, key, choices, use_checkbox=use_checkbox )
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)
def on_timer(self): if not Scanner.running: if self.has_started_scan: if Scanner.error: self.set_scan_title(gettext("Scan error")) self.set_scan_status(Scanner.error) else: if not self.interactive: self.end_modal(True) return self.set_scan_title(gettext("Scan complete")) self.set_scan_status( gettext("Click 'Scan' button if you want to re-scan") ) else: self.set_scan_title(gettext("No scan in progress")) self.set_scan_status( gettext("Click 'Scan' button to start scan") ) if self.scan_button is not None: self.scan_button.enable() self.stop_button.disable() # self.close_button.enable() return status = Scanner.status self.set_scan_title(status[0]) self.set_scan_status(status[1])
def __init__(self, parent): super().__init__(parent, gettext("V-Sync")) self.set_tooltip( gettext( "When checked, enable video synchronization whenever possible") ) SettingsBehavior(self, ["video_sync"])
def scan(self, database): self.set_status(gettext("Scanning games"), gettext("Please wait...")) self.set_status( gettext("Scanning configurations"), gettext("Scanning game database entries..."), ) helper = ScanHelper(database) for database_name, game_database in GameDatabaseIterator( self.fsgc ).game_databases(): with game_database: self.scan_game_database(helper, database_name, game_database) if self.stop_check(): return # if False: # with self.fsgs.get_game_database() as game_database: # self.scan_game_database(helper, game_database) # if self.stop_check(): # return # if Settings.get(Option.DATABASE_SNES) == "1": # with self.fsgs.game_database("snes") as game_database: # self.scan_game_database(helper, game_database) # if self.stop_check(): # return helper.finish()
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 scan(self, database): self.set_status(gettext("Scanning games"), gettext("Please wait...")) self.set_status( gettext("Scanning configurations"), gettext("Scanning game database entries..."), ) helper = ScanHelper(database) for database_name, game_database in GameDatabaseIterator( self.fsgc).game_databases(): with game_database: self.scan_game_database(helper, database_name, game_database) if self.stop_check(): return # if False: # with self.fsgs.get_game_database() as game_database: # self.scan_game_database(helper, game_database) # if self.stop_check(): # return # if Settings.get(Option.DATABASE_SNES) == "1": # with self.fsgs.game_database("snes") as game_database: # self.scan_game_database(helper, game_database) # if self.stop_check(): # return helper.finish()
def on_browse(self): if self.mode == self.CD_MODE: title = gettext("Choose CD-ROM Image") # default_dir = FSGSDirectories.get_cdroms_dir() media_type = "cd" elif self.mode == self.TAPE_MODE: title = gettext("Choose Tape Image") media_type = "tape" elif self.mode == self.CARTRIDGE_MODE: title = gettext("Choose Cartridge Image") media_type = "cartridge" else: title = gettext("Choose Floppy Image") # default_dir = FSGSDirectories.get_floppies_dir() media_type = "floppy" dialog = LauncherFilePicker( self.window, title, media_type, LauncherConfig.get(self.config_key)) if not dialog.show_modal(): return path = dialog.get_path() if self.mode == self.CD_MODE: fsgs.amiga.insert_cd(self.drive, path) elif self.mode == self.FLOPPY_MODE: fsgs.amiga.insert_floppy(self.drive, path) else: fsgs.config.set(self.config_key, Paths.contract_path(path))
def rebuild_warnings(self): self.warnings = [] if self.using_joy_emu and self.joy_emu_conflict: self.warnings.append((WARNING_LEVEL, self.joy_emu_conflict, "")) self.add_option_warnings() self.add_game_warnings() if self.update_available: text = gettext("Update available: {version}").format( version=self.update_available) self.warnings.append((NOTICE_LEVEL, text, "on_update")) if self.outdated_plugins: text = gettext("Outdated plugins: {0}".format(", ".join( self.outdated_plugins))) self.warnings.append((ERROR_LEVEL, text, "on_outdated_plugins")) if (self.platform in ["", "amiga", "cdtv", "cd32"] and self.x_kickstart_file_sha1 == Amiga.INTERNAL_ROM_SHA1 and self.kickstart_file != "internal"): # text = gettext("Compatibility Issue") # self.warnings.append((ERROR_LEVEL, text, "on_kickstart_warning")) text = gettext("Using Kickstart ROM replacement") self.warnings.append((WARNING_LEVEL, text, "on_kickstart_warning")) text = gettext("Click to import Kickstart ROMs") self.warnings.append((NOTICE_LEVEL, text, "on_import_kickstarts")) if self.__error: self.warnings.append((ERROR_LEVEL, self.__error, "")) self.add_config_warnings() self.warnings.sort(key=itemgetter(0))
def __init__(self, parent): fsui.Panel.__init__(self, parent) self.layout = fsui.VerticalLayout() # self.layout.set_padding(20, 20, 20, 20) self.icon_header = NewIconHeader( self, fsui.Icon("video-settings", "pkg:workspace"), gettext("Scaling Options"), "", ) self.layout.add(self.icon_header, fill=True, margin_bottom=20) def add_option(name): self.layout.add( OptionUI.create_group(self, name), fill=True, margin_top=10, margin_bottom=10, ) add_option("zoom") add_option("keep_aspect") label = fsui.HeadingLabel(self, gettext("Filters")) self.layout.add(label, margin_top=20, margin_bottom=20) add_option("scanlines") add_option("rtg_scanlines")
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() label = fsui.HeadingLabel(self, gettext("Available Kickstart Versions")) self.layout.add(label, margin_bottom=10) icon_layout = fsui.HorizontalLayout() self.layout.add(icon_layout, fill=True) icon_layout.add_spacer(20) image = fsui.Image("launcher:/data/kickstart.png") self.image_view = fsui.ImageView(self, image) icon_layout.add(self.image_view, valign=0.0, margin_right=10) vert_layout = fsui.VerticalLayout() icon_layout.add(vert_layout, fill=True, expand=True) vert_layout.add_spacer(0) label = fsui.Label( self, gettext("You should have kickstart files for " "each Amiga model you want to use:"), ) vert_layout.add(label, margin_bottom=0) hori_layout = fsui.HorizontalLayout() vert_layout.add(hori_layout, fill=True) self.kickstart_groups = [] column_layout = fsui.VerticalLayout() hori_layout.add(column_layout, expand=True, fill=True, margin=10) self.add_kickstart_group(column_layout, "Amiga 1000", "A1000") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 500", "A500") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 500+", "A500+") column_layout = fsui.VerticalLayout() hori_layout.add(column_layout, expand=True, fill=True, margin=10) self.add_kickstart_group(column_layout, "Amiga 600", "A600") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 1200", "A1200") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 3000", "A3000") column_layout = fsui.VerticalLayout() hori_layout.add(column_layout, expand=True, fill=True, margin=10) self.add_kickstart_group(column_layout, "Amiga 4000", "A4000/040") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga CD32", "CD32") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Commodore CDTV", "CDTV")
def __init__(self, parent): super().__init__(parent, gettext("V-Sync")) self.set_tooltip( gettext( "When checked, enable video synchronization whenever possible" ) ) SettingsBehavior(self, ["video_sync"])
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): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() label = fsui.HeadingLabel( self, gettext("Available Kickstart Versions")) self.layout.add(label, margin_bottom=10) icon_layout = fsui.HorizontalLayout() self.layout.add(icon_layout, fill=True) icon_layout.add_spacer(20) image = fsui.Image("launcher:res/kickstart.png") self.image_view = fsui.ImageView(self, image) icon_layout.add(self.image_view, valign=0.0, margin_right=10) vert_layout = fsui.VerticalLayout() icon_layout.add(vert_layout, fill=True, expand=True) vert_layout.add_spacer(0) label = fsui.Label( self, gettext("You should have kickstart files for " "each Amiga model you want to use:")) vert_layout.add(label, margin_bottom=0) hori_layout = fsui.HorizontalLayout() vert_layout.add(hori_layout, fill=True) self.kickstart_groups = [] column_layout = fsui.VerticalLayout() hori_layout.add(column_layout, expand=True, fill=True, margin=10) self.add_kickstart_group(column_layout, "Amiga 1000", "A1000") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 500", "A500") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 500+", "A500+") column_layout = fsui.VerticalLayout() hori_layout.add(column_layout, expand=True, fill=True, margin=10) self.add_kickstart_group(column_layout, "Amiga 600", "A600") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 1200", "A1200") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga 3000", "A3000") column_layout = fsui.VerticalLayout() hori_layout.add(column_layout, expand=True, fill=True, margin=10) self.add_kickstart_group(column_layout, "Amiga 4000", "A4000/040") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Amiga CD32", "CD32") column_layout.add_spacer(10) self.add_kickstart_group(column_layout, "Commodore CDTV", "CDTV")
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")
def __init__(self, parent): super().__init__(parent) icon = fsui.Icon("netplay-settings", "pkg:workspace") gettext("Net Play Settings") title = gettext("Net Play") subtitle = "" self.add_header(icon, title, subtitle) self.add_option("irc_nick") self.add_option("netplay_tag") self.add_option("irc_server")
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"])
def __init__(self, parent): super().__init__(parent) icon = fsui.Icon("mouse-settings", "pkg:workspace") gettext("Mouse Settings") title = gettext("Mouse") subtitle = "" self.add_header(icon, title, subtitle) self.add_option("automatic_input_grab") self.add_option("initial_input_grab") self.add_option("middle_click_ungrab") self.add_option("mouse_speed")
def __init__(self, parent, title, task, *, gscontext): print("LaunchDialog parent =", parent) self.gscontext = gscontext self.has_parent = parent is not None self.no_gui = "--no-gui" in sys.argv super().__init__(parent, title, maximizable=False) self.layout = fsui.VerticalLayout() self.layout.add_spacer(400, 20) hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, fill=True) hor_layout.padding_right = 20 hor_layout.add_spacer(20) image = fsui.Image("launcher:/data/fs_uae_group.png") self.image_view = fsui.ImageView(self, image) hor_layout.add(self.image_view, valign=0.0) hor_layout.add_spacer(20) ver_layout = fsui.VerticalLayout() hor_layout.add(ver_layout, fill=True, expand=True) self.title_label = fsui.HeadingLabel(self, title) ver_layout.add(self.title_label, fill=True) ver_layout.add_spacer(6) self.sub_title_label = fsui.Label(self, gettext("Preparing...")) ver_layout.add(self.sub_title_label, fill=True) self.layout.add_spacer(20) hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, fill=True) hor_layout.add_spacer(20, expand=True) self.cancel_button = fsui.Button(self, gettext("Cancel")) self.cancel_button.activated.connect(self.on_cancel_button) hor_layout.add(self.cancel_button) hor_layout.add_spacer(20) self.layout.add_spacer(20) self.set_size(self.layout.get_min_size()) self.center_on_parent() self.was_closed = False self.task = task self.task.progressed.connect(self.on_progress) self.task.finished.connect(self.on_complete) self.task.failed.connect(self.on_error) self.closed.connect(self.__closed)
def add_config_warnings(self): # FIXME: move such warnings to config model code instead if (self.chip_memory_calculated and self.chip_memory_calculated < 2048 and self.amiga_model_calculated in ["A1200", "A4000"]): text = gettext("{amiga_model} with < 2 MB chip memory").format( amiga_model=self.amiga_model) self.warnings.append((WARNING_LEVEL, text, "")) if LauncherConfig.get("amiga_model") == "A4000/OS4": if LauncherConfig.get("jit_compiler") == "1": text = gettext( "JIT compiler with a PPC-only OS is not recommended") self.warnings.append((WARNING_LEVEL, text, ""))
def __init__(self, parent): super().__init__(parent) icon = fsui.Icon("mouse-settings", "pkg:workspace") gettext("Mouse Settings") title = gettext("Mouse") subtitle = "" self.add_header(icon, title, subtitle) self.add_option("automatic_input_grab") self.add_option("initial_input_grab") self.add_option("middle_click_ungrab") self.add_option("mouse_speed")
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"])
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"])
def add_config_warnings(self): # FIXME: move such warnings to config model code instead if self.chip_memory_calculated and \ self.chip_memory_calculated < 2048 and \ self.amiga_model_calculated in ["A1200", "A4000"]: text = gettext("{amiga_model} with < 2 MB chip memory").format( amiga_model=self.amiga_model) self.warnings.append((WARNING_LEVEL, text, "")) if LauncherConfig.get("amiga_model") == "A4000/OS4": if LauncherConfig.get("jit_compiler") == "1": text = gettext( "JIT compiler with a PPC-only OS is not recommended") self.warnings.append((WARNING_LEVEL, text, ""))
def update_auto_item(self): # if self.use_checkbox: # # Checkboxes are used, so there isn't an auto entry! # # return # # if self.options.get(self.key): # # self.set_from_value(self.implicit_value) # pass # else: if self.get_index() == 0 and self.implicit_value: text = gettext("Auto - {}".format(self.implicit_value)) else: text = gettext("Auto") self.set_item_text(0, text)
def update_auto_item(self): # if self.use_checkbox: # # Checkboxes are used, so there isn't an auto entry! # # return # # if self.options.get(self.key): # # self.set_from_value(self.implicit_value) # pass # else: if self.get_index() == 0 and self.implicit_value: text = gettext("Auto - {}".format(self.implicit_value)) else: text = gettext("Auto") self.set_item_text(0, text)
def __init__(self, parent, title, task): print("LaunchDialog parent =", parent) self.has_parent = parent is not None self.no_gui = "--no-gui" in sys.argv super().__init__(parent, title, maximizable=False) self.layout = fsui.VerticalLayout() self.layout.add_spacer(400, 20) hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, fill=True) hor_layout.padding_right = 20 hor_layout.add_spacer(20) image = fsui.Image("launcher:res/fs_uae_group.png") self.image_view = fsui.ImageView(self, image) hor_layout.add(self.image_view, valign=0.0) hor_layout.add_spacer(20) ver_layout = fsui.VerticalLayout() hor_layout.add(ver_layout, fill=True, expand=True) self.title_label = fsui.HeadingLabel(self, title) ver_layout.add(self.title_label, fill=True) ver_layout.add_spacer(6) self.sub_title_label = fsui.Label(self, gettext("Preparing...")) ver_layout.add(self.sub_title_label, fill=True) self.layout.add_spacer(20) hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, fill=True) hor_layout.add_spacer(20, expand=True) self.cancel_button = fsui.Button(self, gettext("Cancel")) self.cancel_button.activated.connect(self.on_cancel_button) hor_layout.add(self.cancel_button) hor_layout.add_spacer(20) self.layout.add_spacer(20) self.set_size(self.layout.get_min_size()) self.center_on_parent() self.was_closed = False self.task = task self.task.progressed.connect(self.on_progress) self.task.finished.connect(self.on_complete) self.task.failed.connect(self.on_error) self.closed.connect(self.__closed)
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.hori_layout = None self.hori_counter = 0 self.add_option(Option.DATABASE_SHOW_GAMES) self.add_option(Option.DATABASE_SHOW_ADULT) self.add_option(Option.DATABASE_SHOW_UNPUBLISHED)
def start_scan(self): if self.scan_button is not None: self.scan_button.disable() self.has_started_scan = True self.set_scan_title(gettext("Starting scan")) self.set_scan_status(gettext("Please wait...")) paths = ScanPathsGroup.get_search_path() # self.close_button.disable() self.stop_button.enable() Scanner.start(paths, scan_for_files=self.scan_for_files, update_game_database=self.update_game_database, purge_other_dirs=True)
def update_heading_label(self): if self.mode == self.CD_MODE: if self.num_drives > 1: self.label.set_text(gettext("CD-ROM Drives")) else: self.label.set_text(gettext("CD-ROM Drive")) elif self.mode == self.TAPE_MODE: self.label.set_text(gettext("Tape Drive")) elif self.mode == self.CARTRIDGE_MODE: self.label.set_text(gettext("Cartridge")) else: self.label.set_text(gettext("Floppy Drives")) # Need to update the layout to account for label widget size change. self.layout.update()
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() heading_label = fsui.HeadingLabel(self, gettext("ROM & RAM")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) label = fsui.Label(self, gettext("Kickstart ROM") + ":") hori_layout.add(label, margin_left=10, margin_right=10) kickstart_types = [gettext("Default"), gettext("Custom"), gettext("Internal")] self.kickstart_type_choice = fsui.Choice(self, kickstart_types) hori_layout.add(self.kickstart_type_choice, margin=10) self.text_field = fsui.TextField(self, "", read_only=True) hori_layout.add(self.text_field, expand=True, margin=10) self.browse_button = IconButton(self, "browse_file_16.png") self.browse_button.set_tooltip(gettext("Browse for File")) self.browse_button.activated.connect(self.on_browse_button) hori_layout.add(self.browse_button, margin=10) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) label = fsui.Label(self, gettext("Extended ROM") + ":") hori_layout.add(label, margin_left=10, margin_right=10) # self.layout.add_spacer(0) kickstart_types = [gettext("Default"), gettext("Custom")] self.ext_rom_type_choice = fsui.Choice(self, kickstart_types) hori_layout.add(self.ext_rom_type_choice, margin_right=10) self.ext_text_field = fsui.TextField(self, "", read_only=True) hori_layout.add(self.ext_text_field, expand=True, margin_right=10) self.ext_browse_button = IconButton(self, "browse_file_16.png") self.ext_browse_button.set_tooltip(gettext("Browse for File")) self.ext_browse_button.activated.connect(self.on_ext_browse_button) hori_layout.add(self.ext_browse_button, margin_right=10) self.initialize_from_config() self.set_config_handlers()
def populate_list(self): database = Database.instance() self.game_lists = database.get_game_lists() if len(self.game_lists) > 0: self.game_lists.insert(0, ["", self.ITEM_SEPARATOR]) self.game_lists.insert(0, [Database.GAME_LIST_GAMES, gettext("Games")]) self.game_lists.insert( 0, [Database.GAME_LIST_CONFIGS, gettext("Configs")] ) self.game_lists.insert(0, ["", gettext("Configs and Games")]) self.clear() for item in self.game_lists: list_name = item[1] if list_name == "Favorites": list_name = gettext("Favorites") self.add_item(list_name)
def __init__(self, parent): super().__init__(parent, gettext("Import Kickstarts")) self.theme = LauncherTheme.get() self.layout = fsui.VerticalLayout(padding=20) self.panel = SetupPanel(self) self.panel.set_min_width(620) self.layout.add(self.panel)
def start_local_game(cls): print("START LOCAL GAME") print("x_missing_files", LauncherConfig.get("x_missing_files")) if LauncherConfig.get("x_missing_files"): if LauncherConfig.get("download_file"): if LauncherConfig.get("download_terms") and not \ Downloader.check_terms_accepted( LauncherConfig.get("download_file"), LauncherConfig.get("download_terms")): from .ui.launcher_window import LauncherWindow dialog = DownloadTermsDialog(LauncherWindow.current(), fsgs) if not dialog.show_modal(): return elif LauncherConfig.get("download_page"): from .ui.launcher_window import LauncherWindow # fsui.show_error(_("This game must be downloaded first.")) DownloadGameWindow(LauncherWindow.current(), fsgs).show() return else: fsui.show_error( gettext("This game variant cannot be started " "because you don't have all required files.")) return platform_id = LauncherConfig.get("platform").lower() amiga_platform = platform_id in ["", "amiga", "cdtv", "cd32"] if amiga_platform: cls.start_local_game_amiga() else: cls.start_local_game_other()