fixed a bug in compose.c, and removed unnecessary code.
authorHiroyuki Yamamoto <hiro-y@kcn.ne.jp>
Mon, 12 Nov 2001 04:04:44 +0000 (04:04 +0000)
committerHiroyuki Yamamoto <hiro-y@kcn.ne.jp>
Mon, 12 Nov 2001 04:04:44 +0000 (04:04 +0000)
ChangeLog.claws
configure.in
src/Makefile.am
src/compose.c
src/template_select.c [deleted file]
src/template_select.h [deleted file]

index d3230305b14c859214ef4b8315f61f7a9ab768a3..d95e77db5c80de56a383604cd3d4481eb102ef01 100644 (file)
@@ -1,3 +1,11 @@
+2001-11-12 [hiro]
+
+       * src/compose.c
+               compose_forward(): fixed a bug that forward quote mark
+               wasn't used.
+               removed unnecessary code.
+       * src/template_select.[ch]: removed.
+
 2001-11-11 [alfons]
 
        * src/compose.c
index c75f5153f95483b2e63b59986d38a4e43be8c188..dff3eb5124aa5e2b554d576c1cfc9b8c0a48ebea 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws6
+EXTRA_VERSION=claws7
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 22640f7756a551e3109ae124d94c306fb6ad1a03..315cadff74281ce7f84ef647b3f6973477442ceb 100644 (file)
@@ -119,8 +119,7 @@ sylpheed_SOURCES = \
        mbox_folder.c mbox_folder.h \
        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
+       gtkspell.c gtkspell.h gtkxtext.h
 
 BUILT_SOURCES = \
        quote_fmt_lex.c \
index 669e21939b9191d92f14e9ad0f39b924573df199..57a11c53acd5c557f51ed9fdba6f390ed583c6b3 100644 (file)
@@ -98,7 +98,6 @@
 #include "gtkshruler.h"
 #include "folder.h"
 #include "addr_compl.h"
-#include "template_select.h"
 #include "quote_fmt.h"
 #include "template.h"
 
@@ -249,9 +248,6 @@ static void toolbar_linewrap_cb             (GtkWidget      *widget,
                                         gpointer        data);
 static void toolbar_address_cb         (GtkWidget      *widget,
                                         gpointer        data);
-static void template_select_cb         (gpointer        daat,
-                                        guint           action,
-                                        GtkWidget      *widget);
 
 
 static void select_account(Compose * compose, PrefsAccount * ac);
@@ -1066,7 +1062,7 @@ Compose *compose_forward(PrefsAccount * account, MsgInfo *msginfo,
                gchar *quote_str;
 
                if (prefs_common.fw_quotemark && *prefs_common.fw_quotemark)
-                       qmark = prefs_common.quotemark;
+                       qmark = prefs_common.fw_quotemark;
                else
                        qmark = "> ";
 
@@ -5682,65 +5678,6 @@ static void compose_toggle_return_receipt_cb(gpointer data, guint action,
                compose->return_receipt = FALSE;
 }
 
-static void template_apply_cb(gchar *s, gpointer data)
-{
-       Compose *compose = (Compose*)data;
-       GtkSText *text = GTK_STEXT(compose->text);
-       gchar *quote_str;
-       gchar *qmark;
-       gchar *parsed_text;
-       gchar *tmpl;
-       gchar *old_tmpl = s;
-
-       if(!s) return;
-       
-       if(compose->replyinfo == NULL) {
-               gtk_stext_freeze(text);
-               gtk_stext_set_point(text, 0);
-               gtk_stext_forward_delete(text, gtk_stext_get_length(text));
-               gtk_stext_insert(text, NULL, NULL, NULL, s, -1);
-               gtk_stext_thaw(text);
-               g_free(old_tmpl);
-               return;
-       }
-
-       parsed_text = g_new(gchar, strlen(s)*2 + 1);
-       tmpl = parsed_text;
-       while(*s) {
-               if (*s == '\n') {
-                       *parsed_text++ = '\\';
-                       *parsed_text++ = 'n';
-                       s++;
-               } else {
-                       *parsed_text++ = *s++;
-               }
-       }
-       *parsed_text = '\0';
-
-       if (prefs_common.quotemark && *prefs_common.quotemark)
-               qmark = prefs_common.quotemark;
-       else
-               qmark = "> ";
-
-       quote_str = compose_quote_fmt(compose, compose->replyinfo, tmpl, qmark);
-       if (quote_str != NULL) {
-               gtk_stext_freeze(text);
-               gtk_stext_set_point(text, 0);
-               gtk_stext_forward_delete(text, gtk_stext_get_length(text));
-               gtk_stext_insert(text, NULL, NULL, NULL, quote_str, -1);
-               gtk_stext_thaw(text);
-       }
-
-       g_free(old_tmpl);
-       g_free(tmpl);
-}
-
-static void template_select_cb(gpointer data, guint action,
-                              GtkWidget *widget)
-{
-       template_select(&template_apply_cb, data);
-}
-
 void compose_headerentry_key_press_event_cb(GtkWidget *entry, GdkEventKey *event, compose_headerentry *headerentry) {
        if((g_slist_length(headerentry->compose->header_list) > 0) &&
            ((headerentry->headernum + 1) != headerentry->compose->header_nextrow) &&
diff --git a/src/template_select.c b/src/template_select.c
deleted file mode 100644 (file)
index aa052d7..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Sylpheed templates subsystem 
- * Copyright (C) 2001 Alexander Barinov
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "defs.h"
-
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-#include <dirent.h>
-#include <sys/stat.h>
-
-#include "intl.h"
-#include "manage_window.h"
-#include "main.h"
-#include "utils.h"
-#include "alertpanel.h"
-#include "template.h"
-
-static struct Template_select {
-        GtkWidget *window;
-        GtkWidget *ok_btn;
-       GtkWidget *clist_tmpls;
-
-       GSList *tmpl_list;
-       void (*template_cb)(gchar *s, gpointer data);
-       gpointer save_data;
-} tmplsl;
-
-/* widget creating functions */
-static void template_select_create_window(void);
-static void template_select_setup_window(void);
-
-/* callbacks */
-static gint template_select_deleted_cb(GtkWidget *widget,
-                                       GdkEventAny *event,
-                                       gpointer data);
-static void template_select_key_pressed_cb(GtkWidget *widget,
-                                          GdkEventKey *event,
-                                          gpointer data);
-static void template_select_cancel_cb(void);
-static void template_select_ok_cb(void);
-
-/* Called from elsewhere */
-void template_select (void (*template_apply_cb)(gchar *s, gpointer data), 
-                      gpointer data)
-{
-       tmplsl.template_cb = template_apply_cb;
-       tmplsl.save_data = data;
-
-       tmplsl.tmpl_list = template_read_config();
-
-       inc_autocheck_timer_remove();
-
-       if(!tmplsl.window){
-               template_select_create_window();
-       }
-       template_select_setup_window();
-       gtk_widget_show(tmplsl.window);
-}
-
-void template_select_create_window(void)
-{
-        /* window structure ;) */
-        GtkWidget *window;
-        GtkWidget   *vbox1;
-        GtkWidget     *scroll1;
-        GtkWidget       *clist_tmpls;
-        GtkWidget     *confirm_area;
-       GtkWidget       *ok_btn;
-       GtkWidget       *cancel_btn;
-
-       gchar *title[] = {_("Registered templates")};
-
-        /* main window */
-       window = gtk_window_new(GTK_WINDOW_DIALOG);
-       gtk_container_set_border_width(GTK_CONTAINER(window), 8);
-       gtk_window_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW(window), TRUE);
-        gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, FALSE);
-        gtk_window_set_default_size(GTK_WINDOW(window), 200, 300);
-
-        /* vbox to handle template name and content */
-       vbox1 = gtk_vbox_new(FALSE, 6);
-       gtk_widget_show(vbox1);
-        gtk_container_add(GTK_CONTAINER(window), vbox1);
-
-        /* templates list */
-       scroll1 = gtk_scrolled_window_new(NULL, NULL);
-       gtk_widget_show(scroll1);
-       gtk_widget_set_usize(scroll1, -1, 150);
-       gtk_box_pack_start(GTK_BOX(vbox1), scroll1, TRUE, TRUE, 0);
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll1),
-                                      GTK_POLICY_AUTOMATIC,
-                                      GTK_POLICY_AUTOMATIC);
-
-       clist_tmpls = gtk_clist_new_with_titles(1, title);
-       gtk_widget_show(clist_tmpls);
-       gtk_container_add(GTK_CONTAINER(scroll1), clist_tmpls);
-       gtk_clist_set_column_width(GTK_CLIST(clist_tmpls), 0, 80);
-       gtk_clist_set_selection_mode(GTK_CLIST(clist_tmpls), GTK_SELECTION_BROWSE);
-       GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(clist_tmpls)->column[0].button,
-                              GTK_CAN_FOCUS);
-
-        /* ok | cancel */
-       gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
-                               &cancel_btn, _("Cancel"), NULL, NULL);
-       gtk_widget_show(confirm_area);
-       gtk_box_pack_end(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
-       gtk_widget_grab_default(ok_btn);
-
-       gtk_window_set_title(GTK_WINDOW(window), _("Templates"));
-
-       gtk_signal_connect(GTK_OBJECT(window), "delete_event",
-                          GTK_SIGNAL_FUNC(template_select_deleted_cb), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
-                          GTK_SIGNAL_FUNC(template_select_key_pressed_cb), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
-       gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
-                          GTK_SIGNAL_FUNC(template_select_ok_cb), NULL);
-       gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
-                           GTK_SIGNAL_FUNC(template_select_cancel_cb), NULL);
-
-       tmplsl.window = window;
-       tmplsl.ok_btn = ok_btn;
-       tmplsl.clist_tmpls = clist_tmpls;
-}
-
-void template_select_setup_window(void)
-{
-       GtkCList *clist = GTK_CLIST(tmplsl.clist_tmpls);
-       GSList *cur;
-       gint row;
-       Template *tmpl;
-       gchar *cond_str[1];
-
-       manage_window_set_transient(GTK_WINDOW(tmplsl.window));
-       gtk_widget_grab_focus(tmplsl.ok_btn);
-
-       gtk_clist_freeze(clist);
-       gtk_clist_clear(clist);
-
-       for (cur = tmplsl.tmpl_list; cur != NULL; cur = cur->next) {
-               tmpl = cur->data;
-               cond_str[0] = tmpl->name;
-               row = gtk_clist_append(clist, cond_str);
-               gtk_clist_set_row_data(clist, row, tmpl);
-       }
-
-       gtk_clist_thaw(clist);
-}
-
-static gint template_select_deleted_cb(GtkWidget *widget, GdkEventAny *event,
-                                       gpointer data)
-{
-       template_select_cancel_cb();
-       return TRUE;
-}
-
-static void template_select_key_pressed_cb(GtkWidget *widget, GdkEventKey *event,
-                                          gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               template_select_cancel_cb();
-}
-
-static void template_select_ok_cb(void)
-{
-       GtkCList *clist = GTK_CLIST(tmplsl.clist_tmpls);
-       gchar *s;
-       Template *tmpl;
-       gint row;
-
-       if (!clist->selection) return;
-       row = GPOINTER_TO_INT(clist->selection->data);
-       tmpl = gtk_clist_get_row_data(clist, row);
-       s = g_strdup(tmpl->value);
-
-       template_clear_config(tmplsl.tmpl_list);
-       gtk_widget_hide(tmplsl.window);
-       inc_autocheck_timer_set();
-       tmplsl.template_cb(s, tmplsl.save_data);
-}
-
-static void template_select_cancel_cb(void)
-{
-       template_clear_config(tmplsl.tmpl_list);
-       gtk_widget_hide(tmplsl.window);
-       inc_autocheck_timer_set();
-       tmplsl.template_cb(NULL, tmplsl.save_data);
-}
diff --git a/src/template_select.h b/src/template_select.h
deleted file mode 100644 (file)
index 897771b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Sylpheed templates subsystem 
- * Copyright (C) 2001 Alexander Barinov
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __TEMPLATE_SELECT_H__
-#define __TEMPLATE_SELECT_H__
-
-void template_select (void (*template_apply_cb)(gchar *s, gpointer data), 
-                      gpointer data);
-
-#endif /* __TEMPLATE_SELECT_H__ */