2007-07-20 [colin] 2.10.0cvs48
authorColin Leroy <colin@colino.net>
Fri, 20 Jul 2007 06:31:51 +0000 (06:31 +0000)
committerColin Leroy <colin@colino.net>
Fri, 20 Jul 2007 06:31:51 +0000 (06:31 +0000)
* src/mainwindow.c
* src/messageview.c
* src/toolbar.c
* src/toolbar.h
Fix random crashes while navigating
(GTK_EVENTS_FLUSH)

ChangeLog
PATCHSETS
configure.ac
src/mainwindow.c
src/messageview.c
src/toolbar.c
src/toolbar.h

index 849154370dcef12c8c34f631785b40bcd5506cb4..fb451dbc58eb9263f6100093c9a26a7451ba1a61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-07-20 [colin]     2.10.0cvs48
+
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/toolbar.c
+       * src/toolbar.h
+               Fix random crashes while navigating
+               (GTK_EVENTS_FLUSH)
+
 2007-07-19 [colin]     2.10.0cvs47
 
        * configure.ac
index 73b626c6e30b24288b5fde7f971b2c6168cffb84..cc0c61866a375b3d6ca7ce8a19a9bb757ed81be2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.155.2.70 -r 1.155.2.71 src/Makefile.am;  ) > 2.10.0cvs45.patchset
 ( cvs diff -u -r 1.155.2.71 -r 1.155.2.72 src/Makefile.am;  cvs diff -u -r 1.25.2.42 -r 1.25.2.43 src/stock_pixmap.c;  cvs diff -u -r 1.1.2.56 -r 1.1.2.57 src/wizard.c;  cvs diff -u -r 1.4.2.51 -r 1.4.2.52 src/gtk/about.c;  diff -u /dev/null src/pixmaps/claws-mail_logo-small.xpm;  ) > 2.10.0cvs46.patchset
 ( cvs diff -u -r 1.654.2.2756 -r 1.654.2.2757 configure.ac;  cvs diff -u -r 1.115.2.158 -r 1.115.2.159 src/main.c;  cvs diff -u -r 1.204.2.141 -r 1.204.2.142 src/prefs_common.c;  cvs diff -u -r 1.103.2.87 -r 1.103.2.88 src/prefs_common.h;  cvs diff -u -r 1.1.2.57 -r 1.1.2.58 src/wizard.c;  cvs diff -u -r 1.9.2.40 -r 1.9.2.41 src/common/defs.h;  cvs diff -u -r 1.36.2.106 -r 1.36.2.107 src/common/utils.c;  ) > 2.10.0cvs47.patchset
+( cvs diff -u -r 1.274.2.199 -r 1.274.2.200 src/mainwindow.c;  cvs diff -u -r 1.94.2.141 -r 1.94.2.142 src/messageview.c;  cvs diff -u -r 1.43.2.76 -r 1.43.2.77 src/toolbar.c;  cvs diff -u -r 1.19.2.19 -r 1.19.2.20 src/toolbar.h;  ) > 2.10.0cvs48.patchset
index 82043688477541b5bd53a84564fad33761c2d9b5..3e70bb09637a98cee930c6edfa2cf2fa83a4b2fa 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=47
+EXTRA_VERSION=48
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c73ebf0109185e56bec781ff505cf5c6a5ba75ca..32b79bf0c226c181db58660a079581a3ad60f7e7 100644 (file)
@@ -2058,24 +2058,6 @@ static void main_window_set_toolbar_combo_compose_menu(MainWindow *mainwin,
                                 ac_prefs);
        }
        gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->compose_mail_btn), menu);
-       menu = gtk_menu_tool_button_get_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->compose_news_btn));
-       if (menu)
-               gtk_widget_destroy(menu);
-       menu = gtk_menu_new();
-
-       for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
-               ac_prefs = (PrefsAccount *)cur_ac->data;
-
-               menuitem = gtk_menu_item_new_with_label
-                       (ac_prefs->account_name
-                        ? ac_prefs->account_name : _("Untitled"));
-               gtk_widget_show(menuitem);
-               gtk_menu_append(GTK_MENU(menu), menuitem);
-               g_signal_connect(G_OBJECT(menuitem), "activate",
-                                G_CALLBACK(account_compose_menu_cb),
-                                ac_prefs);
-       }
-       gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(mainwin->toolbar->compose_news_btn), menu);
 #endif
 }
 
index ffd4b075e513bf7ec1903f93c0aa2fc965a530a4..e8336251f3b5ec74a1ee15dae2f5acbb3f815c41 100644 (file)
@@ -795,10 +795,6 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
                         MSG_IS_SPAM(msginfo->flags)?LEARN_HAM:LEARN_SPAM);
 
        if (messageview->toolbar) {
-               if (messageview->toolbar->learn_ham_btn)
-                       gtk_widget_set_sensitive(
-                               messageview->toolbar->learn_ham_btn, 
-                               procmsg_spam_can_learn());
                if (messageview->toolbar->learn_spam_btn)
                        gtk_widget_set_sensitive(
                                messageview->toolbar->learn_spam_btn, 
index 15795d8edad3903788689befe30f423cec8c9c68..326255d68d7d26c6774bd4ab122e26f1da7a5b60 100644 (file)
@@ -776,16 +776,21 @@ static void activate_compose_button (Toolbar           *toolbar,
                                     ToolbarStyle      style,
                                     ComposeButtonType type)
 {
-       if ((!toolbar->compose_mail_btn) || (!toolbar->compose_news_btn))
+       if ((!toolbar->compose_mail_btn))
                return;
-       gtk_widget_hide(type == COMPOSEBUTTON_NEWS ? toolbar->compose_mail_btn 
-                       : toolbar->compose_news_btn);
-       gtk_widget_show_now(type == COMPOSEBUTTON_NEWS ? toolbar->compose_news_btn
-                       : toolbar->compose_mail_btn);
+
+       if (type == COMPOSEBUTTON_NEWS) {
+               gtk_tool_button_set_icon_widget(
+                       GTK_TOOL_BUTTON(toolbar->compose_mail_btn),
+                       toolbar->compose_news_icon);
+               gtk_widget_show(toolbar->compose_news_icon);
+       } else {
+               gtk_tool_button_set_icon_widget(
+                       GTK_TOOL_BUTTON(toolbar->compose_mail_btn),
+                       toolbar->compose_mail_icon);
+               gtk_widget_show(toolbar->compose_mail_icon);
+       }
        toolbar->compose_btn_type = type;
-       gtk_widget_queue_resize(toolbar->toolbar);
-       gtk_widget_show_now(toolbar->toolbar);
-       GTK_EVENTS_FLUSH();
 }
 
 void toolbar_set_compose_button(Toolbar            *toolbar, 
@@ -801,17 +806,27 @@ static void activate_learn_button (Toolbar           *toolbar,
                                     ToolbarStyle      style,
                                     LearnButtonType type)
 {
-       if ((!toolbar->learn_spam_btn) || (!toolbar->learn_ham_btn))
+       if ((!toolbar->learn_spam_btn))
                return;
 
-       gtk_widget_hide(type == LEARN_SPAM ? toolbar->learn_ham_btn 
-                       : toolbar->learn_spam_btn);
-       gtk_widget_show_now(type == LEARN_SPAM ? toolbar->learn_spam_btn
-                       : toolbar->learn_ham_btn);
+       if (type == LEARN_SPAM) {
+               gtk_tool_button_set_icon_widget(
+                       GTK_TOOL_BUTTON(toolbar->learn_spam_btn),
+                       toolbar->learn_spam_icon);
+               gtk_tool_button_set_label(
+                       GTK_TOOL_BUTTON(toolbar->learn_spam_btn),
+                       _("Learn Spam"));
+               gtk_widget_show(toolbar->learn_spam_icon);
+       } else {
+               gtk_tool_button_set_icon_widget(
+                       GTK_TOOL_BUTTON(toolbar->learn_spam_btn),
+                       toolbar->learn_ham_icon);
+               gtk_tool_button_set_label(
+                       GTK_TOOL_BUTTON(toolbar->learn_spam_btn),
+                       _("Learn Ham"));
+               gtk_widget_show(toolbar->learn_ham_icon);
+       }
        toolbar->learn_btn_type = type; 
-       gtk_widget_queue_resize(toolbar->toolbar);
-       gtk_widget_show_now(toolbar->toolbar);
-       GTK_EVENTS_FLUSH();
 }
 
 void toolbar_set_learn_button(Toolbar            *toolbar, 
@@ -1701,21 +1716,20 @@ Toolbar *toolbar_create(ToolbarType      type,
                                _("Compose Email"),
                                _("Compose with selected Account"));
                        toolbar_data->compose_mail_btn = item; 
+                       toolbar_data->compose_mail_icon = icon_wid; 
+                       g_object_ref(toolbar_data->compose_mail_icon);
 
                        icon_news = stock_pixmap_widget(container, STOCK_PIXMAP_NEWS_COMPOSE);
-                       TOOLBAR_MENUITEM(item,icon_news,_("Compose"),
-                               _("Compose News"),
-                               _("Compose with selected Account"));
-                       toolbar_data->compose_news_btn = item; 
+                       toolbar_data->compose_news_icon = icon_news; 
+                       g_object_ref(toolbar_data->compose_news_icon);
 #else
                        TOOLBAR_ITEM(item,icon_wid,toolbar_item->text,
                                _("Compose Email"));
                        toolbar_data->compose_mail_btn = item; 
+                       toolbar_data->compose_mail_icon = icon_wid; 
 
                        icon_news = stock_pixmap_widget(container, STOCK_PIXMAP_NEWS_COMPOSE);
-                       TOOLBAR_ITEM(item,icon_news,_("Compose"),
-                               _("Compose News"));
-                       toolbar_data->compose_news_btn = item; 
+                       toolbar_data->compose_news_icon = icon_news; 
 #endif
                        break;
                case A_LEARN_SPAM:
@@ -1723,15 +1737,14 @@ Toolbar *toolbar_create(ToolbarType      type,
                                _("Learn Spam"),
                                _("Learn as..."));
                        toolbar_data->learn_spam_btn = item; 
+                       toolbar_data->learn_spam_icon = icon_wid; 
+                       g_object_ref(toolbar_data->learn_spam_icon);
 
                        icon_ham = stock_pixmap_widget(container, STOCK_PIXMAP_HAM_BTN);
-                       TOOLBAR_MENUITEM(item,icon_ham,_("Ham"),
-                               _("Learn Ham"),
-                               _("Learn as..."));
-                       toolbar_data->learn_ham_btn = item; 
+                       toolbar_data->learn_ham_icon = icon_ham; 
+                       g_object_ref(toolbar_data->learn_ham_icon);
 
                        MAKE_MENU(learn_entries,"<LearnSpam>",toolbar_data->learn_spam_btn);
-                       MAKE_MENU(learn_entries,"<LearnHam>",toolbar_data->learn_ham_btn);
                        break;
                case A_REPLY_MESSAGE:
 #ifndef MAEMO
@@ -2076,11 +2089,11 @@ void toolbar_main_set_sensitive(gpointer data)
                        M_HAVE_QUEUED_MAILS);
        }
        if (toolbar->compose_mail_btn) {
-               SET_WIDGET_COND(toolbar->compose_news_btn, 
+               SET_WIDGET_COND(toolbar->compose_mail_btn, 
                        M_HAVE_ACCOUNT);
        }
        if (toolbar->close_window_btn) {
-               SET_WIDGET_COND(toolbar->compose_news_btn, 
+               SET_WIDGET_COND(toolbar->close_window_btn, 
                        M_UNLOCKED);
        }
        if (toolbar->open_mail_btn) {
@@ -2126,10 +2139,10 @@ void toolbar_main_set_sensitive(gpointer data)
                SET_WIDGET_COND(toolbar->exec_btn, 
                        M_DELAY_EXEC);
        
-       if (toolbar->learn_ham_btn)
+/*     if (toolbar->learn_ham_btn)
                SET_WIDGET_COND(toolbar->learn_ham_btn,
                        M_TARGET_EXIST|M_CAN_LEARN_SPAM);
-
+*/
        if (toolbar->learn_spam_btn)
                SET_WIDGET_COND(toolbar->learn_spam_btn, 
                        M_TARGET_EXIST|M_CAN_LEARN_SPAM);
@@ -2218,7 +2231,8 @@ void toolbar_init(Toolbar * toolbar) {
        toolbar->getall_btn             = NULL;
        toolbar->send_btn               = NULL;
        toolbar->compose_mail_btn       = NULL;
-       toolbar->compose_news_btn       = NULL;
+       toolbar->compose_mail_icon      = NULL;
+       toolbar->compose_news_icon      = NULL;
        toolbar->reply_btn              = NULL;
        toolbar->replysender_btn        = NULL;
        toolbar->replyall_btn           = NULL;
index 227e550bea6129c7a22909c5f783c2930e754dcb..0dd4914444c9b2d938dd0698afb4e77e7a1ffcf8 100644 (file)
@@ -55,7 +55,8 @@ struct _Toolbar {
        GtkWidget *send_btn;
 
        GtkWidget *compose_mail_btn;
-       GtkWidget *compose_news_btn;
+       GtkWidget *compose_mail_icon;
+       GtkWidget *compose_news_icon;
 
        GtkWidget *reply_btn;
        GtkWidget *replysender_btn;
@@ -72,7 +73,8 @@ struct _Toolbar {
 
        GtkWidget *separator;
        GtkWidget *learn_spam_btn;
-       GtkWidget *learn_ham_btn;
+       GtkWidget *learn_spam_icon;
+       GtkWidget *learn_ham_icon;
        
        GtkWidget *cancel_inc_btn;