def start(widget, dialog=False, *, gscontext): window = get_window(widget) pos = window.unscaled_position() size = window.unscaled_size() config = get_config(widget) config.set(PARENT_X__, str(pos[0])) config.set(PARENT_Y__, str(pos[1])) config.set(PARENT_W__, str(size[0])) config.set(PARENT_H__, str(size[1])) # FIXME: Remove from LauncherApp from launcher.launcherapp import LauncherApp LauncherApp.start_game(dialog=dialog, gscontext=gscontext)
def app_main(): from launcher.launcherapp import LauncherApp launcherapp = LauncherApp() gscontext = FSGameSystemContext() print("\n\n\n") # print(gscontext.config.items()) config = gscontext.config config.set("amiga_model", "A4000") amigaforeverdir = os.path.join( FSGSDirectories.get_base_dir(), "AmigaForever" ) amigafilesdir = os.path.join(amigaforeverdir, "Amiga Files") shareddir = os.path.join(amigafilesdir, "Shared") romdir = os.path.join(shareddir, "rom") systemdir = os.path.join(shareddir, "dir", "System") workdir = os.path.join(shareddir, "dir", "Work") config.set( "kickstart_file", os.path.join(romdir, "amiga-os-310-a4000.rom") ) # FIXME: Shouldn't be necessary... config.set( "x_kickstart_file", os.path.join(romdir, "amiga-os-310-a4000.rom") ) config.set("hard_drive_0", systemdir) config.set("hard_drive_1", workdir) # config.set("hard_drive_2", os.path.join(FSGSDirectories.get_base_dir(), "Work")) # config.set("zorro_iii_memory", "65536") config.set("graphics_card", "uaegfx") config.set("window_width", "800") config.set("window_height", "600") config.set("legacy", "1") print(gscontext.config.items()) # sys.exit(1) # gscontext.config.set() platform_handler = PlatformHandler.create("amiga") driver = platform_handler.get_runner(gscontext) device_helper = EnumerateHelper() device_helper.default_port_selection(driver.ports, driver.options) driver.prepare() driver.install() # set_progress("__run__") driver.run() driver.wait() driver.finish()
def app_main(): print("prefs") qapplication = init_qt() print("FIXME: Saira - read from proper data location") with open( os.path.expanduser( "~/openretro/git/fsemu/data/SairaCondensed-Medium.ttf" ), "rb", ) as f: QFontDatabase.addApplicationFontFromData(f.read()) with open( os.path.expanduser( "~/openretro/git/fsemu/data/SairaCondensed-Medium.ttf" ), "rb", ) as f: QFontDatabase.addApplicationFontFromData(f.read()) with open( os.path.expanduser( "~/openretro/git/fsemu/data/SairaCondensed-SemiBold.ttf" ), "rb", ) as f: QFontDatabase.addApplicationFontFromData(f.read()) with open( os.path.expanduser( "~/openretro/git/fsemu/data/SairaCondensed-Bold.ttf" ), "rb", ) as f: QFontDatabase.addApplicationFontFromData(f.read()) initialize_qt_style(qapplication) from launcher.launcherapp import LauncherApp launcherapp = LauncherApp() # from launcher.ui.launcherwindow import LauncherWindow # launcherwindow = LauncherWindow() # launcherwindow.show() # window = PrefsWindow(app) # window.show() app = Application() from system.wsopen import wsopen wsopen("SYS:Prefs/WHDLoad") qapplication.exec_()
def app_main(): if "--help" in sys.argv: print(help_text) return print("FS-UAE Launcher {0}".format(VERSION)) print(sys.argv) print(platform.uname()) for i, arg in enumerate(sys.argv[:]): if arg == "--fullscreen" or arg == "--fullscreen=1": sys.argv[i] = "--settings:fullscreen=1" elif arg == "--no-fullscreen" or arg == "--fullscreen=0": sys.argv[i] = "--settings:fullscreen=0" from launcher.launcherapp import LauncherApp app = LauncherApp() if "--no-auto-detect-game" in sys.argv: sys.argv.remove("--no-auto-detect-game") LauncherApp.auto_detect_game = False try: app.start() except Exception as e: traceback.print_exc(file=sys.stderr) import fsui if "--no-gui" in sys.argv: pass else: fsui.show_error( "An error occurred starting FS-UAE Launcher:\n\n" + repr(e) + "\n\nFS-UAE Launcher cannot start " "because of this.", "FS-UAE Launcher", ) fsui.show_error(traceback.format_exc()) else: app.run() app.save_settings() # from fs_uae_launcher.netplay.IRC import IRC # IRC.stop() from fsbc.signal import Signal Signal("quit").notify() print("app_main done")
def _app_main_2(qapplication, appname): launcherapp = LauncherApp() theme = get_global_theme() initialize_qt_style(qapplication, theme) # debug_sys_stdout() app = Application() if appname.lower().endswith(":launcher"): if Settings.get(WORKSPACE_ON_STARTUP) == "1": wsopen("C:LoadWB") if appname: wsopen(appname) else: wsopen("SYS:Launcher") qapplication.exec_()
def on_activated(self): from launcher.launcherapp import LauncherApp LauncherApp.start_game()
def __init__(self, fsgs=None): LauncherWindow._current = weakref.ref(self) # Old name if fsgs is not None: self.fsgs = fsgs else: self.fsgs = default_context() # New name self.gsc = self.fsgs from launcher.launcherapp import LauncherApp LauncherApp.pre_start() border = True maximize = None menu = False if launcher.ui.get_screen_size()[1] <= 768: if fstd.desktop.is_running_gnome_3(): border = False if "--window-border" in sys.argv: border = True maximize = True if Skin.fws(): border = False menu = True if "--no-window-border" in sys.argv: border = False if fsgs_module.product == "OpenRetro": app_name = "OpenRetro Launcher" else: app_name = "FS-UAE Launcher" if Skin.fws(): title = app_name else: title = "{} {}".format(app_name, Application.instance().version) WindowWithTabs.__init__(self, None, title, border=border, menu=menu) icon = self.find_icon() if icon: self.set_icon_from_path(icon) self.main_layout = fsui.VerticalLayout() self.books = [] self.config_browser = None self.configurations_panel = None self.main_menu_close_time = 0 self.main_panel = None self._menu = None self.menu_button = None self.quick_settings_panel = None self.tab_panels = [] self.user_button = None self.user_menu_close_time = 0 self.set_content(self.main_layout) self.column_layout = fsui.HorizontalLayout() self.main_layout.add(self.column_layout, fill=True, expand=True) # left border self.create_column(0, min_width=Skin.get_window_padding_left(), content=False) # left content # if fs_uae_launcher.ui.get_screen_size()[0] > 1024: # left_width = 518 # else: # left_width = 400 # FIXME: adjust left_width = 462 self.create_column(1, min_width=left_width) # right content # right_width = Constants.SCREEN_SIZE[0] * 2 + 21 + 10 + 10 extra_screenshot_width = Constants.SCREEN_SIZE[0] + 21 need_width = 1280 right_width = 518 if self.is_editor_enabled(): # need_width += extra_screen_width pass else: if launcher.ui.get_screen_size()[0] >= need_width: # make room for one more screenshot right_width += extra_screenshot_width pass # right_width = 518 # if Skin.EXTRA_GROUP_MARGIN: # self.main_layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) self.create_column(2, min_width=right_width, expand=True) # right border self.create_column(3, min_width=Skin.get_window_padding_right(), content=False) # if self.is_editor_enabled(): # from ..editor.EditorGroup import EditorGroup # editor = EditorGroup(self) # self.main_layout.add(editor, fill=True, expand=True, # margin_right=20) # if fs_uae_launcher.ui.get_screen_size()[1] >= 768: # right_margin = 0 if launcher.ui.get_screen_size()[1] >= 720: self.bottom_layout = fsui.HorizontalLayout() self.main_layout.add(self.bottom_layout, fill=True) bottom_panel = BottomPanel(self) bottom_panel.set_min_width(10) bottom_panel.set_min_height(Skin.get_bottom_panel_height()) self.bottom_layout.add(bottom_panel, fill=True) self.screenshots_panel = ScreenshotsPanel(self) self.bottom_layout.add(self.screenshots_panel, fill=True) self.game_info_panel = GameInfoPanel(self) self.game_info_panel.set_min_width(GAME_INFO_PANEL_MIN_WIDTH) self.bottom_layout.add(self.game_info_panel, fill=True, expand=True) bottom_panel = BottomPanel(self) bottom_panel.set_min_width(10) bottom_panel.set_min_height(Skin.get_bottom_panel_height()) self.bottom_layout.add(bottom_panel, fill=True) else: self.bottom_layout = None self.screenshots_panel = None # right_margin = -10 - Skin.EXTRA_GROUP_MARGIN # else: # bottom_panel = None # # FIXME: # if bottom_panel is None: # layout.add_spacer(0, Skin.get_bottom_panel_height()) # else: # bottom_panel.set_min_height(Skin.get_bottom_panel_height()) # layout.add(bottom_panel, fill=True, margin_right=right_margin) # elif column == 1: # group = LaunchGroup(self) # layout.add(group, fill=True, margin=10, margin_top=0) # layout.add_spacer(0, 10) self.realize_tabs() # self._menu = self.create_menu() if fsui.System.macosx and fsui.toolkit == "wx": # import wx # self.tools_menu = self.create_menu() # menu_bar = wx.MenuBar() # menu_bar.Append(self.tools_menu._menu, _("Tools")) # self.SetMenuBar(menu_bar) pass self.status_bar = StatusBar(self) self.layout.add(self.status_bar, fill=True) was_maximized = LauncherSettings.get("maximized") == "1" if LauncherSettings.get(Option.LAUNCHER_CONFIG_FEATURE) == "1": if launcher.ui.get_screen_size()[0] > 1300: if launcher.ui.get_screen_size()[1] > 1000: self.layout.min_width = 1280 self.layout.min_height = 720 self.set_size(self.layout.get_min_size()) self.center_on_screen() if was_maximized or maximize: self.maximize() LauncherSignal.add_listener("scan_done", self) LauncherSignal.add_listener("setting", self) self.update_title() self.check_for_update_once() self.implicit_config_handler = ImplicitConfigHandler(self)
def __init__(self, fsgs=None): LauncherWindow._current = weakref.ref(self) # Old name if fsgs is not None: self.fsgs = fsgs else: self.fsgs = default_context() # New name self.gsc = self.fsgs from launcher.launcherapp import LauncherApp LauncherApp.pre_start() border = True maximize = None menu = False if launcher.ui.get_screen_size()[1] <= 768: if fstd.desktop.is_running_gnome_3(): border = False if "--window-border" in sys.argv: border = True maximize = True if Skin.fws(): border = False menu = True if "--no-window-border" in sys.argv: border = False if fsgs_module.product == "OpenRetro": app_name = "OpenRetro Launcher" else: app_name = "FS-UAE Launcher" if Skin.fws(): title = app_name else: title = "{} {}".format(app_name, Application.instance().version) WindowWithTabs.__init__(self, None, title, border=border, menu=menu) icon = self.find_icon() if icon: self.set_icon_from_path(icon) self.main_layout = fsui.VerticalLayout() self.books = [] self.config_browser = None self.configurations_panel = None self.main_menu_close_time = 0 self.main_panel = None self._menu = None self.menu_button = None self.quick_settings_panel = None self.tab_panels = [] self.user_button = None self.user_menu_close_time = 0 self.set_content(self.main_layout) self.column_layout = fsui.HorizontalLayout() self.main_layout.add(self.column_layout, fill=True, expand=True) # left border self.create_column( 0, min_width=Skin.get_window_padding_left(), content=False ) # left content # if fs_uae_launcher.ui.get_screen_size()[0] > 1024: # left_width = 518 # else: # left_width = 400 # FIXME: adjust left_width = 462 self.create_column(1, min_width=left_width) # right content # right_width = Constants.SCREEN_SIZE[0] * 2 + 21 + 10 + 10 extra_screenshot_width = Constants.SCREEN_SIZE[0] + 21 need_width = 1280 right_width = 518 if self.is_editor_enabled(): # need_width += extra_screen_width pass else: if launcher.ui.get_screen_size()[0] >= need_width: # make room for one more screenshot right_width += extra_screenshot_width pass # right_width = 518 # if Skin.EXTRA_GROUP_MARGIN: # self.main_layout.add_spacer(Skin.EXTRA_GROUP_MARGIN) self.create_column(2, min_width=right_width, expand=True) # right border self.create_column( 3, min_width=Skin.get_window_padding_right(), content=False ) # if self.is_editor_enabled(): # from ..editor.EditorGroup import EditorGroup # editor = EditorGroup(self) # self.main_layout.add(editor, fill=True, expand=True, # margin_right=20) # if fs_uae_launcher.ui.get_screen_size()[1] >= 768: # right_margin = 0 if launcher.ui.get_screen_size()[1] >= 720: self.bottom_layout = fsui.HorizontalLayout() self.main_layout.add(self.bottom_layout, fill=True) bottom_panel = BottomPanel(self) bottom_panel.set_min_width(10) bottom_panel.set_min_height(Skin.get_bottom_panel_height()) self.bottom_layout.add(bottom_panel, fill=True) self.screenshots_panel = ScreenshotsPanel(self) self.bottom_layout.add(self.screenshots_panel, fill=True) self.game_info_panel = GameInfoPanel(self) self.game_info_panel.set_min_width(GAME_INFO_PANEL_MIN_WIDTH) self.bottom_layout.add( self.game_info_panel, fill=True, expand=True ) bottom_panel = BottomPanel(self) bottom_panel.set_min_width(10) bottom_panel.set_min_height(Skin.get_bottom_panel_height()) self.bottom_layout.add(bottom_panel, fill=True) else: self.bottom_layout = None self.screenshots_panel = None # right_margin = -10 - Skin.EXTRA_GROUP_MARGIN # else: # bottom_panel = None # # FIXME: # if bottom_panel is None: # layout.add_spacer(0, Skin.get_bottom_panel_height()) # else: # bottom_panel.set_min_height(Skin.get_bottom_panel_height()) # layout.add(bottom_panel, fill=True, margin_right=right_margin) # elif column == 1: # group = LaunchGroup(self) # layout.add(group, fill=True, margin=10, margin_top=0) # layout.add_spacer(0, 10) self.realize_tabs() # self._menu = self.create_menu() if fsui.System.macosx and fsui.toolkit == "wx": # import wx # self.tools_menu = self.create_menu() # menu_bar = wx.MenuBar() # menu_bar.Append(self.tools_menu._menu, _("Tools")) # self.SetMenuBar(menu_bar) pass self.status_bar = StatusBar(self) self.layout.add(self.status_bar, fill=True) was_maximized = LauncherSettings.get("maximized") == "1" if LauncherSettings.get(Option.LAUNCHER_CONFIG_FEATURE) == "1": if launcher.ui.get_screen_size()[0] > 1300: if launcher.ui.get_screen_size()[1] > 1000: self.layout.min_width = 1280 self.layout.min_height = 720 self.set_size(self.layout.get_min_size()) self.center_on_screen() if was_maximized or maximize: self.maximize() LauncherSignal.add_listener("scan_done", self) LauncherSignal.add_listener("setting", self) self.update_title() self.check_for_update_once() self.implicit_config_handler = ImplicitConfigHandler(self)