Пример #1
0
    def get_lutris_links(self):
        box = Gtk.VBox(spacing=6, visible=True)

        donate_button = get_link_button(_("Support Lutris!"))
        donate_button.connect("clicked", lambda *x: open_uri(LINKS["donate"]))
        box.add(donate_button)

        help_label = Gtk.Label(visible=True)
        help_label.set_markup(_("<b>Help:</b>"))
        help_label.set_alignment(0, 0.5)
        help_label.set_margin_top(136)
        box.add(help_label)

        help_box = Gtk.Box(spacing=6, visible=True)
        forums_button = get_link_button(_("Forums"))
        forums_button.set_size_request(-1, -1)
        forums_button.connect("clicked", lambda *x: open_uri(LINKS["forums"]))
        help_box.add(forums_button)
        irc_button = get_link_button(_("IRC"))
        irc_button.set_size_request(-1, -1)
        irc_button.connect("clicked", lambda *x: open_uri(LINKS["irc"]))
        help_box.add(irc_button)
        discord_button = get_link_button(_("Discord"))
        discord_button.set_size_request(-1, -1)
        discord_button.connect("clicked",
                               lambda *x: open_uri(LINKS["discord"]))
        help_box.add(discord_button)
        box.add(help_box)
        return box
Пример #2
0
    def get_lutris_links(self):
        box = Gtk.VBox(spacing=6, visible=True)

        donate_button = get_link_button("Support Lutris!")
        donate_button.connect("clicked", lambda *x: open_uri(LINKS["donate"]))
        box.add(donate_button)

        help_label = Gtk.Label(visible=True)
        help_label.set_markup("<b>Help:</b>")
        help_label.set_alignment(0, 0.5)
        help_label.set_margin_top(136)
        box.add(help_label)

        help_box = Gtk.Box(spacing=6, visible=True)
        forums_button = get_link_button("Forums")
        forums_button.set_size_request(-1, -1)
        forums_button.connect("clicked", lambda *x: open_uri(LINKS["forums"]))
        help_box.add(forums_button)
        irc_button = get_link_button("IRC")
        irc_button.set_size_request(-1, -1)
        irc_button.connect("clicked", lambda *x: open_uri(LINKS["irc"]))
        help_box.add(irc_button)
        discord_button = get_link_button("Discord")
        discord_button.set_size_request(-1, -1)
        discord_button.connect("clicked", lambda *x: open_uri(LINKS["discord"]))
        help_box.add(discord_button)
        box.add(help_box)
        return box
Пример #3
0
    def get_buttons(self):
        displayed = self.game_actions.get_displayed_entries()
        icon_map = {
            # "stop": "media-playback-stop-symbolic",
            # "play": "media-playback-start-symbolic",
            "configure": "preferences-system-symbolic",
            "browse": "system-file-manager-symbolic",
            "show_logs": "utilities-terminal-symbolic",
            "remove": "user-trash-symbolic",
        }
        buttons = {}
        for action in self.game_actions.get_game_actions():
            action_id, label, callback = action
            if action_id in icon_map:
                button = Gtk.Button.new_from_icon_name(icon_map[action_id],
                                                       Gtk.IconSize.MENU)
                button.set_tooltip_text(label)
                button.set_size_request(32, 32)
            else:
                if action_id in ("play", "stop", "install"):
                    button = Gtk.Button(label)
                    button.set_size_request(146, 42)
                else:
                    button = get_link_button(label)

            if displayed.get(action_id):
                button.show()
            else:
                button.hide()
            buttons[action_id] = button

            if action_id in (
                    "desktop-shortcut",
                    "rm-desktop-shortcut",
                    "menu-shortcut",
                    "rm-menu-shortcut",
            ):
                button.connect("clicked", self.on_shortcut_edited, action_id)

            button.connect("clicked", callback)

        if self.game.runner_name and self.game.is_installed:
            for entry in self.get_runner_entries(self.game):
                name, label, callback = entry
                button = get_link_button(label)
                button.show()
                button.connect("clicked", callback)
                buttons[name] = button
        return buttons
Пример #4
0
    def get_buttons(self):
        displayed = self.game_actions.get_displayed_entries()
        disabled_entries = self.game_actions.get_disabled_entries()
        icon_map = {
            # "stop": "media-playback-stop-symbolic",
            # "play": "media-playback-start-symbolic",
            "configure": "preferences-system-symbolic",
            "browse": "system-file-manager-symbolic",
            "show_logs": "utilities-system-monitor-symbolic",
            "remove": "user-trash-symbolic",
        }
        buttons = {}
        for action in self.game_actions.get_game_actions():
            action_id, label, callback = action
            if action_id in icon_map:
                button = Gtk.Button.new_from_icon_name(icon_map[action_id],
                                                       Gtk.IconSize.MENU)
                button.set_tooltip_text(label)
                button.set_size_request(32, 32)
            else:
                if action_id in ("play", "stop", "install"):
                    button = Gtk.Button(label)
                    button.set_size_request(146, 42)
                else:
                    button = get_link_button(label)
            button.connect("clicked", callback)

            if displayed.get(action_id):
                button.show()
            else:
                button.hide()
            if disabled_entries.get(action_id):
                button.set_sensitive(False)
            buttons[action_id] = button
        return buttons
Пример #5
0
 def get_locate_installed_game_button(self):
     """Return a button to locate an existing install"""
     button = get_link_button("Locate installed game")
     button.show()
     button.connect("clicked", self.game_actions.on_locate_installed_game,
                    self.game)
     return {"locate": button}
Пример #6
0
    def get_buttons(self):
        displayed = self.game_actions.get_displayed_entries()
        icon_map = {
            # "stop": "media-playback-stop-symbolic",
            # "play": "media-playback-start-symbolic",
            "configure": "preferences-system-symbolic",
            "browse": "system-file-manager-symbolic",
            "show_logs": "utilities-terminal-symbolic",
            "remove": "user-trash-symbolic",
        }
        buttons = {}
        for action in self.game_actions.get_game_actions():
            action_id, label, callback = action
            if action_id in icon_map:
                button = Gtk.Button.new_from_icon_name(
                    icon_map[action_id], Gtk.IconSize.MENU
                )
                button.set_tooltip_text(label)
                button.set_size_request(32, 32)
            else:
                if action_id in ("play", "stop", "install"):
                    button = Gtk.Button(label)
                    button.set_size_request(146, 42)
                else:
                    button = get_link_button(label)

            if displayed.get(action_id):
                button.show()
            else:
                button.hide()
            buttons[action_id] = button

            if action_id in ('desktop-shortcut', 'rm-desktop-shortcut', 'menu-shortcut', 'rm-menu-shortcut'):
                button.connect("clicked", self.on_shortcut_edited, action_id)

            button.connect("clicked", callback)

        if self.game.runner_name and self.game.is_installed:
            for entry in self.get_runner_entries(self.game):
                name, label, callback = entry
                button = get_link_button(label)
                button.show()
                button.connect("clicked", callback)
                buttons[name] = button
        return buttons
Пример #7
0
 def get_runner_buttons(self):
     buttons = {}
     if self.game.runner_name and self.game.is_installed:
         runner = runners.import_runner(self.game.runner_name)(self.game.config)
         for entry in runner.context_menu_entries:
             name, label, callback = entry
             button = get_link_button(label)
             button.show()
             button.connect("clicked", self.on_link_button_clicked, callback)
             buttons[name] = button
     return buttons
Пример #8
0
 def get_game_buttons(self):
     """Return a dictionary of buttons to use in the panel"""
     displayed = self.game_actions.get_displayed_entries()
     buttons = {}
     for action in self.game_actions.get_game_actions():
         action_id, label, callback = action
         if action_id in ("play", "stop", "install"):
             continue
         button = get_link_button(label)
         if displayed.get(action_id):
             button.show()
         else:
             button.hide()
         buttons[action_id] = button
         button.connect("clicked", self.on_link_button_clicked, callback)
     return buttons
Пример #9
0
    def get_lutris_links(self):
        search_entry = Gtk.SearchEntry(visible=True)
        box = Gtk.VBox(spacing=6, visible=True)
        floss_button = get_link_button("Browse Open Source games")
        floss_button.connect(
            "clicked", lambda *x: search_entry.set_text("open source games"))
        box.add(floss_button)

        f2p_button = get_link_button("Browse Free to Play games")
        f2p_button.connect(
            "clicked", lambda *x: search_entry.set_text("free to play games"))
        box.add(f2p_button)

        donate_button = get_link_button("Support the project")
        donate_button.connect("clicked", lambda *x: open_uri(LINKS["donate"]))
        box.add(donate_button)

        search_label = Gtk.Label(visible=True)
        search_label.set_markup("<b>Search games on Lutris.net:</b>")
        search_label.set_alignment(0, 0.5)
        search_label.set_margin_top(12)
        box.add(search_label)

        search_entry = Gtk.SearchEntry(visible=True)
        search_entry.set_text(self.search_terms)
        search_entry.connect("changed", self.on_search_entry_changed)
        box.add(search_entry)

        help_label = Gtk.Label(visible=True)
        help_label.set_markup("<b>Help:</b>")
        help_label.set_alignment(0, 0.5)
        help_label.set_margin_top(12)
        box.add(help_label)

        help_box = Gtk.Box(spacing=6, visible=True)
        forums_button = get_link_button("Forums")
        forums_button.set_size_request(-1, -1)
        forums_button.connect("clicked", lambda *x: open_uri(LINKS["forums"]))
        help_box.add(forums_button)
        irc_button = get_link_button("IRC")
        irc_button.set_size_request(-1, -1)
        irc_button.connect("clicked", lambda *x: open_uri(LINKS["irc"]))
        help_box.add(irc_button)
        discord_button = get_link_button("Discord")
        discord_button.set_size_request(-1, -1)
        discord_button.connect("clicked",
                               lambda *x: open_uri(LINKS["discord"]))
        help_box.add(discord_button)
        box.add(help_box)
        return box