[Xfce4-commits] <xfburn:master> Use file dialog for adding files when browser is invisible.

David Mohr noreply at xfce.org
Sat Jul 7 07:24:02 CEST 2012


Updating branch refs/heads/master
         to ed4db8ccbef01a86bde9c39649093c164ea0b106 (commit)
       from 26509e65ad1dffc3b085594fa205022862a9240b (commit)

commit ed4db8ccbef01a86bde9c39649093c164ea0b106
Author: David Mohr <david at mcbf.net>
Date:   Sat Jun 16 15:51:31 2012 +0200

    Use file dialog for adding files when browser is invisible.

 xfburn/xfburn-data-composition.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/xfburn/xfburn-data-composition.c b/xfburn/xfburn-data-composition.c
index 4ee22d1..052788e 100644
--- a/xfburn/xfburn-data-composition.c
+++ b/xfburn/xfburn-data-composition.c
@@ -905,7 +905,22 @@ action_add_selected_files (GtkAction *action, XfburnDataComposition *dc)
   gchar *selected_files = NULL;
   
   xfburn_busy_cursor (priv->content);
-  selected_files = xfburn_file_browser_get_selection (browser);
+  if (xfburn_settings_get_boolean("show-filebrowser", FALSE)) {
+    selected_files = xfburn_file_browser_get_selection (browser);
+  } else {
+    GtkWidget * dialog;
+
+    dialog = gtk_file_chooser_dialog_new (_("Files to add to composition"),
+                                          GTK_WINDOW(xfburn_main_window_get_instance()),
+                                          GTK_FILE_CHOOSER_ACTION_OPEN,
+                                          _("Add"),
+                                          GTK_RESPONSE_ACCEPT,
+                                          NULL);
+    if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
+      selected_files = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+    }
+    gtk_widget_destroy (dialog);
+  }
   
   if (selected_files) {
     GtkTreeSelection *selection;


More information about the Xfce4-commits mailing list