[totem] Removed radio code and tidied up the plugin code a little



commit b82bc22eb92f4eee7967b810c16eeadd05487fb7
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue May 5 19:31:01 2009 +0100

    Removed radio code and tidied up the plugin code a little
---
 src/plugins/iplayer/iplayer.py |   15 ++-------
 src/plugins/iplayer/iplayer.ui |   72 ++++++++--------------------------------
 2 files changed, 17 insertions(+), 70 deletions(-)

diff --git a/src/plugins/iplayer/iplayer.py b/src/plugins/iplayer/iplayer.py
index afac9e3..60d5506 100644
--- a/src/plugins/iplayer/iplayer.py
+++ b/src/plugins/iplayer/iplayer.py
@@ -19,10 +19,7 @@ class IplayerPlugin (totem.Plugin):
 		container = builder.get_object ('iplayer_vbox')
 
 		self.tv_tree_store = builder.get_object ('iplayer_programme_store')
-		#self.radio_tree_store = builder.get_object ('iplayer_radio_programme_store')
-		#for object_id in ('iplayer_programme_list', 'iplayer_radio_programme_list')
 		programme_list = builder.get_object ('iplayer_programme_list')
-		#	programme_list.set_data ('id', object_id)
 		programme_list.connect ('row-expanded', self._row_expanded_cb)
 		programme_list.connect ('row-activated', self._row_activated_cb)
 
@@ -30,14 +27,12 @@ class IplayerPlugin (totem.Plugin):
 		container.show_all ()
 
 		self.tv = iplayer2.feed ('tv')
-		#self.radio = iplayer2.feed ('radio')
 
 		# Add the interface to Totem's sidebar
 		self.totem.add_sidebar_page ("iplayer", _("BBC iPlayer"), container)
 
 		# Get the channel category listings
 		self.populate_channel_list (self.tv, self.tv_tree_store)
-		#self.populate_channel_list (self.radio, self.radio_tree_store)
 
 	def deactivate (self, totem_object):
 		totem_object.remove_sidebar_page ("iplayer")
@@ -59,7 +54,7 @@ class IplayerPlugin (totem.Plugin):
 	def _populate_channel_list_cb (self, tree_store, parent_path, values):
 		# Callback from PopulateChannelsThread to add stuff to the tree store
 		if values == None:
-			self.totem.action_error (_('Error Listing Channel Categories'), 'TODO')
+			self.totem.action_error (_('Error Listing Channel Categories'), _('There was an unknown error getting the list of television channels available on BBC iPlayer.'))
 			return False
 
 		parent_iter = tree_store.get_iter (parent_path)
@@ -83,12 +78,7 @@ class IplayerPlugin (totem.Plugin):
 			return
 
 		# Populate it with programmes asynchronously
-		#if tree_view.get_data ('id') == 'iplayer_programme_store':
-		feed = self.tv
-		#else:
-		#	feed = self.radio
-
-		self.populate_programme_list (feed, tree_model, row_iter)
+		self.populate_programme_list (self.tv, tree_model, row_iter)
 
 	def _row_activated_cb (self, tree_view, path, view_column):
 		tree_store = tree_view.get_model ()
@@ -201,6 +191,7 @@ class PopulateProgrammesThread (threading.Thread):
 			# Get the media, which gives the stream URI.
 			# We go for mobile quality, since the higher-quality streams are RTMP-only
 			# which isn't currently supported by GStreamer or xine
+			# TODO: Use higher-quality streams once http://bugzilla.gnome.org/show_bug.cgi?id=566604 is fixed
 			media = programme_item.get_media_for ('mobile')
 			if media == None:
 				# Not worth displaying an error in the interface for this
diff --git a/src/plugins/iplayer/iplayer.ui b/src/plugins/iplayer/iplayer.ui
index 084f2bf..e7768f3 100644
--- a/src/plugins/iplayer/iplayer.ui
+++ b/src/plugins/iplayer/iplayer.ui
@@ -9,77 +9,33 @@
 	</columns>
 </object>
 
-<!--<object class="GtkTreeStore" id="iplayer_radio_programme_store">
-	<columns>
-		<column type="gchararray"/><!-Title->
-		<column type="gchararray"/><!-Summary->
-		<column type="gchararray"/><!-MRL->
-	</columns>
-</object>-->
-
 <object class="GtkVBox" id="iplayer_vbox">
 	<property name="border-width">5</property>
 	<property name="homogeneous">False</property>
 	<property name="spacing">6</property>
 	<child>
-		<!--<object class="GtkNotebook" id="iplayer_notebook">
-			<child>-->
-				<object class="GtkScrolledWindow" id="iplayer_scrolled_window">
-					<property name="hscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
-					<property name="vscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
-					<child>
-						<object class="GtkTreeView" id="iplayer_programme_list">
-							<property name="model">iplayer_programme_store</property>
-							<property name="expander-column">iplayer_title_column</property>
-							<property name="headers-visible">False</property>
-							<child>
-								<object class="GtkTreeViewColumn" id="iplayer_title_column">
-									<child>
-										<object class="GtkCellRendererText" id="iplayer_title_cell_renderer"/>
-										<attributes>
-											<attribute name="text">0</attribute>
-										</attributes>
-									</child>
-								</object>
-							</child>
-						</object>
-					</child>
-				</object>
-			<!--</child>
-			<child type="tab">
-				<object class="GtkLabel" id="iplayer_tv_tab">
-					<property name="label" translatable="yes">Television</property>
-				</object>
-			</child>
+		<object class="GtkScrolledWindow" id="iplayer_scrolled_window">
+			<property name="hscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
+			<property name="vscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
+			<property name="shadow-type">GTK_SHADOW_IN</property>
 			<child>
-				<object class="GtkScrolledWindow" id="iplayer_radio_scrolled_window">
-					<property name="hscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
-					<property name="vscrollbar-policy">GTK_POLICY_AUTOMATIC</property>
+				<object class="GtkTreeView" id="iplayer_programme_list">
+					<property name="model">iplayer_programme_store</property>
+					<property name="expander-column">iplayer_title_column</property>
+					<property name="headers-visible">False</property>
 					<child>
-						<object class="GtkTreeView" id="iplayer_radio_programme_list">
-							<property name="model">iplayer_radio_programme_store</property>
-							<property name="expander-column">iplayer_radio_title_column</property>
-							<property name="headers-visible">False</property>
+						<object class="GtkTreeViewColumn" id="iplayer_title_column">
 							<child>
-								<object class="GtkTreeViewColumn" id="iplayer_radio_title_column">
-									<child>
-										<object class="GtkCellRendererText" id="iplayer_radio_title_cell_renderer"/>
-										<attributes>
-											<attribute name="text">0</attribute>
-										</attributes>
-									</child>
-								</object>
+								<object class="GtkCellRendererText" id="iplayer_title_cell_renderer"/>
+								<attributes>
+									<attribute name="text">0</attribute>
+								</attributes>
 							</child>
 						</object>
 					</child>
 				</object>
 			</child>
-			<child type="tab">
-				<object class="GtkLabel" id="iplayer_radio_tab">
-					<property name="label" translatable="yes">Radio</property>
-				</object>
-			</child>
-		</object>-->
+		</object>
 	</child>
 </object>
 </interface>



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