}
#endif
+static gboolean compose_force_window_origin = TRUE;
static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
gboolean batch)
{
}
gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL,
&geometry, GDK_HINT_MIN_SIZE);
- gtk_widget_set_uposition(window, prefs_common.compose_x,
+
+ if (compose_force_window_origin)
+ gtk_widget_set_uposition(window, prefs_common.compose_x,
prefs_common.compose_y);
g_signal_connect(G_OBJECT(window), "delete_event",
hbox = gtk_hbox_new(FALSE, 6);
from_name = gtk_entry_new();
+
+ g_signal_connect_after(G_OBJECT(from_name), "grab_focus",
+ G_CALLBACK(compose_grab_focus_cb), compose);
for (; accounts != NULL; accounts = accounts->next, num++) {
PrefsAccount *ac = (PrefsAccount *)accounts->data;
}
}
-void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
- guint action)
+static void compose_reply_from_messageview_real(MessageView *msgview, GSList *msginfo_list,
+ guint action, gboolean opening_multiple)
{
- gchar *body;
+ gchar *body = NULL;
GSList *new_msglist = NULL;
MsgInfo *tmp_msginfo = NULL;
gboolean originally_enc = FALSE;
g_return_if_fail(msginfo_list != NULL);
- if (g_slist_length(msginfo_list) == 1) {
+ if (g_slist_length(msginfo_list) == 1 && !opening_multiple) {
MimeInfo *mimeinfo = messageview_get_selected_mime_part(msgview);
MsgInfo *orig_msginfo = (MsgInfo *)msginfo_list->data;
}
}
- body = messageview_get_selection(msgview);
+ if (!opening_multiple)
+ body = messageview_get_selection(msgview);
if (new_msglist) {
compose = compose_reply_mode((ComposeMode)action, new_msglist, body);
g_free(body);
}
+void compose_reply_from_messageview(MessageView *msgview, GSList *msginfo_list,
+ guint action)
+{
+ if ((!prefs_common.forward_as_attachment || action != COMPOSE_FORWARD)
+ && action != COMPOSE_FORWARD_AS_ATTACH && g_slist_length(msginfo_list) > 1) {
+ GSList *cur = msginfo_list;
+ gchar *msg = g_strdup_printf(_("You are about to reply to %d "
+ "messages. Opening the windows "
+ "could take some time. Do you "
+ "want to continue?"),
+ g_slist_length(msginfo_list));
+ if (g_slist_length(msginfo_list) > 9
+ && alertpanel(_("Warning"), msg, GTK_STOCK_CANCEL, "+" GTK_STOCK_YES, NULL)
+ != G_ALERTALTERNATE) {
+ g_free(msg);
+ return;
+ }
+ g_free(msg);
+ /* We'll open multiple compose windows */
+ /* let the WM place the next windows */
+ compose_force_window_origin = FALSE;
+ for (; cur; cur = cur->next) {
+ GSList tmplist;
+ tmplist.data = cur->data;
+ tmplist.next = NULL;
+ compose_reply_from_messageview_real(msgview, &tmplist, action, TRUE);
+ }
+ compose_force_window_origin = TRUE;
+ } else {
+ /* forwarding multiple mails as attachments is done via a
+ * single compose window */
+ compose_reply_from_messageview_real(msgview, msginfo_list, action, FALSE);
+ }
+}
+
void compose_set_position(Compose *compose, gint pos)
{
GtkTextView *text = GTK_TEXT_VIEW(compose->text);