Add buttons to browse games and open runners dialog on main window

This commit is contained in:
Mathieu Comandon 2016-10-11 15:01:01 -07:00
parent b94906f279
commit cea0376561
2 changed files with 36 additions and 3 deletions

View file

@ -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."""

View file

@ -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>