Fix Reply from mainwindow menu and toolbar when mainwindow's
[claws.git] / src / mainwindow.c
index 8e87c709c6b5500885d5149d6ebb99307bb0d1e0..30376f0b6c17d2819f0b153bfd230fe9878c1671 100644 (file)
@@ -1,6 +1,6 @@
 /*
    Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-   Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
+   Copyright (C) 1999-2018 the Claws Mail team and 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
@@ -1369,9 +1369,11 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
        {
                GtkWidget *entry =
                        quicksearch_get_entry(mainwin->summaryview->quicksearch);
-               gboolean dummy;
-               g_signal_emit_by_name(entry, "key-press-event", event, &dummy);
-               return TRUE;
+               gboolean handled;
+               g_signal_emit_by_name(entry, "key-press-event", event, &handled);
+               if (handled) {
+                       return TRUE;
+               }
        }
 
        switch (event->keyval) {
@@ -1445,7 +1447,7 @@ MainWindow *main_window_create()
 
        /* main window */
        window = GTK_WIDGET(gtkut_window_new(GTK_WINDOW_TOPLEVEL, "mainwindow"));
-       gtk_window_set_title(GTK_WINDOW(window), PROG_VERSION_FRIENDLY);
+       gtk_window_set_title(GTK_WINDOW(window), PROG_VERSION);
        gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
 #ifdef GENERIC_UMPC
        prefs_common.layout_mode = SMALL_LAYOUT;
@@ -2624,9 +2626,9 @@ static void main_window_show_cur_account(MainWindow *mainwin)
                           : _("none"));
 
        if (cur_account)
-               buf = g_strdup_printf("%s - %s", ac_name, PROG_VERSION_FRIENDLY);
+               buf = g_strdup_printf("%s - %s", ac_name, PROG_VERSION);
        else
-               buf = g_strdup(PROG_VERSION_FRIENDLY);
+               buf = g_strdup(PROG_VERSION);
        gtk_window_set_title(GTK_WINDOW(mainwin->window), buf);
        g_free(buf);
 
@@ -4118,7 +4120,15 @@ static void main_window_reply_cb(GtkAction *gaction, gpointer data)
 
        msginfo_list = summary_get_selection(mainwin->summaryview);
        cm_return_if_fail(msginfo_list != NULL);
-       compose_reply_from_messageview(msgview, msginfo_list, action);
+
+       if (!summary_has_opened_message(mainwin->summaryview)) {
+               compose_reply_from_messageview(NULL, msginfo_list, action);
+       } else if (summary_is_opened_message_selected(mainwin->summaryview)) {
+               compose_reply_from_messageview(msgview, msginfo_list, action);
+       } else {
+               compose_reply_from_messageview(msgview, NULL, action);
+       }
+
        g_slist_free(msginfo_list);
 }