Esempio n. 1
0
 def get_scripts(self):
     if system.path_exists(self.installer_file):
         # local script
         self.on_scripts_obtained(
             interpreter.read_script(self.installer_file))
     else:
         jobs.AsyncCall(interpreter.fetch_script, self.on_scripts_obtained,
                        self.game_slug, self.revision)
Esempio n. 2
0
 def get_scripts(self, local_script=False):
     if local_script:
         self.on_scripts_obtained(
             interpreter.read_script(self.installer_file))
     else:
         jobs.AsyncCall(
             interpreter.fetch_script,
             self.on_scripts_obtained,
             self.game_slug,
             self.revision,
         )
Esempio n. 3
0
 def get_scripts(self):
     if system.path_exists(self.installer_file):
         # local script
         self.on_scripts_obtained(interpreter.read_script(self.installer_file))
     else:
         jobs.AsyncCall(
             interpreter.fetch_script,
             self.on_scripts_obtained,
             self.game_slug,
             self.revision,
         )
Esempio n. 4
0
    def __init__(
        self,
        game_slug=None,
        installer_file=None,
        revision=None,
        parent=None,
        application=None,
    ):
        super().__init__(application=application)

        self.install_in_progress = False
        self.interpreter = None
        self.parent = parent
        self.game_slug = game_slug
        self.revision = revision
        self.desktop_shortcut_box = None
        self.menu_shortcut_box = None

        self.log_buffer = None
        self.log_textview = None

        self.title_label = InstallerLabel()
        self.title_label.set_selectable(False)
        self.vbox.add(self.title_label)

        self.status_label = InstallerLabel()
        self.status_label.set_max_width_chars(80)
        self.status_label.set_property("wrap", True)
        self.status_label.set_selectable(True)
        self.vbox.add(self.status_label)

        self.widget_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.vbox.pack_start(self.widget_box, True, True, 0)

        self.vbox.add(Gtk.HSeparator())

        self.action_buttons = Gtk.Box(spacing=6)
        action_buttons_alignment = Gtk.Alignment.new(1, 0, 0, 0)
        action_buttons_alignment.add(self.action_buttons)
        self.vbox.pack_start(action_buttons_alignment, False, True, 0)

        self.manual_button = self.add_button(_("Configure m_anually"),
                                             self.on_manual_clicked)
        self.cancel_button = self.add_button(
            _("C_ancel"),
            self.cancel_installation,
            tooltip=_("Abort and revert the installation"))
        self.eject_button = self.add_button(_("_Eject"), self.on_eject_clicked)
        self.source_button = self.add_button(_("_View source"),
                                             self.on_source_clicked)
        self.install_button = self.add_button(_("_Install"),
                                              self.on_install_clicked)
        self.continue_button = self.add_button(_("_Continue"))
        self.play_button = self.add_button(_("_Launch"), self.launch_game)
        self.close_button = self.add_button(_("_Close"), self.on_destroy)

        self.continue_handler = None

        # check if installer is local or online
        if system.path_exists(installer_file):
            self.on_scripts_obtained(interpreter.read_script(installer_file))
        else:
            self.title_label.set_markup(
                _("Waiting for response from %s") % (settings.SITE_URL))
            self.add_spinner()
            self.widget_box.show()
            self.title_label.show()
            jobs.AsyncCall(
                interpreter.fetch_script,
                self.on_scripts_obtained,
                self.game_slug,
                self.revision,
            )
        self.present()