Making text on lists more thumb friendly
[watersofshiloah] / src / windows / conferences.py
index 7e1c599..1febd97 100644 (file)
@@ -18,8 +18,8 @@ _moduleLogger = logging.getLogger(__name__)
 
 class ConferencesWindow(windows._base.ListWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.ListWindow.__init__(self, player, store, node)
+       def __init__(self, app, player, store, node):
+               windows._base.ListWindow.__init__(self, app, player, store, node)
                self._window.set_title(self._node.title)
 
        @classmethod
@@ -28,12 +28,16 @@ class ConferencesWindow(windows._base.ListWindow):
 
                textrenderer = gtk.CellRendererText()
                column = gtk.TreeViewColumn("Date")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
+               column.set_property("fixed-width", 96)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 1)
                yield gobject.TYPE_STRING, column
 
                textrenderer = gtk.CellRendererText()
+               hildonize.set_cell_thumb_selectable(textrenderer)
                column = gtk.TreeViewColumn("Conference")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 2)
                yield gobject.TYPE_STRING, column
@@ -65,7 +69,7 @@ class ConferencesWindow(windows._base.ListWindow):
                self._errorBanner.push_message(str(exception))
 
        def _window_from_node(self, node):
-               sessionsWindow = ConferenceSessionsWindow(self._player, self._store, node)
+               sessionsWindow = ConferenceSessionsWindow(self._app, self._player, self._store, node)
                sessionsWindow.window.set_modal(True)
                sessionsWindow.window.set_transient_for(self._window)
                sessionsWindow.window.set_default_size(*self._window.get_size())
@@ -87,8 +91,8 @@ gobject.type_register(ConferencesWindow)
 
 class ConferenceSessionsWindow(windows._base.ListWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.ListWindow.__init__(self, player, store, node)
+       def __init__(self, app, player, store, node):
+               windows._base.ListWindow.__init__(self, app, player, store, node)
                self._window.set_title(self._node.title)
 
        @classmethod
@@ -96,7 +100,9 @@ class ConferenceSessionsWindow(windows._base.ListWindow):
                yield gobject.TYPE_PYOBJECT, None
 
                textrenderer = gtk.CellRendererText()
+               hildonize.set_cell_thumb_selectable(textrenderer)
                column = gtk.TreeViewColumn("Session")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 1)
                yield gobject.TYPE_STRING, column
@@ -128,7 +134,7 @@ class ConferenceSessionsWindow(windows._base.ListWindow):
                self._errorBanner.push_message(str(exception))
 
        def _window_from_node(self, node):
-               sessionsWindow = ConferenceTalksWindow(self._player, self._store, node)
+               sessionsWindow = ConferenceTalksWindow(self._app, self._player, self._store, node)
                sessionsWindow.window.set_modal(True)
                sessionsWindow.window.set_transient_for(self._window)
                sessionsWindow.window.set_default_size(*self._window.get_size())
@@ -150,8 +156,8 @@ gobject.type_register(ConferenceSessionsWindow)
 
 class ConferenceTalksWindow(windows._base.ListWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.ListWindow.__init__(self, player, store, node)
+       def __init__(self, app, player, store, node):
+               windows._base.ListWindow.__init__(self, app, player, store, node)
                self._window.set_title(self._node.title)
 
        @classmethod
@@ -159,7 +165,9 @@ class ConferenceTalksWindow(windows._base.ListWindow):
                yield gobject.TYPE_PYOBJECT, None
 
                textrenderer = gtk.CellRendererText()
+               hildonize.set_cell_thumb_selectable(textrenderer)
                column = gtk.TreeViewColumn("Talk")
+               column.set_property("sizing", gtk.TREE_VIEW_COLUMN_FIXED)
                column.pack_start(textrenderer, expand=True)
                column.add_attribute(textrenderer, "text", 1)
                yield gobject.TYPE_STRING, column
@@ -191,7 +199,7 @@ class ConferenceTalksWindow(windows._base.ListWindow):
                self._errorBanner.push_message(str(exception))
 
        def _window_from_node(self, node):
-               sessionsWindow = ConferenceTalkWindow(self._player, self._store, node)
+               sessionsWindow = ConferenceTalkWindow(self._app, self._player, self._store, node)
                sessionsWindow.window.set_modal(True)
                sessionsWindow.window.set_transient_for(self._window)
                sessionsWindow.window.set_default_size(*self._window.get_size())
@@ -213,8 +221,8 @@ gobject.type_register(ConferenceTalksWindow)
 
 class ConferenceTalkWindow(windows._base.BasicWindow):
 
-       def __init__(self, player, store, node):
-               windows._base.BasicWindow.__init__(self, player, store)
+       def __init__(self, app, player, store, node):
+               windows._base.BasicWindow.__init__(self, app, player, store)
                self._node = node
                self._playerNode = self._player.node
                self._nextSearch = None
@@ -288,8 +296,10 @@ class ConferenceTalkWindow(windows._base.BasicWindow):
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_player_update_seek(self):
+               if self._isDestroyed:
+                       return False
                self._seekbar.set_value(self._player.percent_elapsed * 100)
-               return True if not self._isDestroyed else False
+               return True
 
        @misc_utils.log_exception(_moduleLogger)
        def _on_player_state_change(self, player, newState):
@@ -300,8 +310,9 @@ class ConferenceTalkWindow(windows._base.BasicWindow):
                        self._updateSeek.start(seconds=1)
                else:
                        self._seekbar.hide()
-                       self._updateSeek.cancel()
-                       self._updateSeek = None
+                       if self._updateSeek is not None:
+                               self._updateSeek.cancel()
+                               self._updateSeek = None
 
                if not self._presenterNavigation.is_active():
                        self._set_context(newState)