summaryrefslogtreecommitdiffstats
path: root/gtk/src/callbacks.c
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-02-02 15:12:19 +0000
committersr55 <[email protected]>2013-02-02 15:12:19 +0000
commita7dfaa518ce3aaf73a64ecc3c61a88c9427aef81 (patch)
tree8efccea1be99fb4aca2fe1ad028c395095500675 /gtk/src/callbacks.c
parentbc3b56381c6ac214b7736a00972c9d0902902453 (diff)
Merging trunk to cl branch.
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5234 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/callbacks.c')
-rw-r--r--gtk/src/callbacks.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 42fd3fa03..eb98553e3 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -833,12 +833,16 @@ dvd_device_changed_cb(GtkComboBoxText *combo, signal_user_data_t *ud)
gchar *name;
dialog = GHB_WIDGET(ud->builder, "source_dialog");
- device = gtk_combo_box_text_get_active_text (combo);
- name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(dialog));
- if (name == NULL || strcmp(name, device) != 0)
- gtk_file_chooser_select_filename (GTK_FILE_CHOOSER(dialog), device);
- if (name != NULL)
- g_free(name);
+ device = gtk_combo_box_text_get_active_text(combo);
+ // Protext against unexpected NULL return value
+ if (device != NULL)
+ {
+ name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(dialog));
+ if (name == NULL || strcmp(name, device) != 0)
+ gtk_file_chooser_select_filename (GTK_FILE_CHOOSER(dialog), device);
+ if (name != NULL)
+ g_free(name);
+ }
}
}
@@ -992,7 +996,21 @@ do_source_dialog(GtkButton *button, gboolean single, signal_user_data_t *ud)
dialog = GHB_WIDGET(ud->builder, "source_dialog");
source_dialog_extra_widgets(ud, dialog);
+#if GTK_CHECK_VERSION(3, 0, 0)
+ // gtk3 has a STUPID BUG! If you select the "same_path" it ends
+ // up selecting the "Recent Files" shortcut instead of taking you
+ // to the directory and file THAT YOU ASKED FOR!!! FUUUUK!!!
+ //
+ // So instead, I am just setting the current folder. It's not
+ // optimal because if you are processing several files in the same
+ // folder, you want the selection to return to where you were last
+ // in the list, but there's not much else I can do at this point.
+ gchar *dirname = g_path_get_dirname(sourcename);
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), dirname);
+ g_free(dirname);
+#else
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), sourcename);
+#endif
response = gtk_dialog_run(GTK_DIALOG (dialog));
gtk_widget_hide(dialog);
if (response == GTK_RESPONSE_NO)