static GtkTargetEntry compose_mime_types[] =
{
{"text/uri-list", 0, 0},
- {"text/plain", 0, 0},
- {"STRING", 0, 0}
+ {"UTF8_STRING", 0, 0},
+ {"text/plain", 0, 0}
};
static gboolean compose_put_existing_to_front(MsgInfo *info)
gboolean use_signing = FALSE;
gboolean use_encryption = FALSE;
gchar *privacy_system = NULL;
+ int priority = PRIORITY_NORMAL;
g_return_val_if_fail(msginfo != NULL, NULL);
g_return_val_if_fail(msginfo->folder != NULL, NULL);
if (!procheader_get_header_from_msginfo(msginfo, queueheader_buf,
sizeof(queueheader_buf), "X-Priority: ")) {
param = atoi(&queueheader_buf[strlen("X-Priority: ")]); /* mind the space */
- compose->priority = param;
+ priority = param;
}
} else {
account = msginfo->folder->folder->account;
compose = compose_create(account, COMPOSE_REEDIT, batch);
compose->updating = TRUE;
-
+ compose->priority = priority;
+
if (privacy_system != NULL) {
compose->privacy_system = privacy_system;
compose_use_signing(compose, use_signing);
gchar *subject = NULL;
gchar *body = NULL;
gchar *temp = NULL;
- gint len = 0;
+ guint len = 0;
scan_mailto_url(mailto, &to, &cc, NULL, &subject, &body);
if (msginfo->subject && *msginfo->subject) {
gchar *buf, *buf2;
- guchar *p;
+ gchar *p;
buf = p = g_strdup(msginfo->subject);
p += subject_get_prefix_length(p);
gchar *msgpath = NULL;
gboolean discard_window = FALSE;
gchar *errstr = NULL;
+ MainWindow *mainwin = mainwindow_get_mainwindow();
+
if (prefs_common.send_dialog_mode != SEND_DIALOG_ALWAYS
|| compose->batch == TRUE)
discard_window = TRUE;
return -1;
}
+ toolbar_main_set_sensitive(mainwin);
+ main_window_set_menu_sensitive(mainwin);
return 0;
bail:
compose_allow_user_actions (compose, TRUE);
compose->sending = FALSE;
compose->modified = TRUE;
+ toolbar_main_set_sensitive(mainwin);
+ main_window_set_menu_sensitive(mainwin);
return -1;
}
mimetext->subtype = g_strdup("plain");
g_hash_table_insert(mimetext->typeparameters, g_strdup("charset"),
g_strdup(out_codeset));
+
/* protect trailing spaces when signing message */
if (action == COMPOSE_WRITE_FOR_SEND && compose->use_signing &&
privacy_system_can_sign(compose->privacy_system)) {
encoding = ENC_QUOTED_PRINTABLE;
}
+ debug_print("main text: %d bytes encoded as %s in %d\n",
+ strlen(buf), out_codeset, encoding);
+
/* check for line length limit */
if (action == COMPOSE_WRITE_FOR_SEND &&
encoding != ENC_QUOTED_PRINTABLE && encoding != ENC_BASE64 &&
gint val;
val = compose_queue_sub(compose, NULL, NULL, NULL, TRUE, TRUE);
- if (!val)
+ if (!val) {
compose_close(compose);
- else if (val == -1) {
+ } else if (val == -1) {
alertpanel_error(_("Could not queue message."));
} else if (val == -2) {
alertpanel_error(_("Could not queue message:\n\n%s."), strerror(errno));
alertpanel_error(_("Could not queue message for sending:\n\n"
"Charset conversion failed."));
}
+ toolbar_main_set_sensitive(mainwindow_get_mainwindow());
}
void compose_draft (gpointer data)
GtkTextMark *mark_start = gtk_text_buffer_get_insert(buffer);
GtkTextIter start_iter, end_iter;
gint start, end;
-
gchar *contents = gtk_clipboard_wait_for_text(gtk_clipboard_get(clip));
if (contents == NULL)
return;
+ undo_paste_clipboard(GTK_TEXT_VIEW(compose->text), compose->undostruct);
+
/* we shouldn't delete the selection when middle-click-pasting, or we
* can't mid-click-paste our own selection */
- if (clip != GDK_SELECTION_PRIMARY)
+ if (clip != GDK_SELECTION_PRIMARY) {
gtk_text_buffer_delete_selection(buffer, FALSE, TRUE);
+ }
if (insert_place == NULL) {
/* if insert_place isn't specified, insert at the cursor.
gtk_text_iter_backward_char(&start_iter);
compose_beautify_paragraph(compose, &start_iter, TRUE);
}
-
} else if (GTK_IS_EDITABLE(entry))
gtk_editable_paste_clipboard (GTK_EDITABLE(entry));