diff options
-rw-r--r-- | contrib/anastasis_gtk_main_window.glade | 48 | ||||
-rw-r--r-- | src/anastasis/anastasis-gtk_action.c | 27 | ||||
-rw-r--r-- | src/anastasis/anastasis-gtk_handle-core-secret-changed.c | 11 |
3 files changed, 63 insertions, 23 deletions
diff --git a/contrib/anastasis_gtk_main_window.glade b/contrib/anastasis_gtk_main_window.glade index 30ce66e..4c2b747 100644 --- a/contrib/anastasis_gtk_main_window.glade +++ b/contrib/anastasis_gtk_main_window.glade @@ -75,6 +75,19 @@ Author: Christian Grothoff, Dennis Neufeld </row> </data> </object> + <object class="GtkAdjustment" id="anastasis_gtk_enter_secret_hadjustment"> + <property name="upper">100</property> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + </object> + <object class="GtkTextBuffer" id="anastasis_gtk_enter_secret_textbuffer"> + <signal name="changed" handler="anastasis_gtk_enter_secret_textbuffer_changed_cb" swapped="no"/> + </object> + <object class="GtkAdjustment" id="anastasis_gtk_enter_secret_vadjustment"> + <property name="upper">100</property> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + </object> <object class="GtkListStore" id="anastasis_gtk_recovery_progress_liststore"> <columns> <!-- column-name description --> @@ -2582,6 +2595,7 @@ You can also use "back" to add additional authentication methods.</property> </child> <child> <object class="GtkFrame" id="anastasis_gtk_enter_secret_frame"> + <property name="height-request">1500</property> <property name="can-focus">False</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> @@ -2640,6 +2654,9 @@ You can also use "back" to add additional authentication methods.</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="has-focus">True</property> + <property name="tooltip-text" translatable="yes">This allows you to uniquely identify a secret if you have made multiple back ups. The value entered here will NOT be protected by the authentication checks!</property> + <property name="primary-icon-tooltip-text" translatable="yes">If you make multiple backups using Anastasis, the secret's name will allow you to distinguish the different backups.</property> + <property name="placeholder-text" translatable="yes">Do NOT enter the actual secret here!</property> <signal name="changed" handler="anastasis_gtk_enter_secret_name_entry_changed_cb" swapped="no"/> </object> <packing> @@ -2707,19 +2724,30 @@ identify your secret later.</property> <property name="visible">True</property> <property name="can-focus">False</property> <child> - <object class="GtkEntry" id="anastasis_gtk_enter_secret_entry"> + <object class="GtkScrolledWindow" id="enter_secret_scrolled_window"> <property name="visible">True</property> <property name="can-focus">True</property> - <property name="valign">start</property> - <property name="margin-left">5</property> - <property name="margin-right">5</property> - <property name="margin-start">5</property> - <property name="margin-end">5</property> + <property name="tooltip-text" translatable="yes">Enter the secret you want to back up here.</property> + <property name="margin-start">10</property> + <property name="margin-end">10</property> <property name="hexpand">True</property> - <property name="primary-icon-stock">gtk-dialog-authentication</property> - <property name="placeholder-text" translatable="yes">Type or paste your secret here</property> - <property name="input-purpose">password</property> - <signal name="changed" handler="anastasis_gtk_enter_secret_entry_changed_cb" swapped="no"/> + <property name="vexpand">True</property> + <property name="hadjustment">anastasis_gtk_enter_secret_hadjustment</property> + <property name="vadjustment">anastasis_gtk_enter_secret_vadjustment</property> + <property name="shadow-type">in</property> + <child> + <object class="GtkTextView" id="anastasis_gtk_enter_secret_textview"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="hadjustment">anastasis_gtk_enter_secret_hadjustment</property> + <property name="hscroll-policy">natural</property> + <property name="vadjustment">anastasis_gtk_enter_secret_vadjustment</property> + <property name="vscroll-policy">natural</property> + <property name="buffer">anastasis_gtk_enter_secret_textbuffer</property> + </object> + </child> </object> <packing> <property name="expand">True</property> diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c index ca3406a..8581808 100644 --- a/src/anastasis/anastasis-gtk_action.c +++ b/src/anastasis/anastasis-gtk_action.c @@ -1225,7 +1225,7 @@ action_secret_editing (void) AG_insensitive ("anastasis_gtk_main_window_forward_button"); AG_sensitive ("anastasis_gtk_enter_secret_open_button"); - AG_sensitive ("anastasis_gtk_enter_secret_entry"); + AG_sensitive ("anastasis_gtk_enter_secret_textview"); AG_hide ("anastasis_gtk_secret_clear_file_button"); AG_hide ("anastasis_gtk_secret_clear_text_button"); AG_hide ("anastasis_gtk_secret_file_name_hbox"); @@ -1292,8 +1292,18 @@ action_secret_editing (void) (0 == strlen (text)) ) text = NULL; if (! AG_in_secret_editing) - update_entry ("anastasis_gtk_enter_secret_entry", - text); + { + GtkTextBuffer *tb = GCG_get_main_window_object ( + "anastasis_gtk_enter_secret_textbuffer"); + const char *old; + + old = gtk_entry_get_text (tb); + if (0 != strcmp (old, + text)) + gtk_text_buffer_set_text (tb, + text, + -1); + } update_label ("anastasis_gtk_secret_file_name_label", filename); if ( (NULL != text) || @@ -1308,7 +1318,7 @@ action_secret_editing (void) } if (NULL != filename) { - AG_insensitive ("anastasis_gtk_enter_secret_entry"); + AG_insensitive ("anastasis_gtk_enter_secret_textbuffer"); AG_show ("anastasis_gtk_secret_clear_file_button"); AG_show ("anastasis_gtk_secret_file_name_hbox"); AG_hide ("anastasis_gtk_secret_file_chooser_hbox"); @@ -1318,15 +1328,18 @@ action_secret_editing (void) else { /* secret is NULL */ - update_entry ("anastasis_gtk_enter_secret_entry", - NULL); + GtkTextBuffer *tb = GCG_get_main_window_object ( + "anastasis_gtk_enter_secret_textbuffer"); + gtk_text_buffer_set_text (tb, + "", + -1); } if ( (NULL == name) || (0 == strlen (name) ) ) AG_focus ("anastasis_gtk_secret_name_entry"); else if (NULL == filename) - AG_focus ("anastasis_gtk_enter_secret_entry"); + AG_focus ("anastasis_gtk_enter_secret_textbuffer"); GNUNET_JSON_parse_free (spec); } AG_sensitive ("anastasis_gtk_main_window_prev_button"); diff --git a/src/anastasis/anastasis-gtk_handle-core-secret-changed.c b/src/anastasis/anastasis-gtk_handle-core-secret-changed.c index b086fe5..c0ca4c1 100644 --- a/src/anastasis/anastasis-gtk_handle-core-secret-changed.c +++ b/src/anastasis/anastasis-gtk_handle-core-secret-changed.c @@ -33,11 +33,10 @@ void -anastasis_gtk_enter_secret_entry_changed_cb (GtkEditable *entry, - gpointer user_data) +anastasis_gtk_enter_secret_textbuffer_changed_cb (GtkTextBuffer *tb, + gpointer user_data) { - GtkEntry *e = GTK_ENTRY (entry); - const char *text = gtk_entry_get_text (e); + const char *text = gtk_text_buffer_get_text (tb); json_t *arguments; struct GNUNET_TIME_Absolute expiration; @@ -56,7 +55,7 @@ anastasis_gtk_enter_secret_entry_changed_cb (GtkEditable *entry, NULL, &AG_action_cb, NULL); - AG_focus ("anastasis_gtk_enter_secret_entry"); + AG_focus ("anastasis_gtk_enter_secret_textview"); return; } arguments = json_pack ("{s:{s:s,s:s},s:o}", @@ -75,6 +74,6 @@ anastasis_gtk_enter_secret_entry_changed_cb (GtkEditable *entry, &AG_action_cb, NULL); json_decref (arguments); - AG_focus ("anastasis_gtk_enter_secret_entry"); + AG_focus ("anastasis_gtk_enter_secret_textview"); AG_in_secret_editing = false; } |