anastasis-gtk

Demonstrator GUI for Anastasis
Log | Files | Refs | README | LICENSE

commit e8e83969e6cf71f7ab86010433aa6f63e74bd19f
parent 0ea0e7d7215648844a58d90315eb193a55458779
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 16 Nov 2021 19:28:57 +0100

-fix FTBFS

Diffstat:
Msrc/anastasis/anastasis-gtk_action.c | 21+++++++++++++++------
Msrc/anastasis/anastasis-gtk_handle-core-secret-changed.c | 12+++++++++++-
2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c @@ -1293,11 +1293,20 @@ action_secret_editing (void) text = NULL; if (! AG_in_secret_editing) { - GtkTextBuffer *tb = GCG_get_main_window_object ( - "anastasis_gtk_enter_secret_textbuffer"); + GtkTextBuffer *tb = GTK_TEXT_BUFFER (GCG_get_main_window_object ( + "anastasis_gtk_enter_secret_textbuffer")); const char *old; - - old = gtk_entry_get_text (tb); + GtkTextIter start; + GtkTextIter end; + + gtk_text_buffer_get_start_iter (tb, + &start); + gtk_text_buffer_get_end_iter (tb, + &end); + old = gtk_text_buffer_get_text (tb, + &start, + &end, + true); if (0 != strcmp (old, text)) gtk_text_buffer_set_text (tb, @@ -1328,8 +1337,8 @@ action_secret_editing (void) else { /* secret is NULL */ - GtkTextBuffer *tb = GCG_get_main_window_object ( - "anastasis_gtk_enter_secret_textbuffer"); + GtkTextBuffer *tb = GTK_TEXT_BUFFER (GCG_get_main_window_object ( + "anastasis_gtk_enter_secret_textbuffer")); gtk_text_buffer_set_text (tb, "", diff --git a/src/anastasis/anastasis-gtk_handle-core-secret-changed.c b/src/anastasis/anastasis-gtk_handle-core-secret-changed.c @@ -36,10 +36,20 @@ void anastasis_gtk_enter_secret_textbuffer_changed_cb (GtkTextBuffer *tb, gpointer user_data) { - const char *text = gtk_text_buffer_get_text (tb); json_t *arguments; struct GNUNET_TIME_Absolute expiration; + GtkTextIter start; + GtkTextIter end; + const char *text; + gtk_text_buffer_get_start_iter (tb, + &start); + gtk_text_buffer_get_end_iter (tb, + &end); + text = gtk_text_buffer_get_text (tb, + &start, + &end, + true); if (AG_in_action) return; AG_in_secret_editing = true;