If the account is enabled, set a checkmark pixmap instead of a strange
2001-08-14 Peter Williams <peterw@ximian.com> * 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
This commit is contained in:
committed by
Peter Williams
parent
ab1d2c34e6
commit
f604364042
@ -1,3 +1,12 @@
|
||||
2001-08-14 Peter Williams <peterw@ximian.com>
|
||||
|
||||
* 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 <peterw@ximian.com>
|
||||
|
||||
Fix bug #215... desensitize menu items based on the number of
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user