def set_config_handlers(self): if self.mode_choice is not None: self.mode_choice.on_changed = self.on_mode_changed self.device_choice.on_changed = self.on_device_changed LauncherConfig.add_listener(self) LauncherSignal.add_listener("settings_updated", self) LauncherSignal.add_listener("device_list_updated", self)
def __init__(self, parent): self.parent = weakref.ref(parent) LauncherConfig.add_listener(self) LauncherSettings.add_listener(self) self.dirty = True self.do_update() parent.destroyed.connect(self.on_parent_destroyed)
def __init__(self, parent): parent.__amiga_enable_behavior = self self._parent = weakref.ref(parent) LauncherConfig.add_listener(self) # FIXME: We need to disconnect the listener parent.destroyed.connect(self.on_destroy)
def __init__(self, parent): StatusElement.__init__(self, parent) self.error_icon = Image("launcher:res/16/error.png") self.warning_icon = Image("launcher:res/16/warning_3.png") self.notice_icon = Image("launcher:res/16/information.png") self.icons = [ self.error_icon, self.warning_icon, self.notice_icon, ] self.coordinates = [] self.warnings = [] self.game_notice = "" self.variant_notice = "" self.variant_warning = "" self.variant_error = "" self.joy_emu_conflict = "" self.using_joy_emu = False self.kickstart_file = "" self.x_kickstart_file_sha1 = "" self.update_available = "" self.__error = "" self.x_missing_files = "" self.download_page = "" self.download_file = "" self.amiga_model = "" self.amiga_model_calculated = "" self.chip_memory = "" self.chip_memory_calculated = 0 self.outdated_plugins = [] self.custom_config = set() self.custom_uae_config = set() self.settings_config_keys = set() plugin_manager = PluginManager.instance() for plugin in plugin_manager.plugins(): if plugin.outdated: self.outdated_plugins.append(plugin.name) ConfigBehavior(self, [ "x_game_notice", "x_variant_notice", "x_variant_warning", "x_variant_error", "x_joy_emu_conflict", "amiga_model", "x_kickstart_file_sha1", "kickstart_file", "download_page", "download_file", "x_missing_files", "__error", "chip_memory", "jit_compiler"]) SettingsBehavior(self, ["__update_available"]) LauncherConfig.add_listener(self) for key in JOYSTICK_KEYS: self.on_config(key, LauncherConfig.get(key)) for key in LauncherConfig.keys(): if LauncherConfig.is_custom_uae_option(key): self.on_config(key, LauncherConfig.get(key)) elif LauncherConfig.is_custom_option(key): self.on_config(key, LauncherConfig.get(key)) LauncherSettings.add_listener(self) for key in LauncherSettings.keys(): if LauncherConfig.is_config_only_option(key): self.on_setting(key, LauncherSettings.get(key))
def __init__(self, parent, platforms): self.platforms = set(platforms) parent.__platform_behavior = self self._parent = weakref.ref(parent) self.on_config("platform", LauncherConfig.get("platform")) LauncherConfig.add_listener(self) # FIXME: We need to disconnect the listener parent.destroyed.connect(self.on_destroy)
def __init__(self, parent, names): parent.__config_enable_behavior = self self._parent = weakref.ref(parent) self._names = set(names) LauncherConfig.add_listener(self) try: parent.destroyed.connect(self.on_parent_destroyed) except AttributeError: print("WARNING: ConfigBehavior without remove_listener " "implementation") for name in names: # Broadcast initial value self.on_config(name, LauncherConfig.get(name))
def __init__(self, parent, names): parent.__config_enable_behavior = self self._parent = weakref.ref(parent) self._names = set(names) LauncherConfig.add_listener(self) try: parent.destroyed.connect(self.on_parent_destroyed) except AttributeError: print("WARNING: ConfigBehavior without remove_listener " "implementation") for name in names: # Broadcast initial value self.on_config(name, LauncherConfig.get(name))
def __init__(self, parent): StatusElement.__init__(self, parent) # self.set_min_width(140) self.layout = HorizontalLayout() self.icon = Image("launcher:res/16/world_link.png") self.right_icon = Image("launcher:res/16/drop_down_arrow.png") self.right_icon_disabled = Image( "launcher:res/16/drop_down_arrow_disabled.png") # self.inactive_icon = self.active_icon.grey_scale() self.text = gettext("Web Links") LauncherConfig.add_listener(self) self.on_config("protection", LauncherConfig.get("protection")) self.have = set() for key in url_keys: self.on_config(key, LauncherConfig.get(key))
def __init__(self, parent): StatusElement.__init__(self, parent) # self.set_min_width(140) self.layout = HorizontalLayout() self.icon = Image("launcher:res/16x16/world_link.png") self.right_icon = Image("launcher:res/16x16/drop_down_arrow.png") self.right_icon_disabled = Image( "launcher:res/16x16/drop_down_arrow_disabled.png") # self.inactive_icon = self.active_icon.grey_scale() self.text = gettext("Web Links") LauncherConfig.add_listener(self) self.on_config("protection", LauncherConfig.get("protection")) self.have = set() for key in url_keys: self.on_config(key, LauncherConfig.get(key))
def __init__(self, parent, fsgc, port_gui_index): super().__init__(parent, [""], read_only=True) self.fsgc = fsgc self.port_gui_index = port_gui_index self.port = self.port_gui_index + 1 self._platform = "" self._config_key = "" self.device_option_key = "" # AmigaEnableBehavior(self.device_choice) self.device_values = [] self.rebuild_device_list() self.fsgc.signal.connect("config", self.on_config) # Must check platform before device option key self.on_config(Option.PLATFORM, self.fsgc.config.get(Option.PLATFORM)) self.on_config(self.device_option_key, LauncherConfig.get(self.device_option_key)) # self.changed.connect(self.__changed) self.set_index(0) LauncherConfig.add_listener(self) LauncherSignal.add_listener("settings_updated", self) LauncherSignal.add_listener("device_list_updated", self)
def set_config_handlers(self): LauncherConfig.add_listener(self)
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)
def __init__(self, parent): super().__init__(parent, "save_button.png") self.set_tooltip(gettext("Save Config")) LauncherConfig.add_listener(self) self.on_config("__changed", LauncherConfig.get("__changed"))
def set_config_handlers(self): LauncherConfig.add_listener(self)
def __init__(self, parent): super().__init__(parent, "save_button.png") self.set_tooltip(gettext("Save Config")) LauncherConfig.add_listener(self) self.on_config("__changed", LauncherConfig.get("__changed"))
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" platforms = AMIGA_PLATFORMS else: self.file_key_prefix = "floppy_image_" self.file_key = "floppy_image_{0}" self.sha1_key = "x_floppy_image_{0}_sha1" platforms = AMIGA_PLATFORMS 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: save_disk_check_box = SaveDiskCheckBox(self) hori_layout.add(save_disk_check_box, margin_right=20) PlatformEnableBehavior(save_disk_check_box, platforms=platforms) clear_button = IconButton(self, "clear_button.png") clear_button.set_tooltip(gettext("Clear List")) clear_button.activated.connect(self.on_clear_list) PlatformEnableBehavior(clear_button, platforms=platforms) 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) PlatformEnableBehavior(remove_button, platforms=platforms) 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) PlatformEnableBehavior(add_button, platforms=platforms) 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) PlatformEnableBehavior(self.list_view, platforms=platforms) 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)
def set_config_handlers(self): self.kickstart_type_choice.on_changed = self.on_kickstart_type_changed self.ext_rom_type_choice.on_changed = self.on_ext_rom_type_changed LauncherConfig.add_listener(self)
def set_config_handlers(self): self.kickstart_type_choice.on_changed = self.on_kickstart_type_changed self.ext_rom_type_choice.on_changed = self.on_ext_rom_type_changed LauncherConfig.add_listener(self)
def __init__(self, parent): StatusElement.__init__(self, parent) self.error_icon = Image("launcher:res/16x16/error.png") self.warning_icon = Image("launcher:res/16x16/warning_3.png") self.notice_icon = Image("launcher:res/16x16/information.png") self.icons = [self.error_icon, self.warning_icon, self.notice_icon] self.coordinates = [] self.warnings = [] self.game_notice = "" self.variant_notice = "" self.variant_warning = "" self.variant_error = "" self.joy_emu_conflict = "" self.using_joy_emu = False self.kickstart_file = "" self.x_kickstart_file_sha1 = "" self.update_available = "" self.__error = "" self.x_missing_files = "" self.download_page = "" self.download_file = "" self.platform = "" self.amiga_model = "" self.amiga_model_calculated = "" self.chip_memory = "" self.chip_memory_calculated = 0 self.outdated_plugins = [] self.custom_config = set() self.custom_uae_config = set() self.settings_config_keys = set() plugin_manager = PluginManager.instance() for plugin in plugin_manager.plugins(): if plugin.outdated: self.outdated_plugins.append(plugin.name) ConfigBehavior( self, [ "x_game_notice", "x_variant_notice", "x_variant_warning", "x_variant_error", "x_joy_emu_conflict", "amiga_model", "x_kickstart_file_sha1", "kickstart_file", "download_page", "download_file", "x_missing_files", "__error", "chip_memory", "jit_compiler", "platform", ], ) SettingsBehavior(self, ["__update_available"]) LauncherConfig.add_listener(self) for key in JOYSTICK_KEYS: self.on_config(key, LauncherConfig.get(key)) for key in LauncherConfig.keys(): if LauncherConfig.is_custom_uae_option(key): self.on_config(key, LauncherConfig.get(key)) elif LauncherConfig.is_custom_option(key): self.on_config(key, LauncherConfig.get(key)) LauncherSettings.add_listener(self) for key in LauncherSettings.keys(): if LauncherConfig.is_config_only_option(key): self.on_setting(key, LauncherSettings.get(key))