def __init__(self): fsui.LegacyDialog.__init__(self, None, "Create/Join Game") self.layout = fsui.VerticalLayout() self.layout.add_spacer(20) hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, fill=True) hor_layout.add_spacer(20) self.text = fsui.TextField(self) self.text.activated.connect(self.on_ok_button) hor_layout.add(self.text, expand=True) hor_layout.add_spacer(20) 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, " Cancel ") self.cancel_button.activated.connect(self.on_cancel_button) hor_layout.add(self.cancel_button) hor_layout.add_spacer(10) self.ok_button = fsui.Button(self, " Create/Join ") self.ok_button.activated.connect(self.on_ok_button) hor_layout.add(self.ok_button) hor_layout.add_spacer(20) self.layout.add_spacer(20) self.set_size(self.layout.get_min_size()) self.text.focus()
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): 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, 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): 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): super().__init__(parent) icon = fsui.Icon("language-settings", "pkg:workspace") # gettext("Appearance") title = gettext("Language") # gettext("Set language and look for FS-UAE applications") subtitle = gettext("Set language for FS-UAE applications") self.add_header(icon, title, subtitle) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) # hori_layout.add(fsui.Label(self, gettext("Language:"))) hori_layout.add(fsui.Label(self, gettext("Language:"))) hori_layout.add_spacer(0, expand=True) self.language_choice = LanguageSettingChoice(self) hori_layout.add(self.language_choice) self.layout.add_spacer(20) information = "" # information = gettext( # "A change of language will only affect applications " # "which are restarted after the change.") # information += "\n\n" information += gettext( "When Automatic is specified, your preferred language is set " "based on information from the operating system (or English, " "if a supported language is not detected).") self.layout.add(fsui.MultiLineLabel(self, information, 640))
def __init__(self, parent, task): fsui.Window.__init__( self, parent, task.get_task_name()) self.set_icon(fsui.Icon("tools", "pkg:workspace")) self.layout = fsui.VerticalLayout() self.layout.min_width = 500 self.layout.set_padding(20, 20, 20, 20) self.icon_header = IconHeader( self, fsui.Icon("tools", "pkg:workspace"), task.get_task_name(), "") self.layout.add(self.icon_header, fill=True, margin_bottom=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.abort_button = fsui.Button(self, gettext("Stop")) self.abort_button.activated.connect(self.on_abort_activated) hori_layout.add(self.abort_button) self.set_size(self.layout.get_min_size()) self.center_on_parent() self.task = task self.task.progressed.connect(self.on_progress) self.task.failed.connect(self.on_failure) self.task.succeeded.connect(self.close) self.task.stopped.connect(self.close) self.task.start()
def __init__(self, parent=None): print("RefreshWindow parent =", parent) title = gettext("Updating Database") super().__init__(parent, title, maximizable=False) self.set_icon(fsui.Icon("refresh", "pkg:workspace")) self.layout = fsui.VerticalLayout() self.layout.min_width = 500 self.layout.set_padding(20, 20, 20, 20) self.icon_header = IconHeader(self, fsui.Icon("refresh", "pkg:workspace"), gettext("Updating Database"), "") self.layout.add(self.icon_header, fill=True, margin_bottom=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.stop_button = fsui.Button(self, gettext("Stop")) self.stop_button.activated.connect(self.on_abort_activated) hori_layout.add(self.stop_button) self.set_size(self.layout.get_min_size()) self.center_on_parent() self.task = DatabaseRefreshTask() self.task.progressed.connect(self.on_progress) self.task.failed.connect(self.on_failure) self.task.succeeded.connect(self.close) self.task.stopped.connect(self.close) self.task.start()
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, drive): fsui.Group.__init__(self, parent) self.cd_mode = False self.drive = drive self.config_key = "" self.config_key_sha1 = "" self.config_key_implicit = "" self.eject_button = IconButton(self, "eject_button.png") # AmigaEnableBehavior(self.eject_button) self.eject_button.set_tooltip(gettext("Eject")) self.eject_button.activated.connect(self.on_eject) self.text_field = fsui.TextField(self, "", read_only=True) 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) AmigaEnableBehavior(self.browse_button) self.layout = fsui.HorizontalLayout() self.layout.add(self.eject_button) self.layout.add_spacer(10) self.layout.add(self.text_field, expand=True) self.layout.add_spacer(10) self.layout.add(self.browse_button) # Config.add_listener(self) # fsgs.signal.connect(self.on_config, # "fsgs:config:floppy_drive_{0}".format(self.drive), # "fsgs:config:cdrom_drive_{0}".format(self.drive)) fsgs.signal.connect("config", self.on_config) self.update_config_key()
def __init__(self, parent, new_button=True): super().__init__(parent) self.layout = fsui.VerticalLayout() hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True) if new_button: label_stand_in = fsui.Panel(self) _, th = label_stand_in.measure_text(gettext("Configuration")) label_stand_in.set_min_height(th) hori_layout.add(label_stand_in, margin_top=10, margin_bottom=10) hori_layout.add(NewConfigButton(self), margin_left=10, margin_right=10) self.config_name_field = fsui.TextField(self) hori_layout.add( self.config_name_field, expand=True, margin=10, margin_top=0, margin_bottom=0, ) hori_layout.add(SaveButton(self), margin_left=10, margin_right=10) self.config_name_field.on_changed = self.on_config_name_changed SettingsBehavior(self, ["config_name"])
def __init__(self, parent, index): self.index = index if index: self.key = Option.SECONDARY_JOYSTICK else: self.key = Option.PRIMARY_JOYSTICK fsui.Group.__init__(self, parent) self.layout = fsui.HorizontalLayout() devices = ["", get_keyboard_title()] # for i, name in enumerate(DeviceManager.get_joystick_names()): # devices.append(name) for device_name in DeviceManager.get_joystick_names(): if DeviceManager.is_joystick(device_name): devices.append(device_name) self.device_choice = fsui.ComboBox(self, devices) self.layout.add(self.device_choice, expand=True) # Config.add_listener(self) self.initialize_from_settings() self.set_settings_handlers()
def __init__(self, parent, drives, main=False): super().__init__(parent, drives, removable_media=True) self.layout3 = fsui.HorizontalLayout() self.layout.add(self.layout3, fill=True) self.layout3.add_spacer(0, expand=True) self.cd_mode = False self.__platform = "" self.__amiga_model = "" self._main = main self._c64_model = "" self._cpc_model = "" self._spectrum_model = "" self._ines_header_widget = INesHeaderWidget(self) self._ines_header_widget.hide() self.layout.add(self._ines_header_widget, fill=True) self._a78_header_widget = A78HeaderWidget(self) self._a78_header_widget.hide() self.layout.add(self._a78_header_widget, fill=True) self._command_widget = CommandWidget(self) self._command_widget.hide() self.layout.add(self._command_widget, fill=True) self.update_media_type() ConfigBehavior( self, [ Option.PLATFORM, Option.AMIGA_MODEL, Option.C64_MODEL, Option.CPC_MODEL, Option.SPECTRUM_MODEL, ], )
def __init__(self, parent, gsc): super().__init__(parent) self.layout = fsui.VerticalLayout() self.hori_layout = fsui.HorizontalLayout() self.layout.add(self.hori_layout, fill=True, expand=True) self.progress_label = fsui.Label(self, "") self.progress_label.set_visible(False) self.hori_layout.add(self.progress_label, fill=True, expand=True) # self.progress_2_label = fsui.Label(self, "") # self.progress_2_label.set_visible(False) # self.hori_layout.add(self.progress_2_label, fill=True, expand=True) self.fullscreen_mode_button = FullscreenModeButton(self) self.hori_layout.add( self.fullscreen_mode_button, fill=True, margin_right=10) self.monitor_button = MonitorButton(self) self.hori_layout.add( self.monitor_button, fill=True, margin_right=10) self.screen_info_label = ScreenInfoLabel(self) self.hori_layout.add(self.screen_info_label, fill=True, expand=True, margin_right=10) self.video_sync_checkbox = VideoSyncCheckBox(self) self.hori_layout.add(self.video_sync_checkbox, margin_right=10) self.override_warning = OverrideWarning(self, Option.FULLSCREEN) self.hori_layout.add(self.override_warning, margin_right=10) self.fullscreen_button = FullscreenToggleButton(self) self.hori_layout.add(self.fullscreen_button, fill=True) start_button = StartButton(self, gsc) self.hori_layout.add(start_button, fill=True, margin_left=10) # ConfigBehavior(self, [Option.FULLSCREEN]) gsc.config.add_behavior( self, [Option.FULLSCREEN, "__running", "__progress"])
def __init__(self, parent, drives, main=False): FloppiesGroup.__init__(self, parent, drives, removable_media=True) self.layout3 = fsui.HorizontalLayout() self.layout.add(self.layout3, fill=True) self.layout3.add_spacer(0, expand=True) self.cd_mode = False self.__platform = "" self.__amiga_model = "" self._main = main self._c64_model = "" self._zxs_model = "" self._ines_header_widget = INesHeaderWidget(self) self._ines_header_widget.hide() self.layout.add(self._ines_header_widget, fill=True) self._a78_header_widget = A78HeaderWidget(self) self._a78_header_widget.hide() self.layout.add(self._a78_header_widget, fill=True) self.update_media_type() ConfigBehavior(self, [ Option.PLATFORM, Option.AMIGA_MODEL, Option.C64_MODEL, Option.ZXS_MODEL ])
def __init__(self, parent=None): # if app.name == "fs-uae-arcade": title = "FS-UAE Arcade" # else: # title = "FS Game Center" border = True if maximized(): border = False super().__init__( parent, title, separator=False, border=border, menu=True, color=(0x00, 0x00, 0x00), ) self.set_background_color(fsui.Color(0x00, 0x00, 0x00)) self.layout = fsui.HorizontalLayout() self.quit_flag = False callbacks = Callbacks() callbacks.set_window(self) interval = 16 self.qt_window = QtWindow(callbacks, interval, window=self) self.adapter = fsui.Adapter(self, self.qt_window) self.adapter.set_min_size((960, 540)) self.layout.add(self.adapter, expand=True, fill=True) # self.set_size((960, 540)) # qt_window.setFocus() self.adapter.focus() self.shown.connect(self.on_show) self.closed.connect(self.on_close)
def __init__(self, parent): fsui.LegacyDialog.__init__(self, parent, "Choose Game") self.info = {} self.layout = fsui.VerticalLayout(padding=20) self.text = fsui.TextField(self) self.text.on_changed = self.on_text self.layout.add(self.text, fill=True) self.layout.add_spacer(20) self.view = GameListView(self) self.view.set_game_info = self.set_game_info self.view.set_min_width(600) self.view.set_min_height(300) self.layout.add(self.view, expand=True, fill=True) self.layout.add_spacer(20) self.link_field = fsui.TextField(self) self.layout.add(self.link_field, fill=True) self.layout.add_spacer(20) hlayout = fsui.HorizontalLayout() self.layout.add(hlayout, fill=True) hlayout.add_spacer(0, expand=True) self.cancel_button = fsui.Button(self, gettext("Cancel")) self.cancel_button.activated.connect(self.on_cancel_button) hlayout.add(self.cancel_button) hlayout.add_spacer(10) self.ok_button = fsui.Button(self, gettext("OK")) self.ok_button.activated.connect(self.on_ok_button) hlayout.add(self.ok_button) self.text.focus() self.set_size(self.layout.get_min_size()) self.center_on_parent()
def add_database_option(self, platform, name, description=""): self.options_on_page.add(name) group = OptionUI.create_group(self, name, description=description, help_button=False) if self.hori_counter % 2 == 0: self.hori_layout = fsui.HorizontalLayout() self.layout.add(self.hori_layout, fill=True, margin_top=10, margin_bottom=10, margin_left=-10, margin_right=-10) self.hori_layout.add(group, fill=True, expand=-1, margin=10, margin_top=0, margin_bottom=0) self.hori_layout.add(PlatformSettingsButton(self, platform), margin_right=10) if self.hori_counter % 2 == 0: self.hori_layout.add_spacer(0) self.hori_counter += 1
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, 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, 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): super().__init__(parent) icon = fsui.Icon("settings", "pkg:workspace") # gettext("WHDLoad Settings") title = gettext("WHDLoad") subtitle = gettext("Options for WHDLoad support in FS-UAE Launcher") self.add_header(icon, title, subtitle) label = fsui.MultiLineLabel(self, gettext( "The following options only apply when you use the automatic " "WHDLoad support in FS-UAE Launcher, for example in relation with " "the online game database."), 640) self.layout.add(label, fill=True, margin_top=0) self.add_option("whdload_splash_delay") label = fsui.Label( self, gettext("Directory for WHDLoad.key file (if you have it):")) self.layout.add(label, margin_top=10) hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, margin_top=4, fill=True) label = fsui.Label( self, FSGSDirectories.get_base_dir()) hor_layout.add_spacer(0, expand=True) hor_layout.add(label)
def __init__(self, parent, path, import_type): if import_type == self.AMIGA_FOREVER: title = gettext("Import From Amiga Forever CD/DVD") else: title = gettext("Import Kickstarts and ROMs") super().__init__(parent, title, maximizable=False) self.layout = fsui.VerticalLayout() self.layout.padding_left = 20 self.layout.padding_top = 20 self.layout.padding_right = 20 self.layout.padding_bottom = 20 self.text_area = fsui.TextArea(self, read_only=True) self.text_area.set_min_width(600) self.text_area.set_min_height(300) self.layout.add(self.text_area) hori_layout = fsui.HorizontalLayout() self.layout.add(hori_layout, fill=True, margin_top=20) hori_layout.add_spacer(0, expand=True) self.close_button = fsui.Button(self, gettext("Close")) self.close_button.activated.connect(self.on_close_button) self.close_button.disable() hori_layout.add(self.close_button) self.line_count = 0 self.task = ImportTask(path, import_type) self.task.start() self.set_size(self.layout.get_min_size()) self.center_on_parent() fsui.call_later(TIMER_INTERVAL, self.on_timer)
def __init__(self, parent): BottomPanel.__init__(self, parent) Skin.set_background_color(self) self.layout = fsui.HorizontalLayout() self.image_loader = ImageLoader() def get_min_width(): return 0 # def get_min_height(): # return Constants.SCREEN_SIZE[1] + 2 * BORDER self.layout.get_min_width = get_min_width # self.layout.get_min_height = get_min_height self.layout.padding_left = BORDER // 2 self.layout.padding_right = BORDER // 2 self.layout.padding_top = BORDER + 2 self.layout.padding_bottom = Skin.get_bottom_margin() self.default_image = fsui.Image("launcher:res/screenshot.png") # self.default_image.resize(Constants.SCREEN_SIZE) self.screenshot_overlay = fsui.Image( "launcher:res/screenshot_overlay.png") self.images = [self.default_image for _ in range(6)] self.image_paths = ["" for _ in range(6)] self.requests = [None for _ in range(6)] self.x_offset = 0 if LauncherSettings.get("config_base"): # self.load_images(Settings.get("config_base")) self.load_images() LauncherSettings.add_listener(self)
def __init__(self, parent, title="", maximizable=True): if isinstance(parent, Application): parent.add_window(self) # parent = None self.__border = WindowBorder(None, title, self) super().__init__(self.__border) self.set_background_color(fsui.Color(0xF2, 0xF2, 0xF2)) self.layout = fsui.VerticalLayout() self.__title_layout = fsui.HorizontalLayout() self.layout.add(self.__title_layout, fill=True) self.__menu_button = WindowMenuButton(self) self.__title_layout.add(self.__menu_button) self.__title_panel = WindowTitlePanel(self) self.__title_layout.add(self.__title_panel, expand=True) self.__minimize_button = WindowMinimizeButton(self) self.__title_layout.add(self.__minimize_button) self._maximize_button = WindowMaximizeButton(self) self.__title_layout.add(self._maximize_button) if not maximizable: print("hiding") self._maximize_button.hide() self.__close_button = WindowCloseButton(self) self.__title_layout.add(self.__close_button) self.__content_added = False self.__menu = None
def __init__(self, parent, port, autofire_button=True): self.port = port self.device_option_key = "joystick_port_{0}".format(port) self.mode_option_key = "joystick_port_{0}_mode".format(port) self.autofire_mode_option_key = "joystick_port_{0}_autofire".format( port) fsui.Group.__init__(self, parent) self.layout = fsui.HorizontalLayout() self.joystick_mode_values = [ "nothing", "mouse", "joystick", "cd32 gamepad" ] self.joystick_mode_titles = [ gettext("No Amiga Device"), gettext("Amiga Mouse"), gettext("Amiga Joystick"), gettext("CD32 Pad") ] self.mode_choice = fsui.Choice(self, self.joystick_mode_titles) AmigaEnableBehavior(self.mode_choice) self.layout.add(self.mode_choice) self.layout.add_spacer(10) # else: # self.mode_choice = None if port >= 4: self.mode_choice.disable() # devices = ["", _("No Host Device"), _("Mouse"), # _("Cursor Keys and Right Ctrl/Alt")] # for i, name in enumerate(DeviceManager.get_joystick_names()): # devices.append(name) # if not self.joystick_values_initialized: # self.joystick_values.append(DeviceManager.device_ids[i]) # self.joystick_values_initialized = True self.device_choice = fsui.ComboBox(self, [""], read_only=True) AmigaEnableBehavior(self.device_choice) self.joystick_values = [] self.rebuild_device_list() self.device_choice.set_index(0) # print(self.device_choice.get_index()) self.layout.add(self.device_choice, expand=True) if port < 4 and autofire_button: self.autofire_button = IconButton(self, "16/lightning_off.png") self.autofire_button.activated.connect(self.on_autofire_button) self.layout.add(self.autofire_button, margin_left=10) else: self.autofire_button = None if port == 4: self.help_button = HelpButton( self, "https://fs-uae.net/custom-joystick-port") self.layout.add(self.help_button, margin_left=10) self.initialize_from_config() self.set_config_handlers()
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=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, title="", menu=False, minimizable=True, maximizable=True, separator=True, closable=True, background=None, ): super().__init__(parent) if background is None: background = (0xFF, 0xFF, 0xFF) background_color = fsui.Color(background) if background_color.to_hsl().l >= 0.6: self.foreground_color = (0x00, 0x00, 0x00) else: self.foreground_color = (0xFF, 0xFF, 0xFF) self.background_color = background_color self.set_background_color(background_color) self.set_normal_cursor() self.layout = fsui.VerticalLayout() hor_layout = fsui.HorizontalLayout() self.layout.add(hor_layout, fill=True) self.menu_button = WindowMenuButton(self) hor_layout.add(self.menu_button) if not menu: self.menu_button.hide() hor_layout.add_spacer(20 - TEXT_SPACING) self.title_panel = WindowTitlePanel(self) hor_layout.add(self.title_panel, expand=True) self.minimize_button = WindowMinimizeButton(self) hor_layout.add(self.minimize_button) if not minimizable: self.minimize_button.hide() self.maximize_button = WindowMaximizeButton(self) hor_layout.add(self.maximize_button) if not maximizable: self.maximize_button.hide() self.close_button = WindowCloseButton(self) hor_layout.add(self.close_button) if not closable: self.close_button.hide() if separator: self.separator = TitleSeparator(self) self.layout.add(self.separator, fill=True)