revert undo stuff that belong in 0.6.6claws
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 11 Nov 2001 18:16:18 +0000 (18:16 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 11 Nov 2001 18:16:18 +0000 (18:16 +0000)
ChangeLog.claws
src/Makefile.am
src/compose.c
src/compose.h

index e84a2d7c6dae9505b0a026696c51484a3302442d..051e5e3bdc3d97624d1490e0096904f11dc2e26a 100644 (file)
@@ -1,3 +1,10 @@
+2001-11-11 [alfons]
+       
+       * src/compose.[ch]
+       * src/undo.[ch]
+       * src/Makefile.am
+               revert the undo stuff (this is 0.6.6claws stuff)
+
 2001-11-11 [hoa]       0.6.5.claws6
 
        * src/compose.[ch]
index 9856543b269de09ee343d8a284b23ae9f29a66a2..22640f7756a551e3109ae124d94c306fb6ad1a03 100644 (file)
@@ -120,8 +120,7 @@ sylpheed_SOURCES = \
        quote_fmt_lex.l quote_fmt_lex.h \
        quote_fmt_parse.y quote_fmt.h \
        gtkspell.c gtkspell.h gtkxtext.h \
-       template_select.c template_select.h \
-       undo.c undo.h
+       template_select.c template_select.h
 
 BUILT_SOURCES = \
        quote_fmt_lex.c \
index 52ec399915e93628963acb428ac289c1fc2806fb..7e6ec9e8567c1076c9e822fa60a7001271a86ae0 100644 (file)
 #include "quote_fmt.h"
 #include "template.h"
 
-/* DINH V. Hoa - waiting for definitive version
-   of undo patch */
-#ifdef USE_UNDO_PATCH
-#include "undo.h"
-#endif
-
 #if USE_GPGME
 #  include "rfc2015.h"
 #endif
@@ -314,10 +308,6 @@ static gint compose_delete_cb              (GtkWidget      *widget,
 static void compose_destroy_cb         (GtkWidget      *widget,
                                         Compose        *compose);
 
-#ifdef USE_UNDO_PATCH /* DINH V. Hoa */
-static void compose_undo_cb            (Compose        *compose);
-static void compose_redo_cb            (Compose        *compose);
-#endif
 static void compose_cut_cb             (Compose        *compose);
 static void compose_copy_cb            (Compose        *compose);
 static void compose_paste_cb           (Compose        *compose);
@@ -326,12 +316,6 @@ static void compose_allsel_cb              (Compose        *compose);
 static void compose_grab_focus_cb      (GtkWidget      *widget,
                                         Compose        *compose);
 
-#ifdef USE_UNDO_PATCH /* DINH V. Hoa */
-static void compose_insert_text_cb(GtkEditable *editable, gchar *new_text,
-               gint new_text_length, gint *position, Compose *compose);
-static void compose_delete_text_cb(GtkEditable *editable, gint start_pos,
-               gint end_pos, Compose *compose);
-#endif
 static void compose_changed_cb         (GtkEditable    *editable,
                                         Compose        *compose);
 static void compose_button_press_cb    (GtkWidget      *widget,
@@ -442,13 +426,8 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_File/_Close"),                   "<alt>W", compose_close_cb, 0, NULL},
 
        {N_("/_Edit"),             NULL, NULL, 0, "<Branch>"},
-#ifdef USE_UNDO_PATCH /* DINH V. Hoa */
-       {N_("/_Edit/_Undo"),       "<control>Z", compose_undo_cb, 0, NULL},
-       {N_("/_Edit/_Redo"),       "<control>Y", compose_redo_cb, 0, NULL},
-#else
-       {N_("/_Edit/_Undo"),       "<control>Z", NULL, 0, NULL},
-       {N_("/_Edit/_Redo"),       "<control>Y", NULL, 0, NULL},
-#endif
+       {N_("/_Edit/_Undo"),       "<control>Z", NULL, 0, NULL},
+       {N_("/_Edit/_Redo"),       "<control>Y", NULL, 0, NULL},
        {N_("/_Edit/---"),         NULL, NULL, 0, "<Separator>"},
        {N_("/_Edit/Cu_t"),        "<control>X", compose_cut_cb,    0, NULL},
        {N_("/_Edit/_Copy"),       "<control>C", compose_copy_cb,   0, NULL},
@@ -1697,9 +1676,6 @@ static void compose_insert_sig(Compose *compose)
                return;
        }
 
-       gtk_stext_set_point(GTK_STEXT(compose->text),
-                           gtk_stext_get_length(GTK_STEXT(compose->text)));
-
        gtk_stext_insert(GTK_STEXT(compose->text), NULL, NULL, NULL, "\n\n", 2);
        if (prefs_common.sig_sep) {
                gtk_stext_insert(GTK_STEXT(compose->text), NULL, NULL, NULL,
@@ -3763,12 +3739,6 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
 
        gtk_container_add(GTK_CONTAINER(scrolledwin), text);
 
-#ifdef USE_UNDO_PATCH
-       gtk_signal_connect(GTK_OBJECT(text), "insert-text",
-                          GTK_SIGNAL_FUNC(compose_insert_text_cb), compose);
-       gtk_signal_connect(GTK_OBJECT(text), "delete-text",
-                          GTK_SIGNAL_FUNC(compose_delete_text_cb), compose);
-#endif
        gtk_signal_connect(GTK_OBJECT(text), "changed",
                           GTK_SIGNAL_FUNC(compose_changed_cb), compose);
        gtk_signal_connect(GTK_OBJECT(text), "grab_focus",
@@ -4372,11 +4342,6 @@ static void compose_destroy(Compose *compose)
 
        g_free(compose->exteditor_file);
 
-#ifdef USE_UNDO_PATCH
-       compose_undo_free_list(&compose->undo);
-       compose_undo_free_list(&compose->redo);
-#endif
-
        for (row = 0; (ainfo = gtk_clist_get_row_data(clist, row)) != NULL;
             row++)
                compose_attach_info_free(ainfo);
@@ -5360,22 +5325,6 @@ static void compose_destroy_cb(GtkWidget *widget, Compose *compose)
        compose_destroy(compose);
 }
 
-#ifdef USE_UNDO_PATCH
-static void compose_undo_cb(Compose *compose)
-{
-       if (compose->focused_editable &&
-           GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
-               compose_undo_undo(compose,NULL);
-}
-
-static void compose_redo_cb(Compose *compose)
-{
-       if (compose->focused_editable &&
-           GTK_WIDGET_HAS_FOCUS(compose->focused_editable))
-               compose_undo_redo(compose,NULL);
-}
-#endif
-
 static void compose_cut_cb(Compose *compose)
 {
        if (compose->focused_editable &&
@@ -5414,32 +5363,6 @@ static void compose_grab_focus_cb(GtkWidget *widget, Compose *compose)
                compose->focused_editable = widget;
 }
 
-#ifdef USE_UNDO_PATCH
-static void compose_insert_text_cb(GtkEditable *editable, gchar *new_text,
-               gint new_text_length, gint *position, Compose *compose)
-{
-       guchar *text_to_insert;
-
-       text_to_insert = g_strndup (new_text, new_text_length);
-       compose_undo_add (text_to_insert, *position, (*position + new_text_length), UNDO_ACTION_INSERT, compose);
-
-       g_free (text_to_insert);
-}
-
-static void compose_delete_text_cb(GtkEditable *editable, gint start_pos,
-               gint end_pos, Compose *compose)
-{
-        guchar *text_to_delete;
-
-        if (start_pos == end_pos )
-             return;
-        text_to_delete = gtk_editable_get_chars (GTK_EDITABLE(editable), start_pos, end_pos);
-       compose_undo_add (text_to_delete, start_pos, end_pos, UNDO_ACTION_DELETE, compose);
-
-       g_free (text_to_delete);
-}
-#endif
-
 static void compose_changed_cb(GtkEditable *editable, Compose *compose)
 {
        if (compose->modified == FALSE) {
index 6c0f9f0c14815959db5e971b9ab58eb42289b7a8..22fb594de20f1a951e781a5d298b68009df6401c 100644 (file)
@@ -179,15 +179,6 @@ struct _Compose
        gint   exteditor_readdes;
        gint   exteditor_tag;
 
-/* DINH V. Hoa - waiting for definitive version
-   of undo patch */
-#ifdef USE_UNDO_PATCH
-        GList *undo;
-        GList *redo;
-        gboolean undo_state;
-        gboolean redo_state;
-#endif
-
 #if USE_PSPELL
         /* Pspell spell checker */
         GtkPspell *gtkpspell;