Improve address parsing.
[claws.git] / src / mainwindow.c
index d5fc81365891c1a3d1c1eec8514c028114523881..2e6af4c393225cc704735ff8bb5efc17f829d9f1 100644 (file)
@@ -461,6 +461,10 @@ static void addr_gather_cb  ( MainWindow  *mainwin,
                                   guint       action,
                                   GtkWidget   *widget );
 
+static void addr_gather_msg_cb  ( MainWindow  *mainwin,
+                                  guint       action,
+                                  GtkWidget   *widget );
+
 #define  SEPARATE_ACTION  667
 
 static GtkItemFactoryEntry mainwin_entries[] =
@@ -677,7 +681,9 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Tools/_Address book..."),        "<shift><control>A", addressbook_open_cb, 0, NULL},
        {N_("/_Tools/Add sender to address boo_k"),
                                                NULL, add_address_cb, 0, NULL},
-       {N_("/_Tools/_Gather addresses..."),    NULL, addr_gather_cb, 0, NULL},
+       {N_("/_Tools/_Gather addresses"),       NULL, NULL, 0, "<Branch>"},
+       {N_("/_Tools/_Gather addresses/from _Folder..."),       NULL, addr_gather_cb, 0, NULL},
+       {N_("/_Tools/_Gather addresses/from _Messages..."),     NULL, addr_gather_msg_cb, 0, NULL},
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
        {N_("/_Tools/_Filter messages"),                NULL, filter_cb, 0, NULL},
        {N_("/_Tools/_Create filter rule"),     NULL, NULL, 0, "<Branch>"},
@@ -1601,7 +1607,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 
                {"/Tools/Selective download..."     , M_HAVE_ACCOUNT|M_UNLOCKED},
                {"/Tools/Add sender to address book", M_SINGLE_TARGET_EXIST},
-               {"/Tools/Gather addresses..."       , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
+               {"/Tools/Gather addresses"          , M_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/Filter messages"           , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
                {"/Tools/Create filter rule"        , M_SINGLE_TARGET_EXIST|M_UNLOCKED},
                {"/Tools/Execute"                   , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
@@ -3103,11 +3109,24 @@ static void set_toolbar_style(MainWindow *mainwin)
        }
 }
 
+/*
+ * Gather addresses for selected folder.
+ */
 static void addr_gather_cb( MainWindow *mainwin,
                            guint action,
                            GtkWidget *widget )
 {
-       addressbook_gather( mainwin->summaryview->folder_item );
+       addressbook_gather( mainwin->summaryview->folder_item, NULL );
+}
+
+/*
+ * Gather addresses for selected messages in summary view.
+ */
+static void addr_gather_msg_cb( MainWindow *mainwin,
+                           guint action,
+                           GtkWidget *widget )
+{
+       summary_gather_address( mainwin->summaryview );
 }
 
 /*