fix bugs introduced while fixing messageview reply
authorOliver Haertel <o.h.a@gmx.net>
Sat, 1 Mar 2003 09:45:14 +0000 (09:45 +0000)
committerOliver Haertel <o.h.a@gmx.net>
Sat, 1 Mar 2003 09:45:14 +0000 (09:45 +0000)
ChangeLog.claws
configure.ac
src/mainwindow.c
src/messageview.c
src/toolbar.c
src/toolbar.h

index 772d7472ae7cbe727b8ba705e97cf2ab79d1f57e..c872e091603e1a95eef0715d0efaff513d7e4acd 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-01 [oliver]    0.8.10claws66
+
+       * src/mainwindow.c
+       * src/messageview.c
+               menu callbacks call toolbar_menu_reply
+       * src/toolbar.[ch]
+               callbacks from menu handled by toolbar_menu_reply
+               
 2003-03-01 [paul]      0.8.10claws65
 
        * src/addressbook.c
index 7b18ac280bc91581117892ff55c62e0d3bb3b7e1..f116fd65c8e9550968d5fb4f6bbdc4d5d9386916 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws65
+EXTRA_VERSION=claws66
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 9595087a1dcf8969b9fe79ef35968978ef23a4cc..b290f4141a09d42e3606dfa3e150d230ae9b6897 100644 (file)
@@ -397,7 +397,9 @@ static void addr_harvest_msg_cb      ( MainWindow  *mainwin,
 static gboolean mainwindow_focus_in_event      (GtkWidget      *widget, 
                                                 GdkEventFocus  *focus,
                                                 gpointer        data);
-
+void main_window_reply_cb                      (MainWindow     *mainwin, 
+                                                guint           action,
+                                                GtkWidget      *widget);
 #define  SEPARATE_ACTION 500 
 
 static GtkItemFactoryEntry mainwin_entries[] =
@@ -604,16 +606,16 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/Compose a_n email message"),     "<control>M", compose_mail_cb, 0, NULL},
        {N_("/_Message/Compose a news message"),        NULL,   compose_news_cb, 0, NULL},
-       {N_("/_Message/_Reply"),                "<control>R",   reply_cb, COMPOSE_REPLY, NULL},
+       {N_("/_Message/_Reply"),                "<control>R",   main_window_reply_cb, COMPOSE_REPLY, NULL},
        {N_("/_Message/Repl_y to"),             NULL, NULL, 0, "<Branch>"},
-       {N_("/_Message/Repl_y to/_all"),        "<shift><control>R", reply_cb, COMPOSE_REPLY_TO_ALL, NULL},
-       {N_("/_Message/Repl_y to/_sender"),     NULL, reply_cb, COMPOSE_REPLY_TO_SENDER, NULL},
+       {N_("/_Message/Repl_y to/_all"),        "<shift><control>R", main_window_reply_cb, COMPOSE_REPLY_TO_ALL, NULL},
+       {N_("/_Message/Repl_y to/_sender"),     NULL, main_window_reply_cb, COMPOSE_REPLY_TO_SENDER, NULL},
        {N_("/_Message/Repl_y to/mailing _list"),
-                                               "<control>L", reply_cb, COMPOSE_REPLY_TO_LIST, NULL},
-       {N_("/_Message/Follow-up and reply to"),NULL, reply_cb, COMPOSE_FOLLOWUP_AND_REPLY_TO, NULL},
+                                               "<control>L", main_window_reply_cb, COMPOSE_REPLY_TO_LIST, NULL},
+       {N_("/_Message/Follow-up and reply to"),NULL, main_window_reply_cb, COMPOSE_FOLLOWUP_AND_REPLY_TO, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
-       {N_("/_Message/_Forward"),              "<control><alt>F", reply_cb, COMPOSE_FORWARD, NULL},
-       {N_("/_Message/Redirect"),              NULL, reply_cb, COMPOSE_REDIRECT, NULL},
+       {N_("/_Message/_Forward"),              "<control><alt>F", main_window_reply_cb, COMPOSE_FORWARD, NULL},
+       {N_("/_Message/Redirect"),              NULL, main_window_reply_cb, COMPOSE_REDIRECT, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/Re-_edit"),              NULL, reedit_cb, 0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
@@ -2150,6 +2152,11 @@ static void toggle_toolbar_cb(MainWindow *mainwin, guint action,
        toolbar_toggle(action, mainwin);
 }
 
+void main_window_reply_cb(MainWindow *mainwin, guint action,
+                         GtkWidget *widget)
+{
+       toolbar_menu_reply(TOOLBAR_MAIN, mainwin, action);
+}
 /* END Toolbar Stuff */
 
 static void toggle_statusbar_cb(MainWindow *mainwin, guint action,
index 5673a31e52b391404b1720f989ac7a3f1e9a3f55..f4c967ec08b809d3f8462b4b25da2c7a5fdc7cc1 100644 (file)
@@ -71,7 +71,7 @@ static void return_receipt_send_clicked (NoticeView   *noticeview,
 static PrefsAccount *select_account_from_list
                                        (GList          *ac_list);
 
-static void messageview_menubar_cb     (gpointer        data, 
+static void messageview_menubar_cb     (MessageView    *msgview,
                                         guint           action, 
                                         GtkWidget      *widget);
                                         
@@ -826,13 +826,9 @@ static PrefsAccount *select_account_from_list(GList *ac_list)
        return account_find_from_id(account_id);
 }
 
-static void messageview_menubar_cb(gpointer data, guint action, GtkWidget *widget)
+static void messageview_menubar_cb(MessageView *msgview, guint action, GtkWidget *widget)
 {
-       MessageView *msgview = (MessageView*)data;
-       MainWindow *mainwin = (MainWindow*)msgview->mainwin;
-
-       g_return_if_fail(mainwin != NULL);
-       reply_cb(mainwin, action, widget);
+       toolbar_menu_reply(TOOLBAR_MSGVIEW, msgview, action);
 }
 
 static void messageview_close_cb(gpointer data, guint action, GtkWidget *widget)
index 7bafc9e39f8aa576635050fcbe560b39b005eb8c..045bacad7939cf260ce653d34bf4852626c50ee2 100644 (file)
@@ -87,6 +87,8 @@ static void activate_compose_button           (Toolbar        *toolbar,
                                                 ComposeButtonType type);
 
 /* toolbar callbacks */
+static void toolbar_reply                      (gpointer        data, 
+                                                guint           action);
 static void toolbar_delete_cb                  (GtkWidget      *widget,
                                                 gpointer        data);
 
@@ -1356,7 +1358,7 @@ static GtkWidget *get_window_widget(ToolbarType type, gpointer data)
 }
 
 static void toolbar_buttons_cb(GtkWidget   *widget, 
-                                     ToolbarItem *item)
+                              ToolbarItem *item)
 {
        gint num_items;
        gint i;
@@ -1951,7 +1953,20 @@ void delete_msgview_cb(gpointer data, guint action, GtkWidget *widget)
        }       
 }
 
-void toolbar_reply(gpointer data, guint action)
+void toolbar_menu_reply(ToolbarType type, gpointer data, guint action)
+{
+       ToolbarItem *item;
+
+       g_return_if_fail(data != NULL);
+
+       item = g_new0(ToolbarItem, 1);
+       item->parent = data;
+       item->type = type;
+       toolbar_reply(item, action);
+       g_free(item);   
+}
+
+static void toolbar_reply(gpointer data, guint action)
 {
        ToolbarItem *toolbar_item = (ToolbarItem*)data;
        MainWindow *mainwin;
@@ -1976,10 +1991,11 @@ void toolbar_reply(gpointer data, guint action)
                msginfo = msgview->msginfo;
                break;
        default:
-               break;
+               return;
        }
 
-       if (!msginfo) return;
+       g_return_if_fail (msginfo != NULL);
+       g_return_if_fail (summaryview != NULL);
 
        text = gtkut_editable_get_selection
                (GTK_EDITABLE(msgview->textview->text));
@@ -2089,12 +2105,6 @@ void toolbar_reply(gpointer data, guint action)
        g_free(text);   
 }
 
-
-void reply_cb(gpointer data, guint action, GtkWidget *widget)
-{
-       toolbar_reply(data, action);
-}
-
 void inc_mail_cb(gpointer data, guint action, GtkWidget *widget)
 {
        MainWindow *mainwin = (MainWindow*)data;
index 26742083024cc3abeb6e83cb5a736d8e1c9758f6..3dc483d0163cfc72364ecd883d30e10039849538 100644 (file)
@@ -195,9 +195,6 @@ void        toolbar_comp_set_sensitive      (gpointer        data,
                                         gboolean        sensitive);
 
 /* invoked by mainwindow entries and toolbar actions */
-void   reply_cb                        (gpointer        data, 
-                                        guint           action, 
-                                        GtkWidget      *widget);
 void   delete_msgview_cb               (gpointer        data, 
                                         guint           action, 
                                         GtkWidget      *widget);
@@ -230,6 +227,7 @@ void        toolbar_set_style               (GtkWidget      *toolbar_wid,
                                         guint           action);
 void   toolbar_destroy                 (Toolbar        *toolbar);
 void   toolbar_init                    (Toolbar        *toolbar);
-void   toolbar_reply                   (gpointer        data, 
+void   toolbar_menu_reply              (ToolbarType     type,
+                                        gpointer        data,  
                                         guint           action);
 #endif /* __CUSTOM_TOOLBAR_H__ */