+2003-12-20 [melvin] 0.9.8claws6
+
+ * src/action.[ch]
+ Changed the interface for action_update_*_menu() so
+ action.c does not need to know the paths of the different
+ actions menu (mainwindow, message view and compose window).
+
+ * src/compose.c
+ Tiny code cleanup to merge spell checker related code
+ compose_update_actions_menu(): new function to update
+ the actions menu. Use it in compose_create()
+
+ * src/compose.h
+ compose_update_actions_menu(): new function to update
+ the actions menu. Used also in prefs_actions.c.
+
+ * src/mainwindow.[ch]
+ main_window_update_actions_menu(): new function to update
+ the actions menu. Used in main_window_create() and in
+ prefs_actions.c
+
+ * src/messageview.[ch]
+ messageview_update_actions_menu(): new function to update
+ the actions menu. Used in messageview_add_toolbar() and in
+ prefs_actions.c
+
+ * src/prefs_actions.c
+ prefs_actions_ok(): fixed to update the actions menu of
+ the separate message view and the compose windows.
+
2003-12-20 [luke] 0.9.8claws5
* src/procheader.c
fix unfolding/newline stripping for multiline fields
MICRO_VERSION=8
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=5
+EXTRA_VERSION=6
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
else
};
static void action_update_menu (GtkItemFactory *ifactory,
- gchar *branch_path,
+ const gchar *branch_path,
gpointer callback,
gpointer data);
static void compose_actions_execute_cb (Compose *compose,
msgview_actions_execute_cb((MessageView*)data, action_nb, widget);
}
-void action_update_mainwin_menu(GtkItemFactory *ifactory, MainWindow *mainwin)
+void action_update_mainwin_menu(GtkItemFactory *ifactory,
+ const gchar *branch_path,
+ MainWindow *mainwin)
{
- action_update_menu(ifactory, "/Tools/Actions",
+ action_update_menu(ifactory, branch_path,
mainwin_actions_execute_cb, mainwin);
}
-void action_update_msgview_menu(GtkItemFactory *ifactory, MessageView *msgview)
+void action_update_msgview_menu(GtkItemFactory *ifactory,
+ const gchar *branch_path,
+ MessageView *msgview)
{
- action_update_menu(ifactory, "/Tools/Actions",
+ action_update_menu(ifactory, branch_path,
msgview_actions_execute_cb, msgview);
}
-void action_update_compose_menu(GtkItemFactory *ifactory, Compose *compose)
+void action_update_compose_menu(GtkItemFactory *ifactory,
+ const gchar *branch_path,
+ Compose *compose)
{
- action_update_menu(ifactory, "/Tools/Actions",
+ action_update_menu(ifactory, branch_path,
compose_actions_execute_cb, compose);
}
-static void action_update_menu(GtkItemFactory *ifactory, gchar *branch_path,
+static void action_update_menu(GtkItemFactory *ifactory,
+ const gchar *branch_path,
gpointer callback, gpointer data)
{
GtkWidget *menuitem;
ActionType action_get_type (const gchar *action_str);
-void actions_execute (gpointer data,
- guint action_nb,
- GtkWidget *widget,
- gint source);
+void actions_execute (gpointer data,
+ guint action_nb,
+ GtkWidget *widget,
+ gint source);
-void action_update_mainwin_menu (GtkItemFactory *ifactory,
+void action_update_mainwin_menu (GtkItemFactory *ifactory,
+ const gchar *branch_path,
MainWindow *mainwin);
void action_update_msgview_menu (GtkItemFactory *ifactory,
+ const gchar *branch_path,
MessageView *msgview);
-void action_update_compose_menu (GtkItemFactory *ifactory,
+void action_update_compose_menu (GtkItemFactory *ifactory,
+ const gchar *branch_path,
Compose *compose);
#endif /* __ACTION_H__ */
}
#endif
- action_update_compose_menu(ifactory, compose);
-
-
undostruct = undo_init(text);
undo_set_change_state_func(undostruct, &compose_undo_state_changed,
menubar);
}
}
}
+ compose->gtkaspell = gtkaspell;
#endif
compose_select_account(compose, account, TRUE);
-#if USE_ASPELL
- compose->gtkaspell = gtkaspell;
-#endif
-
if (account->set_autocc && account->auto_cc && mode != COMPOSE_REEDIT)
compose_entry_append(compose, account->auto_cc, COMPOSE_CC);
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), prefs_common.trans_hdr ? _("Newsgroups:") : "Newsgroups:");
addressbook_set_target_compose(compose);
- action_update_compose_menu(ifactory, compose);
if (mode != COMPOSE_REDIRECT)
compose_set_template_menu(compose);
/* Priority */
compose->priority = PRIORITY_NORMAL;
compose_update_priority_menu_item(compose);
-
+
+ /* Actions menu */
+ compose_update_actions_menu(compose);
+
#if USE_GPGME
activate_gnupg_mode(compose, account);
#endif
gtk_menu_item_set_submenu(GTK_MENU_ITEM(compose->tmpl_menu), menu);
}
+void compose_update_actions_menu(Compose *compose)
+{
+ GtkItemFactory *ifactory;
+
+ ifactory = gtk_item_factory_from_widget(compose->menubar);
+ action_update_compose_menu(ifactory, "/Tools/Actions", compose);
+}
+
void compose_reflect_prefs_all(void)
{
GList *cur;
gint compose_send (Compose *compose);
+void compose_update_actions_menu (Compose *compose);
+
void compose_reflect_prefs_all (void);
void compose_reflect_prefs_pixmap_theme (void);
toolbar_main_set_sensitive(mainwin);
/* create actions menu */
- action_update_mainwin_menu(ifactory, mainwin);
+ main_window_update_actions_menu(mainwin);
/* attach accel groups to main window */
#define ADD_MENU_ACCEL_GROUP_TO_WINDOW(menu,win) \
messageview_destroy(mainwin->messageview);
}
+void main_window_update_actions_menu(MainWindow *mainwin)
+{
+ GtkItemFactory *ifactory;
+
+ ifactory = gtk_item_factory_from_widget(mainwin->menubar);
+ action_update_mainwin_menu(ifactory, "/Tools/Actions", mainwin);
+}
+
void main_window_cursor_wait(MainWindow *mainwin)
{
void main_window_destroy (MainWindow *mainwin);
+void main_window_update_actions_menu (MainWindow *mainwin);
+
void main_window_cursor_wait (MainWindow *mainwin);
void main_window_cursor_normal (MainWindow *mainwin);
return msgview_list;
}
+void messageview_update_actions_menu(MessageView *msgview)
+{
+ GtkItemFactory *ifactory;
+
+ /* Messages opened in a new window do not have a menu bar */
+ if (msgview->menubar == NULL)
+ return;
+ ifactory = gtk_item_factory_from_widget(msgview->menubar);
+ action_update_msgview_menu(ifactory, "/Tools/Actions", msgview);
+}
+
void messageview_add_toolbar(MessageView *msgview, GtkWidget *window)
{
GtkWidget *handlebox;
gtk_container_add(GTK_CONTAINER(vbox),
GTK_WIDGET_PTR(msgview));
- ifactory = gtk_item_factory_from_widget(menubar);
- action_update_msgview_menu(ifactory, msgview);
+ messageview_update_actions_menu(msgview);
msgview_list = g_list_append(msgview_list, msgview);
}
gboolean messageview_is_visible (MessageView *messageview);
+void messageview_update_actions_menu (MessageView *msgview);
void messageview_add_toolbar (MessageView *msgview,
GtkWidget *vbox);
void messageview_reflect_prefs_pixmap_theme (void);
static void prefs_actions_ok(GtkWidget *widget, gpointer data)
{
- GtkItemFactory *ifactory;
- MainWindow *mainwin = (MainWindow *)data;
- GtkItemFactoryEntry ifentry = {NULL, NULL, NULL, 0, "<Branch>"};
+ MainWindow *mainwin = (MainWindow *) data;
+ GList *list;
+ GList *iter;
+ MessageView *msgview;
+ Compose *compose;
prefs_actions_write_config();
- ifactory = gtk_item_factory_from_widget(mainwin->menubar);
- action_update_mainwin_menu(ifactory, mainwin);
+
+ /* Update mainwindow actions menu */
+ main_window_update_actions_menu(mainwin);
+
+ /* Update separated message view actions menu */
+ list = messageview_get_msgview_list();
+ for (iter = list; iter; iter = iter->next) {
+ msgview = (MessageView *) iter->data;
+ messageview_update_actions_menu(msgview);
+ }
+
+ /* Update compose windows actions menu */
+ list = compose_get_compose_list();
+ for (iter = list; iter; iter = iter->next) {
+ compose = (Compose *) iter->data;
+ compose_update_actions_menu(compose);
+ }
+
gtk_widget_hide(actions.window);
inc_unlock();
}