made smart wrapping an option
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Mon, 9 Jul 2001 20:14:59 +0000 (20:14 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Mon, 9 Jul 2001 20:14:59 +0000 (20:14 +0000)
ChangeLog.claws
src/compose.c
src/prefs_common.c
src/prefs_common.h

index 2f86a5c64a878e5307079d88a2d6091c156453d7..a407796af437b2978c161ff5c76e4c8e517c1b0c 100644 (file)
@@ -1,4 +1,4 @@
-2001-07-08 [hoa]
+2001-07-09 [hoa]
 
        * AUTHORS
                changed my email address
        * configure.in
                fix incorrect description of --enable-ldap parameter
 
+       * src/prefs_common.[ch]
+         src/compose.c
+               add experimental option "smart wrapping" which make the
+               compose editor auto wrap.
+               
+               | TODO: the problem with the buggy cursor handling is caused |
+               | by the GtkText. when deleting / backspacing text its       |
+               | wrapping algorithm does not take in account the previous   |
+               | line. should find a way to hack this in.                   |
+               | or should perhaps combine this with the word wrapping      |
+               | patch i wrote in january.                                  |
+
        * src/about.c
                show build parameters for LDAP and JPilot
 
index 079c3c72bdb9925cf537dace77e17537bc98f7ed..43428495884382edde032410d035a669b523a060 100644 (file)
@@ -2963,8 +2963,10 @@ static Compose *compose_create(PrefsAccount *account)
                            gtk_scrolled_window_get_vadjustment
                            (GTK_SCROLLED_WINDOW(scrolledwin)));
        gtk_stext_set_editable(GTK_STEXT(text), TRUE);
-       gtk_stext_set_word_wrap(GTK_STEXT(text), TRUE);
-       gtk_stext_set_wrap_rmargin(GTK_STEXT(text), prefs_common.linewrap_len);
+       if (prefs_common.smart_wrapping) {      
+               gtk_stext_set_word_wrap(GTK_STEXT(text), TRUE);
+               gtk_stext_set_wrap_rmargin(GTK_STEXT(text), prefs_common.linewrap_len);
+       }               
 
        gtk_container_add(GTK_CONTAINER(scrolledwin), text);
 
index 86c496e6379aeaedeb75388bef4eed3c4755cba9..8379ce67d83469738f85874acc9ec190f6c1dc2e 100644 (file)
@@ -104,6 +104,7 @@ static struct Compose {
 
        GtkWidget * checkbtn_forward_as_attachment;
        GtkWidget * checkbtn_reply_account_autoselect;
+       GtkWidget * checkbtn_smart_wrapping;
 } compose;
 
 static struct Display {
@@ -295,6 +296,9 @@ static PrefParam param[] = {
        {"reply_account_autoselect", "TRUE", &prefs_common.reply_account_autoselect,
         P_BOOL, &compose.checkbtn_reply_account_autoselect,
         prefs_set_data_from_toggle, prefs_set_toggle},
+        {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
+        P_BOOL, &compose.checkbtn_smart_wrapping,
+        prefs_set_data_from_toggle, prefs_set_toggle},
 
        {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
         NULL, NULL, NULL},
@@ -1069,6 +1073,7 @@ static void prefs_compose_create(void)
 
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_reply_account_autoselect;
+       GtkWidget *checkbtn_smart_wrapping;
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -1200,6 +1205,9 @@ static void prefs_compose_create(void)
        PACK_CHECK_BUTTON (vbox1, checkbtn_reply_account_autoselect,
                           _("Automatically select account for mail replies"));
 
+       PACK_CHECK_BUTTON (vbox1, checkbtn_smart_wrapping,
+                          _("Smart wrapping (EXPERIMENTAL)"));
+
        /*
        compose.checkbtn_quote   = checkbtn_quote;
        compose.entry_quotemark  = entry_quotemark;
@@ -1217,6 +1225,8 @@ static void prefs_compose_create(void)
                checkbtn_forward_as_attachment;
        compose.checkbtn_reply_account_autoselect =
                checkbtn_reply_account_autoselect;
+       compose.checkbtn_smart_wrapping = 
+               checkbtn_smart_wrapping;
 }
 
 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
index c23f8e7a72763b1fdfd4a917ca6bb492f9dd5851..9db10427ca71833837b308aa059bcc9ab8c691c4 100644 (file)
@@ -74,6 +74,7 @@ struct _PrefsCommon
        gchar *fw_quotefmt;
        gboolean forward_as_attachment;
        gboolean reply_account_autoselect;
+       gboolean smart_wrapping;
 
        /* Display */
        gchar *widgetfont;