diff options
author | jstebbins <[email protected]> | 2009-06-30 17:22:43 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-30 17:22:43 +0000 |
commit | b5526f35fe83ede6affbdeb9eed3e4e6d9c8f6b1 (patch) | |
tree | 8be97016c13fbe13023381a5bf979ad5625835c8 /gtk/src/settings.c | |
parent | e7a1a9f47c475028b6e73f36ed704bc65ca6c77d (diff) |
LinGui: SRT support
- there are now two buttons to add subtitles
one button adds normal subtitles from the source.
the second adds SRT subtitles.
- when an SRT subtitle is selected in the list, the available controls change
SRT controls are: Language, Character Codeset, File, and Time Offset (ms)
- A combo entry box is used for character code. A subset of the most common
character codes is available in the popup. Other codes can be manually
entered in the entry box.
- The last used SRT file directory is remembered.
- Remove the debug printf eddyg left in decsrtsub.c
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2648 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/settings.c')
-rw-r--r-- | gtk/src/settings.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gtk/src/settings.c b/gtk/src/settings.c index f392bc281..f95b6a627 100644 --- a/gtk/src/settings.c +++ b/gtk/src/settings.c @@ -349,9 +349,13 @@ ghb_widget_value(GtkWidget *widget) } else if (type == GTK_TYPE_FILE_CHOOSER_BUTTON) { - const gchar *str; + gchar *str; str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(widget)); + if (str == NULL) + str = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(widget)); value = ghb_string_value_new(str); + if (str != NULL) + g_free(str); } else { @@ -620,10 +624,27 @@ update_widget(GtkWidget *widget, const GValue *value) { gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(widget), str); } - else + else if (act == GTK_FILE_CHOOSER_ACTION_SAVE) { gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(widget), str); } + else + { + if (!g_file_test(str, G_FILE_TEST_IS_DIR)) + { + gchar *dirname; + + dirname = g_path_get_dirname(str); + gtk_file_chooser_set_current_folder( + GTK_FILE_CHOOSER(widget), dirname); + g_free(dirname); + } + else + { + gtk_file_chooser_set_current_folder( + GTK_FILE_CHOOSER(widget), str); + } + } } else { |