2005-10-13 [paul] 1.9.15cvs34
authorPaul Mangan <paul@claws-mail.org>
Thu, 13 Oct 2005 14:54:20 +0000 (14:54 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 13 Oct 2005 14:54:20 +0000 (14:54 +0000)
* src/export.c
* src/import.c
fix typos in g_warnings
* src/prefs_account.c
add a file selector for Signature file

Patches by wwp

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/export.c
src/import.c
src/prefs_account.c

index 548f4dc..4d7091e 100644 (file)
@@ -1,3 +1,13 @@
+2005-10-13 [paul]      1.9.15cvs34
+
+       * src/export.c
+       * src/import.c
+               fix typos in g_warnings
+       * src/prefs_account.c
+               add a file selector for Signature file
+
+       Patches by wwp
+
 2005-10-12 [colin]     1.9.15cvs33
 
        * src/mimeview.c
index fb834c2..f034381 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.23.2.13 -r 1.23.2.14 src/crash.c;  cvs diff -u -r 1.179.2.77 -r 1.179.2.78 src/imap.c;  cvs diff -u -r 1.274.2.72 -r 1.274.2.73 src/mainwindow.c;  cvs diff -u -r 1.83.2.40 -r 1.83.2.41 src/mimeview.c;  cvs diff -u -r 1.101.2.17 -r 1.101.2.18 src/news.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/prefs_image_viewer.c;  cvs diff -u -r 1.395.2.134 -r 1.395.2.135 src/summaryview.c;  cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/wizard.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/pgpcore/prefs_gpg.c;  ) > 1.9.15cvs31.patchset
 ( cvs diff -u -r 1.382.2.182 -r 1.382.2.183 src/compose.c;  ) > 1.9.15cvs32.patchset
 ( cvs diff -u -r 1.83.2.41 -r 1.83.2.42 src/mimeview.c;  ) > 1.9.15cvs33.patchset
+( cvs diff -u -r 1.8.2.13 -r 1.8.2.14 src/export.c;  cvs diff -u -r 1.13.2.12 -r 1.13.2.13 src/import.c;  cvs diff -u -r 1.105.2.37 -r 1.105.2.38 src/prefs_account.c;  ) > 1.9.15cvs34.patchset
index b06d000..96fe163 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=33
+EXTRA_VERSION=34
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 2031103..128764c 100644 (file)
@@ -253,7 +253,7 @@ static void export_filesel_cb(GtkWidget *widget, gpointer data)
                                                conv_get_locale_charset_str(),
                                                CS_UTF_8);
                if (!filename) {
-                       g_warning("export_filesel_cb(): faild to convert character set.");
+                       g_warning("export_filesel_cb(): failed to convert character set.");
                        filename = g_strdup(oldstr);
                }
                gtk_entry_set_text(GTK_ENTRY(file_entry), filename);
index 2e66423..72b4ad3 100644 (file)
@@ -256,7 +256,7 @@ static void import_filesel_cb(GtkWidget *widget, gpointer data)
 
        utf8_filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
        if (!utf8_filename) {
-               g_warning("import_filesel_cb(): faild to convert characer set.");
+               g_warning("import_filesel_cb(): failed to convert character set.");
                utf8_filename = g_strdup(filename);
        }
        gtk_entry_set_text(GTK_ENTRY(file_entry), utf8_filename);
index b929acf..f99a23a 100644 (file)
@@ -27,6 +27,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
+#include <gtk/filesel.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -59,6 +60,10 @@ static gboolean new_account;
 static PrefsAccount tmp_ac_prefs;
 
 static GtkWidget *notebook;
+static GtkWidget *sigfile_radiobtn;
+static GtkWidget *sigcmd_radiobtn;
+static GtkWidget *entry_sigpath;
+static GtkWidget *signature_browse_button;
 
 static GSList *prefs_pages = NULL;
 
@@ -573,6 +578,15 @@ static void prefs_account_advanced_create  (void);
 static void prefs_account_select_folder_cb     (GtkWidget      *widget,
                                                 gpointer        data);
 
+static void prefs_account_sigfile_radiobtn_cb  (GtkWidget      *widget,
+                                                gpointer        data);
+
+static void prefs_account_sigcmd_radiobtn_cb   (GtkWidget      *widget,
+                                                gpointer        data);
+
+static void prefs_account_signature_browse_cb  (GtkWidget      *widget,
+                                                gpointer        data);
+
 static void pop_bfr_smtp_tm_set_sens           (GtkWidget      *widget,
                                                 gpointer        data);
 
@@ -1769,12 +1783,9 @@ static void prefs_account_compose_create(void)
        GtkWidget *frame_sig;
        GtkWidget *vbox_sig;
        GtkWidget *label_sigpath;
-       GtkWidget *entry_sigpath;
        GtkWidget *checkbtn_autosig;
        GtkWidget *label_sigsep;
        GtkWidget *entry_sigsep;
-       GtkWidget *sigfile_radiobtn;
-       GtkWidget *sigcmd_radiobtn;
        GtkWidget *frame;
        GtkWidget *table;
        GtkWidget *autocc_chkbtn;
@@ -1823,6 +1834,8 @@ static void prefs_account_compose_create(void)
        g_object_set_data (G_OBJECT (sigfile_radiobtn),
                           MENU_VAL_ID,
                           GINT_TO_POINTER (SIG_FILE));
+       g_signal_connect(G_OBJECT(sigfile_radiobtn), "clicked",
+                        G_CALLBACK(prefs_account_sigfile_radiobtn_cb), NULL);
 
        sigcmd_radiobtn = gtk_radio_button_new_with_label_from_widget
                (GTK_RADIO_BUTTON(sigfile_radiobtn), _("Command output"));
@@ -1832,6 +1845,8 @@ static void prefs_account_compose_create(void)
        g_object_set_data (G_OBJECT (sigcmd_radiobtn),
                           MENU_VAL_ID,
                           GINT_TO_POINTER (SIG_COMMAND));
+       g_signal_connect(G_OBJECT(sigcmd_radiobtn), "clicked",
+                        G_CALLBACK(prefs_account_sigcmd_radiobtn_cb), NULL);
 
        hbox2 = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox2);
@@ -1844,6 +1859,18 @@ static void prefs_account_compose_create(void)
        gtk_widget_show (entry_sigpath);
        gtk_box_pack_start (GTK_BOX (hbox2), entry_sigpath, TRUE, TRUE, 0);
 
+#if GTK_CHECK_VERSION(2, 6, 0)
+       signature_browse_button = gtk_button_new_with_mnemonic(_("_Browse"));
+       gtk_button_set_image((GtkButton*)signature_browse_button,
+               gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON));
+#else
+       signature_browse_button = gtk_button_new_from_stock(GTK_STOCK_OPEN);
+#endif
+       gtk_widget_show (signature_browse_button);
+       gtk_box_pack_start (GTK_BOX (hbox2), signature_browse_button, FALSE, FALSE, 0);
+       g_signal_connect(G_OBJECT(signature_browse_button), "clicked",
+                        G_CALLBACK(prefs_account_signature_browse_cb), NULL);
+
        PACK_FRAME (vbox1, frame, _("Automatically set the following addresses"));
 
        table =  gtk_table_new (3, 2, FALSE);
@@ -2474,6 +2501,33 @@ static void prefs_account_select_folder_cb(GtkWidget *widget, gpointer data)
        }
 }
 
+static void prefs_account_sigfile_radiobtn_cb(GtkWidget *widget, gpointer data)
+{
+       gtk_widget_set_sensitive(GTK_WIDGET(signature_browse_button), TRUE);
+}
+
+static void prefs_account_sigcmd_radiobtn_cb(GtkWidget *widget, gpointer data)
+{
+       gtk_widget_set_sensitive(GTK_WIDGET(signature_browse_button), FALSE);
+}
+
+static void prefs_account_signature_browse_cb(GtkWidget *widget, gpointer data)
+{
+       gchar *filename;
+       gchar *utf8_filename;
+
+       filename = filesel_select_file_open(_("Select signature file"), NULL);
+       if (!filename) return;
+
+       utf8_filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
+       if (!utf8_filename) {
+               g_warning("prefs_account_signature_browse_cb(): failed to convert character set.");
+               utf8_filename = g_strdup(filename);
+       }
+       gtk_entry_set_text(GTK_ENTRY(entry_sigpath), utf8_filename);
+       g_free(utf8_filename);
+}
+
 static void prefs_account_edit_custom_header(void)
 {
        prefs_custom_header_open(&tmp_ac_prefs);