mirror of
https://github.com/lutris/lutris
synced 2024-10-04 14:59:37 +00:00
Show the log-in notification only with the splash, not if you have games or if you have games, but they are filtered away.
This commit is contained in:
parent
4975ce4030
commit
e0c81d7024
|
@ -46,8 +46,7 @@ from lutris.util.system import update_desktop_icons
|
||||||
|
|
||||||
|
|
||||||
@GtkTemplate(ui=os.path.join(datapath.get(), "ui", "lutris-window.ui"))
|
@GtkTemplate(ui=os.path.join(datapath.get(), "ui", "lutris-window.ui"))
|
||||||
class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
|
class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate, DialogInstallUIDelegate): # pylint: disable=too-many-public-methods
|
||||||
DialogInstallUIDelegate): # pylint: disable=too-many-public-methods
|
|
||||||
"""Handler class for main window signals."""
|
"""Handler class for main window signals."""
|
||||||
|
|
||||||
default_view_type = "grid"
|
default_view_type = "grid"
|
||||||
|
@ -234,6 +233,7 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
|
||||||
action.connect("change-state", value.callback)
|
action.connect("change-state", value.callback)
|
||||||
self.actions[name] = action
|
self.actions[name] = action
|
||||||
if value.enabled:
|
if value.enabled:
|
||||||
|
|
||||||
def updater(action=action, value=value):
|
def updater(action=action, value=value):
|
||||||
action.props.enabled = value.enabled()
|
action.props.enabled = value.enabled()
|
||||||
|
|
||||||
|
@ -569,6 +569,8 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
|
||||||
else:
|
else:
|
||||||
self.show_label(_("No games found"))
|
self.show_label(_("No games found"))
|
||||||
|
|
||||||
|
self.update_notification()
|
||||||
|
|
||||||
def update_store(self, *_args, **_kwargs):
|
def update_store(self, *_args, **_kwargs):
|
||||||
service_id = self.filters.get("service")
|
service_id = self.filters.get("service")
|
||||||
service = self.service
|
service = self.service
|
||||||
|
@ -678,8 +680,16 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
|
||||||
splash_box = Gtk.HBox(visible=True, margin_top=24)
|
splash_box = Gtk.HBox(visible=True, margin_top=24)
|
||||||
splash_box.pack_start(side_splash, False, False, 12)
|
splash_box.pack_start(side_splash, False, False, 12)
|
||||||
splash_box.set_center_widget(center_splash)
|
splash_box.set_center_widget(center_splash)
|
||||||
|
splash_box.is_splash = True
|
||||||
self.show_overlay(splash_box, Gtk.Align.FILL, Gtk.Align.FILL)
|
self.show_overlay(splash_box, Gtk.Align.FILL, Gtk.Align.FILL)
|
||||||
|
|
||||||
|
def is_showing_splash(self):
|
||||||
|
if self.blank_overlay.get_visible():
|
||||||
|
for ch in self.blank_overlay.get_children():
|
||||||
|
if hasattr(ch, "is_splash"):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def show_spinner(self):
|
def show_spinner(self):
|
||||||
# This is inconsistent, but we can't use the blank overlay for the spinner- it
|
# This is inconsistent, but we can't use the blank overlay for the spinner- it
|
||||||
# won't reliably start as a child of blank_overlay. It seems like it fails if
|
# won't reliably start as a child of blank_overlay. It seems like it fails if
|
||||||
|
@ -825,8 +835,8 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
|
||||||
self.filters["installed"] = filter_installed
|
self.filters["installed"] = filter_installed
|
||||||
|
|
||||||
def update_notification(self):
|
def update_notification(self):
|
||||||
logged_in = bool(read_user_info())
|
show_notification = not read_user_info() and self.is_showing_splash()
|
||||||
self.notification_revealer.set_reveal_child(not logged_in)
|
self.notification_revealer.set_reveal_child(show_notification)
|
||||||
|
|
||||||
@GtkTemplate.Callback
|
@GtkTemplate.Callback
|
||||||
def on_lutris_log_in_button_clicked(self, _button):
|
def on_lutris_log_in_button_clicked(self, _button):
|
||||||
|
|
Loading…
Reference in a new issue