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, icon: fsui.Icon, title, subtitle="", icon_position=ICON_LEFT, ): Group.__init__(self, parent) self.layout = fsui.HorizontalLayout() image = icon.image(48) self.image_view = fsui.ImageView(self, image) if icon_position == self.ICON_LEFT: self.layout.add(self.image_view) self.layout.add_spacer(20) vert_layout = fsui.VerticalLayout() self.layout.add(vert_layout, expand=True, fill=False, valign=0.5) self.title_label = fsui.HeadingLabel(self, title) vert_layout.add(self.title_label) vert_layout.add_spacer(2) self.subtitle_label = fsui.Label(self, subtitle) vert_layout.add(self.subtitle_label, fill=True) if icon_position == self.ICON_RIGHT: self.layout.add_spacer(20) self.layout.add(self.image_view)
def __init__(self, parent=None): title = gettext("Log Out from Your OAGD.net Account") super().__init__(parent, title, minimizable=False, maximizable=False) self.set_icon(fsui.Icon("password", "pkg:workspace")) self.layout = fsui.VerticalLayout() self.layout.set_padding(20, 20, 20, 20) heading_layout = fsui.HorizontalLayout() self.layout.add(heading_layout) heading_layout.add(fsui.ImageView( self, fsui.Image("workspace:res/48/password.png"))) heading_layout.add_spacer(20) heading_layout_2 = fsui.VerticalLayout() heading_layout.add( heading_layout_2, expand=True, fill=False, valign=0.5) heading_layout_2.add(fsui.HeadingLabel( self, gettext("Log Out from Your OAGD.net Account"))) heading_layout_2.add_spacer(2) heading_layout_2.add(fsui.Label( self, gettext("While logged out you will not get " "database updates"))) self.layout.add_spacer(20) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) self.created_label = fsui.Label(self, "") hori_layout.add(self.created_label, expand=True) hori_layout.add_spacer(20) self.logout_button = fsui.Button(self, gettext("Log Out")) # self.logout_button.disable() self.logout_button.activated.connect(self.on_logout_activated) hori_layout.add(self.logout_button)
def __init__(self, parent, icon, title, subtitle="", icon_position=ICON_RIGHT): Group.__init__(self, parent) self.layout = fsui.HorizontalLayout() image = icon.image(48) self.image_view = fsui.ImageView(self, image) if icon_position == self.ICON_LEFT: self.layout.add(self.image_view) self.layout.add_spacer(20) # vert_layout = fsui.VerticalLayout() # self.layout.add( # vert_layout, expand=True, fill=False, valign=0.5) self.title_label = fsui.HeadingLabel(self, title) font = self.title_label.get_font() font.increase_size(3) self.title_label.set_font(font) self.layout.add(self.title_label, expand=True, fill=False, valign=0.5) if icon_position == self.ICON_RIGHT: self.layout.add_spacer(20) self.layout.add(self.image_view)
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, path): unused(path) fsui.Window.__init__(self, parent, gettext("Checksumming")) self.layout = fsui.VerticalLayout() label = fsui.HeadingLabel(self, gettext("Checksumming file...")) self.layout.add(label, fill=True) self.layout.add_spacer(6)
def __init__(self, parent): fsui.Panel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.VerticalLayout() heading_label = fsui.HeadingLabel(self, gettext("Hard Drives")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) self.hard_drive_groups = [] for i in range(4): self.hard_drive_groups.append(HardDriveGroup(self, i)) self.layout.add(self.hard_drive_groups[i], fill=True, margin=10) self.layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) heading_label = fsui.HeadingLabel(self, gettext("WHDLoad Arguments")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) self.whdload_group = WHDLoadGroup(self) self.layout.add(self.whdload_group, fill=True)
def __init__(self, parent): ConfigPanel.__init__(self, parent) heading_label = fsui.HeadingLabel(self, gettext("ROM & RAM")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) self.kickstart_group = KickstartGroup(self) self.layout.add(self.kickstart_group, fill=True) self.layout.add_spacer(10) self.memory_group = MemoryGroup(self) self.layout.add(self.memory_group, fill=True)
def __init__(self, parent, with_more_button=True): unused(with_more_button) fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() self.model_ids = [ x["id"] for x in Amiga.models if "/" not in x["id"]] self.model_titles = [ x["title"] for x in Amiga.models if "/" not in x["id"]] self.sub_model_ids = [] self.sub_model_titles = [] self.sub_model_updating = False self.model_choice = fsui.Choice(self, self.model_titles) AmigaEnableBehavior(self.model_choice) self.sub_model_choice = fsui.Choice(self, self.sub_model_titles) AmigaEnableBehavior(self.sub_model_choice) self.accuracy_label = fsui.Label(self, gettext("Accuracy:")) self.accuracy_choice = fsui.Choice(self, [ gettext("High"), gettext("Medium"), gettext("Low")]) AmigaEnableBehavior(self.accuracy_choice) self.ntsc_checkbox = ConfigCheckBox(self, "NTSC", "ntsc_mode") AmigaEnableBehavior(self.ntsc_checkbox) # if fs_uae_launcher.ui.get_screen_size()[1] > 768: # self.layout.add(heading_label, margin=10) # self.layout.add_spacer(0) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) heading_label = fsui.HeadingLabel(self, gettext("Amiga Model")) hori_layout.add(heading_label, margin=10) hori_layout.add_spacer(10) hori_layout.add(self.ntsc_checkbox, expand=False, margin_left=10, margin_right=10) hori_layout.add_spacer(0, expand=True) hori_layout.add(self.accuracy_label, margin_right=10) hori_layout.add(self.accuracy_choice, margin_right=10) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) hori_layout.add(self.model_choice, expand=False, margin=10) hori_layout.add(self.sub_model_choice, expand=True, margin=10) ConfigBehavior(self, ["accuracy", "amiga_model"]) self.model_choice.on_changed = self.on_model_changed self.sub_model_choice.on_changed = self.on_sub_model_changed self.accuracy_choice.on_changed = self.on_accuracy_changed
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 __init__(self, parent, icon, title): super().__init__(parent) self.layout = fsui.HorizontalLayout() # FIXME: From Theme self.set_background_color(fsui.Color(0xFF, 0xFF, 0xFF)) self.title_label = fsui.HeadingLabel(self, title) font = fsui.Font("Roboto", 26) self.title_label.set_font(font) self.layout.add(self.title_label, expand=True, fill=True, margin=20) self.layout.add_spacer(20) self.layout.add(fsui.ImageView(self, icon.image(48)), margin_right=20)
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.HorizontalLayout() # self.layout.padding_left = 10 # self.layout.padding_top = 10 # self.layout.padding_right = 10 # self.layout.padding_bottom = 10 # #image = fsui.Image("launcher:res/search_group.png") # #self.image_view = fsui.ImageView(self, image) # self.layout.add_spacer(20) # #self.layout.add(self.image_view, valign=0.0) # self.layout.add_spacer(48) # self.layout.add_spacer(20) self.layout2 = fsui.VerticalLayout() self.layout.add(self.layout2, fill=True, expand=True) self.title_label = fsui.HeadingLabel(self, "") self.layout2.add(self.title_label, fill=True) # self.layout2.add_spacer(10) # hor_layout = fsui.HorizontalLayout() # self.layout2.add(hor_layout) # self.scan_label = fsui.Label(self, _("Scan for:")) # hor_layout.add(self.scan_label) # hor_layout.add_spacer(10) # self.scan_roms = fsui.CheckBox(self, _("ROMs")) # if Settings.get("scan_roms") == "1": # self.scan_roms.check() # self.scan_roms.on_changed = self.on_change # hor_layout.add(self.scan_roms) # hor_layout.add_spacer(10) # self.scan_files = fsui.CheckBox(self, _("Game Files")) # if Settings.get("scan_files") == "1": # self.scan_files.check() # self.scan_files.on_changed = self.on_change # hor_layout.add(self.scan_files) # hor_layout.add_spacer(10) # self.scan_configs = fsui.CheckBox(self, _("Configurations")) # if Settings.get("scan_configs") == "1": # self.scan_configs.check() # self.scan_configs.on_changed = self.on_change # hor_layout.add(self.scan_configs) # hor_layout.add_spacer(10) self.layout2.add_spacer(10) self.status_label = fsui.Label(self, "") self.layout2.add(self.status_label, fill=True)
def __init__( self, parent, autofire_button=True, refresh_button=False, parallel_ports=False, custom_ports=False, ): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() if parallel_ports: heading = gettext("Parallel Port Joysticks") elif custom_ports: heading = gettext("Custom Joystick Port") else: heading = gettext("Joystick & Mouse Port") if False: # Keeping the old string here to keep the translations alive gettext("Joystick Ports") hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) heading_label = fsui.HeadingLabel(self, heading) hori_layout.add(heading_label, margin=10) hori_layout.add_spacer(0, expand=True) if refresh_button: self.refresh_button = IconButton(self, "refresh_button.png") self.refresh_button.set_tooltip( gettext("Refresh List of Connected Joystick Devices")) self.refresh_button.activated.connect(self.on_refresh_button) hori_layout.add(self.refresh_button, margin_right=10) self.layout.add_spacer(0) self.selectors = [] offset = 0 count = 2 if parallel_ports: offset = 2 elif custom_ports: offset = 4 count = 1 input_ports = [1, 0, 2, 3, 4] for i in input_ports[offset:offset + count]: # self.layout.add_spacer(10) selector = InputSelector(self, i, autofire_button=autofire_button) self.layout.add(selector, fill=True, margin=10)
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 __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)
def __init__(self, parent): ConfigPanel.__init__(self, parent) heading_label = fsui.HeadingLabel(self, gettext("Expansions")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) # self.add_option(Option.CPU) self.add_option(Option.ACCELERATOR) # self.add_option(Option.ACCELERATOR_MEMORY) self.add_option(Option.BLIZZARD_SCSI_KIT) self.add_option(Option.GRAPHICS_CARD) # self.add_option(Option.GRAPHICS_MEMORY) self.add_option(Option.SOUND_CARD) self.add_option(Option.NETWORK_CARD) self.add_option(Option.BSDSOCKET_LIBRARY)
def __init__(self, parent): fsui.Panel.__init__(self, parent) self.layout = fsui.VerticalLayout() label = fsui.HeadingLabel(self, gettext("OpenGL Settings")) self.layout.add(label, margin=10, 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("fsaa") add_option("texture_filter") add_option("video_sync_method") add_option("texture_format")
def __init__(self, parent=None): title = gettext("Log Out from Your OpenRetro Account") super().__init__(parent, title, minimizable=False, maximizable=False) self.theme = WorkspaceTheme.instance() self.layout = fsui.VerticalLayout() self.set_icon(fsui.Icon("password", "pkg:workspace")) self.layout.set_padding(20, 20, 20, 20) heading_layout = fsui.HorizontalLayout() self.layout.add(heading_layout) heading_layout.add( fsui.ImageView(self, fsui.Image("workspace:/data/48/password.png"))) heading_layout.add_spacer(20) heading_layout_2 = fsui.VerticalLayout() heading_layout.add(heading_layout_2, expand=True, fill=False, valign=0.5) heading_layout_2.add( fsui.HeadingLabel(self, gettext("Log Out from Your OpenRetro Account"))) heading_layout_2.add_spacer(2) heading_layout_2.add( fsui.Label( self, gettext("While logged out you will not get " "database updates"), )) self.layout.add_spacer(20) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) self.created_label = fsui.Label(self, "") hori_layout.add(self.created_label, expand=True) hori_layout.add_spacer(20) self.logout_button = fsui.Button(self, gettext("Log Out")) # self.logout_button.set_enabled(False) self.logout_button.activated.connect(self.__logout_activated) hori_layout.add(self.logout_button) if self.window().theme.has_close_buttons: self.close_button = CloseButton(self) hori_layout.add(self.close_button, fill=True, margin_left=10)
def __init__(self, parent, import_type=0): fsui.Group.__init__(self, parent) self.type = import_type self.path = "" self.layout = fsui.VerticalLayout() if self.type == self.AMIGA_FOREVER: title = gettext("Import From Amiga Forever CD/DVD") else: title = gettext("Import Kickstarts and ROMs") label = fsui.HeadingLabel(self, title) self.layout.add(label, margin_bottom=10) icon_layout = fsui.HorizontalLayout() self.layout.add(icon_layout, fill=True) icon_layout.add_spacer(20) if self.type == self.AMIGA_FOREVER: image = fsui.Image("launcher:/data/amiga_forever_group.png") else: 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) if self.type == self.AMIGA_FOREVER: text = gettext("If you own Amiga Forever, select the drive/folder " 'and click "{0}"').format(gettext("Import")) else: text = gettext("Select a folder containing Amiga kickstart files " 'and click "{0}"').format(gettext("Import")) label = fsui.Label(self, text) vert_layout.add(label, margin_bottom=10) hori_layout = fsui.HorizontalLayout() vert_layout.add(hori_layout, fill=True, margin=0) self.text_field = fsui.TextField(self, "", read_only=True) hori_layout.add(self.text_field, expand=True) self.browse_button = fsui.Button(self, gettext("Browse")) self.browse_button.activated.connect(self.on_browse) hori_layout.add(self.browse_button, margin_left=10) self.import_button = fsui.Button(self, gettext("Import")) self.import_button.activated.connect(self.on_import) self.import_button.set_enabled(False) hori_layout.add(self.import_button, margin_left=10)
def __init__(self, parent): super().__init__(parent) heading_label = fsui.HeadingLabel(self, gettext("Expansions")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) # self.add_amiga_option(Option.CPU) self.add_amiga_option(Option.ACCELERATOR) # self.add_amiga_option(Option.ACCELERATOR_MEMORY) self.add_amiga_option(Option.BLIZZARD_SCSI_KIT) self.add_amiga_option(Option.GRAPHICS_CARD) # self.add_amiga_option(Option.GRAPHICS_MEMORY) self.add_amiga_option(Option.SOUND_CARD) self.add_amiga_option(Option.NETWORK_CARD) # self.add_amiga_option(Option.BSDSOCKET_LIBRARY) self.add_amiga_option(Option.FREEZER_CARTRIDGE) self.add_amiga_option(Option.DONGLE_TYPE)
def __init__(self, parent): ConfigPanel.__init__(self, parent) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) heading_label = fsui.HeadingLabel( self, gettext("Additional Configuration")) hori_layout.add(heading_label, margin=10) hori_layout.add_spacer(0, expand=True) self.custom_button = fsui.Button( self, gettext("Custom Configuration") + "...") self.custom_button.activated.connect(self.on_custom_button) hori_layout.add(self.custom_button, margin_right=10) self.layout.add_spacer(0) self.add_option(Option.CPU) self.add_option(Option.JIT_COMPILER) self.add_option(Option.FLOPPY_DRIVE_SPEED) self.add_option(Option.FLOPPY_DRIVE_VOLUME_EMPTY) self.add_option(Option.FREEZER_CARTRIDGE) self.add_option(Option.DONGLE_TYPE)
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() heading_label = fsui.HeadingLabel(self, gettext("WHDLoad Arguments")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) self.text_field = fsui.TextField(self, "") hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True, margin=10) hori_layout.add(self.text_field, expand=True) self.help_button = HelpButton( self, "https://fs-uae.net/whdload-support") hori_layout.add(self.help_button, margin_left=10) self.initialize_from_config() self.set_config_handlers()
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() # self.layout.padding_left = 20 # self.layout.padding_right = 20 self.layout.add_spacer(20) self.label = fsui.HeadingLabel(self, "Edit Config") self.layout.add(self.label) self.layout.add_spacer(10) horlayout = fsui.HorizontalLayout() self.layout.add(horlayout, fill=True) self.game_button = fsui.Button(self, "Pick Game") self.game_button.activated.connect(self.on_game_button) horlayout.add(self.game_button, fill=True) horlayout.add_spacer(10) horlayout.add_spacer(0, expand=True) self.save_button = fsui.Button(self, "Save") self.save_button.activated.connect(self.on_save_button) horlayout.add(self.save_button, fill=True) self.layout.add_spacer(14) self.config_xml_ctrl = XMLControl(self) self.layout.add(self.config_xml_ctrl, fill=True, expand=True) self.layout.add_spacer(20) self.game_xml_ctrl = XMLControl(self) self.layout.add(self.game_xml_ctrl, fill=True, expand=True) self.layout.add_spacer(20) LauncherSettings.add_listener(self) LauncherConfig.add_listener(self)
def __init__(self, parent): super().__init__(parent) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) heading_label = fsui.HeadingLabel(self, gettext("Additional Configuration")) hori_layout.add(heading_label, margin=10) hori_layout.add_spacer(0, expand=True) hori_layout.add(CustomConfigButton(self), margin_right=10) self.layout.add_spacer(0) amiga_panel = fsui.Panel(self) amiga_panel.layout = fsui.VerticalLayout() self.layout.add(amiga_panel, fill=True) self.add_amiga_option(Option.CPU, parent=amiga_panel) self.add_amiga_option(Option.JIT_COMPILER, parent=amiga_panel) self.add_amiga_option(Option.FLOPPY_DRIVE_SPEED, parent=amiga_panel) self.add_amiga_option(Option.FLOPPY_DRIVE_VOLUME_EMPTY, parent=amiga_panel) self.add_amiga_option(Option.FREEZER_CARTRIDGE, parent=amiga_panel) self.add_amiga_option(Option.DONGLE_TYPE, parent=amiga_panel)
def __init__(self, parent): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() heading_label = fsui.HeadingLabel(self, gettext("Expansions")) self.layout.add(heading_label, margin=10) self.layout.add_spacer(0) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) vert_layout = fsui.VerticalLayout() hori_layout.add(vert_layout, fill=True, expand=True) hor2_layout = fsui.HorizontalLayout() widget = ConfigCheckBox( self, gettext("UAE Graphics Card (Picasso96 Support)"), "uaegfx_card") # widget.set_tooltip(gettext("Picasso96 Support (uaegfx.card)")) hor2_layout.add(widget, expand=True) widget = HelpButton(self, "https://fs-uae.net/options#uaegfx-card") hor2_layout.add(widget, margin_left=10) vert_layout.add(hor2_layout, fill=True, margin=10) # vert_layout = fsui.VerticalLayout() # hori_layout.add(vert_layout, fill=True, expand=True) hor2_layout = fsui.HorizontalLayout() # gettext("Built-in TCP/IP Stack") widget = ConfigCheckBox(self, "UAE bsdsocket.library", "bsdsocket_library") # widget.set_tooltip( # gettext("Built-in TCP/IP Stack (bsdsocket.library)")) hor2_layout.add(widget, expand=True) widget = HelpButton(self, "https://fs-uae.net/options#bsdsocket-library") hor2_layout.add(widget, margin_left=10) vert_layout.add(hor2_layout, fill=True, margin=10)
def __init__(self, parent, index): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() self.index = index self.config_key = "hard_drive_{0}".format(index) self.config_key_sha1 = "x_hard_drive_{0}_sha1".format(index) if index == 0: # heading_label = fsui.HeadingLabel(self, # _("Hard Drive {0}").format(index + 1)) heading_label = fsui.HeadingLabel(self, gettext("Hard Drives")) self.layout.add(heading_label, margin_bottom=20) self.layout.add_spacer(0) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) self.eject_button = IconButton(self, "eject_button.png") self.eject_button.set_tooltip(gettext("Eject")) self.eject_button.activated.connect(self.on_eject_button) hori_layout.add(self.eject_button) self.text_field = fsui.TextField(self, "", read_only=True) hori_layout.add(self.text_field, expand=True, margin_left=10) self.browse_button = IconButton(self, "browse_folder_16.png") self.browse_button.set_tooltip(gettext("Browse for Folder")) self.browse_button.activated.connect(self.on_browse_folder_button) hori_layout.add(self.browse_button, margin_left=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_file_button) hori_layout.add(self.browse_button, margin_left=10) self.initialize_from_config() self.set_config_handlers()
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, 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)
def __init__(self, parent, fsgc): self.fsgc = fsgc super().__init__(parent) self.layout = fsui.VerticalLayout() hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) heading_label = fsui.HeadingLabel(self, gettext("Settings")) hori_layout.add(heading_label, margin=10) hori_layout.add_spacer(0, expand=True) settings_button = IconButton(self, "16x16/more.png") settings_button.activated.connect(self.on_settings_button) hori_layout.add(settings_button, margin_right=10) self.layout.add_spacer(0) # button = fsui.Button(self, "Platform Settings") # button.activated.connect(self.on_platform_settings_button) # self.layout.add(button, margin=10, fill=True) # self.add_option(Option.KEEP_ASPECT, text=gettext("Keep Aspect"), # platforms=AMIGA_PLATFORMS) self.add_option(Option.SCALE, text=None, enable=SCALING) self.add_option(Option.STRETCH, text=None, enable=STRETCHING) self.add_option(Option.BEZEL, text=None, enable=BEZEL) self.add_option(Option.EFFECT, text=None, enable=EFFECTS) self.add_option(Option.ZOOM, text=None, platforms=AMIGA_PLATFORMS) self.add_option(Option.BORDER, text=None, platforms=BORDER) # self.add_option(Option.SMOOTHING, text=None, platforms=SMOOTHING) # self.add_option(Option.CROP, text=None, platforms=CROPPING) # if fsgc.settings[Option.DEVELOPER_MODE] == "1": # pass # # self.add_option(Option.ZXS_DRIVER, [Platform.ZXS]) # # self.add_option(Option.DOS_EMULATOR, [Platform.DOS]) # self.add_option(Option.NES_EMULATOR, [Platform.NES]) self.add_option(Option.AUTO_LOAD, [Platform.DOS, Platform.ZXS]) self.add_option(Option.AUTO_QUIT, [Platform.DOS]) self.add_option(Option.TURBO_LOAD, [Platform.ZXS]) # self.add_option(Option.FRAME, text=None, platforms=BEZEL) # self.add_option(Option.BEZEL, text=None, platforms=BEZEL) # self.add_option(Option.CHEATS, platforms=CHEATS) quick_settings = fsgc.settings[Option.QUICK_SETTINGS_OPTIONS] for option in quick_settings.split(","): option = option.strip().lower() if "[" in option: # For future use of e.g.: # option1[platform1,platform2],option2[platform,...] option, platforms = option.split("[", 1) else: platforms = [] if option in options: try: self.add_option(option) except Exception: print("Error adding quick setting") traceback.print_exc() self.layout.add_spacer(expand=True) hori_layout = fsui.HorizontalLayout() hori_layout.add_spacer(expand=True) self.platform_settings_button = fsui.Button(self, "Platform Settings") self.platform_settings_button.activated.connect( self.on_platform_settings_button) hori_layout.add(self.platform_settings_button, margin=10) self.layout.add(hori_layout, fill=True) hori_layout = fsui.HorizontalLayout() hori_layout.add_spacer(expand=True) self.video_sync_checkbox = VideoSyncCheckBox(self) hori_layout.add(self.video_sync_checkbox, margin_right=10) self.layout.add(hori_layout, fill=True) self.monitor_button = MonitorButton(self) hori_layout.add(self.monitor_button, fill=True, margin_right=10) self.fullscreen_mode_button = FullscreenModeButton(self) hori_layout.add(self.fullscreen_mode_button, fill=True, margin_right=10) self.layout.add_spacer(10) ConfigBehavior(self, [Option.PLATFORM]) SettingsBehavior(self, [Option.G_SYNC])
def __init__(self, parent, cd_mode): fsui.Group.__init__(self, parent) self.layout = fsui.VerticalLayout() self.cd_mode = cd_mode if self.cd_mode: self.file_key_prefix = "cdrom_image_" self.file_key = "cdrom_image_{0}" self.sha1_key = "x_cdrom_image_{0}_sha1" else: self.file_key_prefix = "floppy_image_" self.file_key = "floppy_image_{0}" self.sha1_key = "x_floppy_image_{0}_sha1" hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, expand=False, fill=True) self.heading_label = fsui.HeadingLabel(self, gettext("Media Swap List")) hori_layout.add(self.heading_label, margin=10, margin_top=20, margin_bottom=20) hori_layout.add_spacer(0, expand=True) if not self.cd_mode: # hori_layout.add(ConfigWidgetFactory().create( # self, Option.SAVE_DISK), margin_right=20) hori_layout.add(SaveDiskCheckBox(self), margin_right=20) clear_button = IconButton(self, "clear_button.png") clear_button.set_tooltip(gettext("Clear List")) clear_button.activated.connect(self.on_clear_list) hori_layout.add(clear_button, margin_right=10) remove_button = IconButton(self, "remove_button.png") remove_button.set_tooltip(gettext("Remove Selected Files")) remove_button.activated.connect(self.on_remove_button) hori_layout.add(remove_button, margin_right=10) add_button = IconButton(self, "add_button.png") add_button.set_tooltip(gettext("Add Files to List")) add_button.activated.connect(self.on_add_button) hori_layout.add(add_button, margin_right=10) # hori_layout = fsui.HorizontalLayout() # self.layout.add(hori_layout, expand=True, fill=True) self.list_view = fsui.ListView(self) self.list_view.on_activate_item = self.on_activate_item if self.cd_mode: self.default_icon = fsui.Image("launcher:res/cdrom_16.png") else: self.default_icon = fsui.Image("launcher:res/floppy_16.png") # hori_layout.add(self.list_view, expand=True, fill=True, margin=10) self.layout.add(self.list_view, expand=True, fill=True, margin=10, margin_top=0) # vert_layout = fsui.VerticalLayout() # hori_layout.add(vert_layout, fill=True) # add_button = IconButton(self, "add_button.png") # add_button.set_tooltip(gettext("Add Files to List")) # add_button.activated.connect(self.on_add_button) # vert_layout.add(add_button, margin=10) # # remove_button = IconButton(self, "remove_button.png") # remove_button.set_tooltip(gettext("Remove Selected Files")) # remove_button.activated.connect(self.on_remove_button) # vert_layout.add(remove_button, margin=10) # # clear_button = IconButton(self, "clear_button.png") # clear_button.set_tooltip(gettext("Clear List")) # clear_button.activated.connect(self.on_clear_list) # vert_layout.add(clear_button, margin=10) self.update_list() LauncherConfig.add_listener(self)