sync with 0.9.12cvs18 HEAD
authorPaul Mangan <paul@claws-mail.org>
Mon, 12 Jul 2004 10:39:50 +0000 (10:39 +0000)
committerPaul Mangan <paul@claws-mail.org>
Mon, 12 Jul 2004 10:39:50 +0000 (10:39 +0000)
18 files changed:
ChangeLog.claws
configure.ac
po/POTFILES.in
src/Makefile.am
src/account.c
src/codeconv.c
src/common/intl.h
src/common/utils.c
src/common/utils.h
src/compose.c
src/gtk/quicksearch.c
src/gtk/quicksearch.h
src/inc.c
src/main.c
src/prefs_common.c
src/prefs_msg_colors.c
src/procmsg.h
src/toolbar.c

index 7966bd5a6f32ea735271aea630bed0314bf569cc..aff1017e7c5f9485ad8afa5b24d44a25598cd51a 100644 (file)
@@ -1,3 +1,148 @@
+2004-07-08 [colin]     0.9.12cvs18
+
+       * src/common/smtp.h
+               Fix guint vs gint bug
+
+2004-07-08 [colin]     0.9.12cvs17
+
+       * src/common/smtp.c
+               use to_human_readable() for sizes
+
+2004-07-08 [paul]      0.9.12cvs16
+
+       * src/inc.c [1.174]
+               fix occasional non-clearance of the statusbar
+               (close Bug 531 'SA plugin: status bar does not 
+                get cleared in OFFLINE mode')
+
+2004-07-07 [colin]     0.9.12cvs15
+
+       * src/prefs_common.c [1.225]
+       * src/prefs_common.h [1.112]
+               Add a hidden summary_quicksearch_sticky preference,
+               to allow the quicksearch bar to reset across folders
+       * src/summaryview.c [1.437]
+               Use this preference
+       * src/gtk/quicksearch.c [1.5]
+       * src/gtk/quicksearch.h [1.3]
+               Add this preference, fix focus when hitting Enter,
+               add handling of Esc key to reset
+
+2004-07-06 [colin]     0.9.12cvs14
+
+       * src/gtk/quicksearch.c [1.4]
+               Add Clear button
+
+2004-07-06 [christoph] 0.9.12cvs13
+
+       * src/toolbar.c
+               enable next unread button in empty folders if next folder
+               dialog is not disabled
+
+2004-07-06 [colin]     0.9.12cvs12
+
+       * src/common/smtp.c [1.16]
+               Display maximum message size in the log
+
+2004-07-06 [paul]      0.9.12cvs11
+
+       * src/toolbar.c
+               fix typo. (spotted by Fabien Vantard)
+
+2004-07-06 [paul]      0.9.12cvs10
+
+       * src/main.c
+               terminate cleanly on SIGHUP. Patch submitted by
+               Thomas Gilgin <thg@karate-muellheim.de>
+
+2004-07-05 [christoph] 0.9.12cvs9
+
+       * src/inc.c
+               better replacing of %d in new mail notification command
+
+2004-07-05 [colin]     0.9.12cvs8
+
+       * src/common/smtp.[ch]
+               Take SIZE (returned by EHLO) into account, and
+               avoid sending too big messages
+
+2004-07-04 [paul]      0.9.12cvs7
+
+       * src/account.c
+               fix auto-account selection on imap/news
+
+2004-07-01 [paul]      0.9.12cvs6
+
+       * src/gtk/quicksearch.c
+               reveal hidden string in gui
+               
+       * src/compose.c
+               fix updating of gpg signing setting on 
+               switching accounts
+
+2004-06-30 [darko]     0.9.12cvs5
+
+       * src/common/utils.c
+               remove expand_search_string()
+       * src/gtk/quicksearch.c
+               remove no longer needed for loop (thanks Christoph)
+               add expand_search_string()
+
+2004-06-30 [darko]     0.9.12cvs4
+
+       * src/common/utils.c
+               allow all filtering expressions in quicksearch
+
+       (Closes Bug 519 filtering expr. in quicksearch)
+
+2004-06-30 [christoph] 0.9.12cvs3
+
+       * configure.ac
+               better 'localedir'
+
+       * src/common/intl.h
+               allow plugins to define TEXTDOMAIN for the _(...) macro
+
+2004-06-30 [paul]      0.9.12cvs2
+
+       * po/POTFILES.in
+         src/Makefile.am
+         src/main.c
+         src/prefs_common.c
+         src/prefs_msg_colors.[ch]     ** NEW FILES **
+               move message colouring options to
+               '/Other Preferences/Message View/Colors'
+
+2004-06-30 [paul]      0.9.12cvs1
+
+       * po/POTFILES.in
+         src/Makefile.am
+         src/main.c
+         src/prefs_common.c
+         src/prefs_wrapping.[ch]       ** NEW FILES **
+               move message wrapping options to
+               /'Other Preferences/Compose/Message Wrapping'
+
+2004-06-28 [paul]      0.9.12
+
+       * Sylpheed-Claws 0.9.12 released
+
+       * po/es.po
+         po/fr.po
+         po/sk.po
+               updated by Ricardo Mones Lastra, Fabien Vantard,
+               Andrej Kacian
+
+2004-06-27 [paul]      0.9.11cvs19
+
+       * src/common/ssl.c
+               re-enable certificate check
+
+2004-06-25 [christoph] 0.9.11cvs18
+
+       * src/procmsg.h
+               add MSG_HAS_ATTACHMENT to MSG_CACHED_FLAG_MASK
+
 2004-06-25 [paul]      0.9.11cvs17
 
        * sync with main 0.9.12cvs1
                attachment, encryped and signed (with privacy API) part
                detection
 
+       (Closes Feature Request [ 961428 ] No paperclip for HTML mails)
+
 2004-06-22 [paul]
 
        * po/ru.po
index 7fdb13e8062c0b233e57965f306d7df2e45fb8e6..9e7ca58cc3f5af680b05769d7dc0b6f8c736abff 100644 (file)
@@ -8,17 +8,17 @@ PACKAGE=sylpheed-claws
 dnl version number
 MAJOR_VERSION=0
 MINOR_VERSION=9
-MICRO_VERSION=11
+MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=17
+EXTRA_VERSION=18
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.25
+EXTRA_GTK2_VERSION=.1
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
-    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}
+    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
 else
-    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}
+    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
 fi
 
 dnl set $target
index 01dfb508900ffa1f1480b618d4703b77b90e60c2..3142de95e747d7dc6a7f753e445a20a4b4057d55 100644 (file)
@@ -90,11 +90,13 @@ src/prefs_folder_item.c
 src/prefs_fonts.c
 src/prefs_gtk.c
 src/prefs_matcher.c
+src/prefs_msg_colors.c
 src/prefs_spelling.c
 src/prefs_summary_column.c
 src/prefs_template.c
 src/prefs_themes.c
 src/prefs_toolbar.c
+src/prefs_wrapping.c
 src/privacy.c
 src/procmsg.c
 src/quote_fmt.c
index cfad0b32542d45d6ad956e26e7fa83ff72c531dd..bd64f56ea2b12a968b2d573a0f51ffff36fd7e0b 100644 (file)
@@ -94,11 +94,13 @@ sylpheed_SOURCES = \
        prefs_fonts.c \
        prefs_gtk.c \
        prefs_matcher.c \
+       prefs_msg_colors.c \
        prefs_spelling.c \
        prefs_summary_column.c \
        prefs_template.c \
        prefs_themes.c \
        prefs_toolbar.c \
+       prefs_wrapping.c \
        privacy.c \
        procheader.c \
        procmime.c \
@@ -223,11 +225,13 @@ sylpheedinclude_HEADERS = \
        prefs_fonts.h \
        prefs_gtk.h \
        prefs_matcher.h \
+       prefs_msg_colors.h \
        prefs_spelling.h \
        prefs_summary_column.h \
        prefs_template.h \
        prefs_themes.h \
        prefs_toolbar.h \
+       prefs_wrapping.h \
        privacy.h \
        procheader.h \
        procmime.h \
index 101257accac31693760c0932282793ca3e3f7820..aa57b27c650c4d9cb9304eac536654c561fe5d4b 100644 (file)
@@ -1165,13 +1165,6 @@ PrefsAccount *account_get_reply_account(MsgInfo *msginfo, gboolean reply_autosel
        if (msginfo->folder->prefs && msginfo->folder->prefs->enable_default_account)
                account = account_find_from_id(msginfo->folder->prefs->default_account);
        
-       /* select the account for the whole folder (IMAP / NNTP) */
-       if (!account)
-               /* FIXME: this is not right, because folder may be nested. we should
-                * ascend the tree until we find a parent with proper account 
-                * information */
-               account = msginfo->folder->folder->account;
-
        /* select account by to: and cc: header if enabled */
        if (reply_autosel) {
                if (!account && msginfo->to) {
@@ -1189,6 +1182,13 @@ PrefsAccount *account_get_reply_account(MsgInfo *msginfo, gboolean reply_autosel
                }
        }
 
+       /* select the account for the whole folder (IMAP / NNTP) */
+       if (!account) 
+               /* FIXME: this is not right, because folder may be nested. we should
+                * ascend the tree until we find a parent with proper account 
+                * information */
+               account = msginfo->folder->folder->account;
+
        /* select current account */
        if (!account) account = cur_account;
        
index 36fbef862fd4b454d85746becef4610c6b5e059f..6c722f6109c74f6cd51f74e368b3065498dbcf69 100644 (file)
@@ -1472,8 +1472,8 @@ const gchar *conv_get_current_locale(void)
        if (!cur_locale) cur_locale = g_getenv("LANG");
        if (!cur_locale) cur_locale = setlocale(LC_CTYPE, NULL);
 
-       debug_print("current locale: %s\n",
-                   cur_locale ? cur_locale : "(none)");
+/*     debug_print("current locale: %s\n",
+                   cur_locale ? cur_locale : "(none)"); */
 
        return cur_locale;
 }
index 5ce3ad8200b8c4534f9e69b6a7250799a97ad577..7faa1d8c48702bf832e783c04d248c46fea245c0 100644 (file)
@@ -7,7 +7,11 @@
 
 #ifdef ENABLE_NLS
 #  include <libintl.h>
-#  define _(String) gettext(String)
+#  ifndef TEXTDOMAIN
+#    define _(String) gettext(String)
+#  else
+#    define _(String) dgettext(TEXTDOMAIN, String)
+#  endif /* TEXTDOMAIN */
 #  ifdef gettext_noop
 #    define N_(String) gettext_noop(String)
 #  else
index e969b635e32e7884ff3dea793c48017375230933..e0d614d31acc70a33617e7aae2b79ccd78b54d6a 100644 (file)
@@ -3466,191 +3466,6 @@ int subject_get_prefix_length(const gchar *subject)
                return 0;
 }
 
-/* allow Mutt-like patterns in quick search */
-gchar *expand_search_string(const gchar *search_string)
-{
-       int i = 0;
-       gchar term_char, save_char;
-       gchar *cmd_start, *cmd_end;
-       GString *matcherstr;
-       gchar *returnstr = NULL;
-       gchar *copy_str;
-       gboolean casesens, dontmatch;
-       /* list of allowed pattern abbreviations */
-       struct {
-               gchar           *abbreviated;   /* abbreviation */
-               gchar           *command;       /* actual matcher command */ 
-               gint            numparams;      /* number of params for cmd */
-               gboolean        qualifier;      /* do we append regexpcase */
-               gboolean        quotes;         /* do we need quotes */
-       }
-       cmds[] = {
-               { "a",  "all",                          0,      FALSE,  FALSE },
-               { "ag", "age_greater",                  1,      FALSE,  FALSE },
-               { "al", "age_lower",                    1,      FALSE,  FALSE },
-               { "b",  "body_part",                    1,      TRUE,   TRUE  },
-               { "B",  "message",                      1,      TRUE,   TRUE  },
-               { "c",  "cc",                           1,      TRUE,   TRUE  },
-               { "C",  "to_or_cc",                     1,      TRUE,   TRUE  },
-               { "D",  "deleted",                      0,      FALSE,  FALSE },
-               { "e",  "header \"Sender\"",            1,      TRUE,   TRUE  },
-               { "E",  "execute",                      1,      FALSE,  TRUE  },
-               { "f",  "from",                         1,      TRUE,   TRUE  },
-               { "F",  "forwarded",                    0,      FALSE,  FALSE },
-               { "h",  "headers_part",                 1,      TRUE,   TRUE  },
-               { "i",  "header \"Message-Id\"",        1,      TRUE,   TRUE  },
-               { "I",  "inreplyto",                    1,      TRUE,   TRUE  },
-               { "L",  "locked",                       0,      FALSE,  FALSE },
-               { "n",  "newsgroups",                   1,      TRUE,   TRUE  },
-               { "N",  "new",                          0,      FALSE,  FALSE },
-               { "O",  "~new",                         0,      FALSE,  FALSE },
-               { "r",  "replied",                      0,      FALSE,  FALSE },
-               { "R",  "~unread",                      0,      FALSE,  FALSE },
-               { "s",  "subject",                      1,      TRUE,   TRUE  },
-               { "se", "score_equal",                  1,      FALSE,  FALSE },
-               { "sg", "score_greater",                1,      FALSE,  FALSE },
-               { "sl", "score_lower",                  1,      FALSE,  FALSE },
-               { "Se", "size_equal",                   1,      FALSE,  FALSE },
-               { "Sg", "size_greater",                 1,      FALSE,  FALSE },
-               { "Ss", "size_smaller",                 1,      FALSE,  FALSE },
-               { "t",  "to",                           1,      TRUE,   TRUE  },
-               { "T",  "marked",                       0,      FALSE,  FALSE },
-               { "U",  "unread",                       0,      FALSE,  FALSE },
-               { "x",  "header \"References\"",        1,      TRUE,   TRUE  },
-               { "X",  "test",                         1,      FALSE,  FALSE }, 
-               { "y",  "header \"X-Label\"",           1,      TRUE,   TRUE  },
-               { "&",  "&",                            0,      FALSE,  FALSE },
-               { "|",  "|",                            0,      FALSE,  FALSE },
-               { NULL, NULL,                           0,      FALSE,  FALSE }
-       };
-
-       if (search_string == NULL)
-               return NULL;
-
-       copy_str = g_strdup(search_string);
-
-       /* if it's a full command don't process it so users
-          can still do something like from regexpcase "foo" */
-       for (i = 0; cmds[i].command; i++) {
-               const gchar *tmp_search_string = search_string;
-               cmd_start = cmds[i].command;
-               /* allow logical NOT */
-               if (*tmp_search_string == '~')
-                       tmp_search_string++;
-               if (!strncmp(tmp_search_string, cmd_start, strlen(cmd_start)))
-                       break;
-       }
-       if (cmds[i].command)
-               return copy_str;
-
-       matcherstr = g_string_sized_new(16);
-       cmd_start = copy_str;
-       while (cmd_start && *cmd_start) {
-               /* skip all white spaces */
-               while (*cmd_start && isspace((guchar)*cmd_start))
-                       cmd_start++;
-        cmd_end = cmd_start;
-
-               /* extract a command */
-               while (*cmd_end && !isspace((guchar)*cmd_end))
-                       cmd_end++;
-
-               /* save character */
-               save_char = *cmd_end;
-               *cmd_end = '\0';
-
-               dontmatch = FALSE;
-               casesens = FALSE;
-
-               /* ~ and ! mean logical NOT */
-               if (*cmd_start == '~' || *cmd_start == '!')
-               {
-                       dontmatch = TRUE;
-                       cmd_start++;
-               }
-               /* % means case sensitive match */
-               if (*cmd_start == '%')
-               {
-                       casesens = TRUE;
-                       cmd_start++;
-               }
-
-               /* find matching abbreviation */
-               for (i = 0; cmds[i].command; i++) {
-                       if (!strcmp(cmd_start, cmds[i].abbreviated)) {
-                               /* restore character */
-                               *cmd_end = save_char;
-
-                               /* copy command */
-                               if (matcherstr->len > 0) {
-                                       g_string_append(matcherstr, " ");
-                               }
-                               if (dontmatch)
-                                       g_string_append(matcherstr, "~");
-                               g_string_append(matcherstr, cmds[i].command);
-                               g_string_append(matcherstr, " ");
-
-                               /* stop if no params required */
-                               if (cmds[i].numparams == 0)
-                                       break;
-
-                               /* extract a parameter, allow quotes */
-                while (*cmd_end && isspace((guchar)*cmd_end))
-                             cmd_end++;
-                               cmd_start = cmd_end;
-                               if (*cmd_start == '"') {
-                                       term_char = '"';
-                                       cmd_end++;
-                               }
-                               else
-                                       term_char = ' ';
-
-                               /* extract actual parameter */
-                               while ((*cmd_end) && (*cmd_end != term_char))
-                                       cmd_end++;
-
-                               if (*cmd_end == '"')
-                                       cmd_end++;
-
-                               save_char = *cmd_end;
-                               *cmd_end = '\0';
-
-                               if (cmds[i].qualifier) {
-                                       if (casesens)
-                                               g_string_append(matcherstr, "regexp ");
-                                       else
-                                               g_string_append(matcherstr, "regexpcase ");
-                               }
-
-                               /* do we need to add quotes ? */
-                               if (cmds[i].quotes && term_char != '"')
-                                       g_string_append(matcherstr, "\"");
-
-                               /* copy actual parameter */
-                               g_string_append(matcherstr, cmd_start);
-
-                               /* do we need to add quotes ? */
-                               if (cmds[i].quotes && term_char != '"')
-                                       g_string_append(matcherstr, "\"");
-
-                               /* restore original character */
-                               *cmd_end = save_char;
-
-                               break;
-                       }
-               }
-
-               if (*cmd_end)
-                       cmd_end++;
-               cmd_start = cmd_end;
-       }
-
-       g_free(copy_str);
-       returnstr = matcherstr->str;
-       g_string_free(matcherstr, FALSE);
-       return returnstr;
-}
-
 guint g_stricase_hash(gconstpointer gptr)
 {
        guint hash_result = 0;
index 9c74c45aacfce2b9716aa04a91a7cec630255cb8..085e2c962041270411886d47ccdef9604ea72f29 100644 (file)
@@ -437,9 +437,6 @@ const gchar * line_has_quote_char   (const gchar *str,
 const gchar * line_has_quote_char_last (const gchar *str,
                                         const gchar *quote_chars);
 
-/* used in extended search */
-gchar * expand_search_string   (const gchar *str);
-
 guint g_stricase_hash  (gconstpointer gptr);
 gint g_stricase_equal  (gconstpointer gptr1, gconstpointer gptr2);
 gint g_int_compare     (gconstpointer a, gconstpointer b);
index f7b5302f30988c0ba488ec684324523545e12ebf..6ef9be64a31eb0f41c2ceaca5be3cb5228422b67 100644 (file)
@@ -3110,16 +3110,17 @@ static void compose_select_account(Compose *compose, PrefsAccount *account,
                                          COMPOSE_ENTRY_REPLY_TO);
        }
 
-       menuitem = gtk_item_factory_get_item(ifactory, "/View/Ruler");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
-                                      prefs_common.show_ruler);
 #endif
 
 #if USE_GPGME
        if (account->default_sign)
                menu_set_active(ifactory, "/Message/Sign", TRUE);
+       else
+               menu_set_active(ifactory, "/Message/Sign", FALSE);
        if (account->default_encrypt)
                menu_set_active(ifactory, "/Message/Encrypt", TRUE);
+       else
+               menu_set_active(ifactory, "/Message/Encrypt", FALSE);
                                       
        activate_gnupg_mode(compose, account);          
 #endif /* USE_GPGME */
index 0a47a23ec69ddc43d0fe6d88466fc0adb85dafb0..ee38717d2f36352c412fc41e8139241faa153b10 100644 (file)
@@ -107,13 +107,11 @@ static gboolean searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
                                  QuickSearch *quicksearch)
 {
        if (event != NULL && event->keyval == GDK_Escape) {
-               quicksearch_set(quicksearch, 
-                       prefs_common.summary_quicksearch_type, "");
-               gtk_widget_grab_focus(GTK_WIDGET(GTK_COMBO(
-                       quicksearch->search_string_entry)->entry));
+               quicksearch_set(quicksearch, prefs_common.summary_quicksearch_type, "");
+               gtk_widget_grab_focus(GTK_WIDGET(GTK_COMBO(quicksearch->search_string_entry)->entry));
                return TRUE;
        }
-       
+
        if (event != NULL && event->keyval == GDK_Return) {
                const gchar *search_string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(quicksearch->search_string_entry)->entry));
 
@@ -153,8 +151,10 @@ static gboolean searchtype_changed(GtkMenuItem *widget, gpointer data)
 
        prepare_matcher(quicksearch);
 
+       quicksearch_set_running(quicksearch, TRUE);
        if (quicksearch->callback != NULL)
                quicksearch->callback(quicksearch, quicksearch->callback_data);
+       quicksearch_set_running(quicksearch, FALSE);
 }
 
 /*
@@ -197,11 +197,13 @@ static gchar *search_descr_strings[] = {
        "x S",   N_("messages which contain S in References header"),
        "X cmd", N_("messages returning 0 when passed to command"),
        "y S",   N_("messages which contain S in X-Label header"),
-        "",     "" ,
+       "",      "" ,
        "&",     N_("logical AND operator"),
        "|",     N_("logical OR operator"),
        "! or ~",       N_("logical NOT operator"),
        "%",     N_("case sensitive search"),
+       "",      "" ,
+       " ",     N_("all filtering expressions are allowed"),
        NULL,    NULL 
 };
  
@@ -323,6 +325,10 @@ QuickSearch *quicksearch_new()
 
        gtk_box_pack_start(GTK_BOX(hbox_search), search_hbbox, FALSE, FALSE, 2);                                
        gtk_widget_show(search_hbbox);
+       if (prefs_common.summary_quicksearch_type == QUICK_SEARCH_EXTENDED)
+               gtk_widget_show(search_description);
+       else
+               gtk_widget_hide(search_description);
        
        g_signal_connect(G_OBJECT(GTK_COMBO(search_string_entry)->entry), 
                           "key_press_event",
@@ -384,10 +390,8 @@ void quicksearch_set(QuickSearch *quicksearch, QuickSearchType type,
 
        prepare_matcher(quicksearch);
 
-       quicksearch_set_running(quicksearch, TRUE);
        if (quicksearch->callback != NULL)
                quicksearch->callback(quicksearch, quicksearch->callback_data); 
-       quicksearch_set_running(quicksearch, FALSE);
 }
 
 gboolean quicksearch_is_active(QuickSearch *quicksearch)
@@ -436,6 +440,183 @@ gboolean quicksearch_match(QuickSearch *quicksearch, MsgInfo *msginfo)
        return FALSE;
 }
 
+/* allow Mutt-like patterns in quick search */
+gchar *expand_search_string(const gchar *search_string)
+{
+       int i = 0;
+       gchar term_char, save_char;
+       gchar *cmd_start, *cmd_end;
+       GString *matcherstr;
+       gchar *returnstr = NULL;
+       gchar *copy_str;
+       gboolean casesens, dontmatch;
+       /* list of allowed pattern abbreviations */
+       struct {
+               gchar           *abbreviated;   /* abbreviation */
+               gchar           *command;       /* actual matcher command */ 
+               gint            numparams;      /* number of params for cmd */
+               gboolean        qualifier;      /* do we append regexpcase */
+               gboolean        quotes;         /* do we need quotes */
+       }
+       cmds[] = {
+               { "a",  "all",                          0,      FALSE,  FALSE },
+               { "ag", "age_greater",                  1,      FALSE,  FALSE },
+               { "al", "age_lower",                    1,      FALSE,  FALSE },
+               { "b",  "body_part",                    1,      TRUE,   TRUE  },
+               { "B",  "message",                      1,      TRUE,   TRUE  },
+               { "c",  "cc",                           1,      TRUE,   TRUE  },
+               { "C",  "to_or_cc",                     1,      TRUE,   TRUE  },
+               { "D",  "deleted",                      0,      FALSE,  FALSE },
+               { "e",  "header \"Sender\"",            1,      TRUE,   TRUE  },
+               { "E",  "execute",                      1,      FALSE,  TRUE  },
+               { "f",  "from",                         1,      TRUE,   TRUE  },
+               { "F",  "forwarded",                    0,      FALSE,  FALSE },
+               { "h",  "headers_part",                 1,      TRUE,   TRUE  },
+               { "i",  "header \"Message-Id\"",        1,      TRUE,   TRUE  },
+               { "I",  "inreplyto",                    1,      TRUE,   TRUE  },
+               { "L",  "locked",                       0,      FALSE,  FALSE },
+               { "n",  "newsgroups",                   1,      TRUE,   TRUE  },
+               { "N",  "new",                          0,      FALSE,  FALSE },
+               { "O",  "~new",                         0,      FALSE,  FALSE },
+               { "r",  "replied",                      0,      FALSE,  FALSE },
+               { "R",  "~unread",                      0,      FALSE,  FALSE },
+               { "s",  "subject",                      1,      TRUE,   TRUE  },
+               { "se", "score_equal",                  1,      FALSE,  FALSE },
+               { "sg", "score_greater",                1,      FALSE,  FALSE },
+               { "sl", "score_lower",                  1,      FALSE,  FALSE },
+               { "Se", "size_equal",                   1,      FALSE,  FALSE },
+               { "Sg", "size_greater",                 1,      FALSE,  FALSE },
+               { "Ss", "size_smaller",                 1,      FALSE,  FALSE },
+               { "t",  "to",                           1,      TRUE,   TRUE  },
+               { "T",  "marked",                       0,      FALSE,  FALSE },
+               { "U",  "unread",                       0,      FALSE,  FALSE },
+               { "x",  "header \"References\"",        1,      TRUE,   TRUE  },
+               { "X",  "test",                         1,      FALSE,  FALSE }, 
+               { "y",  "header \"X-Label\"",           1,      TRUE,   TRUE  },
+               { "&",  "&",                            0,      FALSE,  FALSE },
+               { "|",  "|",                            0,      FALSE,  FALSE },
+               { NULL, NULL,                           0,      FALSE,  FALSE }
+       };
+
+       if (search_string == NULL)
+               return NULL;
+
+       copy_str = g_strdup(search_string);
+
+       matcherstr = g_string_sized_new(16);
+       cmd_start = copy_str;
+       while (cmd_start && *cmd_start) {
+               /* skip all white spaces */
+               while (*cmd_start && isspace((guchar)*cmd_start))
+                       cmd_start++;
+               cmd_end = cmd_start;
+
+               /* extract a command */
+               while (*cmd_end && !isspace((guchar)*cmd_end))
+                       cmd_end++;
+
+               /* save character */
+               save_char = *cmd_end;
+               *cmd_end = '\0';
+
+               dontmatch = FALSE;
+               casesens = FALSE;
+
+               /* ~ and ! mean logical NOT */
+               if (*cmd_start == '~' || *cmd_start == '!')
+               {
+                       dontmatch = TRUE;
+                       cmd_start++;
+               }
+               /* % means case sensitive match */
+               if (*cmd_start == '%')
+               {
+                       casesens = TRUE;
+                       cmd_start++;
+               }
+
+               /* find matching abbreviation */
+               for (i = 0; cmds[i].command; i++) {
+                       if (!strcmp(cmd_start, cmds[i].abbreviated)) {
+                               /* restore character */
+                               *cmd_end = save_char;
+
+                               /* copy command */
+                               if (matcherstr->len > 0) {
+                                       g_string_append(matcherstr, " ");
+                               }
+                               if (dontmatch)
+                                       g_string_append(matcherstr, "~");
+                               g_string_append(matcherstr, cmds[i].command);
+                               g_string_append(matcherstr, " ");
+
+                               /* stop if no params required */
+                               if (cmds[i].numparams == 0)
+                                       break;
+
+                               /* extract a parameter, allow quotes */
+                               while (*cmd_end && isspace((guchar)*cmd_end))
+                                       cmd_end++;
+
+                               cmd_start = cmd_end;
+                               if (*cmd_start == '"') {
+                                       term_char = '"';
+                                       cmd_end++;
+                               }
+                               else
+                                       term_char = ' ';
+
+                               /* extract actual parameter */
+                               while ((*cmd_end) && (*cmd_end != term_char))
+                                       cmd_end++;
+
+                               if (*cmd_end == '"')
+                                       cmd_end++;
+
+                               save_char = *cmd_end;
+                               *cmd_end = '\0';
+
+                               if (cmds[i].qualifier) {
+                                       if (casesens)
+                                               g_string_append(matcherstr, "regexp ");
+                                       else
+                                               g_string_append(matcherstr, "regexpcase ");
+                               }
+
+                               /* do we need to add quotes ? */
+                               if (cmds[i].quotes && term_char != '"')
+                                       g_string_append(matcherstr, "\"");
+
+                               /* copy actual parameter */
+                               g_string_append(matcherstr, cmd_start);
+
+                               /* do we need to add quotes ? */
+                               if (cmds[i].quotes && term_char != '"')
+                                       g_string_append(matcherstr, "\"");
+
+                               /* restore original character */
+                               *cmd_end = save_char;
+
+                               break;
+                       }
+               }
+
+               if (*cmd_end)
+                       cmd_end++;
+               cmd_start = cmd_end;
+       }
+
+       g_free(copy_str);
+
+       /* return search string if no match is found to allow 
+          all available filtering expressions in quicksearch */
+       if (matcherstr->len > 0) returnstr = matcherstr->str;
+       else returnstr = g_strdup(search_string);
+
+       g_string_free(matcherstr, FALSE);
+       return returnstr;
+}
+
 static void quicksearch_set_running(QuickSearch *quicksearch, gboolean run)
 {
        quicksearch->running = run;
@@ -445,3 +626,4 @@ gboolean quicksearch_is_running(QuickSearch *quicksearch)
 {
        return quicksearch->running;
 }
+
index b5ed8ea4dc0cd3402007b3add6f0b9cf6b897c13..0458b5160657b4f040997de1528107e23d9791ad 100644 (file)
@@ -43,5 +43,7 @@ void quicksearch_set_execute_callback(QuickSearch *quicksearch,
                                      QuickSearchExecuteCallback callback,
                                      gpointer data);
 gboolean quicksearch_match(QuickSearch *quicksearch, MsgInfo *msginfo);
+gchar *expand_search_string(const gchar *str);
 gboolean quicksearch_is_running(QuickSearch *quicksearch);
+
 #endif /* QUICKSEARCH_H */
index 9387e86262796c8b290819ada0d757f5648b95dd..5f32f9e4088a621dfb3de3fdf6c92d8115218ca5 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -642,6 +642,8 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                }
                g_slist_free(msglist);
 
+               statusbar_pop_all();
+
                new_msgs += pop3_session->cur_total_num;
 
                if (pop3_session->error_val == PS_AUTHFAIL &&
@@ -1315,18 +1317,22 @@ static gpointer autocheck_data = NULL;
 static void inc_notify_cmd(gint new_msgs, gboolean notify)
 {
 
-       gchar *buf;
+       gchar *buf, *numpos;
 
        if (!(new_msgs && notify && prefs_common.newmail_notify_cmd &&
            *prefs_common.newmail_notify_cmd))
                     return;
-       if ((buf = strchr(prefs_common.newmail_notify_cmd, '%')) &&
-               buf[1] == 'd' && !strchr(&buf[1], '%'))
-               buf = g_strdup_printf(prefs_common.newmail_notify_cmd, 
-                                     new_msgs);
-       else
-               buf = g_strdup(prefs_common.newmail_notify_cmd);
+       buf = g_strdup(prefs_common.newmail_notify_cmd);
+       if ((numpos = strstr(buf, "%d")) != NULL) {
+               gchar *buf2;
+
+               *numpos = '\0';
+               buf2 = g_strdup_printf("%s%d%s", buf, new_msgs, numpos + 2);
+               g_free(buf);
+               buf = buf2;
+       }
 
+       debug_print("executing new mail notification command: %s\n", buf);
        execute_command_line(buf, TRUE);
 
        g_free(buf);
index 3cdb0ed56358728721ec1f3e77cd6fc31f03ca72..15395538ddd5bde251285fe41c1e0b5e6372e70f 100644 (file)
 #include "prefs_actions.h"
 #include "prefs_ext_prog.h"
 #include "prefs_fonts.h"
+#include "prefs_msg_colors.h"
 #include "prefs_spelling.h"
 #include "prefs_themes.h"
+#include "prefs_wrapping.h"
 #include "prefs_display_header.h"
 #include "account.h"
 #include "procmsg.h"
@@ -263,6 +265,8 @@ int main(int argc, char *argv[])
        prefs_themes_init();
        prefs_fonts_init();
        prefs_ext_prog_init();
+       prefs_wrapping_init();
+       prefs_msg_colors_init();
 #ifdef USE_ASPELL
        gtkaspell_checkers_init();
        prefs_spelling_init();
@@ -440,6 +444,8 @@ static void exit_sylpheed(MainWindow *mainwin)
        prefs_themes_done();
        prefs_fonts_done();
        prefs_ext_prog_done();
+       prefs_wrapping_done();
+       prefs_msg_colors_done();
 #ifdef USE_ASPELL       
        prefs_spelling_done();
        gtkaspell_checkers_quit();
@@ -932,6 +938,9 @@ static void install_basic_sighandlers()
 #ifdef SIGINT
        sigaddset(&mask, SIGINT);
 #endif
+#ifdef SIGHUP
+       sigaddset(&mask, SIGHUP);
+#endif
 
        act.sa_handler = quit_signal_handler;
        act.sa_mask    = mask;
@@ -943,6 +952,9 @@ static void install_basic_sighandlers()
 #ifdef SIGINT
        sigaction(SIGINT, &act, 0);
 #endif 
+#ifdef SIGHUP
+       sigaction(SIGHUP, &act, 0);
+#endif 
 
        sigprocmask(SIG_UNBLOCK, &mask, 0);
 }
index a6f2c397c84d45abe4478235e11dfcdb4184b883..6f35975f99dde8be8b116c48f0634cd5392ed25d 100644 (file)
@@ -98,11 +98,6 @@ static struct Compose {
        GtkWidget *checkbtn_autoextedit;
        GtkWidget *spinbtn_undolevel;
        GtkObject *spinbtn_undolevel_adj;
-       GtkWidget *spinbtn_linewrap;
-       GtkObject *spinbtn_linewrap_adj;
-       GtkWidget *checkbtn_wrapquote;
-       GtkWidget *checkbtn_autowrap;
-       GtkWidget *checkbtn_wrapatsend;
 
        GtkWidget *checkbtn_reply_account_autosel;
        GtkWidget *checkbtn_forward_account_autosel;
@@ -111,7 +106,6 @@ static struct Compose {
        GtkWidget *checkbtn_default_reply_list;
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_redirect_keep_from;
-       GtkWidget *checkbtn_smart_wrapping;
        GtkWidget *checkbtn_reply_with_quote;
        
        GtkWidget *checkbtn_autosave;
@@ -143,8 +137,6 @@ static struct Display {
 } display;
 
 static struct Message {
-       GtkWidget *chkbtn_enablecol;
-       GtkWidget *button_edit_col;
        GtkWidget *chkbtn_mbalnum;
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
@@ -199,23 +191,11 @@ static struct Other {
        GtkObject *spinbtn_iotimeout_adj;
 } other;
 
-static struct MessageColorButtons {
-       GtkWidget *quote_level1_btn;
-       GtkWidget *quote_level2_btn;
-       GtkWidget *quote_level3_btn;
-       GtkWidget *uri_btn;
-       GtkWidget *tgt_folder_btn;
-       GtkWidget *signature_btn;
-} color_buttons;
-
 static struct KeybindDialog {
        GtkWidget *window;
        GtkWidget *combo;
 } keybind;
 
-static GtkWidget *quote_color_win;
-static GtkWidget *color_dialog;
-
 static void prefs_common_charset_set_data_from_optmenu    (PrefParam *pparam);
 static void prefs_common_charset_set_optmenu              (PrefParam *pparam);
 static void prefs_common_encoding_set_data_from_optmenu    (PrefParam *pparam);
@@ -316,21 +296,15 @@ static PrefParam param[] = {
         prefs_set_data_from_spinbtn, prefs_set_spinbtn},
 
        {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
-        &compose.spinbtn_linewrap,
-        prefs_set_data_from_spinbtn, prefs_set_spinbtn},
+        NULL, NULL, NULL},
        {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
-        &compose.checkbtn_wrapquote,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
        {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL,
-        &compose.checkbtn_autowrap,
-        prefs_set_data_from_toggle, prefs_set_toggle},
-       {"linewrap_before_sending", "FALSE",
-        &prefs_common.linewrap_at_send, P_BOOL,
-        &compose.checkbtn_wrapatsend,
-        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},
+        NULL, NULL, NULL},
+       {"linewrap_before_sending", "FALSE", &prefs_common.linewrap_at_send, P_BOOL, 
+        NULL, NULL, NULL},
+        {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping, P_BOOL, 
+        NULL, NULL, NULL},
         {"autosave", "FALSE", &prefs_common.autosave,
         P_BOOL, &compose.checkbtn_autosave,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -602,8 +576,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        /* Message */
        {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
-        &message.chkbtn_enablecol,
-        prefs_set_data_from_toggle, prefs_set_toggle},
+        NULL, NULL, NULL},
 
        {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_COLOR,
         NULL, NULL, NULL},
@@ -821,25 +794,6 @@ static void date_format_select_row         (GtkWidget      *date_format_list,
 static GtkWidget *date_format_create            (GtkButton      *button,
                                                  void           *data);
 
-static void prefs_quote_colors_dialog          (void);
-static void prefs_quote_colors_dialog_create   (void);
-static gboolean prefs_quote_colors_key_pressed (GtkWidget      *widget,
-                                                GdkEventKey    *event,
-                                                gpointer        data);
-static void quote_color_set_dialog             (GtkWidget      *widget,
-                                                gpointer        data);
-static void quote_colors_set_dialog_ok         (GtkWidget      *widget,
-                                                gpointer        data);
-static void quote_colors_set_dialog_cancel     (GtkWidget      *widget,
-                                                gpointer        data);
-static gboolean quote_colors_set_dialog_key_pressed    (GtkWidget      *widget,
-                                                        GdkEventKey    *event,
-                                                        gpointer        data);
-static void set_button_bg_color                        (GtkWidget      *widget,
-                                                gint            color);
-static void prefs_enable_message_color_toggled (void);
-static void prefs_recycle_colors_toggled       (GtkWidget      *widget);
-
 static void prefs_keybind_select               (void);
 static gint prefs_keybind_deleted              (GtkWidget      *widget,
                                                 GdkEventAny    *event,
@@ -1399,24 +1353,12 @@ static void prefs_compose_create(void)
        GtkObject *spinbtn_undolevel_adj;
        GtkWidget *spinbtn_undolevel;
 
-       GtkWidget *vbox_linewrap;
-
-       GtkWidget *hbox3;
-       GtkWidget *hbox4;
        GtkWidget *hbox5;
-       GtkWidget *label_linewrap;
-       GtkObject *spinbtn_linewrap_adj;
-       GtkWidget *spinbtn_linewrap;
-       GtkWidget *checkbtn_wrapquote;
-       GtkWidget *checkbtn_autowrap;
-       GtkWidget *checkbtn_wrapatsend;
 
        GtkWidget *checkbtn_default_reply_list;
 
        GtkWidget *checkbtn_forward_as_attachment;
        GtkWidget *checkbtn_redirect_keep_from;
-       GtkWidget *checkbtn_smart_wrapping;
-       GtkWidget *frame_msgwrap;
 
        GtkWidget *hbox_autosave;
        GtkWidget *checkbtn_autosave;
@@ -1496,49 +1438,6 @@ static void prefs_compose_create(void)
        gtk_widget_set_size_request (spinbtn_undolevel, 64, -1);
        gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
 
-        /* line-wrapping */
-       PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
-
-       vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
-       gtk_widget_show (vbox_linewrap);
-       gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
-
-       hbox3 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox3);
-       gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
-
-
-       label_linewrap = gtk_label_new (_("Wrap messages at"));
-       gtk_widget_show (label_linewrap);
-       gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
-
-       spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
-       spinbtn_linewrap = gtk_spin_button_new
-               (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
-       gtk_widget_show (spinbtn_linewrap);
-       gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
-       gtk_widget_set_size_request (spinbtn_linewrap, 64, -1);
-       gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
-
-       label_linewrap = gtk_label_new (_("characters"));
-       gtk_widget_show (label_linewrap);
-       gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
-
-       hbox4 = gtk_hbox_new (FALSE, VSPACING);
-       gtk_widget_show (hbox4);
-       gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
-
-       PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
-
-       PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
-
-       PACK_CHECK_BUTTON
-               (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
-
-       PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
-                          _("Smart wrapping (EXPERIMENTAL)"));
-       
        /*
        compose.checkbtn_quote   = checkbtn_quote;
        compose.entry_quotemark  = entry_quotemark;
@@ -1554,12 +1453,6 @@ static void prefs_compose_create(void)
        compose.spinbtn_undolevel     = spinbtn_undolevel;
        compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
 
-       compose.spinbtn_linewrap      = spinbtn_linewrap;
-       compose.spinbtn_linewrap_adj  = spinbtn_linewrap_adj;
-       compose.checkbtn_wrapquote    = checkbtn_wrapquote;
-       compose.checkbtn_autowrap     = checkbtn_autowrap;
-       compose.checkbtn_wrapatsend   = checkbtn_wrapatsend;
-
        compose.checkbtn_autosave     = checkbtn_autosave;
        compose.entry_autosave_length = entry_autosave_length;
        
@@ -1567,8 +1460,6 @@ static void prefs_compose_create(void)
                checkbtn_forward_as_attachment;
        compose.checkbtn_redirect_keep_from =
                checkbtn_redirect_keep_from;
-       compose.checkbtn_smart_wrapping = 
-               checkbtn_smart_wrapping;
        compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
 }
 
@@ -1861,8 +1752,6 @@ static void prefs_message_create(void)
        GtkWidget *vbox2;
        GtkWidget *vbox3;
        GtkWidget *hbox1;
-       GtkWidget *chkbtn_enablecol;
-       GtkWidget *button_edit_col;
        GtkWidget *chkbtn_mbalnum;
        GtkWidget *chkbtn_disphdrpane;
        GtkWidget *chkbtn_disphdr;
@@ -1893,24 +1782,6 @@ static void prefs_message_create(void)
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
-       hbox1 = gtk_hbox_new (FALSE, 8);
-       gtk_widget_show (hbox1);
-       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
-
-       PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
-                          _("Enable coloration of message"));
-       g_signal_connect(G_OBJECT(chkbtn_enablecol), "toggled",
-                        G_CALLBACK(prefs_enable_message_color_toggled),
-                        NULL);
-
-       button_edit_col = gtk_button_new_with_label (_(" Edit... "));
-       gtk_widget_show (button_edit_col);
-       gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
-       g_signal_connect (G_OBJECT (button_edit_col), "clicked",
-                         G_CALLBACK(prefs_quote_colors_dialog), NULL);
-
-       SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
-
        PACK_CHECK_BUTTON
                (vbox2, chkbtn_mbalnum,
                 _("Display multi-byte alphanumeric as\n"
@@ -2015,9 +1886,6 @@ static void prefs_message_create(void)
        PACK_CHECK_BUTTON(vbox3, chkbtn_attach_desc,
                          _("Show attachment descriptions (rather than names)"));
 
-
-       message.chkbtn_enablecol   = chkbtn_enablecol;
-       message.button_edit_col    = button_edit_col;
        message.chkbtn_mbalnum     = chkbtn_mbalnum;
        message.chkbtn_disphdrpane = chkbtn_disphdrpane;
        message.chkbtn_disphdr     = chkbtn_disphdr;
@@ -2713,336 +2581,6 @@ static GtkWidget *date_format_create(GtkButton *button, void *data)
        return datefmt_win;
 }
 
-void prefs_quote_colors_dialog(void)
-{
-       if (!quote_color_win)
-               prefs_quote_colors_dialog_create();
-       gtk_widget_show(quote_color_win);
-       manage_window_set_transient(GTK_WINDOW(quote_color_win));
-
-       gtk_main();
-       gtk_widget_hide(quote_color_win);
-
-       textview_update_message_colors();
-       main_window_reflect_prefs_all();
-}
-
-static void prefs_quote_colors_dialog_create(void)
-{
-       GtkWidget *window;
-       GtkWidget *vbox;
-       GtkWidget *table;
-       GtkWidget *quotelevel1_label;
-       GtkWidget *quotelevel2_label;
-       GtkWidget *quotelevel3_label;
-       GtkWidget *uri_label;
-       GtkWidget *signature_label;
-       GtkWidget *tgt_folder_label;
-       GtkWidget *hbbox;
-       GtkWidget *ok_btn;
-       GtkWidget *recycle_colors_btn;
-       GtkWidget *frame_colors;
-
-       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-       gtk_container_set_border_width(GTK_CONTAINER(window), 2);
-       gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
-       gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW(window), TRUE);
-       gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
-
-       vbox = gtk_vbox_new (FALSE, VSPACING);
-       gtk_container_add (GTK_CONTAINER (window), vbox);
-       gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
-       PACK_FRAME(vbox, frame_colors, _("Colors"));
-
-       table = gtk_table_new (5, 2, FALSE);
-       gtk_container_add (GTK_CONTAINER (frame_colors), table);
-       gtk_container_set_border_width (GTK_CONTAINER (table), 8);
-       gtk_table_set_row_spacings (GTK_TABLE (table), 2);
-       gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
-
-       color_buttons.quote_level1_btn = gtk_button_new();
-       gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
-                         0, 1, 0, 1, 0, 0, 0, 0);
-       gtk_widget_set_size_request (color_buttons.quote_level1_btn, 40, 30);
-       gtk_container_set_border_width
-               (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
-
-       color_buttons.quote_level2_btn = gtk_button_new();
-       gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
-                         0, 1, 1, 2, 0, 0, 0, 0);
-       gtk_widget_set_size_request (color_buttons.quote_level2_btn, 40, 30);
-       gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
-
-       color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
-       gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
-                         0, 1, 2, 3, 0, 0, 0, 0);
-       gtk_widget_set_size_request (color_buttons.quote_level3_btn, 40, 30);
-       gtk_container_set_border_width
-               (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
-
-       color_buttons.uri_btn = gtk_button_new_with_label ("");
-       gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
-                         0, 1, 3, 4, 0, 0, 0, 0);
-       gtk_widget_set_size_request (color_buttons.uri_btn, 40, 30);
-       gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
-
-       color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
-       gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
-                         0, 1, 4, 5, 0, 0, 0, 0);
-       gtk_widget_set_size_request (color_buttons.tgt_folder_btn, 40, 30);
-       gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
-
-       color_buttons.signature_btn = gtk_button_new_with_label ("");
-       gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
-                         0, 1, 5, 6, 0, 0, 0, 0);
-       gtk_widget_set_size_request (color_buttons.signature_btn, 40, 30);
-       gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
-
-       quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
-       gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-       gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
-       gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
-
-       quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
-       gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-       gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
-       gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
-
-       quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
-       gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-       gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
-       gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
-
-       uri_label = gtk_label_new (_("URI link"));
-       gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-       gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
-       gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
-
-       tgt_folder_label = gtk_label_new (_("Target folder"));
-       gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-       gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
-       gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
-
-       signature_label = gtk_label_new (_("Signatures"));
-       gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
-                         (GTK_EXPAND | GTK_FILL), 0, 0, 0);
-       gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
-       gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
-
-       PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
-                          _("Recycle quote colors"));
-
-       gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
-                               NULL, NULL, NULL, NULL);
-       gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
-
-       gtk_widget_grab_default(ok_btn);
-       MANAGE_WINDOW_SIGNALS_CONNECT(window);
-       g_signal_connect(G_OBJECT(window), "delete_event",
-                        G_CALLBACK(gtk_main_quit), NULL);
-       g_signal_connect(G_OBJECT(window), "key_press_event",
-                        G_CALLBACK(prefs_quote_colors_key_pressed),
-                        NULL);
-
-       g_signal_connect(G_OBJECT(color_buttons.quote_level1_btn), "clicked",
-                        G_CALLBACK(quote_color_set_dialog), "LEVEL1");
-       g_signal_connect(G_OBJECT(color_buttons.quote_level2_btn), "clicked",
-                        G_CALLBACK(quote_color_set_dialog), "LEVEL2");
-       g_signal_connect(G_OBJECT(color_buttons.quote_level3_btn), "clicked",
-                        G_CALLBACK(quote_color_set_dialog), "LEVEL3");
-       g_signal_connect(G_OBJECT(color_buttons.uri_btn), "clicked",
-                        G_CALLBACK(quote_color_set_dialog), "URI");
-       g_signal_connect(G_OBJECT(color_buttons.tgt_folder_btn), "clicked",
-                        G_CALLBACK(quote_color_set_dialog), "TGTFLD");
-       g_signal_connect(G_OBJECT(color_buttons.signature_btn), "clicked",
-                        G_CALLBACK(quote_color_set_dialog), "SIGNATURE");
-       g_signal_connect(G_OBJECT(recycle_colors_btn), "toggled",
-                        G_CALLBACK(prefs_recycle_colors_toggled), NULL);
-       g_signal_connect(G_OBJECT(ok_btn), "clicked",
-                        G_CALLBACK(gtk_main_quit), NULL);
-
-       /* show message button colors and recycle options */
-       set_button_bg_color(color_buttons.quote_level1_btn,
-                           prefs_common.quote_level1_col);
-       set_button_bg_color(color_buttons.quote_level2_btn,
-                           prefs_common.quote_level2_col);
-       set_button_bg_color(color_buttons.quote_level3_btn,
-                           prefs_common.quote_level3_col);
-       set_button_bg_color(color_buttons.uri_btn,
-                           prefs_common.uri_col);
-       set_button_bg_color(color_buttons.tgt_folder_btn,
-                           prefs_common.tgt_folder_col);
-       set_button_bg_color(color_buttons.signature_btn,
-                           prefs_common.signature_col);
-       gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
-                                    prefs_common.recycle_quote_colors);
-
-       gtk_widget_show_all(vbox);
-       quote_color_win = window;
-}
-
-static gboolean prefs_quote_colors_key_pressed(GtkWidget *widget,
-                                              GdkEventKey *event, gpointer data)
-{
-       if (event && event->keyval == GDK_Escape)
-               gtk_main_quit();
-       return FALSE;
-}
-
-static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
-{
-       gchar *type = (gchar *)data;
-       gchar *title = NULL;
-       gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
-       gint rgbvalue = 0;
-       GtkColorSelectionDialog *dialog;
-
-       if(g_strcasecmp(type, "LEVEL1") == 0) {
-               title = _("Pick color for quotation level 1");
-               rgbvalue = prefs_common.quote_level1_col;
-       } else if(g_strcasecmp(type, "LEVEL2") == 0) {
-               title = _("Pick color for quotation level 2");
-               rgbvalue = prefs_common.quote_level2_col;
-       } else if(g_strcasecmp(type, "LEVEL3") == 0) {
-               title = _("Pick color for quotation level 3");
-               rgbvalue = prefs_common.quote_level3_col;
-       } else if(g_strcasecmp(type, "URI") == 0) {
-               title = _("Pick color for URI");
-               rgbvalue = prefs_common.uri_col;
-       } else if(g_strcasecmp(type, "TGTFLD") == 0) {
-               title = _("Pick color for target folder");
-               rgbvalue = prefs_common.tgt_folder_col;
-       } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
-               title = _("Pick color for signatures");
-               rgbvalue = prefs_common.signature_col;
-       } else {   /* Should never be called */
-               g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
-               return;
-       }
-
-       color_dialog = gtk_color_selection_dialog_new(title);
-       gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
-       gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
-       manage_window_set_transient(GTK_WINDOW(color_dialog));
-
-       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
-                        "clicked", G_CALLBACK(quote_colors_set_dialog_ok), data);
-       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
-                        "clicked", G_CALLBACK(quote_colors_set_dialog_cancel), data);
-       g_signal_connect(G_OBJECT(color_dialog), "key_press_event",
-                        G_CALLBACK(quote_colors_set_dialog_key_pressed),
-                        data);
-
-       /* preselect the previous color in the color selection dialog */
-       color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
-       color[1] = (gdouble) ((rgbvalue & 0x00ff00) >>  8) / 255.0;
-       color[2] = (gdouble)  (rgbvalue & 0x0000ff)        / 255.0;
-       dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
-       gtk_color_selection_set_color
-               (GTK_COLOR_SELECTION(dialog->colorsel), color);
-
-       gtk_widget_show(color_dialog);
-}
-
-static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
-{
-       GtkColorSelection *colorsel = (GtkColorSelection *)
-                                               ((GtkColorSelectionDialog *)color_dialog)->colorsel;
-       gdouble color[4];
-       gint red, green, blue, rgbvalue;
-       gchar *type = (gchar *)data;
-
-       gtk_color_selection_get_color(colorsel, color);
-
-       red      = (gint) (color[0] * 255.0);
-       green    = (gint) (color[1] * 255.0);
-       blue     = (gint) (color[2] * 255.0);
-       rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
-
-#if 0
-       fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
-       fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
-       fprintf(stderr, "Color is %x\n", rgbvalue);
-#endif
-
-       if (g_strcasecmp(type, "LEVEL1") == 0) {
-               prefs_common.quote_level1_col = rgbvalue;
-               set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
-       } else if (g_strcasecmp(type, "LEVEL2") == 0) {
-               prefs_common.quote_level2_col = rgbvalue;
-               set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
-       } else if (g_strcasecmp(type, "LEVEL3") == 0) {
-               prefs_common.quote_level3_col = rgbvalue;
-               set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
-       } else if (g_strcasecmp(type, "URI") == 0) {
-               prefs_common.uri_col = rgbvalue;
-               set_button_bg_color(color_buttons.uri_btn, rgbvalue);
-       } else if (g_strcasecmp(type, "TGTFLD") == 0) {
-               prefs_common.tgt_folder_col = rgbvalue;
-               set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
-               folderview_set_target_folder_color(prefs_common.tgt_folder_col);
-       } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
-               prefs_common.signature_col = rgbvalue;
-               set_button_bg_color(color_buttons.signature_btn, rgbvalue);
-       } else
-               fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
-
-       gtk_widget_destroy(color_dialog);
-}
-
-static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
-{
-       gtk_widget_destroy(color_dialog);
-}
-
-static gboolean quote_colors_set_dialog_key_pressed(GtkWidget *widget,
-                                                   GdkEventKey *event,
-                                                   gpointer data)
-{
-       gtk_widget_destroy(color_dialog);
-       return FALSE;
-}
-
-static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
-{
-       GtkStyle *newstyle;
-       GdkColor color;
-
-       gtkut_convert_int_to_gdk_color(rgbvalue, &color);
-       newstyle = gtk_style_copy(gtk_widget_get_default_style());
-       newstyle->bg[GTK_STATE_NORMAL]   = color;
-       newstyle->bg[GTK_STATE_PRELIGHT] = color;
-       newstyle->bg[GTK_STATE_ACTIVE]   = color;
-
-       gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
-}
-
-static void prefs_enable_message_color_toggled(void)
-{
-       gboolean is_active;
-
-       is_active = gtk_toggle_button_get_active
-               (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
-       gtk_widget_set_sensitive(message.button_edit_col, is_active);
-       prefs_common.enable_color = is_active;
-}
-
-static void prefs_recycle_colors_toggled(GtkWidget *widget)
-{
-       gboolean is_active;
-
-       is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-       prefs_common.recycle_quote_colors = is_active;
-}
-
 static void prefs_keybind_select(void)
 {
        GtkWidget *window;
index 24fa9996f4dc030bf4ce4fa51d65eeb90d82f267..88f4c6464333a91066f79b20f9be78fb0cf95ce2 100644 (file)
@@ -108,7 +108,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
        color_buttons.quote_level1_btn = gtk_button_new();
-       gtk_widget_set_usize (color_buttons.quote_level1_btn, 30, 20);
+       gtk_widget_set_size_request (color_buttons.quote_level1_btn, 30, 20);
        gtk_box_pack_start (GTK_BOX(hbox), color_buttons.quote_level1_btn, 
                            FALSE, FALSE, 0);
 
@@ -121,7 +121,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
        color_buttons.quote_level2_btn = gtk_button_new();
-       gtk_widget_set_usize (color_buttons.quote_level2_btn, 30, 20);
+       gtk_widget_set_size_request (color_buttons.quote_level2_btn, 30, 20);
        gtk_box_pack_start (GTK_BOX(hbox), color_buttons.quote_level2_btn, 
                            FALSE, FALSE, 0);
 
@@ -134,7 +134,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
        color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
-       gtk_widget_set_usize (color_buttons.quote_level3_btn, 30, 20);
+       gtk_widget_set_size_request (color_buttons.quote_level3_btn, 30, 20);
        gtk_box_pack_start (GTK_BOX(hbox), color_buttons.quote_level3_btn, 
                            FALSE, FALSE, 0);
 
@@ -147,7 +147,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
        color_buttons.uri_btn = gtk_button_new_with_label ("");
-       gtk_widget_set_usize (color_buttons.uri_btn, 30, 20);
+       gtk_widget_set_size_request (color_buttons.uri_btn, 30, 20);
        gtk_box_pack_start (GTK_BOX(hbox), color_buttons.uri_btn, 
                            FALSE, FALSE, 0);
 
@@ -159,7 +159,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
        color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
-       gtk_widget_set_usize (color_buttons.tgt_folder_btn, 30, 20);
+       gtk_widget_set_size_request (color_buttons.tgt_folder_btn, 30, 20);
        gtk_box_pack_start (GTK_BOX(hbox), color_buttons.tgt_folder_btn, 
                            FALSE, FALSE, 0);
 
@@ -171,7 +171,7 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          (GTK_EXPAND | GTK_FILL), 0, 0, 0);
 
        color_buttons.signature_btn = gtk_button_new_with_label ("");
-       gtk_widget_set_usize (color_buttons.signature_btn, 30, 20);
+       gtk_widget_set_size_request (color_buttons.signature_btn, 30, 20);
        gtk_box_pack_start (GTK_BOX(hbox), color_buttons.signature_btn, 
                            FALSE, FALSE, 0);
 
@@ -186,18 +186,18 @@ void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
                          
        gtk_widget_show_all(table);
 
-       gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
-                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
-       gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
-                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
-       gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
-                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
-       gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
-                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
-       gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
-                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
-       gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
-                          GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
+       g_signal_connect(G_OBJECT(color_buttons.quote_level1_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "LEVEL1");
+       g_signal_connect(G_OBJECT(color_buttons.quote_level2_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "LEVEL2");
+       g_signal_connect(G_OBJECT(color_buttons.quote_level3_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "LEVEL3");
+       g_signal_connect(G_OBJECT(color_buttons.uri_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "URI");
+       g_signal_connect(G_OBJECT(color_buttons.tgt_folder_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "TGTFLD");
+       g_signal_connect(G_OBJECT(color_buttons.signature_btn), "clicked",
+                        G_CALLBACK(quote_color_set_dialog), "SIGNATURE");
 
        set_button_bg_color(color_buttons.quote_level1_btn,
                            prefs_common.quote_level1_col);
@@ -229,6 +229,7 @@ static void prefs_quote_colors_key_pressed(GtkWidget *widget,
 {
        if (event && event->keyval == GDK_Escape)
                gtk_main_quit();
+       return FALSE;
 }
 
 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
@@ -268,13 +269,12 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
        gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
        manage_window_set_transient(GTK_WINDOW(color_dialog));
 
-       gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
-                          "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
-       gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
-                          "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
-       gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
-                          GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
-                          data);
+       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
+                        "clicked", G_CALLBACK(quote_colors_set_dialog_ok), data);
+       g_signal_connect(G_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
+                        "clicked", G_CALLBACK(quote_colors_set_dialog_cancel), data);
+       g_signal_connect(G_OBJECT(color_dialog), "key_press_event",
+                        G_CALLBACK(quote_colors_set_dialog_key_pressed),data);
 
        /* preselect the previous color in the color selection dialog */
        color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
@@ -343,6 +343,7 @@ static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
                                                gpointer data)
 {
        gtk_widget_destroy(color_dialog);
+       return FALSE;
 }
 
 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
index 4b98430506b9e94832a6661af1fd2d7bdd92192c..39e5e2ca7acfb82816616fc3462b610bc9071d6b 100644 (file)
@@ -97,7 +97,7 @@ typedef guint32 MsgPermFlags;
 
 typedef guint32 MsgTmpFlags;
 
-#define MSG_CACHED_FLAG_MASK   (MSG_MULTIPART | MSG_ENCRYPTED | MSG_SIGNED)
+#define MSG_CACHED_FLAG_MASK   (MSG_MULTIPART | MSG_ENCRYPTED | MSG_SIGNED | MSG_HAS_ATTACHMENT)
 
 #define MSG_SET_FLAGS(msg, flags)      { (msg) |= (flags); }
 #define MSG_UNSET_FLAGS(msg, flags)    { (msg) &= ~(flags); }
index a264ae386f21329e98e9f3c3456162ed8486086a..429c5b74f61bd37571f682d395f439e5b795bf08 100644 (file)
@@ -1370,7 +1370,7 @@ Toolbar *toolbar_create(ToolbarType        type,
                                             toolbar_data->reply_btn,
                                           _("Reply to Message"), NULL);
                        n_menu_entries = sizeof(reply_entries) / 
-                               sizeof(replysender_entries[0]);
+                               sizeof(reply_entries[0]);
                        reply_combo = gtkut_combo_button_create(toolbar_data->reply_btn,
                                              reply_entries, n_menu_entries,
                                              "<Reply>", (gpointer)toolbar_item);
@@ -1684,7 +1684,12 @@ void toolbar_main_set_sensitive(gpointer data)
                SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->fwd_combo),
                        M_HAVE_ACCOUNT|M_TARGET_EXIST); 
 
-       SET_WIDGET_COND(toolbar->next_btn, M_MSG_EXIST);
+       if (prefs_common.next_unread_msg_dialog == NEXTUNREADMSGDIALOG_ASSUME_NO) {
+               SET_WIDGET_COND(toolbar->next_btn, M_MSG_EXIST);
+       } else {
+               SET_WIDGET_COND(toolbar->next_btn, 0);
+       }
+
        SET_WIDGET_COND(toolbar->delete_btn,
                        M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED);
        SET_WIDGET_COND(toolbar->exec_btn, M_DELAY_EXEC);