2006-06-18 [colin] 2.3.0cvs22
authorColin Leroy <colin@colino.net>
Sun, 18 Jun 2006 18:04:36 +0000 (18:04 +0000)
committerColin Leroy <colin@colino.net>
Sun, 18 Jun 2006 18:04:36 +0000 (18:04 +0000)
* src/prefs_customheader.c
Only allow correct filenames for various
custom headers

ChangeLog
PATCHSETS
configure.ac
src/prefs_customheader.c

index 95dd59b75889378c7cd9d84e3d5b0f8b33b90a7f..26c185df8003fdd8ad84b8e7de5db3a04e0c3af0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-18 [colin]     2.3.0cvs22
+
+       * src/prefs_customheader.c
+               Only allow correct filenames for various
+               custom headers
+
 2006-06-18 [colin]     2.3.0cvs21
 
        * src/prefs_customheader.c
index 3fd4ee77d38e2b6a175d084c539f38eabdee7a79..fe9d51068fbad60f2ecfb7d756f6995f15853260 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.220 -r 1.395.2.221 src/summaryview.c;  ) > 2.3.0cvs19.patchset
 ( cvs diff -u -r 1.79.2.35 -r 1.79.2.36 src/mh.c;  ) > 2.3.0cvs20.patchset
 ( cvs diff -u -r 1.16.2.19 -r 1.16.2.20 src/prefs_customheader.c;  ) > 2.3.0cvs21.patchset
+( cvs diff -u -r 1.16.2.20 -r 1.16.2.21 src/prefs_customheader.c;  ) > 2.3.0cvs22.patchset
index 4498526ce03bb7b058a4f8919b271812795d702c..d9ca5692758a3f312574d378d792f8e9ce1aec42 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=21
+EXTRA_VERSION=22
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 34a9e0865a383a8a906f63eae5774186a3f84a0c..5dbe090c8e4957d935ef1908d3cfaaec58069a50 100644 (file)
@@ -554,10 +554,17 @@ static void prefs_custom_header_list_view_set_row(PrefsAccount *ac)
 #define B64_BUFFSIZE           77
 static void prefs_custom_header_val_from_file_cb(void)
 {
-       gchar *filename = filesel_select_file_open(_("Choose file"), NULL);
+       gchar *filename = NULL;
        gchar *contents = NULL;
        const gchar *hdr = gtk_entry_get_text(GTK_ENTRY(customhdr.hdr_entry));
        
+       if (!strcmp(hdr, "Face"))
+               filename = filesel_select_file_open_with_filter(_("Choose file"), NULL, "*.png");
+       else if (!strcmp(hdr, "X-Face"))
+               filename = filesel_select_file_open_with_filter(_("Choose file"), NULL, "*.xbm");
+       else
+               filename = filesel_select_file_open_with_filter(_("Choose file"), NULL, "*.txt");
+
        if (!strcmp(hdr, "Face") || !strcmp(hdr, "X-Face")) {
                if (filename && is_file_exist(filename)) {
                        FILE *fp = NULL;
@@ -649,6 +656,9 @@ static void prefs_custom_header_val_from_file_cb(void)
                        fclose(fp);
                }
        } else {
+               if (!filename)
+                       return;
+
                contents = file_read_to_str(filename);
                if (strchr(contents, '\n') || strchr(contents,'\r')) {
                        alertpanel_error(_("This file contains newlines."));