mirror of
https://github.com/lutris/lutris
synced 2024-10-14 19:53:53 +00:00
Add buttons to browse games and open runners dialog on main window
This commit is contained in:
parent
b94906f279
commit
cea0376561
|
@ -446,12 +446,17 @@ class LutrisWindow(Gtk.Application):
|
|||
connection_status = "Not connected"
|
||||
connection_label.set_text(connection_status)
|
||||
|
||||
def on_games_button_clicked(self, widget):
|
||||
self._open_browser("https://lutris.net/games/")
|
||||
|
||||
def on_register_account(self, *args):
|
||||
register_url = "https://lutris.net/user/register"
|
||||
self._open_browser("https://lutris.net/user/register")
|
||||
|
||||
def _open_browser(self, url):
|
||||
try:
|
||||
subprocess.check_call(["xdg-open", register_url])
|
||||
subprocess.check_call(["xdg-open", url])
|
||||
except subprocess.CalledProcessError:
|
||||
Gtk.show_uri(None, register_url, Gdk.CURRENT_TIME)
|
||||
Gtk.show_uri(None, url, Gdk.CURRENT_TIME)
|
||||
|
||||
def on_synchronize_manually(self, widget):
|
||||
"""Callback when Synchronize Library is activated."""
|
||||
|
|
|
@ -376,6 +376,34 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="toolbar_style">icons</property>
|
||||
<property name="icon_size">4</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="games_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Browse games</property>
|
||||
<property name="label" translatable="yes">Browse games</property>
|
||||
<property name="icon_name">applications-games</property>
|
||||
<signal name="clicked" handler="on_games_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="runners_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Manage runners</property>
|
||||
<property name="label" translatable="yes">Manage runners</property>
|
||||
<property name="icon_name">system-run</property>
|
||||
<signal name="clicked" handler="on_runners_activate" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="play_button">
|
||||
<property name="visible">True</property>
|
||||
|
|
Loading…
Reference in a new issue