/*
* 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
static void export_mbox_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void export_list_mbox_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void empty_trash_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
guint action,
GtkWidget *widget);
+static void set_decode_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+
static void hide_read_messages (MainWindow *mainwin,
guint action,
GtkWidget *widget);
{N_("/_File"), NULL, NULL, 0, "<Branch>"},
{N_("/_File/_Add mailbox"), NULL, NULL, 0, "<Branch>"},
{N_("/_File/_Add mailbox/MH..."), NULL, add_mailbox_cb, 0, NULL},
+ {N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_File/Change folder order"), NULL, foldersort_cb, 0, NULL},
+ {N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_File/_Import mbox file..."), NULL, import_mbox_cb, 0, NULL},
{N_("/_File/_Export to mbox file..."), NULL, export_mbox_cb, 0, NULL},
- {N_("/_File/Empty all _Trash folders"), "<shift>D", empty_trash_cb, 0, NULL},
+ {N_("/_File/_Export selected to mbox file..."),
+ NULL, export_list_mbox_cb, 0, NULL},
+ {N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_File/Empty all _Trash folders"), "<shift>D", empty_trash_cb, 0, NULL},
{N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_File/_Save as..."), "<control>S", save_as_cb, 0, NULL},
{N_("/_File/_Print..."), NULL, print_cb, 0, NULL},
{N_("/_View/_Code set/7bit ascii (US-ASC_II)"),
CODESET_ACTION(C_US_ASCII)},
-#if HAVE_ICONV
{N_("/_View/_Code set/Unicode (_UTF-8)"),
CODESET_ACTION(C_UTF_8)},
CODESET_SEPARATOR,
-#endif
{N_("/_View/_Code set/Western European (ISO-8859-_1)"),
CODESET_ACTION(C_ISO_8859_1)},
{N_("/_View/_Code set/Western European (ISO-8859-15)"),
CODESET_ACTION(C_ISO_8859_15)},
CODESET_SEPARATOR,
-#if HAVE_ICONV
{N_("/_View/_Code set/Central European (ISO-8859-_2)"),
CODESET_ACTION(C_ISO_8859_2)},
CODESET_SEPARATOR,
{N_("/_View/_Code set/Cyrillic (Windows-1251)"),
CODESET_ACTION(C_WINDOWS_1251)},
CODESET_SEPARATOR,
-#endif
{N_("/_View/_Code set/Japanese (ISO-2022-_JP)"),
CODESET_ACTION(C_ISO_2022_JP)},
-#if HAVE_ICONV
{N_("/_View/_Code set/Japanese (ISO-2022-JP-2)"),
CODESET_ACTION(C_ISO_2022_JP_2)},
-#endif
{N_("/_View/_Code set/Japanese (_EUC-JP)"),
CODESET_ACTION(C_EUC_JP)},
{N_("/_View/_Code set/Japanese (_Shift__JIS)"),
CODESET_ACTION(C_SHIFT_JIS)},
-#if HAVE_ICONV
CODESET_SEPARATOR,
{N_("/_View/_Code set/Simplified Chinese (_GB2312)"),
CODESET_ACTION(C_GB2312)},
CODESET_ACTION(C_TIS_620)},
{N_("/_View/_Code set/Thai (Windows-874)"),
CODESET_ACTION(C_WINDOWS_874)},
-#endif
#undef CODESET_SEPARATOR
#undef CODESET_ACTION
+#define DECODE_SEPARATOR \
+ {N_("/_View/Decode/---"), NULL, NULL, 0, "<Separator>"}
+#define DECODE_ACTION(action) \
+ NULL, set_decode_cb, action, "/View/Decode/Auto detect"
+ {N_("/_View/Decode"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/Decode/_Auto detect"),
+ NULL, set_decode_cb, 0, "<RadioItem>"},
+ {N_("/_View/Decode/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/Decode/_8bit"), DECODE_ACTION(ENC_8BIT)},
+ {N_("/_View/Decode/_Quoted printable"), DECODE_ACTION(ENC_QUOTED_PRINTABLE)},
+ {N_("/_View/Decode/_Base64"), DECODE_ACTION(ENC_BASE64)},
+ {N_("/_View/Decode/_Uuencode"), DECODE_ACTION(ENC_X_UUENCODE)},
+
+#undef DECODE_SEPARATOR
+#undef DECODE_ACTION
+
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/Open in new _window"), "<control><alt>N", open_msg_cb, 0, NULL},
{N_("/_View/Mess_age source"), "<control>U", view_source_cb, 0, NULL},
{N_("/_Configuration/_Edit accounts..."),
NULL, account_edit_open, 0, NULL},
{N_("/_Configuration/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Configuration/_Common preferences..."),
- NULL, prefs_common_open_cb, 0, NULL},
+ {N_("/_Configuration/_Preferences..."),
+ NULL, prefs_open_cb, 0, NULL},
{N_("/_Configuration/Pre-processing..."),
NULL, prefs_pre_processing_open_cb, 0, NULL},
{N_("/_Configuration/Post-processing..."),
NULL, prefs_filtering_open_cb, 0, NULL},
{N_("/_Configuration/_Templates..."), NULL, prefs_template_open_cb, 0, NULL},
{N_("/_Configuration/_Actions..."), NULL, prefs_actions_open_cb, 0, NULL},
- {N_("/_Configuration/_Other Preferences..."), NULL, prefs_open_cb, 0, NULL},
{N_("/_Configuration/Plugins..."), NULL, plugins_open_cb, 0, NULL},
{N_("/_Help"), NULL, NULL, 0, "<Branch>"},
{
/* TODO : destroy other component */
messageview_destroy(mainwin->messageview);
+ mainwin->messageview = NULL;
}
void main_window_update_actions_menu(MainWindow *mainwin)
{
GtkAllocation *allocation;
+ if (mainwin->messageview == NULL) {
+ debug_print("called after messageview "
+ "has been deallocated!\n");
+ return;
+ }
+
allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
if (allocation->width > 1 && allocation->height > 1) {
if (confirm) {
if (alertpanel(_("Empty trash"),
_("Empty all messages in trash?"),
- _("Yes"), _("No"), NULL) != G_ALERTDEFAULT)
+ GTK_STOCK_YES, GTK_STOCK_NO, NULL)
+ != G_ALERTDEFAULT)
return;
manage_window_focus_in(mainwin->window, NULL, NULL);
}
- procmsg_empty_trash();
+ procmsg_empty_all_trash();
if (mainwin->summaryview->folder_item &&
mainwin->summaryview->folder_item->stype == F_TRASH)
return;
}
folder = folder_new(folder_get_class_from_string("mh"),
- !strcmp(path, "Mail") ? _("Mailbox") : g_basename(path),
- path);
+ !strcmp(path, "Mail") ? _("Mailbox") :
+ g_path_get_basename(path), path);
g_free(path);
if (folder->klass->create_tree(folder) < 0) {
if (prefs_common.folderview_visible)
gtk_widget_show(folderwin);
}
+
if (type & SEPARATE_MESSAGE) {
messagewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(messagewin),
mainwin);
if (messageview_is_visible(mainwin->messageview))
gtk_widget_show(messagewin);
+ } else {
+ mainwin->messageview->statusbar = mainwin->statusbar;
+ mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
}
gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
(mainwin->menu_factory, "/View/Show or hide/Message view");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), FALSE);
+ mainwin->messageview->statusbar = mainwin->statusbar;
+ mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
+
return TRUE;
}
export_mbox(mainwin->summaryview->folder_item);
}
+static void export_list_mbox_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summaryview_export_mbox_list(mainwin->summaryview);
+}
+
static void empty_trash_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
{
if (prefs_common.confirm_on_exit) {
if (alertpanel(_("Exit"), _("Exit this program?"),
- _("OK"), _("Cancel"), NULL) != G_ALERTDEFAULT)
+ GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL)
+ != G_ALERTDEFAULT)
return;
manage_window_focus_in(mainwin->window, NULL, NULL);
}
{
MessageView *msgview = (MessageView*)mainwin->messageview;
GSList *msginfo_list = NULL;
- gchar *body;
g_return_if_fail(msgview != NULL);
msginfo_list = summary_get_selection(mainwin->summaryview);
g_return_if_fail(msginfo_list != NULL);
-
- body = messageview_get_selection(msgview);
- compose_reply_mode((ComposeMode)action, msginfo_list, body);
- g_free(body);
+ compose_reply_from_messageview(msgview, msginfo_list, action);
g_slist_free(msginfo_list);
}
if (GTK_CHECK_MENU_ITEM(widget)->active) {
str = conv_get_charset_str((CharSet)action);
- g_free(prefs_common.force_charset);
- prefs_common.force_charset = str ? g_strdup(str) : NULL;
-
+
+ g_free(mainwin->messageview->forced_charset);
+ mainwin->messageview->forced_charset = str ? g_strdup(str) : NULL;
+ procmime_force_charset(str);
+
summary_redisplay_msg(mainwin->summaryview);
debug_print("forced charset: %s\n", str ? str : "Auto-Detect");
}
}
+static void set_decode_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ if (GTK_CHECK_MENU_ITEM(widget)->active) {
+ mainwin->messageview->forced_encoding = (EncodingType)action;
+
+ summary_redisplay_msg(mainwin->summaryview);
+
+ debug_print("forced encoding: %d\n", action);
+ }
+}
+
static void hide_read_messages (MainWindow *mainwin, guint action,
GtkWidget *widget)
{
{
FolderItem *item;
- item = folderview_get_selected(mainwin->folderview);
+ item = folderview_get_selected_item(mainwin->folderview);
if (item) {
main_window_cursor_wait(mainwin);
STATUSBAR_PUSH(mainwin, _("Deleting duplicated messages..."));
static void prefs_common_open_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- prefs_common_open();
+ /* prefs_common_open(); */
}
static void prefs_pre_processing_open_cb(MainWindow *mainwin, guint action,