2005-06-08 [paul] 1.9.11cvs46
authorPaul Mangan <paul@claws-mail.org>
Wed, 8 Jun 2005 07:17:53 +0000 (07:17 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 8 Jun 2005 07:17:53 +0000 (07:17 +0000)
sync with main:

* src/codeconv.c
* src/codeconv.h
always enabled Japanese auto-detection
if the first letters of locale string
is "ja"
* src/compose.c
don't use "destroy" signal to destroy
Compose object (fix rare crashes on discard?)
* src/mainwindow.c
* src/messageview.c
* src/prefs_send.c
added Hebrew encodings
* src/sourcewindow.c
don't use "destroy" signal to destroy
objects

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/codeconv.c
src/codeconv.h
src/compose.c
src/mainwindow.c
src/messageview.c
src/prefs_send.c
src/sourcewindow.c

index cf98b6f94126a85f0974feb72b74079c38f63415..d7a84bfeadf6006d15567a0f2c472cc6fcd2b634 100644 (file)
@@ -1,3 +1,23 @@
+2005-06-08 [paul]      1.9.11cvs46
+
+       sync with main:
+       
+       * src/codeconv.c
+       * src/codeconv.h
+               always enabled Japanese auto-detection
+               if the first letters of locale string
+               is "ja"
+       * src/compose.c
+               don't use "destroy" signal to destroy
+               Compose object (fix rare crashes on discard?)
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/prefs_send.c
+               added Hebrew encodings
+       * src/sourcewindow.c
+               don't use "destroy" signal to destroy
+               objects
+
 2005-06-07 [colin]     1.9.11cvs45
 
        * src/summaryview.c
index 1ea36001155b295636b9ff1389f29cdd49ae6eec..974660f4f3ad79f2ea1809d0649be74676eec0e2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.75 -r 1.395.2.76 src/summaryview.c;  ) > 1.9.11cvs43.patchset
 ( cvs diff -u -r 1.395.2.76 -r 1.395.2.77 src/summaryview.c;  ) > 1.9.11cvs44.patchset
 ( cvs diff -u -r 1.395.2.77 -r 1.395.2.78 src/summaryview.c;  ) > 1.9.11cvs45.patchset
+( cvs diff -u -r 1.65.2.29 -r 1.65.2.30 src/codeconv.c;  cvs diff -u -r 1.15.2.7 -r 1.15.2.8 src/codeconv.h;  cvs diff -u -r 1.382.2.127 -r 1.382.2.128 src/compose.c;  cvs diff -u -r 1.274.2.41 -r 1.274.2.42 src/mainwindow.c;  cvs diff -u -r 1.94.2.53 -r 1.94.2.54 src/messageview.c;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/prefs_send.c;  cvs diff -u -r 1.9.2.12 -r 1.9.2.13 src/sourcewindow.c;  ) > 1.9.11cvs46.patchset
index ac98baf5b3ff52b1dd530f1761f76aa208e54715..c4f1c43eeaf13c0fb6b41392ae801cc409f4e95f 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=45
+EXTRA_VERSION=46
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 877d48d882facba7ab56d1018cab324c89ea251f..bdccf8169040541d6ab0071d9e4f4ae205ad8f17 100644 (file)
@@ -771,7 +771,7 @@ CodeConvFunc conv_get_code_conv_func(const gchar *src_charset_str,
 
        /* auto detection mode */
        if (!src_charset_str && !dest_charset_str) {
-               if (src_charset == C_EUC_JP || src_charset == C_SHIFT_JIS)
+               if (conv_is_ja_locale())
                        return conv_anytodisp;
                else
                        return conv_noconv;
@@ -1418,6 +1418,24 @@ const gchar *conv_get_current_locale(void)
        return cur_locale;
 }
 
+gboolean conv_is_ja_locale(void)
+{
+       static gint is_ja_locale = -1;
+       const gchar *cur_locale;
+
+       if (is_ja_locale != -1)
+               return is_ja_locale != 0;
+
+       is_ja_locale = 0;
+       cur_locale = conv_get_current_locale();
+       if (cur_locale) {
+               if (g_strncasecmp(cur_locale, "ja", 2) == 0)
+                       is_ja_locale = 1;
+       }
+
+       return is_ja_locale != 0;
+}
+
 gchar *conv_unmime_header(const gchar *str, const gchar *default_encoding)
 {
        gchar buf[BUFFSIZE];
@@ -1439,7 +1457,7 @@ gchar *conv_unmime_header(const gchar *str, const gchar *default_encoding)
                }
        }
 
-       if (conv_get_locale_charset() == C_EUC_JP)
+       if (conv_is_ja_locale())
                conv_anytodisp(buf, sizeof(buf), str);
        else
                conv_localetodisp(buf, sizeof(buf), str);
index fd979c59b70b833bd194acb379c01140668fca2e..875246bfb59229f0839fed15c5bf73d55c2f9bb9 100644 (file)
@@ -208,6 +208,7 @@ const gchar *conv_get_outgoing_charset_str  (void);
 gboolean conv_is_multibyte_encoding            (CharSet         encoding);
 
 const gchar *conv_get_current_locale           (void);
+gboolean conv_is_ja_locale                     (void);
 
 gchar *conv_unmime_header              (const gchar    *str,
                                          const gchar   *default_encoding);
index ad8d3c6af18f8f3f1fb9fd48397c3fad8080fbe6..b5967553c8830a7c98fd8222c34fb485cc6c992a 100644 (file)
@@ -373,8 +373,6 @@ static void compose_ext_editor_cb   (gpointer        data,
 static gint compose_delete_cb          (GtkWidget      *widget,
                                         GdkEventAny    *event,
                                         gpointer        data);
-static void compose_destroy_cb         (GtkWidget      *widget,
-                                        Compose        *compose);
 
 static void compose_undo_cb            (Compose        *compose);
 static void compose_redo_cb            (Compose        *compose);
@@ -4717,8 +4715,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
 
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(compose_delete_cb), compose);
-       g_signal_connect(G_OBJECT(window), "destroy",
-                        G_CALLBACK(compose_destroy_cb), compose);
        MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_widget_realize(window);
 
@@ -5363,6 +5359,8 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
 
 static void compose_destroy(Compose *compose)
 {
+       compose_list = g_list_remove(compose_list, compose);
+
        /* NOTE: address_completion_end() does nothing with the window
         * however this may change. */
        address_completion_end(compose->window);
@@ -5417,6 +5415,7 @@ static void compose_destroy(Compose *compose)
                gtk_widget_destroy(compose->paned);
        gtk_widget_destroy(compose->popupmenu);
 
+       gtk_widget_destroy(compose->window);
        toolbar_destroy(compose->toolbar);
        g_free(compose->toolbar);
        g_free(compose);
@@ -6502,13 +6501,6 @@ static void compose_ext_editor_cb(gpointer data, guint action,
        compose_exec_ext_editor(compose);
 }
 
-static void compose_destroy_cb(GtkWidget *widget, Compose *compose)
-{
-       if (compose->sending)
-               return;
-       compose_destroy(compose);
-}
-
 static void compose_undo_cb(Compose *compose)
 {
        gboolean prev_autowrap = compose->autowrap;
@@ -7385,7 +7377,7 @@ static void compose_close(Compose *compose)
        gtkut_widget_get_uposition(compose->window, &x, &y);
        prefs_common.compose_x = x;
        prefs_common.compose_y = y;
-       gtk_widget_destroy(compose->window);
+       compose_destroy(compose);
 }
 
 /**
index 832bce6559898385dea8f26598ccfdb1f13864ae..9142b1862fd2ba405153c6f1b32de4bf4a354f68 100644 (file)
@@ -576,6 +576,12 @@ static GtkItemFactoryEntry mainwin_entries[] =
         ENC_ACTION(C_ISO_8859_7)},
        ENC_SEPARATOR,
 
+       {N_("/_View/Character _encoding/Hebrew (ISO-8859-_8)"),
+        ENC_ACTION(C_ISO_8859_8)},
+       {N_("/_View/Character _encoding/Hebrew (Windows-1255)"),
+        ENC_ACTION(C_CP1255)},
+       ENC_SEPARATOR,
+
        {N_("/_View/Character _encoding/Turkish (ISO-8859-_9)"),
         ENC_ACTION(C_ISO_8859_9)},
        ENC_SEPARATOR,
index 6097ad5c2ff99ce236b5fe5a8edf014210b73c67..e438e04a67687fd06f655e6df23666c9a0f7bc4f 100644 (file)
@@ -64,8 +64,9 @@
 
 static GList *messageview_list = NULL;
 
-static void messageview_destroy_cb     (GtkWidget      *widget,
-                                        MessageView    *messageview);
+static gint messageview_delete_cb      (GtkWidget              *widget,
+                                        GdkEventAny            *event,
+                                        MessageView            *messageview);
 static void messageview_size_allocate_cb(GtkWidget     *widget,
                                         GtkAllocation  *allocation);
 static gboolean key_pressed            (GtkWidget      *widget,
@@ -196,6 +197,11 @@ static GtkItemFactoryEntry msgview_entries[] =
        {N_("/_View/Character _encoding/Greek (ISO-8859-_7)"),
         ENC_ACTION(C_ISO_8859_7)},
        ENC_SEPARATOR,
+       {N_("/_View/Character _encoding/Hebrew (ISO-8859-_8)"),
+        ENC_ACTION(C_ISO_8859_8)},
+       {N_("/_View/Character _encoding/Hebrew (Windows-1255)"),
+        ENC_ACTION(C_CP1255)},
+       ENC_SEPARATOR,
        {N_("/_View/Character _encoding/Turkish (ISO-8859-_9)"),
         ENC_ACTION(C_ISO_8859_9)},
        ENC_SEPARATOR,
@@ -440,8 +446,8 @@ MessageView *messageview_create_with_new_window(MainWindow *mainwin)
        g_signal_connect(G_OBJECT(window), "size_allocate",
                         G_CALLBACK(messageview_size_allocate_cb),
                         msgview);
-       g_signal_connect(G_OBJECT(window), "destroy",
-                        G_CALLBACK(messageview_destroy_cb), msgview);
+       g_signal_connect(G_OBJECT(window), "delete_event",
+                        G_CALLBACK(messageview_delete_cb), msgview);
        g_signal_connect(G_OBJECT(window), "key_press_event",
                         G_CALLBACK(key_pressed), msgview);
 
@@ -831,6 +837,8 @@ void messageview_destroy(MessageView *messageview)
        
        msgview_list = g_list_remove(msgview_list, messageview); 
 
+       if (messageview->window)
+               gtk_widget_destroy(messageview->window);
        g_free(messageview);
 }
 
@@ -1026,9 +1034,11 @@ void messageview_save_as(MessageView *messageview)
        g_free(src);
 }
 
-static void messageview_destroy_cb(GtkWidget *widget, MessageView *messageview)
+static gint messageview_delete_cb(GtkWidget *widget, GdkEventAny *event,
+                                 MessageView *messageview)
 {
        messageview_destroy(messageview);
+       return TRUE;
 }
 
 static void messageview_size_allocate_cb(GtkWidget *widget,
@@ -1043,8 +1053,10 @@ static void messageview_size_allocate_cb(GtkWidget *widget,
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
                        MessageView *messageview)
 {
-       if (event && event->keyval == GDK_Escape && messageview->window)
-               gtk_widget_destroy(messageview->window);
+       if (event && event->keyval == GDK_Escape && messageview->window) {
+               messageview_destroy(messageview);
+               return TRUE;
+       }
        return FALSE;
 }
 
@@ -1315,7 +1327,7 @@ static void print_cb(gpointer data, guint action, GtkWidget *widget)
 static void close_cb(gpointer data, guint action, GtkWidget *widget)
 {
        MessageView *messageview = (MessageView *)data;
-       gtk_widget_destroy(messageview->window);
+       messageview_destroy(messageview);
 }
 
 static void copy_cb(gpointer data, guint action, GtkWidget *widget)
index c4bdf55727fe06172ebacb86789adab3f164dbcd..e46ed7439bcf21299a45b495663fc91fc99a41e5 100644 (file)
@@ -192,16 +192,19 @@ void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
        SET_MENUITEM(_("Western European (ISO-8859-1)"),  CS_ISO_8859_1);
        SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
        SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Central European (ISO-8859-2)"),  CS_ISO_8859_2);
+       SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
        SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Baltic (ISO-8859-13)"),           CS_ISO_8859_13);
-       SET_MENUITEM(_("Baltic (ISO-8859-4)"),            CS_ISO_8859_4);
+       SET_MENUITEM(_("Baltic (ISO-8859-13)"),          CS_ISO_8859_13);
+       SET_MENUITEM(_("Baltic (ISO-8859-4)"),           CS_ISO_8859_4);
        SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Greek (ISO-8859-7)"),             CS_ISO_8859_7);
+       SET_MENUITEM(_("Greek (ISO-8859-7)"),            CS_ISO_8859_7);
        SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Turkish (ISO-8859-9)"),           CS_ISO_8859_9);
+       SET_MENUITEM(_("Hebrew (ISO-8859-8)"),           CS_ISO_8859_8);
+       SET_MENUITEM(_("Hebrew (Windows-1255)"),         CS_WINDOWS_1255);
        SET_MENUITEM(NULL, NULL);
-       SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),          CS_ISO_8859_5);
+       SET_MENUITEM(_("Turkish (ISO-8859-9)"),          CS_ISO_8859_9);
+       SET_MENUITEM(NULL, NULL);
+       SET_MENUITEM(_("Cyrillic (ISO-8859-5)"),         CS_ISO_8859_5);
        SET_MENUITEM(_("Cyrillic (KOI8-R)"),             CS_KOI8_R);
        SET_MENUITEM(_("Cyrillic (KOI8-U)"),             CS_KOI8_U);
        SET_MENUITEM(_("Cyrillic (Windows-1251)"),       CS_WINDOWS_1251);
index d1328c8830faa1208699f064c1b3bd23d1f998e5..71793db6d07645013185fa8b46d4e7b9c92c528f 100644 (file)
@@ -38,7 +38,8 @@
 
 static void source_window_size_alloc_cb        (GtkWidget      *widget,
                                         GtkAllocation  *allocation);
-static void source_window_destroy_cb   (GtkWidget      *widget,
+static gint source_window_delete_cb    (GtkWidget      *widget,
+                                        GdkEventAny    *event,
                                         SourceWindow   *sourcewin);
 static gboolean key_pressed            (GtkWidget      *widget,
                                         GdkEventKey    *event,
@@ -77,9 +78,8 @@ SourceWindow *source_window_create(void)
        g_signal_connect(G_OBJECT(window), "size_allocate",
                         G_CALLBACK(source_window_size_alloc_cb),
                         sourcewin);
-       g_signal_connect(G_OBJECT(window), "destroy",
-                        G_CALLBACK(source_window_destroy_cb),
-                        sourcewin);
+       g_signal_connect(G_OBJECT(window), "delete_event",
+                        G_CALLBACK(source_window_delete_cb), sourcewin);
        g_signal_connect(G_OBJECT(window), "key_press_event",
                         G_CALLBACK(key_pressed), sourcewin);
        gtk_widget_realize(window);
@@ -120,6 +120,7 @@ void source_window_show(SourceWindow *sourcewin)
 
 void source_window_destroy(SourceWindow *sourcewin)
 {
+       gtk_widget_destroy(sourcewin->window);
        g_free(sourcewin);
 }
 
@@ -179,10 +180,11 @@ static void source_window_size_alloc_cb(GtkWidget *widget,
        prefs_common.sourcewin_height = allocation->height;
 }
 
-static void source_window_destroy_cb(GtkWidget *widget,
-                                    SourceWindow *sourcewin)
+static gint source_window_delete_cb(GtkWidget *widget, GdkEventAny *event,
+                                   SourceWindow *sourcewin)
 {
        source_window_destroy(sourcewin);
+       return TRUE;
 }
 
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
@@ -203,7 +205,8 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
                        gtk_widget_destroy(sourcewin->window);
                break;
        case GDK_Escape:
-               gtk_widget_destroy(sourcewin->window);
+               source_window_destroy(sourcewin);
+               return TRUE;
                break;
        }