コード例 #1
0
ファイル: installerwindow.py プロジェクト: ruankranz/lutris
    def prepare_install(self, script_slug):
        install_script = None
        for script in self.scripts:
            if script["slug"] == script_slug:
                install_script = script
        if not install_script:
            raise ValueError("Could not find script %s" % script_slug)
        try:
            self.interpreter = interpreter.ScriptInterpreter(
                install_script, self)
        except MissingGameDependency as ex:
            dlg = QuestionDialog({
                "question":
                "This game requires %s. Do you want to install it?" % ex.slug,
                "title":
                "Missing dependency",
            })
            if dlg.result == Gtk.ResponseType.YES:
                InstallerWindow(
                    game_slug=ex.slug,
                    parent=self.parent,
                    application=self.application,
                )
            self.destroy()
            return

        self.title_label.set_markup(u"<b>Installing {}</b>".format(
            escape_gtk_label(self.interpreter.game_name)))
        self.select_install_folder()
コード例 #2
0
    def on_installer_selected(self, _widget, installer_slug):
        """Sets the script interpreter to the correct script then proceed to
        install folder selection.

        If the installed game depends on another one and it's not installed,
        prompt the user to install it and quit this installer.
        """
        self.clean_widgets()
        try:

            self.interpreter = interpreter.ScriptInterpreter(
                self.get_script_from_slug(installer_slug),
                self
            )

        except MissingGameDependency as ex:
            dlg = QuestionDialog(
                {
                    "question": _("This game requires %s. Do you want to install it?") % ex.slug,
                    "title": _("Missing dependency"),
                }
            )
            if dlg.result == Gtk.ResponseType.YES:
                InstallerWindow(
                    installers=self.installers,
                    service=self.service,
                    appid=self.appid,
                    application=self.application,
                )
            self.destroy()
            return
        self.title_label.set_markup(_(u"<b>Installing {}</b>").format(gtk_safe(self.interpreter.installer.game_name)))
        self.select_install_folder()
コード例 #3
0
 def prepare_install(self, script_slug):
     install_script = None
     for script in self.scripts:
         if script["slug"] == script_slug:
             install_script = script
     if not install_script:
         raise ValueError("Could not find script %s" % script_slug)
     self.interpreter = interpreter.ScriptInterpreter(install_script, self)
     self.title_label.set_markup(u"<b>Installing {}</b>".format(
         escape_gtk_label(self.interpreter.game_name)))
     self.select_install_folder()
コード例 #4
0
ファイル: installerwindow.py プロジェクト: akapps/lutris
    def on_installer_selected(self, _widget, installer_version):
        """Sets the script interpreter to the correct script then proceed to
        install folder selection.

        If the installed game depends on another one and it's not installed,
        prompt the user to install it and quit this installer.
        """
        self.clean_widgets()
        try:
            script = None
            for _script in self.installers:
                if _script["version"] == installer_version:
                    script = _script
            self.interpreter = interpreter.ScriptInterpreter(script, self)

        except MissingGameDependency as ex:
            dlg = QuestionDialog({
                "question":
                _("This game requires %s. Do you want to install it?") %
                ex.slug,
                "title":
                _("Missing dependency"),
            })
            if dlg.result == Gtk.ResponseType.YES:
                InstallerWindow(
                    installers=self.installers,
                    service=self.service,
                    appid=self.appid,
                    application=self.application,
                )
            self.destroy()
            return
        self.title_label.set_markup(
            _("<b>Installing {}</b>").format(
                gtk_safe(self.interpreter.installer.game_name)))
        self.select_install_folder()

        desktop_shortcut_button = Gtk.CheckButton(_("Create desktop shortcut"),
                                                  visible=True)
        desktop_shortcut_button.connect(
            "clicked", self.on_create_desktop_shortcut_clicked)
        self.widget_box.pack_start(desktop_shortcut_button, False, False, 5)

        menu_shortcut_button = Gtk.CheckButton(
            _("Create application menu shortcut"), visible=True)
        menu_shortcut_button.connect("clicked",
                                     self.on_create_menu_shortcut_clicked)
        self.widget_box.pack_start(menu_shortcut_button, False, False, 5)
コード例 #5
0
ファイル: installerwindow.py プロジェクト: volzhs/lutris
 def prepare_install(self, script_index):
     script = self.scripts[script_index]
     self.interpreter = interpreter.ScriptInterpreter(script, self)
     self.title_label.set_markup(u"<b>Installing {}</b>".format(
         self._escape_text(self.interpreter.game_name)))
     self.select_install_folder()
コード例 #6
0
 def prepare_install(self, script_index):
     script = self.scripts[script_index]
     self.interpreter = interpreter.ScriptInterpreter(script, self)
     game_name = self.interpreter.game_name.replace('&', '&amp;')
     self.title_label.set_markup(u"<b>Installing {}</b>".format(game_name))
     self.select_install_folder()