OSDN Git Service

LinGui: fix a couple subtitle UI issues
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 3 Oct 2009 16:47:09 +0000 (16:47 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 3 Oct 2009 16:47:09 +0000 (16:47 +0000)
- SRT filename was getting lost when moving the subtitle highlight around
- SRT subtitles didn't get reloaded properly when editing a queue item

git-svn-id: svn://localhost/HandBrake/trunk@2862 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/settings.c
gtk/src/subtitlehandler.c

index f95b6a6..20cdb38 100644 (file)
@@ -630,7 +630,16 @@ update_widget(GtkWidget *widget, const GValue *value)
                }
                else
                {
-                       if (!g_file_test(str, G_FILE_TEST_IS_DIR))
+                       if (g_file_test(str, G_FILE_TEST_IS_DIR))
+                       {
+                               gtk_file_chooser_set_current_folder(
+                                       GTK_FILE_CHOOSER(widget), str);
+                       }
+                       else if (g_file_test(str, G_FILE_TEST_EXISTS))
+                       {
+                               gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(widget), str);
+                       }
+                       else
                        {
                                gchar *dirname;
 
@@ -639,11 +648,6 @@ update_widget(GtkWidget *widget, const GValue *value)
                                        GTK_FILE_CHOOSER(widget), dirname);
                                g_free(dirname);
                        }
-                       else
-                       {
-                               gtk_file_chooser_set_current_folder(
-                                       GTK_FILE_CHOOSER(widget), str);
-                       }
                }
        }
        else
index c5fc0b8..b1b6148 100644 (file)
@@ -822,7 +822,7 @@ srt_file_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
 {
        GValue *settings;
 
-       g_debug("srt_changed_cb ()");
+       g_debug("srt_file_changed_cb ()");
        ghb_check_dependency(ud, widget, NULL);
        ghb_widget_to_setting(ud->settings, widget);
        settings = ghb_selected_subtitle_settings(ud);
@@ -1312,8 +1312,14 @@ ghb_reset_subtitles(signal_user_data_t *ud, GValue *settings)
        count = ghb_array_len(slist);
        for (ii = 0; ii < count; ii++)
        {
+               int source;
+
                subtitle = ghb_value_dup(ghb_array_get_nth(slist, ii));
-               ghb_add_subtitle(ud, subtitle);
+               source = ghb_settings_get_int(subtitle, "SubtitleSource");
+               if (source == SRTSUB)
+                       ghb_add_srt(ud, subtitle);
+               else
+                       ghb_add_subtitle(ud, subtitle);
        }
 }