[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis-gtk] branch master updated: shorten challenge button la
From: |
gnunet |
Subject: |
[taler-anastasis-gtk] branch master updated: shorten challenge button labels, grab focus where needed |
Date: |
Sun, 11 Apr 2021 17:43:49 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis-gtk.
The following commit(s) were added to refs/heads/master by this push:
new 094b85d shorten challenge button labels, grab focus where needed
094b85d is described below
commit 094b85dc3eab3a34baabdac742df49898ffa683f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Apr 11 17:43:47 2021 +0200
shorten challenge button labels, grab focus where needed
---
contrib/anastasis_gtk_main_window.glade | 16 ++++++++++++++--
src/anastasis/anastasis-gtk_action.c | 17 ++++++++++-------
src/anastasis/anastasis-gtk_helper.c | 17 +++++++++++++++++
src/anastasis/anastasis-gtk_helper.h | 9 +++++++++
4 files changed, 50 insertions(+), 9 deletions(-)
diff --git a/contrib/anastasis_gtk_main_window.glade
b/contrib/anastasis_gtk_main_window.glade
index d76c72e..4c0d027 100644
--- a/contrib/anastasis_gtk_main_window.glade
+++ b/contrib/anastasis_gtk_main_window.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2
+<!-- Generated with glade 3.38.2
Copyright (C) Anastasis SARL
@@ -587,6 +587,8 @@ Author: Christian Grothoff, Dennis Neufeld
<object class="GtkEntry"
id="anastasis_gtk_ia_full_name_entry">
<property
name="visible">True</property>
<property
name="can-focus">True</property>
+ <property
name="has-focus">True</property>
+ <property
name="is-focus">True</property>
<property
name="hexpand">True</property>
<property
name="placeholder-text" translatable="yes">Max Mustermann</property>
<signal name="changed"
handler="AG_identity_changed" swapped="no"/>
@@ -939,6 +941,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="label"
translatable="yes">SMS</property>
<property
name="visible">True</property>
<property
name="can-focus">True</property>
+ <property
name="has-focus">True</property>
<property
name="receives-default">True</property>
<signal name="clicked"
handler="anastasis_gtk_btn_add_auth_sms_clicked_cb" swapped="no"/>
</object>
@@ -1757,6 +1760,8 @@ Author: Christian Grothoff, Dennis Neufeld
<object class="GtkEntry"
id="anastasis_gtk_enter_secret_entry">
<property
name="visible">True</property>
<property
name="can-focus">True</property>
+ <property
name="has-focus">True</property>
+ <property
name="is-focus">True</property>
<property
name="primary-icon-stock">gtk-dialog-authentication</property>
<property
name="input-purpose">password</property>
<signal name="changed"
handler="anastasis_gtk_enter_secret_entry_changed_cb" swapped="no"/>
@@ -1801,6 +1806,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property
name="label">gtk-open</property>
<property
name="visible">True</property>
<property
name="can-focus">True</property>
+ <property
name="can-default">True</property>
<property
name="receives-default">True</property>
<property
name="use-stock">True</property>
<signal name="clicked"
handler="anastasis_gtk_enter_secret_open_button_clicked_cb" swapped="no"/>
@@ -2155,6 +2161,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property
name="label">gtk-copy</property>
<property
name="visible">True</property>
<property
name="can-focus">True</property>
+ <property
name="can-default">True</property>
<property
name="receives-default">True</property>
<property
name="tooltip-text" translatable="yes">Copy secret to clipboard</property>
<property
name="use-stock">True</property>
@@ -2412,6 +2419,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="label">gtk-go-back</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
+ <property name="can-default">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<signal name="clicked"
handler="anastasis_gtk_main_window_back_clicked" swapped="no"/>
@@ -2439,6 +2447,7 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
+ <property name="can-default">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<signal name="clicked"
handler="anastasis_gtk_main_window_save_as_button_clicked_cb" swapped="no"/>
@@ -2454,6 +2463,7 @@ Author: Christian Grothoff, Dennis Neufeld
<object class="GtkButton"
id="anastasis_gtk_main_window_quit_button">
<property name="label">gtk-quit</property>
<property name="can-focus">True</property>
+ <property name="can-default">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<signal name="clicked"
handler="anastasis_gtk_main_window_quit_button_clicked_cb" swapped="no"/>
@@ -2481,7 +2491,9 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="label">gtk-go-forward</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="can-focus">True</property>
+ <property name="can-focus">False</property>
+ <property name="can-default">True</property>
+ <property name="has-default">True</property>
<property name="receives-default">True</property>
<property name="use-stock">True</property>
<signal name="clicked"
handler="anastasis_gtk_main_window_forward_clicked" swapped="no"/>
diff --git a/src/anastasis/anastasis-gtk_action.c
b/src/anastasis/anastasis-gtk_action.c
index c588fc1..f3a3cae 100644
--- a/src/anastasis/anastasis-gtk_action.c
+++ b/src/anastasis/anastasis-gtk_action.c
@@ -522,6 +522,7 @@ action_user_attributes_collecting (void)
AG_show ("anastasis_gtk_main_window_prev_button");
AG_show ("anastasis_gtk_main_window_forward_button");
AG_show ("anastasis_gtk_identity_frame");
+ AG_focus ("anastasis_gtk_ia_full_name_entry");
AG_show ("anastasis_gtk_user_attributes_image");
}
@@ -975,6 +976,7 @@ action_secret_editing (void)
AG_sensitive ("anastasis_gtk_main_window_prev_button");
AG_show ("anastasis_gtk_enter_secret_frame");
AG_show ("anastasis_gtk_enter_secret_image");
+ AG_focus ("anastasis_gtk_enter_secret_entry");
AG_show ("anastasis_gtk_main_control_vbox");
AG_show ("anastasis_gtk_main_window_prev_button");
AG_show ("anastasis_gtk_main_window_forward_button");
@@ -1946,7 +1948,7 @@ action_challenge_selecting (void)
GNUNET_asprintf (&ins_str,
"#%u: %s",
(unsigned int) index,
- instructions);
+ gettext (type));
b = gtk_button_new_with_label (ins_str);
GNUNET_free (ins_str);
}
@@ -1954,7 +1956,8 @@ action_challenge_selecting (void)
char *cost_str;
GNUNET_asprintf (&cost_str,
- _ ("Price: %s"),
+ _ ("%s\nPrice: %s"),
+ instructions,
TALER_amount2s (&cost));
gtk_widget_set_tooltip_text (b,
cost_str);
@@ -2358,18 +2361,18 @@ diag_code (const json_t *details)
static void
action_challenge_solving (void)
{
- static struct
+ struct
{
const char *type;
GtkDialog *(*ctor)(const json_t *details);
} type_map [] = {
- { .type = "question",
+ { .type = gettext_noop ("question"),
.ctor = &diag_question },
- { .type = "sms",
+ { .type = gettext_noop ("sms"),
.ctor = &diag_code },
- { .type = "post",
+ { .type = gettext_noop ("post"),
.ctor = &diag_code },
- { .type = "email",
+ { .type = gettext_noop ("email"),
.ctor = &diag_code },
{ .type = NULL,
.ctor = NULL }
diff --git a/src/anastasis/anastasis-gtk_helper.c
b/src/anastasis/anastasis-gtk_helper.c
index f548c38..5334606 100644
--- a/src/anastasis/anastasis-gtk_helper.c
+++ b/src/anastasis/anastasis-gtk_helper.c
@@ -71,6 +71,23 @@ AG_sensitive (const char *name)
}
+void
+AG_focus (const char *name)
+{
+ GtkWidget *w;
+
+ w = GTK_WIDGET (GCG_get_main_window_object (name));
+ if (NULL == w)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Widget `%s' not found, cannot focus on it!\n",
+ name);
+ return;
+ }
+ gtk_widget_grab_focus (w);
+}
+
+
void
AG_insensitive (const char *name)
{
diff --git a/src/anastasis/anastasis-gtk_helper.h
b/src/anastasis/anastasis-gtk_helper.h
index 545b3a6..1606b55 100644
--- a/src/anastasis/anastasis-gtk_helper.h
+++ b/src/anastasis/anastasis-gtk_helper.h
@@ -307,6 +307,15 @@ void
AG_sensitive (const char *name);
+/**
+ * Make widget of the given @a name the focus.
+ *
+ * @param name widget to focus
+ */
+void
+AG_focus (const char *name);
+
+
/**
* Thaw the user interface.
*/
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis-gtk] branch master updated: shorten challenge button labels, grab focus where needed,
gnunet <=