diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/filesel.c | 50 | ||||
-rw-r--r-- | src/foldersel.c | 2 |
4 files changed, 61 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2005-03-16 + * src/filesel.c: remember the state of the expander of file save + dialog. + +2005-03-16 + * src/compose.[ch]: added a menu to temporally change the outgoing encoding. Use UTF-8 also for headers if it is forced for body. * src/codeconv.[ch]: diff --git a/ChangeLog.ja b/ChangeLog.ja index a64051db..417a631c 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-03-16 + * src/filesel.c: ファイル保存ダイアログの expander の状態を記憶する + ようにした。 + +2005-03-16 + * src/compose.[ch]: 送信エンコーディングを一時的に変更するための メニューを追加。 UTF-8 を本文に強制的に使用する場合、ヘッダにも 使用するようにした。 diff --git a/src/filesel.c b/src/filesel.c index be1b1cb6..e031f177 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -21,6 +21,7 @@ #include <glib/gi18n.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtkfilechooserdialog.h> +#include <gtk/gtkexpander.h> #include <gtk/gtkstock.h> #include "main.h" @@ -37,6 +38,9 @@ static GSList *filesel_select_file_full (const gchar *title, static GtkWidget *filesel_create (const gchar *title, GtkFileChooserAction action); +static void filesel_save_expander_set_expanded (GtkWidget *dialog, + gboolean expanded); +static gboolean filesel_save_expander_get_expanded (GtkWidget *dialog); gchar *filesel_select_file(const gchar *title, const gchar *file, GtkFileChooserAction action) @@ -68,6 +72,7 @@ static GSList *filesel_select_file_full(const gchar *title, const gchar *file, gchar *cwd; GtkWidget *dialog; gchar *prev_dir; + static gboolean save_expander_expanded = FALSE; GSList *list = NULL; if (!path_table) @@ -95,6 +100,11 @@ static GSList *filesel_select_file_full(const gchar *title, const gchar *file, gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), multiple); + if (action == GTK_FILE_CHOOSER_ACTION_SAVE && save_expander_expanded) { + filesel_save_expander_set_expanded + (dialog, save_expander_expanded); + } + gtk_widget_show(dialog); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { @@ -108,6 +118,10 @@ static GSList *filesel_select_file_full(const gchar *title, const gchar *file, } } + if (action == GTK_FILE_CHOOSER_ACTION_SAVE) + save_expander_expanded = + filesel_save_expander_get_expanded(dialog); + manage_window_focus_out(dialog, NULL, NULL); gtk_widget_destroy(dialog); @@ -158,3 +172,39 @@ static GtkWidget *filesel_create(const gchar *title, return dialog; } + +static void container_foreach_cb(GtkWidget *widget, gpointer data) +{ + GtkWidget **expander = (GtkWidget **)data; + + if (*expander == NULL) { + if (GTK_IS_EXPANDER(widget)) + *expander = widget; + else if (GTK_IS_CONTAINER(widget)) + gtk_container_foreach(GTK_CONTAINER(widget), + container_foreach_cb, data); + } +} + +static void filesel_save_expander_set_expanded(GtkWidget *dialog, + gboolean expanded) +{ + GtkWidget *expander = NULL; + + gtk_container_foreach(GTK_CONTAINER(dialog), container_foreach_cb, + &expander); + if (expander) + gtk_expander_set_expanded(GTK_EXPANDER(expander), expanded); +} + +static gboolean filesel_save_expander_get_expanded(GtkWidget *dialog) +{ + GtkWidget *expander = NULL; + + gtk_container_foreach(GTK_CONTAINER(dialog), container_foreach_cb, + &expander); + if (expander) + return gtk_expander_get_expanded(GTK_EXPANDER(expander)); + else + return FALSE; +} diff --git a/src/foldersel.c b/src/foldersel.c index b6efebaf..c6f537e4 100644 --- a/src/foldersel.c +++ b/src/foldersel.c @@ -1,6 +1,6 @@ /* * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2004 Hiroyuki Yamamoto + * Copyright (C) 1999-2005 Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by |