Exemplo n.º 1
0
def get_launcher_window_title():
    value = get_setting(LAUNCHER_WINDOW_TITLE)
    if not value:
        if Product.is_fs_uae() or Product.is_openretro():
            value = "{} Launcher".format(Product.base_name)
        else:
            # Experimental styling of name, similar to styling of FSEMU
            # emulators done by GameDriver.
            value = "{}  ·  Launcher".format(Product.base_name)
    return value
Exemplo n.º 2
0
    def __init__(self, parent):
        # # FIXME: parent not needed?
        super().__init__()

        self._parent_ref = weakref.ref(parent)

        # self.add_item(
        #         gettext("Update Game Database"), self.on_update_game_database
        #     )
        # app_name = "{} Launcher".format(Product.base_name)

        if DeveloperMode.enabled:
            self.add_item(gettext("New window"), self.__on_new_window)
            self.add_separator()

        if Product.is_fs_uae():
            self.add_item(
                gettext("Execute command..."),
                self.__on_execute_command,
            )
            self.add_separator()

        self.add_item(
            gettext("Scan files..."),
            self.__on_file_scanner,
        )
        self.add_item(
            gettext("Sync game database..."),
            self.__on_database_updater,
        )

        self.add_separator()

        if DeveloperMode.enabled:
            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()

        # Utilities

        # if Product.is_fs_uae():
        #     self.add_item(gettext("Tools"), self.__on_tools)
        #     # self.add_item(gettext("Utilities"), self.__on_utilities)

        self.add_separator()
        self.add_item(gettext("Preferences"), self.__on_preferences)
        self.add_item(gettext("Game controllers"), None)
        self.add_separator()
        self.add_item(gettext("Utilities"), self.__on_utilities)
        self.add_item(gettext("Check for updates..."), self.onCheckForUpdates)
Exemplo n.º 3
0
 def _check_platform(self, platform_option):
     if LauncherSettings.get(platform_option) == "1":
         return True
     if Product.includes_amiga() and platform_option in [
             Option.AMIGA_DATABASE,
             Option.CD32_DATABASE,
             Option.CDTV_DATABASE,
     ]:
         if LauncherSettings.get(platform_option) != "0":
             return True
         return False
     if (Product.is_openretro()
             and platform_option in OPENRETRO_DEFAULT_DATABASES):
         if LauncherSettings.get(platform_option) == "0":
             return False
         return True
     return False
 def get_default_search_path(cls):
     paths = []
     path = cls.get_base_dir()
     paths.append(path)
     if Product.includes_amiga():
         for path in cls.get_amiga_forever_directories():
             paths.append(path)
     return paths
 def get_covers_dir(cls):
     path = cls.portable_dir("covers_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Covers")
         else:
             path = os.path.join(cls.get_data_dir(), "Covers")
     return path
 def get_screenshots_dir(cls):
     path = cls.portable_dir("screenshots_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Screenshots")
         else:
             path = os.path.join(cls.get_data_dir(), "Screenshots")
     return path
 def get_plugins_dir(cls):
     path = cls.portable_dir("plugins_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Plugins")
         else:
             path = os.path.join(cls.get_data_dir(), "Plugins")
     if not os.path.exists(path):
         os.makedirs(path)
     return path
 def get_kickstarts_dir(cls):
     path = cls.portable_dir("kickstarts_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Kickstarts")
         else:
             path = os.path.join(cls.media_dir(), "ROMs")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
 def get_controllers_dir(cls):
     path = cls.portable_dir("controllers_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Controllers")
         else:
             path = os.path.join(cls.get_data_dir(), "Devs", "Joysticks")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
 def get_configurations_dir(cls):
     path = cls.portable_dir("configurations_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Configurations")
         else:
             path = os.path.join(cls.get_data_dir(), "Configs")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
 def get_hard_drives_dir(cls):
     path = cls.portable_dir("hard_drives_dir")
     if not path:
         if Product.is_fs_uae():
             path = os.path.join(cls.get_base_dir(), "Hard Drives")
         else:
             path = os.path.join(cls.media_dir(), "HardDrives")
     if not os.path.exists(path):
         os.makedirs(path)
     path = Paths.get_real_case(path)
     return path
    def __init__(self, parent):
        super().__init__(parent)
        icon = fsui.Icon("fs-uae-launcher", "pkg:launcher")
        self.add_header(icon, "{} Launcher".format(Product.base_name))

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

        self.add_option(Option.LAUNCHER_CLOSE_BUTTONS)

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

        self.add_section(gettext("Maintenance"))
        label = fsui.MultiLineLabel(
            self,
            gettext(
                "Defragmenting the databases will improve performance "
                "by ensuring that tables and indices are stored contiguously "
                "on disk. It will also reclaim some storage space."
            ),
            640,
        )
        self.layout.add(label, fill=True, margin_top=20)
        button = fsui.Button(self, gettext("Defragment Databases"))
        button.activated.connect(self.on_defragment_button)
        self.layout.add(button, margin_top=20)
Exemplo n.º 13
0
    def __init__(self,
                 parent=None,
                 minimal=False,
                 interactive=True,
                 scan_for_files=True):
        title = gettext("File scanner")
        super().__init__(parent, title=title, maximizable=False)

        # interactive = True
        # scan_for_files = True
        # minimal = False

        # def __init__(
        #     self, parent, minimal=False, interactive=True, scan_for_files=True
        # ):
        # super().__init__(parent, gettext("Update File Database"))
        buttons, layout = fsui.DialogButtons.create_with_layout(
            self, create_parent_layout=False)
        buttons.create_close_button()

        self.layout.add_spacer(640, 0)

        self.interactive = interactive
        self.scan_for_files = scan_for_files
        self.update_game_database = False
        # self.update_game_database = True

        if not minimal:
            if Product.includes_amiga():
                self.scan_kickstart_group = ScanKickstartGroup(self)
                layout.add(self.scan_kickstart_group, fill=True)
                layout.add_spacer(20)
                heading = gettext(
                    "Scan for Kickstarts, Files and Configurations")
            else:
                heading = gettext("Scan for ROMs, media and config files")
            label = fsui.HeadingLabel(self, heading)
            layout.add(label, margin_bottom=10)

            self.scan_paths_group = ScanPathsGroup(self)
            layout.add(self.scan_paths_group, fill=True, margin=0)

            layout.add_spacer(20)

        self.scan_progress_group = ScanProgressGroup(self)
        layout.add(self.scan_progress_group, fill=True)

        # layout.add_spacer(20)
        # layout.add_spacer(20)

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

        # hor_layout.add_spacer(10, expand=True)
        if interactive:
            self.scan_button = buttons.add_button(
                fsui.Button(buttons, gettext("Scan")))
            # self.scan_button = fsui.Button(self, _("Scan"))
            # hor_layout.add(self.scan_button)
            # hor_layout.add_spacer(10)
            self.scan_button.activated.connect(self.on_scan_button)
        else:
            self.scan_button = None

        # self.stop_button = fsui.Button(self, _("Abort"))
        # hor_layout.add(self.stop_button)
        self.stop_button = buttons.add_button(
            fsui.Button(buttons, gettext("Stop")))
        self.stop_button.activated.connect(self.on_stop_button)

        # layout.add_spacer(10)

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

        self.old_title = ""
        self.old_status = ""
        self.has_started_scan = False

        # self.timer = fsui.IntervalTimer(TIMER_INTERVAL)
        # self.timer.activated.connect(self.on_timer)
        self.start_timer(TIMER_INTERVAL)
        # self.closed.connect(self.timer.stop)

        if not self.interactive:
            self.start_scan()
Exemplo n.º 14
0
def getLauncherPluginName() -> str:
    """Returns name like FS-UAE-Launcher or OpenRetro-Launcher"""
    return Product.getLauncherPluginName()
Exemplo n.º 15
0
    def __init__(self, parent):
        super().__init__(parent)
        column = 0

        self.toolbar = None
        self.tab_panel = TabPanel(self)
        # if Skin.fws():
        #     self.title_bar = TitleBar(self)
        #     self.layout.add(self.title_bar, fill=True)
        # if self.tab_panel:
        self.layout.add(self.tab_panel, fill=True)
        self.current_tab_group_id = 0
        self.tab_groups = [[]]

        self.book = Book(self)
        self.layout.add(self.book, fill=True, expand=True, margin=10)
        self.books = [self.book]

        self.add_page(
            column,
            MainPanel,
            "32x32/go-home",
            gettext("Config"),
            gettext("Main configuration options"),
        )
        if not Product.is_fs_fuse():
            self.add_page(
                column,
                FloppiesPanel,
                "32x32/media-floppy",
                gettext("Floppies"),
                gettext("Floppy drives"),
            )
        if not Product.is_fs_fuse():
            self.add_page(
                column,
                CDPanel,
                "32x32/media-optical",
                gettext("CD-ROMs"),
                gettext("CD-ROM drives"),
            )
        if not Product.is_fs_fuse():
            # noinspection SpellCheckingInspection
            self.add_page(
                column,
                HardDrivesPanel,
                "32x32/drive-harddisk",
                gettext("Hard drives"),
            )
        if not Product.is_fs_fuse():
            self.add_page(
                column,
                InputPanel,
                "32x32/applications-games",
                gettext("Input"),
                gettext("Input options"),
            )
        if not Product.is_fs_fuse():
            # self.add_scroll_page(
            self.add_page(
                column,
                RomRamPanel,
                "32x32/application-x-firmware",
                gettext("Hardware"),
                gettext("CPU, ROM & RAM"),
            )
        if not Product.is_fs_fuse():
            # self.add_scroll_page(
            self.add_page(
                column,
                ExpansionsPanel,
                "32x32/audio-card",
                gettext("Expansions"),
                gettext("Expansions"),
            )
        if not Product.is_fs_fuse():
            # self.add_scroll_page(
            self.add_page(
                column,
                AdditionalConfigPanel,
                "32x32/system-shutdown",
                gettext("Additional Configuration"),
                gettext("Additional configuration"),
            )

        self.select_tab(0, 0)
Exemplo n.º 16
0
def vfs_prefs_entries():
    result = {
        "advanced": {
            "name": "Advanced",
        },
        "advanced.info": {
            "name": "Advanced.info"
        },
        "appearance": {
            "name": "Appearance",
        },
        "appearance.info": {
            "name": "Appearance.info"
        },
        "controller": {
            "name": "Controller",
        },
        "controller.info": {
            "name": "Controller.info"
        },
        "filedatabase": {
            "name": "FileDatabase",
        },
        "filedatabase.info": {
            "name": "FileDatabase.info"
        },
        "gamedatabase": {
            "name": "GameDatabase",
        },
        "gamedatabase.info": {
            "name": "GameDatabase.info"
        },
        "openretro": {
            "name": "OpenRetro",
        },
        "openretro.info": {
            "name": "OpenRetro.info"
        },
        "privacy": {
            "name": "Privacy",
        },
        "privacy.info": {
            "name": "Privacy.info"
        },
        "storage": {
            "name": "Storage",
        },
        "storage.info": {
            "name": "Storage.info"
        },
        "update": {
            "name": "Update",
        },
        "update.info": {
            "name": "Update.info"
        },
    }
    if Product.is_fs_uae():
        result.update({
            # # self.iconview.add_icon(label="Input")
            # # FIXME: Should be a tool or utility instead?
            # # self.iconview.add_icon(label="Janitor")
            "arcade": {
                "name": "Arcade",
            },
            "arcade.info": {
                "name": "Arcade.info"
            },
            # "backup": {"name": "Backup",},
            # "backup.info": {"name": "Backup.info"},
            # "directory": {"name": "Directory",},
            # "directory.info": {"name": "Directory.info"},
            # "firmware": {"name": "Firmware",},
            # "firmware.info": {"name": "Firmware.info"},
            # "font": {"name": "Font",},
            # "font.info": {"name": "Font.info"},
            "keyboard": {
                "name": "Keyboard",
            },
            "keyboard.info": {
                "name": "Keyboard.info"
            },
            "locale": {
                "name": "Locale",
            },
            "locale.info": {
                "name": "Locale.info"
            },
            "logging": {
                "name": "Logging",
            },
            "logging.info": {
                "name": "Logging.info"
            },
            "midi": {
                "name": "MIDI",
            },
            "midi.info": {
                "name": "MIDI.info"
            },
            "mouse": {
                "name": "Mouse",
            },
            "mouse.info": {
                "name": "Mouse.info"
            },
            # "netplay": {"name": "NetPlay",},
            # "netplay.info": {"name": "NetPlay.info"},
            "opengl": {
                "name": "OpenGL",
            },
            "opengl.info": {
                "name": "OpenGL.info"
            },
            # "overscan": {"name": "Overscan",},
            # "overscan.info": {"name": "Overscan.info"},
            "platforms": vfs_platforms,
            "platforms.info": {
                "name": "Platforms.info"
            },
            # "plugin": {
            #     "name": "Plugin",
            # },
            # "plugin.info": {"name": "Plugin.info"},
            "power": {
                "name": "Power",
            },
            "power.info": {
                "name": "Power.info"
            },
            "screenmode": {
                "name": "ScreenMode",
            },
            "screenmode.info": {
                "name": "ScreenMode.info"
            },
            "sound": {
                "name": "Sound",
            },
            "sound.info": {
                "name": "Sound.info"
            },
            "video": {
                "name": "Video",
            },
            "video.info": {
                "name": "Video.info"
            },
            "whdload": {
                "name": "WHDLoad",
            },
            "whdload.info": {
                "name": "WHDLoad.info"
            },
            "workspace": {
                "name": "Workspace",
            },
            "workspace.info": {
                "name": "Workspace.info"
            },
        })
    return result