[gnome-music/wip/jfelder/lastfm-ui-v1: 27/27] debug messages



commit dc577640ae7af31ad1e535f022d80e3be22720aa
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Jan 14 17:58:23 2020 +0100

    debug messages

 gnomemusic/scrobbler.py       | 9 +++++++++
 gnomemusic/widgets/appmenu.py | 1 +
 2 files changed, 10 insertions(+)
---
diff --git a/gnomemusic/scrobbler.py b/gnomemusic/scrobbler.py
index 54d3b4d0..d2067dd8 100644
--- a/gnomemusic/scrobbler.py
+++ b/gnomemusic/scrobbler.py
@@ -81,21 +81,26 @@ class GoaLastFM(GObject.GObject):
         self._find_lastfm_account()
 
     def _goa_account_added(self, client, obj):
+        print("Gao account added")
         self._find_lastfm_account()
 
     def _goa_account_removed(self, client, obj):
         account = obj.get_account()
+        print("Goa account removed", account.props.provider_type)
         if account.props.provider_type == "lastfm":
+            print("last.fm account removed")
             self._account.disconnect(self._music_disabled_id)
             self._reset_attributes()
 
     @log
     def _find_lastfm_account(self):
+        print("looking for last.fm account")
         accounts = self._client.get_accounts()
 
         for obj in accounts:
             account = obj.get_account()
             if account.props.provider_type == "lastfm":
+                print("last.fm acccount found")
                 self._authentication = obj.get_oauth2_based()
                 self._account = account
                 self._music_disabled_id = self._account.connect(
@@ -103,8 +108,11 @@ class GoaLastFM(GObject.GObject):
                 self._goa_music_disabled(self._account)
                 break
 
+        print("no last.fm account found")
+
     @log
     def _goa_music_disabled(self, klass, args=None):
+        print("on test dissabled?", self._account.props.music_disabled)
         if self._account.props.music_disabled is True:
             self._state = GoaLastFM.State.DISABLED
         else:
@@ -188,6 +196,7 @@ class LastFmScrobbler(GObject.GObject):
         The account state depends on GoaLast.fm state property.
         :param GoaLastFM.State value: new state
         """
+        print("nouveau account state du scrobbler", value)
         self._account_state = value
         self.notify("can-scrobble")
 
diff --git a/gnomemusic/widgets/appmenu.py b/gnomemusic/widgets/appmenu.py
index 101c447a..b65623ee 100644
--- a/gnomemusic/widgets/appmenu.py
+++ b/gnomemusic/widgets/appmenu.py
@@ -54,6 +54,7 @@ class AppMenu(Gtk.PopoverMenu):
 
     def _on_scrobbler_state_changed(self, klass, args):
         state = self._lastfm_scrobbler.props.account_state
+        print("on catche dans appemenu", state)
         if state == GoaLastFM.State.NOT_CONFIGURED:
             self._lastfm_box.props.sensitive = False
             if self._lastfm_switcher_id is not None:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]