aboutsummaryrefslogtreecommitdiff
path: root/src/filesel.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-22 11:18:22 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-09-22 11:18:22 +0000
commite804cac393c2dd84a8c570541fec5d6f7245d945 (patch)
treea0480475e799431680bfac040b30d30a0b41aeac /src/filesel.c
parent39a1d4cf0bd2ae39c2300b12f9c826514acd560e (diff)
implemented 'Save all'.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@601 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/filesel.c')
-rw-r--r--src/filesel.c27
1 files changed, 23 insertions, 4 deletions
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);