[Commits] filtering.c 1.60.2.57.2.2 1.60.2.57.2.3 messageview.c 1.94.2.218.2.4 1.94.2.218.2.5 prefs_actions.c 1.60.2.73.2.1 1.60.2.73.2.2 prefs_actions.h 1.5.2.7.2.1 1.5.2.7.2.2 prefs_toolbar.c 1.30.2.67.2.1 1.30.2.67.2.2 prefs_toolbar.h 1.5.2.12 1.5.2.12.2.1 toolbar.c 1.43.2.124.2.2 1.43.2.124.2.3 toolbar.h 1.19.2.33 1.19.2.33.2.1
miras at claws-mail.org
miras at claws-mail.org
Sun Feb 19 22:01:19 CET 2012
Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv23420/src
Modified Files:
Tag: new-contacts
filtering.c messageview.c prefs_actions.c prefs_actions.h
prefs_toolbar.c prefs_toolbar.h toolbar.c toolbar.h
Log Message:
2012-02-19 [mir] 3.7.10cvs16.23-new-contacts
* src/filtering.c
* src/messageview.c
* src/prefs_actions.c
* src/prefs_actions.h
* src/prefs_toolbar.c
* src/prefs_toolbar.h
* src/toolbar.c
* src/toolbar.h
Applied patch 3.8.0cvs27, 3.8.0cvs28, and 3.8.0cvs29
from cvs HEAD.
Index: toolbar.c
===================================================================
RCS file: /home/claws-mail/claws/src/toolbar.c,v
retrieving revision 1.43.2.124.2.2
retrieving revision 1.43.2.124.2.3
diff -u -d -r1.43.2.124.2.2 -r1.43.2.124.2.3
--- toolbar.c 11 Jan 2012 22:40:47 -0000 1.43.2.124.2.2
+++ toolbar.c 19 Feb 2012 21:01:16 -0000 1.43.2.124.2.3
@@ -815,40 +815,52 @@
gpointer data,
gint source)
{
- GSList *cur, *lop;
- gchar *action, *action_p;
- gboolean found = FALSE;
+ GSList *cur;
gint i = 0;
for (cur = action_list; cur != NULL; cur = cur->next) {
ToolbarClawsActions *act = (ToolbarClawsActions*)cur->data;
if (widget == act->widget) {
-
- for (lop = prefs_common.actions_list; lop != NULL; lop = lop->next) {
- action = g_strdup((gchar*)lop->data);
+ i = prefs_actions_find_by_name(act->name);
- action_p = strstr(action, ": ");
- action_p[0] = 0x00;
- if (g_utf8_collate(act->name, action) == 0) {
- found = TRUE;
- g_free(action);
- break;
- } else
- i++;
- g_free(action);
- }
- if (found)
+ if (i != -1)
break;
}
}
- if (found)
+ if (i != -1)
actions_execute(data, i, widget, source);
else
g_warning ("Error: did not find Claws Action to execute");
}
+gboolean toolbar_check_action_btns(ToolbarType type)
+{
+ GSList *temp, *curr, *list = toolbar_config[type].item_list;
+ gboolean modified = FALSE;
+
+ curr = list;
+ while (curr != NULL) {
+ ToolbarItem *toolbar_item = (ToolbarItem *) curr->data;
+ temp = curr;
+ curr = curr->next;
+
+ if (toolbar_item->index != A_CLAWS_ACTIONS)
+ continue;
+
+ if (prefs_actions_find_by_name(toolbar_item->text) == -1) {
+ list = g_slist_delete_link(list, temp);
+ g_free(toolbar_item->file);
+ g_free(toolbar_item->text);
+ g_free(toolbar_item);
+ modified = TRUE;
+ }
+ }
+
+ return modified;
+}
+
#if !(GTK_CHECK_VERSION(2,12,0))
#define CLAWS_SET_TOOL_ITEM_TIP(widget,tip) { \
gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(widget), GTK_TOOLTIPS(toolbar_tips), \
Index: toolbar.h
===================================================================
RCS file: /home/claws-mail/claws/src/toolbar.h,v
retrieving revision 1.19.2.33
retrieving revision 1.19.2.33.2.1
diff -u -d -r1.19.2.33 -r1.19.2.33.2.1
--- toolbar.h 16 Feb 2011 07:16:17 -0000 1.19.2.33
+++ toolbar.h 19 Feb 2012 21:01:17 -0000 1.19.2.33.2.1
@@ -264,4 +264,5 @@
LearnButtonType learn_btn_type);
const gchar *toolbar_get_short_text (int action);
int toolbar_get_icon (int action);
+gboolean toolbar_check_action_btns (ToolbarType type);
#endif /* __CUSTOM_TOOLBAR_H__ */
Index: filtering.c
===================================================================
RCS file: /home/claws-mail/claws/src/filtering.c,v
retrieving revision 1.60.2.57.2.2
retrieving revision 1.60.2.57.2.3
diff -u -d -r1.60.2.57.2.2 -r1.60.2.57.2.3
--- filtering.c 29 Nov 2011 00:15:20 -0000 1.60.2.57.2.2
+++ filtering.c 19 Feb 2012 21:01:16 -0000 1.60.2.57.2.3
@@ -306,6 +306,9 @@
switch(action->type) {
case MATCHACTION_MOVE:
+ if (MSG_IS_LOCKED(info->flags))
+ return FALSE;
+
dest_folder =
folder_find_item_from_identifier(action->destination);
if (!dest_folder) {
Index: prefs_actions.h
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_actions.h,v
retrieving revision 1.5.2.7.2.1
retrieving revision 1.5.2.7.2.2
diff -u -d -r1.5.2.7.2.1 -r1.5.2.7.2.2
--- prefs_actions.h 29 Nov 2011 00:15:22 -0000 1.5.2.7.2.1
+++ prefs_actions.h 19 Feb 2012 21:01:16 -0000 1.5.2.7.2.2
@@ -27,5 +27,6 @@
void prefs_actions_open (MainWindow *mainwin);
void prefs_actions_rename_path (const gchar *old_path,
const gchar *new_path);
+gint prefs_actions_find_by_name (const gchar *name);
#endif /* __PREFS_ACTIONS_H__ */
Index: prefs_toolbar.c
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_toolbar.c,v
retrieving revision 1.30.2.67.2.1
retrieving revision 1.30.2.67.2.2
diff -u -d -r1.30.2.67.2.1 -r1.30.2.67.2.2
--- prefs_toolbar.c 29 Nov 2011 00:15:23 -0000 1.30.2.67.2.1
+++ prefs_toolbar.c 19 Feb 2012 21:01:16 -0000 1.30.2.67.2.2
@@ -41,6 +41,7 @@
#include "mainwindow.h"
#include "alertpanel.h"
#include "prefs_common.h"
+#include "prefs_actions.h"
#include "utils.h"
@@ -291,7 +292,6 @@
item->index = toolbar_ret_val_from_descr(event);
g_free(event);
- /* TODO: save A_CLAWS_ACTIONS only if they are still active */
toolbar_set_list_item(item, prefs_toolbar->source);
g_free(item->file);
@@ -1266,6 +1266,24 @@
g_free(prefs_toolbar_messageview);
}
+void prefs_toolbar_update_action_btns(void)
+{
+ if (toolbar_check_action_btns(TOOLBAR_MAIN)) {
+ toolbar_save_config_file(TOOLBAR_MAIN);
+ toolbar_update(TOOLBAR_MAIN, mainwindow_get_mainwindow());
+ }
+
+ if (toolbar_check_action_btns(TOOLBAR_COMPOSE)) {
+ toolbar_save_config_file(TOOLBAR_COMPOSE);
+ compose_reflect_prefs_pixmap_theme();
+ }
+
+ if (toolbar_check_action_btns(TOOLBAR_MSGVIEW)) {
+ toolbar_save_config_file(TOOLBAR_MSGVIEW);
+ messageview_reflect_prefs_pixmap_theme();
+ }
+}
+
static void set_visible_if_not_text(GtkTreeViewColumn *col,
GtkCellRenderer *renderer,
GtkTreeModel *model,
Index: prefs_actions.c
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_actions.c,v
retrieving revision 1.60.2.73.2.1
retrieving revision 1.60.2.73.2.2
diff -u -d -r1.60.2.73.2.1 -r1.60.2.73.2.2
--- prefs_actions.c 29 Nov 2011 00:15:22 -0000 1.60.2.73.2.1
+++ prefs_actions.c 19 Feb 2012 21:01:16 -0000 1.60.2.73.2.2
@@ -49,6 +49,7 @@
#include "filtering.h"
#include "prefs_filtering_action.h"
#include "matcher_parser.h"
+#include "prefs_toolbar.h"
enum {
PREFS_ACTIONS_STRING, /*!< string pointer managed by list store,
@@ -585,7 +586,7 @@
static gint prefs_actions_clist_set_row(gint row)
{
const gchar *entry_text;
- gint len;
+ gint len, action_nb;
gchar action[PREFSBUFSIZE];
gchar *new_action;
GtkListStore *store;
@@ -609,6 +610,12 @@
return -1;
}
+ action_nb = prefs_actions_find_by_name(entry_text);
+ if ((action_nb != -1) && ((row == -1) || (row != action_nb + 1))) {
+ alertpanel_error(_("There is action with this name already."));
+ return -1;
+ }
+
strncpy(action, entry_text, PREFSBUFSIZE - 1);
while (strstr(action, "//")) {
@@ -949,6 +956,9 @@
compose_update_actions_menu(compose);
}
+ /* Update toolbars */
+ prefs_toolbar_update_action_btns();
+
gtk_widget_hide(actions.window);
gtk_window_set_modal(GTK_WINDOW(actions.window), FALSE);
inc_unlock();
@@ -1364,3 +1374,26 @@
g_strfreev(tokens);
}
}
+
+gint prefs_actions_find_by_name(const gchar *name)
+{
+ GSList *act = prefs_common.actions_list;
+ gchar *action_name, *action_p;
+ gint action_nb = 0;
+
+ for (; act != NULL; act = act->next) {
+ action_name = g_strdup((gchar *)act->data);
+ action_p = strstr(action_name, ": ");
+ action_p[0] = 0x00;
+
+ if (g_utf8_collate(name, action_name) == 0) {
+ g_free(action_name);
+ return action_nb;
+ }
+
+ g_free(action_name);
+ action_nb++;
+ }
+
+ return -1;
+}
Index: messageview.c
===================================================================
RCS file: /home/claws-mail/claws/src/messageview.c,v
retrieving revision 1.94.2.218.2.4
retrieving revision 1.94.2.218.2.5
diff -u -d -r1.94.2.218.2.4 -r1.94.2.218.2.5
--- messageview.c 5 Feb 2012 22:11:11 -0000 1.94.2.218.2.4
+++ messageview.c 19 Feb 2012 21:01:16 -0000 1.94.2.218.2.5
@@ -2918,6 +2918,9 @@
MsgInfo *msg_old = messageview->msginfo;
MsgInfo *msg_new = msginfo_update->msginfo;
+ if (msg_new == NULL || msg_old == NULL)
+ return FALSE;
+
if (strcmp2(msg_new->msgid, msg_old->msgid))
return FALSE;
Index: prefs_toolbar.h
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_toolbar.h,v
retrieving revision 1.5.2.12
retrieving revision 1.5.2.12.2.1
diff -u -d -r1.5.2.12 -r1.5.2.12.2.1
--- prefs_toolbar.h 16 Feb 2011 07:16:14 -0000 1.5.2.12
+++ prefs_toolbar.h 19 Feb 2012 21:01:16 -0000 1.5.2.12.2.1
@@ -31,5 +31,6 @@
void prefs_toolbar_register_plugin_item(ToolbarType toolbar_type, const gchar *plugin_name, const gchar *item_name, ToolbarPluginCallback cb, gpointer cb_data);
void prefs_toolbar_unregister_plugin_item(ToolbarType toolbar_type, const gchar *plugin_name, const gchar *item_name);
void prefs_toolbar_execute_plugin_item(gpointer parent, ToolbarType toolbar_type, const gchar *id);
+void prefs_toolbar_update_action_btns(void);
#endif /* __PREFS_CUSTOM_TOOLBAR_H__ */
More information about the Commits
mailing list