--- totem.orig/src/totem-playlist.c	2008-12-10 13:22:46.000000000 +0100
+++ totem/src/totem-playlist.c	2008-12-10 15:06:26.000000000 +0100
@@ -263,6 +263,66 @@
 	gtk_widget_show (error_dialog);
 }
 
+void
+totem_playlist_select_subtitle_dialog(TotemPlaylist *playlist, TotemPlaylistSelectDialog mode)
+{
+	char *subtitle, *current, *path;
+	GFile *file, *dir;
+	TotemPlaylistStatus playing;
+	GtkTreeIter iter;
+
+	if (mode == TOTEM_PLAYLIST_DIALOG_PLAYING) {
+		/* user want change subtitles in to the current playing movie */
+		gtk_tree_model_get_iter (playlist->priv->model, &iter, playlist->priv->current);
+	} else if (mode == TOTEM_PLAYLIST_DIALOG_SELECTED) {
+		/* user want change subtitles in to the specified playlist position */
+		GList *l = gtk_tree_selection_get_selected_rows (playlist->priv->selection, NULL);
+		gtk_tree_model_get_iter (playlist->priv->model, &iter, l->data);
+		g_list_foreach (l, (GFunc) gtk_tree_path_free, NULL);
+		g_list_free (l);
+	}
+
+	/* Look for the directory of the current movie */
+	gtk_tree_model_get (playlist->priv->model, &iter,
+			    FILENAME_COL, &current,
+			    -1);
+
+	if (current == NULL)
+		return;
+
+	path = NULL;
+	file = g_file_new_for_commandline_arg (current);
+	dir = g_file_get_parent (file);
+	g_object_unref (file);
+	if (dir != NULL) {
+		path = g_file_get_path (dir);
+		g_object_unref (dir);
+	}
+
+	subtitle = totem_add_subtitle (totem_playlist_get_toplevel (playlist), path);
+	g_free (path);
+
+	if (subtitle == NULL)
+		return;
+
+	gtk_tree_model_get (playlist->priv->model, &iter,
+			    PLAYING_COL, &playing,
+			    -1);
+
+	gtk_list_store_set (GTK_LIST_STORE(playlist->priv->model), &iter, 
+			    SUBTITLE_URI_COL, subtitle,
+			    -1);
+
+	if (playing != TOTEM_PLAYLIST_STATUS_NONE) {
+		g_signal_emit (G_OBJECT (playlist),
+			       totem_playlist_table_signals[SUBTITLE_CHANGED], 0,
+			       NULL);
+	}
+
+	g_free(subtitle);
+}
+
+
 /* This one returns a new string, in UTF8 even if the MRL is encoded
  * in the locale's encoding
  */
@@ -466,55 +526,7 @@
 void
 playlist_select_subtitle_action_callback (GtkAction *action, TotemPlaylist *playlist)
 {
-	char *subtitle, *current, *path;
-	GList *l;
-	GFile *file, *dir;
-	TotemPlaylistStatus playing;
-	GtkTreeIter iter;
-
-	l = gtk_tree_selection_get_selected_rows (playlist->priv->selection, NULL);
-	gtk_tree_model_get_iter (playlist->priv->model, &iter, l->data);
-	g_list_foreach (l, (GFunc) gtk_tree_path_free, NULL);
-	g_list_free (l);
-
-	/* Look for the directory of the current movie */
-	gtk_tree_model_get (playlist->priv->model, &iter,
-			    FILENAME_COL, &current,
-			    -1);
-
-	if (current == NULL)
-		return;
-
-	path = NULL;
-	file = g_file_new_for_commandline_arg (current);
-	dir = g_file_get_parent (file);
-	g_object_unref (file);
-	if (dir != NULL) {
-		path = g_file_get_path (dir);
-		g_object_unref (dir);
-	}
-
-	subtitle = totem_add_subtitle (totem_playlist_get_toplevel (playlist), path);
-	g_free (path);
-
-	if (subtitle == NULL)
-		return;
-
-	gtk_tree_model_get (playlist->priv->model, &iter,
-			    PLAYING_COL, &playing,
-			    -1);
-
-	gtk_list_store_set (GTK_LIST_STORE(playlist->priv->model), &iter, 
-			    SUBTITLE_URI_COL, subtitle,
-			    -1);
-
-	if (playing != TOTEM_PLAYLIST_STATUS_NONE) {
-		g_signal_emit (G_OBJECT (playlist),
-			       totem_playlist_table_signals[SUBTITLE_CHANGED], 0,
-			       NULL);
-	}
-
-	g_free(subtitle);
+	totem_playlist_select_subtitle_dialog(playlist, TOTEM_PLAYLIST_DIALOG_SELECTED);
 }
 
 void
--- totem.orig/data/totem.ui	2008-12-10 13:22:43.000000000 +0100
+++ totem/data/totem.ui	2008-12-10 14:54:49.000000000 +0100
@@ -352,7 +352,13 @@
                <property name="value">4</property>
             </object>
          </child>
-
+         <child>
+            <object class="GtkAction" id="select-subtitle">
+               <property name="label" translatable="yes">Select text subtitle</property>
+               <property name="tooltip" translatable="yes">Select a file to use for text subtitles</property>
+               <signal name="activate" handler="select_subtitle_action_callback"/>
+            </object>
+         </child>
          <child>
             <object class="GtkAction" id="subtitles-menu">
                <property name="label" translatable="yes">S_ubtitles</property>
@@ -470,6 +476,7 @@
             <menuitem name="deinterlace" action="deinterlace"/>
             <menuitem name="next-angle" action="next-angle"/>
             <menuitem name="show-controls" action="show-controls"/>
+            <menuitem name="select-subtitle" action="select-subtitle"/>
             <menu name="subtitles" action="subtitles-menu">
                <placeholder name="placeholder"/>
             </menu>
@@ -509,6 +516,7 @@
          <menuitem name="skip-backwards" action="skip-backwards"/>
          <menuitem name="show-controls" action="show-controls"/>
          <menuitem name="fullscreen" action="fullscreen"/>
+         <menuitem name="select-subtitle" action="select-subtitle"/>
          <separator/>
          <menu name="popup-languages" action="languages-menu">
             <placeholder name="placeholder"/>
--- totem.orig/src/totem.c	2008-12-10 13:22:46.000000000 +0100
+++ totem/src/totem.c	2008-12-10 16:29:29.000000000 +0100
@@ -1092,6 +1092,9 @@
 		/* Clear the playlist */
 		totem_action_set_sensitivity ("clear-playlist", FALSE);
 
+		/* Subtitle selection */
+		totem_action_set_sensitivity ("select-subtitle", FALSE);
+
 		/* Set the logo */
 		bacon_video_widget_set_logo_mode (totem->bvw, TRUE);
 		update_mrl_label (totem, NULL);
@@ -1131,6 +1134,13 @@
 		/* Clear the playlist */
 		totem_action_set_sensitivity ("clear-playlist", retval);
 
+		/* Subtitle selection */
+		if (!g_ascii_strncasecmp(mrl, "file:", 5)) {
+                        totem_action_set_sensitivity ("select-subtitle", retval);
+		} else {
+			totem_action_set_sensitivity ("select-subtitle", FALSE);
+		}
+	
 		/* Set the playlist */
 		play_pause_set_label (totem, retval ? STATE_PAUSED : STATE_STOPPED);
 
