0.9.6claws33
authorChristoph Hohmann <reboot@gmx.ch>
Sat, 18 Oct 2003 12:38:48 +0000 (12:38 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sat, 18 Oct 2003 12:38:48 +0000 (12:38 +0000)
* 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
configure.ac
src/mimeview.c
src/noticeview.c
src/noticeview.h

index eb12e24..f592746 100644 (file)
@@ -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
index 6f8395f..057e5a4 100644 (file)
@@ -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
index e796c75..428621a 100644 (file)
@@ -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);
index 7c95e6a..dbf150e 100644 (file)
@@ -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);
+}
index 346bfd2..054317c 100644 (file)
@@ -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__ */
-