#define COMPOSE_DRAFT_TIMEOUT_UNSET -1
#define COMPOSE_DRAFT_TIMEOUT_FORBIDDEN -2
+static GdkColor default_to_bgcolor = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
+static GdkColor default_to_color = {
+ (gulong)0,
+ (gushort)0,
+ (gushort)0,
+ (gushort)0
+};
+
static GList *compose_list = NULL;
static GSList *extra_headers = NULL;
static void compose_entry_mark_default_to(Compose *compose, const gchar *mailto)
{
-#if !GTK_CHECK_VERSION(3, 0, 0)
- static GdkColor yellow;
- static GdkColor black;
- static gboolean yellow_initialised = FALSE;
-#else
- static GdkColor yellow = { (guint32)0, (guint16)0xf5, (guint16)0xf6, (guint16)0xbe };
- static GdkColor black = { (guint32)0, (guint16)0x0, (guint16)0x0, (guint16)0x0 };
-#endif
GSList *h_list;
GtkEntry *entry;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (!yellow_initialised) {
- gdk_color_parse("#f5f6be", &yellow);
- gdk_color_parse("#000000", &black);
- yellow_initialised = gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &yellow, FALSE, TRUE);
- yellow_initialised &= gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &black, FALSE, TRUE);
- }
-#endif
-
for (h_list = compose->header_list; h_list != NULL; h_list = h_list->next) {
entry = GTK_ENTRY(((ComposeHeaderEntry *)h_list->data)->entry);
if (gtk_entry_get_text(entry) &&
!g_utf8_collate(gtk_entry_get_text(entry), mailto)) {
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (yellow_initialised) {
-#endif
gtk_widget_modify_base(
GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
- GTK_STATE_NORMAL, &yellow);
+ GTK_STATE_NORMAL, &default_to_bgcolor);
gtk_widget_modify_text(
GTK_WIDGET(((ComposeHeaderEntry *)h_list->data)->entry),
- GTK_STATE_NORMAL, &black);
-#if !GTK_CHECK_VERSION(3, 0, 0)
- }
-#endif
+ GTK_STATE_NORMAL, &default_to_color);
}
}
}
COMPOSE_TO, PREF_FOLDER);
compose_entry_mark_default_to(compose, folder->prefs->default_to);
}
- if (folder->prefs->enable_default_cc)
+ if (folder->prefs->enable_default_cc) {
compose_entry_append(compose, folder->prefs->default_cc,
COMPOSE_CC, PREF_FOLDER);
- if (folder->prefs->enable_default_bcc)
+ compose_entry_mark_default_to(compose, folder->prefs->default_cc);
+ }
+ if (folder->prefs->enable_default_bcc) {
compose_entry_append(compose, folder->prefs->default_bcc,
COMPOSE_BCC, PREF_FOLDER);
- if (folder->prefs->enable_default_replyto)
+ compose_entry_mark_default_to(compose, folder->prefs->default_bcc);
+ }
+ if (folder->prefs->enable_default_replyto) {
compose_entry_append(compose, folder->prefs->default_replyto,
COMPOSE_REPLYTO, PREF_FOLDER);
+ compose_entry_mark_default_to(compose, folder->prefs->default_replyto);
+ }
}
static void compose_reply_set_subject(Compose *compose, MsgInfo *msginfo)
privacy_system_can_sign(compose->privacy_system)) {
encoding = ENC_QUOTED_PRINTABLE;
}
-
+
+#ifdef G_OS_WIN32
+ debug_print("main text: %Id bytes encoded as %s in %d\n",
+#else
debug_print("main text: %zd bytes encoded as %s in %d\n",
+#endif
strlen(buf), out_codeset, encoding);
/* check for line length limit */
gtk_widget_show(window);
}
+ gtkut_convert_int_to_gdk_color(prefs_common.default_to_bgcolor,
+ &default_to_bgcolor);
+ gtkut_convert_int_to_gdk_color(prefs_common.default_to_color,
+ &default_to_color);
+
return compose;
}
GtkTreeIter iter;
GSList *list, *saved_list = NULL;
HeaderEntryState *state;
- GtkRcStyle *style = NULL;
-#if !GTK_CHECK_VERSION(3, 0, 0)
- static GdkColor yellow;
- static gboolean color_set = FALSE;
-#else
- static GdkColor yellow = { (guint32)0, (guint32)0xf5, (guint32)0xf6, (guint32)0xbe };
-#endif
/* Get ID of active account in the combo box */
menu = gtk_combo_box_get_model(optmenu);
compose_destroy_headerentry(compose, hentry);
continue;
}
-
state = g_malloc0(sizeof(HeaderEntryState));
state->header = gtk_editable_get_chars(GTK_EDITABLE(
gtk_bin_get_child(GTK_BIN(hentry->combo))), 0, -1);
state->entry = gtk_editable_get_chars(
GTK_EDITABLE(hentry->entry), 0, -1);
state->type = hentry->type;
-
-#if !GTK_CHECK_VERSION(3, 0, 0)
- if (!color_set) {
- gdk_color_parse("#f5f6be", &yellow);
- color_set = gdk_colormap_alloc_color(
- gdk_colormap_get_system(),
- &yellow, FALSE, TRUE);
- }
-#endif
-
- style = gtk_widget_get_modifier_style(hentry->entry);
- state->entry_marked = gdk_color_equal(&yellow,
- &style->base[GTK_STATE_NORMAL]);
saved_list = g_slist_append(saved_list, state);
compose_destroy_headerentry(compose, hentry);
compose->header_nextrow = 1;
compose_create_header_entry(compose);
- if (ac->set_autocc && ac->auto_cc)
+ if (ac->set_autocc && ac->auto_cc) {
compose_entry_append(compose, ac->auto_cc,
COMPOSE_CC, PREF_ACCOUNT);
-
- if (ac->set_autobcc && ac->auto_bcc)
+ compose_entry_mark_default_to(compose, ac->auto_cc);
+ }
+ if (ac->set_autobcc && ac->auto_bcc) {
compose_entry_append(compose, ac->auto_bcc,
COMPOSE_BCC, PREF_ACCOUNT);
-
- if (ac->set_autoreplyto && ac->auto_replyto)
+ compose_entry_mark_default_to(compose, ac->auto_bcc);
+ }
+ if (ac->set_autoreplyto && ac->auto_replyto) {
compose_entry_append(compose, ac->auto_replyto,
COMPOSE_REPLYTO, PREF_ACCOUNT);
+ compose_entry_mark_default_to(compose, ac->auto_replyto);
+ }
for (list = saved_list; list; list = list->next) {
state = (HeaderEntryState *) list->data;
-
+
compose_add_header_entry(compose, state->header,
state->entry, state->type);
if (state->entry_marked)
compose_entry_mark_default_to(compose, state->entry);
-
- g_free(state->header);
+
+ g_free(state->header);
g_free(state->entry);
g_free(state);
}
g_slist_free(saved_list);
-
+
combobox_select_by_data(GTK_COMBO_BOX(compose->header_last->combo),
(ac->protocol == A_NNTP) ?
COMPOSE_NEWSGROUPS : COMPOSE_TO);