2007-11-20 [colin] 3.1.0cvs11
[claws.git] / src / mainwindow.c
index 34354a64e49699934384890ae8805781bf22018e..eb2338063914b525fefbad2a9b878f239077495a 100644 (file)
@@ -114,10 +114,10 @@ static void main_window_menu_callback_block       (MainWindow     *mainwin);
 static void main_window_menu_callback_unblock  (MainWindow     *mainwin);
 
 static void main_window_show_cur_account       (MainWindow     *mainwin);
-
+#ifndef MAEMO
 static void main_window_separation_change      (MainWindow     *mainwin,
                                                 LayoutType      layout_mode);
-
+#endif
 static void main_window_set_widgets            (MainWindow     *mainwin,
                                                 LayoutType      layout_mode);
 
@@ -127,11 +127,11 @@ static void toolbar_child_attached                (GtkWidget      *widget,
 static void toolbar_child_detached             (GtkWidget      *widget,
                                                 GtkWidget      *child,
                                                 gpointer        data);
-
+#ifndef MAEMO
 static gboolean ac_label_button_pressed                (GtkWidget      *widget,
                                                 GdkEventButton *event,
                                                 gpointer        data);
-
+#endif
 static gint main_window_close_cb               (GtkWidget      *widget,
                                                 GdkEventAny    *event,
                                                 gpointer        data);
@@ -448,7 +448,7 @@ static void prefs_post_processing_open_cb (MainWindow       *mainwin,
 static void prefs_filtering_open_cb    (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
-#ifdef USE_OPENSSL
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
 static void ssl_manager_open_cb        (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -461,9 +461,10 @@ static void account_selector_menu_cb        (GtkMenuItem   *menuitem,
                                          gpointer       data);
 static void account_receive_menu_cb     (GtkMenuItem   *menuitem,
                                          gpointer       data);
+#ifndef MAEMO
 static void account_compose_menu_cb     (GtkMenuItem   *menuitem,
                                          gpointer       data);
-
+#endif
 static void prefs_open_cb      (GtkMenuItem    *menuitem,
                                 gpointer        data);
 static void plugins_open_cb    (GtkMenuItem    *menuitem,
@@ -566,8 +567,6 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Edit/_Quick search"),            "slash", mainwindow_quicksearch, 0, NULL},
        {N_("/_View"),                          NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Show or hi_de"),            NULL, NULL, 0, "<Branch>"},
-       {N_("/_View/Show or hi_de/_Message view"),
-                                               "V", toggle_message_cb, 0, "<ToggleItem>"},
        {N_("/_View/Show or hi_de/_Toolbar"),
                                                NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Show or hi_de/_Toolbar/Text _below icons"),
@@ -578,8 +577,12 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, toggle_toolbar_cb, TOOLBAR_ICON, "/View/Show or hide/Toolbar/Text below icons"},
        {N_("/_View/Show or hi_de/_Toolbar/_Text only"),
                                                NULL, toggle_toolbar_cb, TOOLBAR_TEXT, "/View/Show or hide/Toolbar/Text below icons"},
+#ifndef MAEMO
        {N_("/_View/Show or hi_de/_Toolbar/_Hide"),
                                                NULL, toggle_toolbar_cb, TOOLBAR_NONE, "/View/Show or hide/Toolbar/Text below icons"},
+#endif
+       {N_("/_View/Show or hi_de/_Message view"),
+                                               "V", toggle_message_cb, 0, "<ToggleItem>"},
 #ifndef MAEMO
        {N_("/_View/Show or hi_de/Status _bar"),
                                                NULL, toggle_statusbar_cb, 0, "<ToggleItem>"},
@@ -668,92 +671,91 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_View/Character _encoding"),              NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Character _encoding/_Auto detect"),
         NULL, set_charset_cb, C_AUTO, "<RadioItem>"},
-       {N_("/_View/Character _encoding/---"),          NULL, NULL, 0, "<Separator>"},
-       {N_("/_View/Character _encoding/7bit ascii (US-ASC_II)"),
+       ENC_SEPARATOR,
+
+       {N_("/_View/Character _encoding/7bit ASCII (US-ASC_II)"),
         ENC_ACTION(C_US_ASCII)},
        {N_("/_View/Character _encoding/Unicode (_UTF-8)"),
         ENC_ACTION(C_UTF_8)},
        ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Western European (ISO-8859-_1)"),
+       {N_("/_View/Character _encoding/Western European"),NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Western European/ISO-8859-_1"),
         ENC_ACTION(C_ISO_8859_1)},
-       {N_("/_View/Character _encoding/Western European (ISO-8859-15)"),
+       {N_("/_View/Character _encoding/Western European/ISO-8859-15"),
         ENC_ACTION(C_ISO_8859_15)},
-       {N_("/_View/Character _encoding/Western European (Windows-1252)"),
+       {N_("/_View/Character _encoding/Western European/Windows-1252"),
         ENC_ACTION(C_WINDOWS_1252)},
-       ENC_SEPARATOR,
 
        {N_("/_View/Character _encoding/Central European (ISO-8859-_2)"),
         ENC_ACTION(C_ISO_8859_2)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/_Baltic (ISO-8859-13)"),
+       {N_("/_View/Character _encoding/Baltic"),       NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Baltic/ISO-8859-13"),
         ENC_ACTION(C_ISO_8859_13)},
-       {N_("/_View/Character _encoding/Baltic (ISO-8859-_4)"),
+       {N_("/_View/Character _encoding/Baltic/ISO-8859-_4"),
         ENC_ACTION(C_ISO_8859_4)},
-       ENC_SEPARATOR,
 
        {N_("/_View/Character _encoding/Greek (ISO-8859-_7)"),
         ENC_ACTION(C_ISO_8859_7)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Hebrew (ISO-8859-_8)"),
+       {N_("/_View/Character _encoding/Hebrew"),       NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Hebrew/ISO-8859-_8"),
         ENC_ACTION(C_ISO_8859_8)},
-       {N_("/_View/Character _encoding/Hebrew (Windows-1255)"),
+       {N_("/_View/Character _encoding/Hebrew/Windows-1255"),
         ENC_ACTION(C_CP1255)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Arabic (ISO-8859-_6)"),
+       {N_("/_View/Character _encoding/Arabic"),       NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Arabic/ISO-8859-_6"),
         ENC_ACTION(C_ISO_8859_6)},
-       {N_("/_View/Character _encoding/Arabic (Windows-1256)"),
+       {N_("/_View/Character _encoding/Arabic/Windows-1256"),
         ENC_ACTION(C_CP1256)},
-       ENC_SEPARATOR,
 
        {N_("/_View/Character _encoding/Turkish (ISO-8859-_9)"),
         ENC_ACTION(C_ISO_8859_9)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Cyrillic (ISO-8859-_5)"),
+       {N_("/_View/Character _encoding/Cyrillic"),     NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Cyrillic/ISO-8859-_5"),
         ENC_ACTION(C_ISO_8859_5)},
-       {N_("/_View/Character _encoding/Cyrillic (KOI8-_R)"),
+       {N_("/_View/Character _encoding/Cyrillic/KOI8-_R"),
         ENC_ACTION(C_KOI8_R)},
-       {N_("/_View/Character _encoding/Cyrillic (KOI8-U)"),
+       {N_("/_View/Character _encoding/Cyrillic/KOI8-U"),
         ENC_ACTION(C_KOI8_U)},
-       {N_("/_View/Character _encoding/Cyrillic (Windows-1251)"),
+       {N_("/_View/Character _encoding/Cyrillic/Windows-1251"),
         ENC_ACTION(C_CP1251)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Japanese (ISO-2022-_JP)"),
+       {N_("/_View/Character _encoding/Japanese"),     NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Japanese/ISO-2022-_JP"),
         ENC_ACTION(C_ISO_2022_JP)},
-       {N_("/_View/Character _encoding/Japanese (ISO-2022-JP-2)"),
+       {N_("/_View/Character _encoding/Japanese/ISO-2022-JP-2"),
         ENC_ACTION(C_ISO_2022_JP_2)},
-       {N_("/_View/Character _encoding/Japanese (_EUC-JP)"),
+       {N_("/_View/Character _encoding/Japanese/_EUC-JP"),
         ENC_ACTION(C_EUC_JP)},
-       {N_("/_View/Character _encoding/Japanese (_Shift__JIS)"),
+       {N_("/_View/Character _encoding/Japanese/_Shift__JIS"),
         ENC_ACTION(C_SHIFT_JIS)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Simplified Chinese (_GB2312)"),
+       {N_("/_View/Character _encoding/Chinese"),      NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Chinese/Simplified (_GB2312)"),
         ENC_ACTION(C_GB2312)},
-       {N_("/_View/Character _encoding/Simplified Chinese (GBK)"),
+       {N_("/_View/Character _encoding/Chinese/Simplified (GBK)"),
         ENC_ACTION(C_GBK)},
-       {N_("/_View/Character _encoding/Traditional Chinese (_Big5)"),
+       {N_("/_View/Character _encoding/Chinese/Traditional (_Big5)"),
         ENC_ACTION(C_BIG5)},
-       {N_("/_View/Character _encoding/Traditional Chinese (EUC-_TW)"),
+       {N_("/_View/Character _encoding/Chinese/Traditional (EUC-_TW)"),
         ENC_ACTION(C_EUC_TW)},
-       {N_("/_View/Character _encoding/Chinese (ISO-2022-_CN)"),
+       {N_("/_View/Character _encoding/Chinese/ISO-2022-_CN"),
         ENC_ACTION(C_ISO_2022_CN)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Korean (EUC-_KR)"),
+       {N_("/_View/Character _encoding/Korean"),       NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Korean/EUC-_KR"),
         ENC_ACTION(C_EUC_KR)},
-       {N_("/_View/Character _encoding/Korean (ISO-2022-KR)"),
+       {N_("/_View/Character _encoding/Korean/ISO-2022-KR"),
         ENC_ACTION(C_ISO_2022_KR)},
-       ENC_SEPARATOR,
 
-       {N_("/_View/Character _encoding/Thai (TIS-620)"),
+       {N_("/_View/Character _encoding/Thai"),         NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Character _encoding/Thai/TIS-620"),
         ENC_ACTION(C_TIS_620)},
-       {N_("/_View/Character _encoding/Thai (Windows-874)"),
+       {N_("/_View/Character _encoding/Thai/Windows-874"),
         ENC_ACTION(C_WINDOWS_874)},
 
 #undef ENC_SEPARATOR
@@ -897,7 +899,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, delete_duplicated_all_cb,   0, NULL},
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/E_xecute"),                "X", execute_summary_cb, 0, NULL},
-#ifdef USE_OPENSSL
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/SSL cer_tificates..."),    
                                                NULL, ssl_manager_open_cb, 0, NULL},
@@ -1227,15 +1229,34 @@ static void mainwindow_tags_menu_item_apply_tags_activate_cb(GtkWidget *widget,
        tag_apply_open(summary_get_selection(mainwin->summaryview));    
 }
 
+static gint mainwin_tag_cmp_list(gconstpointer a, gconstpointer b)
+{
+       gint id_a = GPOINTER_TO_INT(a);
+       gint id_b = GPOINTER_TO_INT(b);
+       const gchar *tag_a = tags_get_tag(id_a);
+       const gchar *tag_b = tags_get_tag(id_b);
+       
+               
+       if (tag_a == NULL)
+               return tag_b == NULL ? 0:1;
+       
+       if (tag_b == NULL)
+               return tag_a == NULL ? 0:1;
+       return g_utf8_collate(tag_a, tag_b);
+}
+
 static void mainwindow_tags_menu_create(MainWindow *mainwin, gboolean refresh)
 {
        GtkWidget *label_menuitem;
        GtkWidget *menu;
        GtkWidget *item;
        GSList *cur = tags_get_list();
-       GSList *orig = cur;
+       GSList *orig = NULL;
        gboolean existing_tags = FALSE;
 
+       cur = orig = g_slist_sort(cur, mainwin_tag_cmp_list);
+
        label_menuitem = gtk_item_factory_get_item(mainwin->menu_factory,
                                                   "/Message/Tags");
        g_signal_connect(G_OBJECT(label_menuitem), "activate",
@@ -1288,7 +1309,7 @@ static void mainwindow_tags_menu_create(MainWindow *mainwin, gboolean refresh)
        gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
        mainwin->tags_menu = menu;
 }
-
+#ifndef MAEMO
 static gboolean warning_icon_pressed(GtkWidget *widget, GdkEventButton *evt,
                                    MainWindow *mainwindow)
 {
@@ -1322,7 +1343,7 @@ static gboolean warning_enter_notify(GtkWidget *widget,
        gdk_window_set_cursor(mainwindow->warning_btn->window, hand_cursor);
        return FALSE;
 }
-
+#endif
 void mainwindow_show_error(void)
 {
        MainWindow *mainwin = mainwindow_get_mainwindow();
@@ -1334,6 +1355,65 @@ void mainwindow_clear_error(MainWindow *mainwin)
        gtk_widget_hide(mainwin->warning_btn);
 }
 
+#define BREAK_ON_MODIFIER_KEY() \
+       if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
+
+static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
+                                   gpointer data)
+{
+       MainWindow *mainwin = (MainWindow*) data;
+       
+       if (!mainwin || !event) 
+               return FALSE;
+
+       if (quicksearch_has_focus(mainwin->summaryview->quicksearch))
+       {
+               lastkey = event->keyval;
+               return FALSE;
+       }
+
+       switch (event->keyval) {
+       case GDK_Q:             /* Quit */
+               BREAK_ON_MODIFIER_KEY();
+
+               app_exit_cb(mainwin, 0, NULL);
+               return FALSE;
+       case GDK_space:
+               if (mainwin->folderview && mainwin->summaryview
+                   && ((!mainwin->summaryview->displayed
+                       && !mainwin->summaryview->selected) 
+                       || (mainwin->summaryview->folder_item
+                           && mainwin->summaryview->folder_item->total_msgs == 0))) {
+                       g_signal_stop_emission_by_name(G_OBJECT(widget), 
+                                       "key_press_event");
+                       folderview_select_next_unread(mainwin->folderview, TRUE);
+               }
+               break;
+#ifdef MAEMO
+       case GDK_F6:
+               if (maemo_mainwindow_is_fullscreen(widget)) {
+                       gtk_window_unfullscreen(GTK_WINDOW(widget));
+                } else {
+                       gtk_window_fullscreen(GTK_WINDOW(widget));
+                }
+               break;
+       case GDK_Escape:
+               if (mainwin->summaryview && 
+                   mainwin->summaryview->ext_messageview && 
+                   mainwin->summaryview->ext_messageview->window && 
+                   widget == mainwin->summaryview->ext_messageview->window) {
+                       messageview_destroy(mainwin->summaryview->ext_messageview);
+               }
+               break;
+#endif
+       default:
+               break;
+       }
+       return FALSE;
+}
+
+#undef BREAK_ON_MODIFIER_KEY
+
 MainWindow *main_window_create()
 {
        MainWindow *mainwin;
@@ -1749,7 +1829,7 @@ MainWindow *main_window_create()
        folderview_init(folderview);
        summary_init(summaryview);
        messageview_init(messageview);
-#ifdef USE_OPENSSL
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
        sslcertwindow_register_hook();
 #endif
        mainwin->lock_count = 0;
@@ -1774,13 +1854,6 @@ MainWindow *main_window_create()
        return mainwin;
 }
 
-void main_window_destroy(MainWindow *mainwin)
-{
-       /* TODO : destroy other component */
-       messageview_destroy(mainwin->messageview);
-       mainwin->messageview = NULL;    
-}
-
 void main_window_update_actions_menu(MainWindow *mainwin)
 {
        GtkItemFactory *ifactory;
@@ -1861,8 +1934,9 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
        gboolean pixmap_theme_changed = GPOINTER_TO_INT(data);
        GList *cur;
        MainWindow *mainwin;
+#ifndef MAEMO
        GtkWidget *pixmap;
-
+#endif
        for (cur = mainwin_list; cur != NULL; cur = cur->next) {
                mainwin = (MainWindow *)cur->data;
 
@@ -2169,7 +2243,7 @@ static void main_window_show_cur_account(MainWindow *mainwin)
 
        g_free(ac_name);
 }
-
+#ifndef MAEMO
 static void main_window_separation_change(MainWindow *mainwin, LayoutType layout_mode)
 {
        GtkWidget *folder_wid  = GTK_WIDGET_PTR(mainwin->folderview);
@@ -2201,7 +2275,7 @@ static void main_window_separation_change(MainWindow *mainwin, LayoutType layout
        gtk_widget_unref(summary_wid);
        gtk_widget_unref(message_wid);
 }
-
+#endif
 void mainwindow_reset_paned(GtkPaned *paned)
 {
                gint min, max, mid;
@@ -2391,16 +2465,6 @@ void main_window_progress_off(MainWindow *mainwin)
        gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), "");
 }
 
-void main_window_progress_set(MainWindow *mainwin, gint cur, gint total)
-{
-       gchar buf[32];
-
-       g_snprintf(buf, sizeof(buf), "%d / %d", cur, total);
-       gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), buf);
-       gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar),
-                               (total == 0) ? 0 : (gfloat)cur / (gfloat)total);
-}
-
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
 {
        if (confirm && procmsg_have_trashed_mails_fast()) {
@@ -2419,7 +2483,7 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
                gtk_widget_grab_focus(mainwin->folderview->ctree);
 }
 
-void main_window_add_mailbox(MainWindow *mainwin)
+static void main_window_add_mailbox(MainWindow *mainwin)
 {
        gchar *path;
        Folder *folder;
@@ -3265,7 +3329,7 @@ static void toolbar_child_detached(GtkWidget *widget, GtkWidget *child,
 {
        gtk_widget_set_size_request(child, -1, -1);
 }
-
+#ifndef MAEMO
 static gboolean ac_label_button_pressed(GtkWidget *widget, GdkEventButton *event,
                                    gpointer data)
 {
@@ -3283,7 +3347,7 @@ static gboolean ac_label_button_pressed(GtkWidget *widget, GdkEventButton *event
 
        return TRUE;
 }
-
+#endif
 static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event,
                                 gpointer data)
 {
@@ -3977,7 +4041,9 @@ static void process_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
        FolderItem *item = mainwin->summaryview->folder_item;   
        g_return_if_fail(item != NULL);
 
+       item->processing_pending = TRUE;
        folder_item_apply_processing(item);     
+       item->processing_pending = FALSE;
 }
 
 static void execute_summary_cb(MainWindow *mainwin, guint action,
@@ -4172,9 +4238,10 @@ static void prefs_actions_open_cb(MainWindow *mainwin, guint action,
 static void prefs_tags_open_cb(MainWindow *mainwin, guint action,
                                  GtkWidget *widget)
 {
-       prefs_tags_open(mainwin);
+       GSList * list = summary_get_selected_msg_list(mainwin->summaryview);
+       tag_apply_open(list);
 }
-#ifdef USE_OPENSSL
+#if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
 static void ssl_manager_open_cb(MainWindow *mainwin, guint action,
                                  GtkWidget *widget)
 {
@@ -4226,16 +4293,14 @@ static void account_receive_menu_cb(GtkMenuItem *menuitem, gpointer data)
 
        inc_account_mail(mainwin, account);
 }
-
+#ifndef MAEMO
 static void account_compose_menu_cb(GtkMenuItem *menuitem, gpointer data)
 {
-       MainWindow *mainwin = (MainWindow *)mainwin_list->data;
        PrefsAccount *account = (PrefsAccount *)data;
-       FolderItem *item = mainwin->summaryview->folder_item;   
 
        compose_new_with_folderitem(account, NULL, NULL);
 }
-
+#endif
 static void prefs_open_cb(GtkMenuItem *menuitem, gpointer data)
 {
        prefs_gtk_open();
@@ -4322,65 +4387,6 @@ gboolean mainwindow_is_obscured(void)
        return is_obscured;
 }
 
-#define BREAK_ON_MODIFIER_KEY() \
-       if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
-
-gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
-                                   gpointer data)
-{
-       MainWindow *mainwin = (MainWindow*) data;
-       
-       if (!mainwin || !event) 
-               return FALSE;
-
-       if (quicksearch_has_focus(mainwin->summaryview->quicksearch))
-       {
-               lastkey = event->keyval;
-               return FALSE;
-       }
-
-       switch (event->keyval) {
-       case GDK_Q:             /* Quit */
-               BREAK_ON_MODIFIER_KEY();
-
-               app_exit_cb(mainwin, 0, NULL);
-               return FALSE;
-       case GDK_space:
-               if (mainwin->folderview && mainwin->summaryview
-                   && ((!mainwin->summaryview->displayed
-                       && !mainwin->summaryview->selected) 
-                       || (mainwin->summaryview->folder_item
-                           && mainwin->summaryview->folder_item->total_msgs == 0))) {
-                       g_signal_stop_emission_by_name(G_OBJECT(widget), 
-                                       "key_press_event");
-                       folderview_select_next_unread(mainwin->folderview, TRUE);
-               }
-               break;
-#ifdef MAEMO
-       case GDK_F6:
-               if (maemo_mainwindow_is_fullscreen(widget)) {
-                       gtk_window_unfullscreen(GTK_WINDOW(widget));
-                } else {
-                       gtk_window_fullscreen(GTK_WINDOW(widget));
-                }
-               break;
-       case GDK_Escape:
-               if (mainwin->summaryview && 
-                   mainwin->summaryview->ext_messageview && 
-                   mainwin->summaryview->ext_messageview->window && 
-                   widget == mainwin->summaryview->ext_messageview->window) {
-                       messageview_destroy(mainwin->summaryview->ext_messageview);
-               }
-               break;
-#endif
-       default:
-               break;
-       }
-       return FALSE;
-}
-
-#undef BREAK_ON_MODIFIER_KEY
-
 /*
  * Harvest addresses for selected folder.
  */