seahorse r2263 - in seahorse-plugins/trunk: . plugins/applet plugins/epiphany plugins/gedit plugins/nautilus



Author: sadam
Date: Sun Jul  6 02:40:47 2008
New Revision: 2263
URL: http://svn.gnome.org/viewvc/seahorse?rev=2263&view=rev

Log:
2008-07-05  Adam Schreiber  <sadam clemson edu>

    * plugins/applet/seahorse-applet.c:
    * plugins/epiphany/seahorse-extension.c:
    * plugins/gedit/seahorse-gedit.c:
    * plugins/nautilus/seahorse-tool: Finish guarding plugins against 
brand new
    user without keys.


Modified:
   seahorse-plugins/trunk/ChangeLog
   seahorse-plugins/trunk/plugins/applet/seahorse-applet.c
   seahorse-plugins/trunk/plugins/epiphany/seahorse-extension.c
   seahorse-plugins/trunk/plugins/gedit/seahorse-gedit.c
   seahorse-plugins/trunk/plugins/nautilus/seahorse-tool.c

Modified: seahorse-plugins/trunk/plugins/applet/seahorse-applet.c
==============================================================================
--- seahorse-plugins/trunk/plugins/applet/seahorse-applet.c	(original)
+++ seahorse-plugins/trunk/plugins/applet/seahorse-applet.c	Sun Jul  6 02:40:47 2008
@@ -367,7 +367,7 @@
 {
     gchar *signer = NULL;
     gchar *enctext = NULL;
-    gchar **keys;
+    gchar **keys = NULL;
     gboolean ret;
 
     /* No text on clipboard */
@@ -375,7 +375,10 @@
         return;
  
     /* Get the recipient list */
-    keys = cryptui_prompt_recipients (dbus_keyset, _("Choose Recipient Keys"), &signer);
+    if (cryptui_keyset_get_count (dbus_keyset) == 0)
+        cryptui_need_to_get_keys ();
+    else
+        keys = cryptui_prompt_recipients (dbus_keyset, _("Choose Recipient Keys"), &signer);
 
     /* User may have cancelled */
     if (keys && *keys) {
@@ -431,7 +434,11 @@
     if (!text)
         return;
 
-    signer = cryptui_prompt_signer (dbus_keyset, _("Choose Key to Sign with"));
+    if (cryptui_keyset_get_count (dbus_keyset) == 0)
+        cryptui_need_to_get_keys (dbus_keyset);
+    else
+        signer = cryptui_prompt_signer (dbus_keyset, _("Choose Key to Sign with"));
+    
     if (signer == NULL)
         return;
 
@@ -514,6 +521,11 @@
     gchar *signer = NULL;
     gboolean ret;
     
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return NULL;
+    }
+    
     ret = dbus_g_proxy_call (dbus_crypto_proxy, "DecryptText", NULL,
                              G_TYPE_STRING, "openpgp",
                              G_TYPE_INT, 0,
@@ -545,6 +557,11 @@
     gchar *signer;
     gboolean ret;
 
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return NULL;
+    }
+
     ret = dbus_g_proxy_call (dbus_crypto_proxy, "VerifyText", NULL,
                              G_TYPE_STRING, "openpgp",
                              G_TYPE_INT, 0,

Modified: seahorse-plugins/trunk/plugins/epiphany/seahorse-extension.c
==============================================================================
--- seahorse-plugins/trunk/plugins/epiphany/seahorse-extension.c	(original)
+++ seahorse-plugins/trunk/plugins/epiphany/seahorse-extension.c	Sun Jul  6 02:40:47 2008
@@ -240,6 +240,11 @@
     
     init_crypt();
     
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return;
+    }
+
 	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
 	g_return_if_fail (EPHY_IS_EMBED (embed));
 
@@ -285,6 +290,11 @@
     gboolean ret;
     
     init_crypt();
+
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return;
+    }
     
 	embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
 	g_return_if_fail (EPHY_IS_EMBED (embed));
@@ -357,6 +367,11 @@
     gchar *signer = NULL;
     gboolean ret;
     
+        if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+            cryptui_need_to_get_keys (dbus_keyset);
+            return NULL;
+        }
+
     ret = dbus_g_proxy_call (dbus_crypto_proxy, "DecryptText", NULL,
                              G_TYPE_STRING, "openpgp",
                              G_TYPE_INT, 0,
@@ -389,6 +404,11 @@
     gchar *rawtext = NULL;
     gchar *signer;
     gboolean ret;
+    
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return NULL;
+    }
 
     ret = dbus_g_proxy_call (dbus_crypto_proxy, "VerifyText", NULL,
                              G_TYPE_STRING, "openpgp",

Modified: seahorse-plugins/trunk/plugins/gedit/seahorse-gedit.c
==============================================================================
--- seahorse-plugins/trunk/plugins/gedit/seahorse-gedit.c	(original)
+++ seahorse-plugins/trunk/plugins/gedit/seahorse-gedit.c	Sun Jul  6 02:40:47 2008
@@ -307,7 +307,7 @@
     GError *error = NULL;
     gchar *enctext = NULL;
     gchar *buffer;
-    gchar **keys;
+    gchar **keys = NULL;
     gchar *signer;
     gint start, end;
     gboolean ret;
@@ -329,7 +329,10 @@
     
     /* Get the recipient list */
     SEAHORSE_GEDIT_DEBUG (DEBUG_PLUGINS, "getting recipients");
-    keys = cryptui_prompt_recipients (dbus_keyset, _("Choose Recipient Keys"), &signer);
+    if (cryptui_keyset_get_count (dbus_keyset) == 0)
+        cryptui_need_to_get_keys ();
+    else
+        keys = cryptui_prompt_recipients (dbus_keyset, _("Choose Recipient Keys"), &signer);
 
     /* User may have cancelled */
     if (keys && *keys) {
@@ -409,6 +412,11 @@
     
     if (!init_crypt ())
         return NULL;
+
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return NULL;
+    }
     
 g_printerr ("%s\n", text);    
     
@@ -444,6 +452,11 @@
     if (!init_crypt ())
         return NULL;
 
+    if (cryptui_keyset_get_count (dbus_keyset) == 0) {
+        cryptui_need_to_get_keys (dbus_keyset);
+        return NULL;
+    }
+
     ret = dbus_g_proxy_call (dbus_crypto_proxy, "VerifyText", &error,
                              G_TYPE_STRING, "openpgp",
                              G_TYPE_INT, 0,
@@ -608,7 +621,10 @@
     /* Get the document text */
     buffer = get_document_chars (doc, start, end);
 
-    signer = cryptui_prompt_signer (dbus_keyset, _("Choose Key to Sign with"));
+    if (cryptui_keyset_get_count (dbus_keyset) == 0)
+        signer = NULL;
+    else
+        signer = cryptui_prompt_signer (dbus_keyset, _("Choose Key to Sign with"));
     
     /* User may have cancelled */
     if (signer != NULL) {

Modified: seahorse-plugins/trunk/plugins/nautilus/seahorse-tool.c
==============================================================================
--- seahorse-plugins/trunk/plugins/nautilus/seahorse-tool.c	(original)
+++ seahorse-plugins/trunk/plugins/nautilus/seahorse-tool.c	Sun Jul  6 02:40:47 2008
@@ -164,7 +164,7 @@
     keyset = cryptui_keyset_new ("openpgp", TRUE);
     
     if (cryptui_keyset_get_count (keyset) == 0) {
-        cryptui_need_to_get_keys (TRUE);
+        cryptui_need_to_get_keys ();
     } else {    
         recips = cryptui_prompt_recipients (keyset, _("Choose Recipients"), &signer);
         
@@ -296,6 +296,12 @@
     gchar *id;
     
     keyset = cryptui_keyset_new ("openpgp", TRUE);
+    
+    if (cryptui_keyset_get_count (keyset) == 0) {
+        cryptui_need_to_get_keys ();
+        return NULL;
+    }
+    
     signer = cryptui_prompt_signer (keyset, _("Choose Signer"));
     if (signer) {
         



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]