Made GPG signatures verifiable by clicking the
authorColin Leroy <colin@colino.net>
Sun, 22 Sep 2002 10:53:49 +0000 (10:53 +0000)
committerColin Leroy <colin@colino.net>
Sun, 22 Sep 2002 10:53:49 +0000 (10:53 +0000)
[application/pgp-signature] in the Text view

ChangeLog.claws
configure.in
src/mimeview.c
src/mimeview.h
src/textview.c

index 0e5b39c..e146853 100644 (file)
@@ -1,12 +1,21 @@
+2002-09-22 [colin]     0.8.3claws1
+
+       * src/mimeview.[ch]
+               Made mimeview_check_signature() public
+       * src/textview.c
+               Made GPG signatures verifiable by clicking
+               the [application/pgp-signature] in the Text
+               view
+
 2002-09-22 [paul]      0.8.3claws
 
-       *po/bg.po
-        po/en_GB.po
-        po/es.po
-        po/it.po
-        po/pl.po
-        po/pt_BR.po
-        po/sr.po
+       * po/bg.po
+         po/en_GB.po
+         po/es.po
+         po/it.po
+         po/pl.po
+         po/pt_BR.po
+         po/sr.po
                updated translations, submitted by George Danchev,
                me, Ricardo Mones Lastra, Alessandro Maestri,
                Witold Wladyslaw Wojciech Wilk, Fabio Jr.Beneditto 
index ba865c0..5f49ae7 100644 (file)
@@ -10,7 +10,7 @@ MINOR_VERSION=8
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws
+EXTRA_VERSION=claws1
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index fd12892..65b8f70 100644 (file)
@@ -108,9 +108,6 @@ static void mimeview_open_with              (MimeView       *mimeview);
 static void mimeview_view_file         (const gchar    *filename,
                                         MimeInfo       *partinfo,
                                         const gchar    *cmdline);
-#if USE_GPGME
-static void mimeview_check_signature   (MimeView       *mimeview);
-#endif
 
 static GtkItemFactoryEntry mimeview_popup_entries[] =
 {
@@ -1061,7 +1058,7 @@ static void mimeview_update_signature_info(MimeView *mimeview)
        }
 }
 
-static void mimeview_check_signature(MimeView *mimeview)
+void mimeview_check_signature(MimeView *mimeview)
 {
        MimeInfo *mimeinfo;
        FILE *fp;
index 9d5e0ba..b128b0a 100644 (file)
@@ -72,6 +72,9 @@ void mimeview_show_message    (MimeView       *mimeview,
                                 const gchar    *file);
 void mimeview_destroy          (MimeView       *mimeview);
 
+#if USE_GPGME
+void mimeview_check_signature  (MimeView       *mimeview);
+#endif
 void mimeview_pass_key_press_event     (MimeView       *mimeview,
                                         GdkEventKey    *event);
 
index d3ef500..4a7fa85 100644 (file)
@@ -50,6 +50,7 @@
 #include "addressbook.h"
 #include "displayheader.h"
 #include "account.h"
+#include "mimeview.h"
 
 #define FONT_LOAD(font, s) \
 { \
@@ -502,6 +503,22 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
                g_snprintf(buf, sizeof(buf), "\n[%s (%d bytes)]\n",
                           mimeinfo->content_type, mimeinfo->size);
 
+#if USE_GPGME
+       if (mimeinfo->sigstatus && !mimeinfo->sigstatus_full) {
+               gchar *tmp;
+               /* use standard font */
+               gpointer oldfont = textview->msgfont;
+               textview->msgfont = NULL;
+
+               tmp = g_strconcat("pgp: ", _("Check signature"), NULL);
+               textview_write_link(textview, tmp, buf, NULL);
+               
+               /* put things back */
+               textview->msgfont = (GdkFont *)oldfont;
+               oldfont = NULL;
+               g_free(tmp);
+       } else
+#endif
        if (mimeinfo->mime_type != MIME_TEXT &&
            mimeinfo->mime_type != MIME_TEXT_HTML &&
            mimeinfo->mime_type != MIME_TEXT_ENRICHED) {
@@ -1805,7 +1822,18 @@ static gint textview_button_released(GtkWidget *widget, GdkEventButton *event,
                                                }
                                                compose_new(account, uri->uri + 7, NULL);
                                        }
-                               } else {
+                               } else 
+#if USE_GPGME
+                               if (!g_strncasecmp(uri->uri, "pgp:", 4)) {
+                                       GtkAdjustment *pos = gtk_scrolled_window_get_vadjustment(
+                                                               GTK_SCROLLED_WINDOW(textview->scrolledwin));
+                                       gfloat vpos = pos->value;
+                                       mimeview_check_signature(textview->messageview->mimeview);
+                                       /* scroll back where we were */
+                                       gtk_adjustment_set_value(pos, vpos);
+                               } else
+#endif
+                               {
                                        open_uri(uri->uri,
                                                 prefs_common.uri_cmd);
                                }