From f604364042e94ed58b2cbce5746791d88e7c0776 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Tue, 14 Aug 2001 16:35:14 +0000 Subject: If the account is enabled, set a checkmark pixmap instead of a strange 2001-08-14 Peter Williams * mail-accounts.c (load_accounts): If the account is enabled, set a checkmark pixmap instead of a strange plus sign. (mail_accounts_dialog_init): Load the pixmap here. (mail_accounts_dialog_finalise): Free it here. * mail-accounts.h: Prototype it here. svn path=/trunk/; revision=12017 --- mail/ChangeLog | 9 +++++++++ mail/mail-accounts.c | 19 ++++++++++++++++--- mail/mail-accounts.h | 4 ++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 0b33820aa6..3f65a10007 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-08-14 Peter Williams + + * mail-accounts.c (load_accounts): If the account is enabled, + set a checkmark pixmap instead of a strange plus sign. + (mail_accounts_dialog_init): Load the pixmap here. + (mail_accounts_dialog_finalise): Free it here. + + * mail-accounts.h: Prototype it here. + 2001-08-09 Peter Williams Fix bug #215... desensitize menu items based on the number of diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index e8e692d8ef..f7b371a498 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -45,6 +45,8 @@ #include "mail-send-recv.h" #include "mail-session.h" +#include "art/mark.xpm" + static void mail_accounts_dialog_class_init (MailAccountsDialogClass *class); static void mail_accounts_dialog_init (MailAccountsDialog *dialog); static void mail_accounts_dialog_finalise (GtkObject *obj); @@ -91,7 +93,11 @@ mail_accounts_dialog_class_init (MailAccountsDialogClass *class) static void mail_accounts_dialog_init (MailAccountsDialog *o) { - ; + GdkPixbuf *pixbuf; + + pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) mark_xpm); + gdk_pixbuf_render_pixmap_and_mask (pixbuf, &(o->mark_pixmap), &(o->mark_bitmap), 128); + gdk_pixbuf_unref (pixbuf); } static void @@ -100,7 +106,9 @@ mail_accounts_dialog_finalise (GtkObject *obj) MailAccountsDialog *dialog = (MailAccountsDialog *) obj; gtk_object_unref (GTK_OBJECT (dialog->gui)); - + gdk_pixmap_unref (dialog->mark_pixmap); + gdk_bitmap_unref (dialog->mark_bitmap); + ((GtkObjectClass *)(parent_class))->finalize (obj); } @@ -129,7 +137,7 @@ load_accounts (MailAccountsDialog *dialog) else url = NULL; - text[0] = (account->source && account->source->enabled) ? "+" : ""; + text[0] = ""; text[1] = account->name; text[2] = g_strdup_printf ("%s%s", url && url->protocol ? url->protocol : _("None"), (i == default_account) ? _(" (default)") : ""); @@ -140,6 +148,11 @@ load_accounts (MailAccountsDialog *dialog) gtk_clist_append (dialog->mail_accounts, text); g_free (text[2]); + if (account->source->enabled) + gtk_clist_set_pixmap (dialog->mail_accounts, i, 0, + dialog->mark_pixmap, + dialog->mark_bitmap); + /* set the account on the row */ gtk_clist_set_row_data (dialog->mail_accounts, i, (gpointer) account); diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h index 44716bffd0..67f7322caf 100644 --- a/mail/mail-accounts.h +++ b/mail/mail-accounts.h @@ -95,6 +95,10 @@ struct _MailAccountsDialog { /* PGP page */ GnomeFileEntry *pgp_path; GtkToggleButton *remember_passwd; + + /* Pixmaps for the clist */ + GdkPixmap *mark_pixmap; + GdkBitmap *mark_bitmap; }; typedef struct _MailAccountsDialog MailAccountsDialog; -- cgit v1.2.3