aboutsummaryrefslogtreecommitdiffstats
path: root/src/progress.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-01-31 08:44:29 +0000
committerWerner Koch <[email protected]>2017-01-31 08:44:29 +0000
commit752d3597ef02a95efd693373132bf1e246f0edb0 (patch)
tree61fca51953b8bc3a68d3610e26b98f4f8458cc3a /src/progress.c
parenttests: Reduce iterations / threads (diff)
downloadgpgme-752d3597ef02a95efd693373132bf1e246f0edb0.tar.gz
gpgme-752d3597ef02a95efd693373132bf1e246f0edb0.zip
core: Add new context flag "redraw".
* src/context.h (struct gpgme_context): New field 'redraw_suggested'. * src/op-support.c (_gpgme_op_reset): Clear REDRAW_SUGGESTED. * src/progress.c (_gpgme_progress_status_handler): Set REDRAW_SUGGESTED. * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add "redraw". * tests/run-sign.c (main): Use it. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/progress.c')
-rw-r--r--src/progress.c8
1 files changed, 8 insertions, 0 deletions
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;