diff options
Diffstat (limited to 'src/main_window_open_directory.c')
-rw-r--r-- | src/main_window_open_directory.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/main_window_open_directory.c b/src/main_window_open_directory.c index 6f1c2df3..cd67adba 100644 --- a/src/main_window_open_directory.c +++ b/src/main_window_open_directory.c | |||
@@ -25,14 +25,37 @@ | |||
25 | #include "common.h" | 25 | #include "common.h" |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * Thumbnail view is toggled. | 28 | * User selected "Open directory" in menu. Display dialog, open |
29 | * file and then display a new tab with its contents. | ||
29 | */ | 30 | */ |
30 | void | 31 | void |
31 | GNUNET_GTK_main_menu_file_open_gnunet_directory_activate_cb (GtkWidget * dummy, | 32 | GNUNET_GTK_main_menu_file_open_gnunet_directory_activate_cb (GtkWidget * dummy, |
32 | gpointer data) | 33 | gpointer data) |
33 | { | 34 | { |
34 | /* not implemented */ | 35 | GtkWidget *ad; |
36 | GtkBuilder *builder; | ||
37 | char *filename; | ||
38 | |||
39 | builder = GNUNET_GTK_get_new_builder ("open_directory_dialog.glade"); | ||
40 | if (builder == NULL) | ||
41 | { | ||
42 | GNUNET_break (0); | ||
43 | return; | ||
44 | } | ||
45 | ad = GTK_WIDGET (gtk_builder_get_object (builder, | ||
46 | "GNUNET_GTK_open_directory_dialog")); | ||
47 | if (GTK_RESPONSE_OK != gtk_dialog_run (GTK_DIALOG (ad))) | ||
48 | { | ||
49 | gtk_widget_destroy (ad); | ||
50 | g_object_unref (G_OBJECT (builder)); | ||
51 | return; | ||
52 | } | ||
53 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad)); | ||
54 | gtk_widget_destroy (ad); | ||
55 | g_object_unref (G_OBJECT (builder)); | ||
56 | |||
35 | GNUNET_break (0); | 57 | GNUNET_break (0); |
58 | g_free (filename); | ||
36 | } | 59 | } |
37 | 60 | ||
38 | /* end of main_window_open_directory.c */ | 61 | /* end of main_window_open_directory.c */ |