#include "defs.h"
#include <glib.h>
+#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkcontainer.h>
#include <ctype.h>
#include <string.h>
-#include "intl.h"
#include "main.h"
#include "messageview.h"
#include "message_search.h"
{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_CP1251)},
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
unlink(tmp);
return -1;
}
-
+
+ if (prefs_common.work_offline)
+ if (alertpanel(_("Offline warning"),
+ _("You're working offline. Override?"),
+ _("Yes"), _("No"), NULL) != G_ALERTDEFAULT)
+ return 0;
+
/* send it */
path = folder_item_fetch_msg(queue, num);
ok = procmsg_send_message_queue(path);
if (messageview->msginfo != msginfo) {
procmsg_msginfo_free(messageview->msginfo);
messageview->msginfo = procmsg_msginfo_get_full_info(msginfo);
+ if (!messageview->msginfo)
+ messageview->msginfo = procmsg_msginfo_copy(msginfo);
}
headerview_show(messageview->headerview, messageview->msginfo);
else
noticeview_hide(messageview->noticeview);
+ mimeinfo = procmime_mimeinfo_next(mimeinfo);
+ if (mimeinfo && (mimeinfo->type != MIMETYPE_TEXT ||
+ (strcmp(mimeinfo->subtype, "plain") &&
+ strcmp(mimeinfo->subtype, "html")))) {
+ mimeview_show_part(messageview->mimeview,mimeinfo);
+ }
+
g_free(file);
return 0;
void messageview_select_all(MessageView *messageview)
{
TextView *text;
+ GtkTextView *edit = NULL;
+ GtkTextBuffer *textbuf;
+ gint body_pos = 0;
+ GtkTextIter start, end;
+
+ g_return_if_fail(messageview != NULL);
text = messageview_get_current_textview(messageview);
- if (text)
- gtk_editable_select_region(GTK_EDITABLE(text->text), 0, -1);
+ g_return_if_fail(text != NULL);
+
+ edit = GTK_TEXT_VIEW(text->text);
+ g_return_if_fail(edit != NULL);
+
+ textbuf = gtk_text_view_get_buffer(edit);
+ g_return_if_fail(textbuf != NULL);
+
+ gtk_text_buffer_get_bounds(textbuf, &start, &end);
+
+ gtk_text_buffer_move_mark_by_name(textbuf,
+ "selection_bound", &start);
+ gtk_text_buffer_move_mark_by_name(textbuf,
+ "insert", &end);
}
void messageview_set_position(MessageView *messageview, gint pos)
aval = alertpanel(_("Overwrite"),
_("Overwrite existing file?"),
- _("OK"), _("Cancel"), NULL);
+ GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL);
if (G_ALERTDEFAULT != aval) return;
}
static void reply_cb(gpointer data, guint action, GtkWidget *widget)
{
MessageView *messageview = (MessageView *)data;
- GSList *mlist = NULL;
+ GSList *msginfo_list = NULL;
MsgInfo *msginfo;
- gchar *text = NULL;
- ComposeMode mode = (ComposeMode)action;
- TextView *textview;
-
- msginfo = messageview->msginfo;
- mlist = g_slist_append(NULL, msginfo);
-
- textview = messageview_get_current_textview(messageview);
- text = gtkut_editable_get_selection
- (GTK_EDITABLE(textview->text));
- if (text && *text == '\0') {
- g_free(text);
- text = NULL;
- }
- switch (mode) {
- case COMPOSE_REPLY:
- compose_reply(msginfo, prefs_common.reply_with_quote,
- FALSE, prefs_common.default_reply_list, FALSE, text);
- break;
- case COMPOSE_REPLY_WITH_QUOTE:
- compose_reply(msginfo, TRUE, FALSE, prefs_common.default_reply_list, FALSE, text);
- break;
- case COMPOSE_REPLY_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, FALSE, prefs_common.default_reply_list, FALSE, NULL);
- break;
- case COMPOSE_REPLY_TO_SENDER:
- compose_reply(msginfo, prefs_common.reply_with_quote,
- FALSE, FALSE, TRUE, text);
- break;
- case COMPOSE_FOLLOWUP_AND_REPLY_TO:
- compose_followup_and_reply_to(msginfo,
- prefs_common.reply_with_quote,
- FALSE, FALSE, text);
- break;
- case COMPOSE_REPLY_TO_SENDER_WITH_QUOTE:
- compose_reply(msginfo, TRUE, FALSE, FALSE, TRUE, text);
- break;
- case COMPOSE_REPLY_TO_SENDER_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, FALSE, FALSE, TRUE, NULL);
- break;
- case COMPOSE_REPLY_TO_ALL:
- compose_reply(msginfo, prefs_common.reply_with_quote,
- TRUE, FALSE, FALSE, text);
- break;
- case COMPOSE_REPLY_TO_ALL_WITH_QUOTE:
- compose_reply(msginfo, TRUE, TRUE, FALSE, FALSE, text);
- break;
- case COMPOSE_REPLY_TO_ALL_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, TRUE, FALSE, FALSE, NULL);
- break;
- case COMPOSE_REPLY_TO_LIST:
- compose_reply(msginfo, prefs_common.reply_with_quote,
- FALSE, TRUE, FALSE, text);
- break;
- case COMPOSE_REPLY_TO_LIST_WITH_QUOTE:
- compose_reply(msginfo, TRUE, FALSE, TRUE, FALSE, text);
- break;
- case COMPOSE_REPLY_TO_LIST_WITHOUT_QUOTE:
- compose_reply(msginfo, FALSE, FALSE, TRUE, FALSE, NULL);
- break;
- case COMPOSE_FORWARD:
- if (prefs_common.forward_as_attachment) {
- compose_reply_mode(COMPOSE_FORWARD_AS_ATTACH, mlist, text);
- return;
- } else {
- compose_reply_mode(COMPOSE_FORWARD_INLINE, mlist, text);
- return;
- }
- break;
- case COMPOSE_FORWARD_INLINE:
- compose_forward(NULL, msginfo, FALSE, text, FALSE);
- break;
- case COMPOSE_FORWARD_AS_ATTACH:
- compose_forward_multiple(NULL, mlist);
- break;
- case COMPOSE_REDIRECT:
- compose_redirect(NULL, msginfo);
- break;
- default:
- g_warning("compose_reply(): invalid Compose Mode: %d\n", mode);
- }
+ g_return_if_fail(messageview->msginfo);
- /* summary_set_marks_selected(summaryview); */
- g_free(text);
- g_slist_free(mlist);
+ msginfo_list = g_slist_append(msginfo_list, messageview->msginfo);
+ compose_reply_from_messageview(messageview, msginfo_list, action);
+ g_slist_free(msginfo_list);
}
static void reedit_cb(gpointer data, guint action, GtkWidget *widget)
GtkItemFactory *ifactory;
GtkWidget *menuitem;
- if (!messageview && !messageview->new_window)
+ if (!messageview || !messageview->new_window)
return;
/* do some smart things */
if (!messageview->menubar) return;