From e804cac393c2dd84a8c570541fec5d6f7245d945 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 22 Sep 2005 11:18:22 +0000 Subject: implemented 'Save all'. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@601 ee746299-78ed-0310-b773-934348b2243d --- src/filesel.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/filesel.c') diff --git a/src/filesel.c b/src/filesel.c index 1921901f..7d87a928 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -151,6 +151,23 @@ gchar *filesel_save_as(const gchar *file) return filename; } +gchar *filesel_select_dir(const gchar *dir) +{ + GSList *list; + gchar *selected = NULL; + + list = filesel_select_file_full(_("Select directory"), dir, + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + FALSE); + if (list) { + selected = (gchar *)list->data; + slist_free_strings(list->next); + } + g_slist_free(list); + + return selected; +} + static GtkWidget *filesel_create(const gchar *title, GtkFileChooserAction action) { @@ -160,14 +177,16 @@ static GtkWidget *filesel_create(const gchar *title, dialog = gtk_file_chooser_dialog_new (title, NULL, action, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - action == GTK_FILE_CHOOSER_ACTION_SAVE ? GTK_STOCK_SAVE - : GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + (action == GTK_FILE_CHOOSER_ACTION_SAVE || + action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) + ? GTK_STOCK_SAVE : GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); else dialog = gtk_file_chooser_dialog_new (title, NULL, action, - action == GTK_FILE_CHOOSER_ACTION_SAVE ? GTK_STOCK_SAVE - : GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + (action == GTK_FILE_CHOOSER_ACTION_SAVE || + action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) + ? GTK_STOCK_SAVE : GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); -- cgit v1.2.3