From 0c9b601fe8860c383ed01952c73fd80b416d0a18 Mon Sep 17 00:00:00 2001 From: Christoph Hohmann Date: Sat, 18 Oct 2003 12:38:48 +0000 Subject: [PATCH] 0.9.6claws33 * src/mimeview.c * src/noticeview.[ch] change noticeview icon to indicate signature status NOTE: I have used the mime icons for the noticeview now. It would be nice if someone could draw new icons for the noticeview. --- ChangeLog.claws | 6 ++++++ configure.ac | 2 +- src/mimeview.c | 11 ++++++++++- src/noticeview.c | 15 ++++++++++++++- src/noticeview.h | 6 ++++-- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index eb12e24c9..f592746fe 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2003-10-17 [christoph] 0.9.6claws33 + + * src/mimeview.c + * src/noticeview.[ch] + change noticeview icon to indicate signature status + 2003-10-17 [christoph] 0.9.6claws32 * src/Makefile.am diff --git a/configure.ac b/configure.ac index 6f8395f11..057e5a4d8 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=6 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=32 +EXTRA_VERSION=33 if test $EXTRA_VERSION -eq 0; then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws else diff --git a/src/mimeview.c b/src/mimeview.c index e796c756a..428621a95 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -623,24 +623,32 @@ static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo) if (privacy_mimeinfo_is_signed(mimeinfo)) { gchar *text = NULL, *button_text = NULL; GtkSignalFunc func = NULL; - + StockPixmap icon; + switch (privacy_mimeinfo_get_sig_status(mimeinfo)) { case SIGNATURE_UNCHECKED: text = _("This part of the message has been signed"); button_text = _("Check"); func = check_signature_cb; + icon = STOCK_PIXMAP_MIME_GPG_SIGNED; break; case SIGNATURE_OK: + text = _("Signature is ok"); + icon = STOCK_PIXMAP_MIME_GPG_PASSED; + break; case SIGNATURE_WARN: text = _("Signature is ok"); + icon = STOCK_PIXMAP_NOTICE_WARN; break; case SIGNATURE_INVALID: text = _("The signature of this part is invalid"); + icon = STOCK_PIXMAP_MIME_GPG_FAILED; break; case SIGNATURE_CHECK_FAILED: text = _("Checking the signature failed"); button_text = _("Check again"); func = check_signature_cb; + icon = STOCK_PIXMAP_MIME_GPG_UNKNOWN; default: break; } @@ -650,6 +658,7 @@ static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo) mimeview->siginfoview, func, (gpointer) mimeview); + noticeview_set_icon(mimeview->siginfoview, icon); noticeview_show(mimeview->siginfoview); } else { noticeview_hide(mimeview->siginfoview); diff --git a/src/noticeview.c b/src/noticeview.c index 7c95e6a3b..dbf150e66 100644 --- a/src/noticeview.c +++ b/src/noticeview.c @@ -60,6 +60,8 @@ NoticeView *noticeview_create(MainWindow *mainwin) debug_print("Creating notice view...\n"); noticeview = g_new0(NoticeView, 1); + noticeview->window = mainwin->window; + vbox = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox); hsep = gtk_hseparator_new(); @@ -69,7 +71,7 @@ NoticeView *noticeview_create(MainWindow *mainwin) gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - icon = stock_pixmap_widget(mainwin->window, STOCK_PIXMAP_NOTICE_WARN); + icon = stock_pixmap_widget(noticeview->window, STOCK_PIXMAP_NOTICE_WARN); #if 0 /* also possible... */ icon = gtk_pixmap_new(NULL, NULL); @@ -158,3 +160,14 @@ static void noticeview_button_pressed(GtkButton *button, NoticeView *noticeview) noticeview->press(noticeview, noticeview->user_data); } } + +void noticeview_set_icon(NoticeView *noticeview, StockPixmap icon) +{ + GdkPixmap *pixmap; + GdkBitmap *bitmap; + + if (stock_pixmap_gdk(noticeview->window, icon, &pixmap, &bitmap) < 0) + return; + + gtk_pixmap_set(noticeview->icon, pixmap, bitmap); +} diff --git a/src/noticeview.h b/src/noticeview.h index 346bfd2c0..054317ccf 100644 --- a/src/noticeview.h +++ b/src/noticeview.h @@ -22,6 +22,8 @@ typedef struct _NoticeView NoticeView; +#include "stock_pixmap.h" + struct _NoticeView { GtkWidget *vbox; @@ -30,6 +32,7 @@ struct _NoticeView GtkWidget *icon; GtkWidget *text; GtkWidget *button; + GtkWidget *window; gboolean visible; gpointer user_data; void (*press) (NoticeView *, gpointer user_data); @@ -39,7 +42,7 @@ NoticeView *noticeview_create (MainWindow *mainwin); void noticeview_destroy (NoticeView *noticeview); void noticeview_init (NoticeView *noticeview); void noticeview_set_icon (NoticeView *noticeview, - GtkWidget *icon); + StockPixmap icon); void noticeview_set_text (NoticeView *noticeview, const gchar *text); void noticeview_set_button_text @@ -55,4 +58,3 @@ void noticeview_set_button_press_callback gpointer *user_data); #endif /* NOTICEVIEW_H__ */ - -- 2.25.1