예제 #1
0
파일: wine.py 프로젝트: Yilnis/lutris-1
 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)
예제 #2
0
 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'))
예제 #3
0
파일: log.py 프로젝트: zsh-754207424/lutris
    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)
예제 #4
0
파일: hatari.py 프로젝트: steevp/lutris
 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()
예제 #5
0
파일: pcsxr.py 프로젝트: Kehlyos/lutris
 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
예제 #6
0
 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