Related to weird switching of playback on Maemo 5, putting in asserts to confirm...
[watersofshiloah] / src / windows / _base.py
index ac81df2..d855fd8 100644 (file)
@@ -13,7 +13,6 @@ import util.go_utils as go_utils
 
 import stream_index
 import banners
-import playcontrol
 import presenter
 
 
@@ -210,14 +209,14 @@ class ListWindow(BasicWindow):
                self._treeScroller = hildonize.hildonize_scrollwindow(self._treeScroller)
 
                self._separator = gtk.HSeparator()
-               self._playcontrol = playcontrol.NavControl(self._player, self._store)
-               self._playcontrol.connect("home", self._on_home)
-               self._playcontrol.connect("jump-to", self._on_jump)
+               self._presenter = presenter.NavControl(self._player, self._store)
+               self._presenter.connect("home", self._on_home)
+               self._presenter.connect("jump-to", self._on_jump)
 
                self._contentLayout = gtk.VBox(False)
                self._contentLayout.pack_start(self._treeScroller, True, True)
                self._contentLayout.pack_start(self._separator, False, True)
-               self._contentLayout.pack_start(self._playcontrol.toplevel, False, True)
+               self._contentLayout.pack_start(self._presenter.toplevel, False, True)
 
                self._layout.pack_start(self._loadingBanner.toplevel, False, False)
                self._layout.pack_start(self._contentLayout, True, True)
@@ -229,7 +228,7 @@ class ListWindow(BasicWindow):
                self._loadingBanner.toplevel.hide()
 
                self._refresh()
-               self._playcontrol.refresh()
+               self._presenter.refresh()
 
        @classmethod
        def _get_columns(cls):
@@ -270,6 +269,7 @@ class ListWindow(BasicWindow):
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_player_title_change(self, player, node):
+               assert not self._isDestroyed
                self._select_row()
 
        @misc_utils.log_exception(_moduleLogger)
@@ -420,6 +420,7 @@ class PresenterWindow(BasicWindow):
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_player_state_change(self, player, newState):
+               assert not self._isDestroyed
                if self._active and self._player.state == self._player.STATE_PLAY:
                        self._seekbar.show()
                        assert self._updateSeek is None
@@ -436,6 +437,7 @@ class PresenterWindow(BasicWindow):
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_player_title_change(self, player, node):
+               assert not self._isDestroyed
                if not self._active or node in [None, self._node]:
                        self._playerNode = node
                        return
@@ -445,6 +447,7 @@ class PresenterWindow(BasicWindow):
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_player_error(self, player, err, debug):
+               assert not self._isDestroyed
                _moduleLogger.error("%r - %r" % (err, debug))
 
        @misc_utils.log_exception(_moduleLogger)