aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/context.h6
-rw-r--r--src/gpgme.c8
-rw-r--r--src/op-support.c1
-rw-r--r--src/progress.c8
4 files changed, 22 insertions, 1 deletions
diff --git a/src/context.h b/src/context.h
index 1a8698c3..d0542d9f 100644
--- a/src/context.h
+++ b/src/context.h
@@ -114,10 +114,14 @@ struct gpgme_context
/* True if session keys should be exported upon decryption. */
unsigned int export_session_keys : 1;
+ /* True if a Pinentry was launched during the last operation. This
+ * flag is cleared with each operation. */
+ unsigned int redraw_suggested : 1;
+
/* Flags for keylist mode. */
gpgme_keylist_mode_t keylist_mode;
- /* The current pinnetry mode. */
+ /* The current pinentry mode. */
gpgme_pinentry_mode_t pinentry_mode;
/* Number of certs to be included. */
diff --git a/src/gpgme.c b/src/gpgme.c
index cf767c72..2b196a25 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -508,6 +508,10 @@ gpgme_set_ctx_flag (gpgme_ctx_t ctx, const char *name, const char *value)
if (!ctx || !name || !value)
err = gpg_error (GPG_ERR_INV_VALUE);
+ else if (!strcmp (name, "redraw"))
+ {
+ ctx->redraw_suggested = abool;
+ }
else if (!strcmp (name, "full-status"))
{
ctx->full_status = abool;
@@ -544,6 +548,10 @@ gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name)
{
if (!ctx || !name)
return NULL;
+ else if (!strcmp (name, "redraw"))
+ {
+ return ctx->redraw_suggested? "1":"";
+ }
else if (!strcmp (name, "full-status"))
{
return ctx->full_status? "1":"";
diff --git a/src/op-support.c b/src/op-support.c
index d9217ecd..817c5691 100644
--- a/src/op-support.c
+++ b/src/op-support.c
@@ -94,6 +94,7 @@ _gpgme_op_reset (gpgme_ctx_t ctx, int type)
_gpgme_release_result (ctx);
LOCK (ctx->lock);
ctx->canceled = 0;
+ ctx->redraw_suggested = 0;
UNLOCK (ctx->lock);
if (ctx->engine && no_reset)
diff --git a/src/progress.c b/src/progress.c
index c10ccaa8..066a7f5d 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -31,6 +31,8 @@
#include "debug.h"
+/* The status handler for progress status lines which also monitors
+ * the PINENTRY_LAUNCHED status. */
gpgme_error_t
_gpgme_progress_status_handler (void *priv, gpgme_status_code_t code,
char *args)
@@ -42,6 +44,12 @@ _gpgme_progress_status_handler (void *priv, gpgme_status_code_t code,
int current = 0;
int total = 0;
+ if (code == GPGME_STATUS_PINENTRY_LAUNCHED)
+ {
+ ctx->redraw_suggested = 1;
+ return 0;
+ }
+
if (code != GPGME_STATUS_PROGRESS || !*args || !ctx->progress_cb)
return 0;