def run_wineexec(self, *args): dlg = FileDialog("Select an EXE or MSI file", default_path=self.game_path) filename = dlg.filename if not filename: return wineexec(filename, wine_path=self.get_executable(), prefix=self.prefix_path, config=self)
def on_runner_installed(*args): dlg = QuestionDialog({ 'question': "Do you want to select a premium license file?", 'title': "Use premium version?", }) if dlg.result == dlg.YES: license_dlg = FileDialog("Select a license file") license_filename = license_dlg.filename if not license_filename: return shutil.copy(license_filename, os.path.join(settings.RUNNER_DIR, 'redream'))
def on_save_clicked(self, _button): """Handler to save log to a file""" now = datetime.now() log_filename = "%s (%s).log" % (self.title, now.strftime("%Y-%m-%d-%H-%M")) file_dialog = FileDialog(message="Save the logs to...", default_path=os.path.expanduser("~/%s" % log_filename), mode="save") log_path = file_dialog.filename if not log_path: return text = self.buffer.get_text(self.buffer.get_start_iter(), self.buffer.get_end_iter(), True) with open(log_path, "w") as log_file: log_file.write(text)
def on_runner_installed(*args): bios_path = system.create_folder('~/.hatari/bios') dlg = QuestionDialog({ 'question': "Do you want to select an Atari ST BIOS file?", 'title': "Use BIOS file?", }) if dlg.result == dlg.YES: bios_dlg = FileDialog("Select a BIOS file") bios_filename = bios_dlg.filename if not bios_filename: return shutil.copy(bios_filename, bios_path) bios_path = os.path.join(bios_path, os.path.basename(bios_filename)) config = LutrisConfig(runner_slug='hatari') config.raw_runner_config.update({'bios_file': bios_path}) config.save() if callback: callback()
def install(self): success = super(pcsxr, self).install() if not success: return False config_path = os.path.expanduser('~/.pcsxr') if not os.path.exists(config_path): os.makedirs(config_path) bios_path = os.path.expanduser('~/.pcsxr/bios') if not os.path.exists(bios_path): os.makedirs(bios_path) dlg = QuestionDialog({ 'question': "Do you want to select a Playstation BIOS file?", 'title': "Use BIOS file?", }) if dlg.result == dlg.YES: bios_dlg = FileDialog("Select a BIOS file") bios_filename = bios_dlg.filename shutil.copy(bios_filename, bios_path) return True
def install(self): success = super(hatari, self).install() if not success: return False config_path = os.path.expanduser('~/.hatari') if not os.path.exists(config_path): os.makedirs(config_path) bios_path = os.path.expanduser('~/.hatari/bios') if not os.path.exists(bios_path): os.makedirs(bios_path) dlg = QuestionDialog({ 'question': "Do you want to select an Atari ST BIOS file?", 'title': "Use BIOS file?", }) if dlg.result == dlg.YES: bios_dlg = FileDialog("Select a BIOS file") bios_filename = bios_dlg.filename shutil.copy(bios_filename, bios_path) bios_path = os.path.join(bios_path, os.path.basename(bios_filename)) runner_config = LutrisConfig(runner='hatari') runner_config.config_type = 'runner' runner_config.runner_config = {'hatari': {'bios_file': bios_path}} runner_config.save() return True