1
0
mirror of https://github.com/lutris/lutris synced 2024-07-05 16:38:42 +00:00

Hide and show the notification bar when you log into or out of Lutris.

This commit is contained in:
Daniel Johnson 2024-03-06 19:31:03 -05:00 committed by Mathieu Comandon
parent bed49c83e4
commit ee70fba51a

View File

@ -11,7 +11,7 @@ from urllib.parse import unquote, urlparse
from gi.repository import Gdk, Gio, GLib, GObject, Gtk
from lutris import services, settings
from lutris.api import read_user_info
from lutris.api import read_user_info, LUTRIS_ACCOUNT_DISCONNECTED
from lutris.api import LUTRIS_ACCOUNT_CONNECTED
from lutris.database import categories as categories_db
from lutris.database import games as games_db
@ -151,6 +151,7 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
GObject.add_emission_hook(PreferencesDialog, "settings-changed", self.on_settings_changed)
MISSING_GAMES.updated.register(self.update_missing_games_sidebar_row)
LUTRIS_ACCOUNT_CONNECTED.register(self.on_lutris_account_connected)
LUTRIS_ACCOUNT_DISCONNECTED.register(self.on_lutris_account_disconnected)
LOCAL_LIBRARY_UPDATED.register(self.on_local_library_updated)
# Finally trigger the initialization of the view here
@ -872,8 +873,12 @@ class LutrisWindow(Gtk.ApplicationWindow, DialogLaunchUIDelegate,
return True
def on_lutris_account_connected(self):
self.update_notification()
self.sync_library(force=True)
def on_lutris_account_disconnected(self):
self.update_notification()
def on_local_library_updated(self):
self.redraw_view()