1
## Description: Switch from a GtkButton to a GtkFileChooserButton, instead of fidling around with the dialog.
2
## Origin: upstream, no
3
## Author: Pojar George
5
Index: gnomeradio-1.8/src/prefs.c
6
===================================================================
7
--- gnomeradio-1.8.orig/src/prefs.c 2013-05-29 16:41:32.179964469 +0000
8
+++ gnomeradio-1.8/src/prefs.c 2013-05-29 16:42:36.471962557 +0000
11
static void destination_button_clicked_cb(GtkWidget *button, gpointer data)
15
- dialog = gtk_file_chooser_dialog_new(_("Choose a destination folder"), NULL,
16
- GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
17
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
18
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
20
- gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), rec_settings.destination);
21
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
22
- if (rec_settings.destination) g_free(rec_settings.destination);
23
- rec_settings.destination = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
24
- gtk_button_set_label(GTK_BUTTON(button), rec_settings.destination);
25
+ if (rec_settings.destination)
27
+ g_free(rec_settings.destination);
30
- gtk_widget_destroy (dialog);
31
+ rec_settings.destination = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(button));
34
static gboolean list_view_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
36
destination_label = gtk_label_new(_("Destination directory:"));
37
gtk_misc_set_alignment(GTK_MISC(destination_label), 0.0f, 0.5f);
39
- destination_button = gtk_button_new();
40
- gtk_button_set_label(GTK_BUTTON(destination_button), rec_settings.destination);
41
+ destination_button = gtk_file_chooser_button_new(
42
+ _("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
43
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(destination_button), rec_settings.destination);
45
profile_eb = gtk_event_box_new();
46
profile_combo = gm_audio_profile_choose_new();
48
gtk_table_attach_defaults(GTK_TABLE(record_table), destination_button, 1, 2, 0, 1);
49
gtk_table_attach_defaults(GTK_TABLE(record_table), profile_eb, 0, 2, 1, 2);
51
- g_signal_connect(G_OBJECT(destination_button), "clicked", G_CALLBACK(destination_button_clicked_cb), NULL);
52
+ g_signal_connect(GTK_FILE_CHOOSER(destination_button), "selection-changed", G_CALLBACK(destination_button_clicked_cb), NULL);
53
g_signal_connect(G_OBJECT(profile_combo), "changed", G_CALLBACK(profile_combo_change_cb), NULL);
55
gtk_widget_set_tooltip_text(profile_eb, _("Choose the Media Profile that should be used to record."));