def get_runners(self): """Append runners to the model.""" runner_node = self.model.append(None, ["Runners", None]) runners = pga.get_runners() for runner in runners: icon = get_runner_icon(runner, format='pixbuf', size=(16, 16)) self.model.append(runner_node, [runner, icon])
def load_all_runners(self): """Append runners to the model.""" runner_node = self.model.append(None, ["runners", None, "Runners"]) for slug in self.runners: name = lutris.runners.import_runner(slug).human_name icon = get_runner_icon(slug, format="pixbuf", size=(16, 16)) self.model.append(runner_node, [slug, icon, name])
def get_runner_hbox(self, runner_name): # Get runner details runner = import_runner(runner_name)() platform = runner.platform description = runner.description hbox = Gtk.HBox() hbox.show() # Icon icon = get_runner_icon(runner_name) icon.show() icon.set_alignment(0.5, 0.1) hbox.pack_start(icon, False, False, 10) # Label runner_label = Gtk.Label() runner_label.show() if not runner.is_installed(): runner_label.set_sensitive(False) runner_label.set_markup( "<b>%s</b>\n%s\n <i>Supported platforms : %s</i>" % (runner.human_name, description, platform) ) runner_label.set_width_chars(40) runner_label.set_max_width_chars(40) runner_label.set_property('wrap', True) runner_label.set_line_wrap(True) runner_label.set_alignment(0.0, 0.1) runner_label.set_padding(5, 0) self.runner_labels[runner] = runner_label hbox.pack_start(runner_label, True, True, 5) # Buttons self.versions_button = Gtk.Button("Manage versions") self.versions_button.set_size_request(120, 30) self.versions_button.set_valign(Gtk.Align.CENTER) self.versions_button.connect("clicked", self.on_versions_clicked, runner, runner_label) hbox.pack_start(self.versions_button, False, False, 5) self.install_button = Gtk.Button("Install") self.install_button.set_size_request(80, 30) self.install_button.set_valign(Gtk.Align.CENTER) self.install_button.connect("clicked", self.on_install_clicked, runner, runner_label) hbox.pack_start(self.install_button, False, False, 5) self.configure_button = Gtk.Button("Configure") self.configure_button.set_size_request(90, 30) self.configure_button.set_valign(Gtk.Align.CENTER) self.configure_button.connect("clicked", self.on_configure_clicked, runner, runner_label) hbox.pack_start(self.configure_button, False, False, 5) self.set_button_display(runner) return hbox
def get_runner_hbox(self, runner_name): # Get runner details runner = runners.import_runner(runner_name)() platform = runner.platform description = runner.description hbox = Gtk.HBox() hbox.show() # Icon icon = get_runner_icon(runner_name) icon.show() icon.set_alignment(0.5, 0.1) hbox.pack_start(icon, False, False, 10) # Label runner_label = Gtk.Label() runner_label.show() if not runner.is_installed(): runner_label.set_sensitive(False) runner_label.set_markup( "<b>%s</b>\n%s\n <i>Supported platforms : %s</i>" % (runner.human_name, description, platform)) runner_label.set_width_chars(40) runner_label.set_max_width_chars(40) runner_label.set_property('wrap', True) runner_label.set_line_wrap(True) runner_label.set_alignment(0.0, 0.1) runner_label.set_padding(5, 0) self.runner_labels[runner] = runner_label hbox.pack_start(runner_label, True, True, 5) # Buttons self.versions_button = Gtk.Button("Manage versions") self.versions_button.set_size_request(120, 30) self.versions_button.set_valign(Gtk.Align.CENTER) self.versions_button.connect("clicked", self.on_versions_clicked, runner, runner_label) hbox.pack_start(self.versions_button, False, False, 5) self.install_button = Gtk.Button("Install") self.install_button.set_size_request(80, 30) self.install_button.set_valign(Gtk.Align.CENTER) self.install_button.connect("clicked", self.on_install_clicked, runner, runner_label) hbox.pack_start(self.install_button, False, False, 5) self.configure_button = Gtk.Button("Configure") self.configure_button.set_size_request(90, 30) self.configure_button.set_valign(Gtk.Align.CENTER) self.configure_button.connect("clicked", self.on_configure_clicked, runner, runner_label) hbox.pack_start(self.configure_button, False, False, 5) self.set_button_display(runner) return hbox
def get_runner_hbox(self, runner_name): # Get runner details runner = import_runner(runner_name)() platform = runner.platform description = runner.description hbox = Gtk.HBox() # Icon icon = get_runner_icon(runner_name) icon.set_alignment(0.5, 0.1) hbox.pack_start(icon, False, False, 10) # Label runner_label = Gtk.Label() if not runner.is_installed(): runner_label.set_sensitive(False) runner_label.set_markup( "<b>%s</b>\n%s\n <i>Supported platforms : %s</i>" % (runner.human_name, description, platform) ) runner_label.set_width_chars(40) runner_label.set_max_width_chars(40) runner_label.set_property('wrap', True) runner_label.set_line_wrap(True) runner_label.set_alignment(0.0, 0.1) runner_label.set_padding(5, 0) self.runner_labels[runner] = runner_label hbox.pack_start(runner_label, True, True, 5) # Button button = Gtk.Button() button.set_size_request(100, 30) button_align = Gtk.Alignment.new(1.0, 0.0, 0.0, 0.0) self.configure_button(button, runner) button_align.add(button) hbox.pack_start(button_align, False, False, 15) return hbox
def get_runners(self): runner_node = self.model.append(None, ["Runners", None]) runners = pga.get_runners() for runner in runners: icon = get_runner_icon(runner, format='pixbuf', size=(16, 16)) self.model.append(runner_node, [runner, icon])
def add_runner(self, slug): name = runners.import_runner(slug).human_name icon = get_runner_icon(slug, format='pixbuf', size=(16, 16)) self.model.append(self.root_node, [slug, icon, name])
def add_runner(self, slug): name = runners.import_runner(slug).human_name icon = get_runner_icon(slug, format='pixbuf', size=(16, 16)) self.model.append(self.runner_node, ['runners', slug, icon, name])