diff options
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk_edit.c | 2 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_a.c | 27 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_aaaa.c | 45 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_cname.c | 51 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_gns2dns.c | 49 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_leho.c | 53 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_mx.c | 81 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_phone.c | 83 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_pkey.c | 52 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_ptr.c | 48 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_soa.c | 8 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_srv.c | 8 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_template.c | 8 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_txt.c | 8 | ||||
-rw-r--r-- | src/namestore/plugin_gtk_namestore_vpn.c | 8 |
15 files changed, 441 insertions, 90 deletions
diff --git a/src/namestore/gnunet-namestore-gtk_edit.c b/src/namestore/gnunet-namestore-gtk_edit.c index ebe42915..7fe0d27b 100644 --- a/src/namestore/gnunet-namestore-gtk_edit.c +++ b/src/namestore/gnunet-namestore-gtk_edit.c | |||
@@ -1121,7 +1121,7 @@ edit_dialog_phone_validity_check (struct EditDialogContext *edc) | |||
1121 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | 1121 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; |
1122 | 1122 | ||
1123 | entry = GTK_EDITABLE (gtk_builder_get_object (edc->builder, | 1123 | entry = GTK_EDITABLE (gtk_builder_get_object (edc->builder, |
1124 | "edit_dialog_phone_peer_entry")), | 1124 | "edit_dialog_phone_peer_entry")); |
1125 | preedit = gtk_editable_get_chars (entry, 0, -1); | 1125 | preedit = gtk_editable_get_chars (entry, 0, -1); |
1126 | if ( (NULL == preedit) || | 1126 | if ( (NULL == preedit) || |
1127 | (GNUNET_OK != | 1127 | (GNUNET_OK != |
diff --git a/src/namestore/plugin_gtk_namestore_a.c b/src/namestore/plugin_gtk_namestore_a.c index 319e7b0b..d72373e9 100644 --- a/src/namestore/plugin_gtk_namestore_a.c +++ b/src/namestore/plugin_gtk_namestore_a.c | |||
@@ -28,11 +28,28 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the A record value. Enable/disable 'save' | ||
32 | * button depending on the validity of the value. | ||
33 | * | ||
34 | * @param entry editing widget | ||
35 | * @param user_data the plugin environment | ||
36 | */ | ||
37 | void | ||
38 | GNS_edit_dialog_a_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
42 | |||
43 | env->check_validity (env->cls); | ||
44 | } | ||
45 | |||
46 | |||
47 | /** | ||
31 | * Function that will be called to initialize the builder's | 48 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 49 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 50 | * The `n_value` is the existing value of the record as a string. |
34 | * | 51 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 53 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 54 | * @param builder the edit dialog's builder |
38 | */ | 55 | */ |
@@ -54,7 +71,7 @@ a_load (void *cls, | |||
54 | * Function that will be called to retrieve the final value of the | 71 | * Function that will be called to retrieve the final value of the |
55 | * record (in string format) once the dialog is being closed. | 72 | * record (in string format) once the dialog is being closed. |
56 | * | 73 | * |
57 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 74 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
58 | * @param builder the edit dialog's builder | 75 | * @param builder the edit dialog's builder |
59 | * @return record value as a string, as specified in the dialog | 76 | * @return record value as a string, as specified in the dialog |
60 | */ | 77 | */ |
@@ -79,7 +96,7 @@ a_store (void *cls, | |||
79 | * function should highlight fields with invalid inputs for the | 96 | * function should highlight fields with invalid inputs for the |
80 | * user. | 97 | * user. |
81 | * | 98 | * |
82 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 99 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
83 | * @param builder the edit dialog's builder | 100 | * @param builder the edit dialog's builder |
84 | * @return #GNUNET_OK if there is a valid record value in the dialog | 101 | * @return #GNUNET_OK if there is a valid record value in the dialog |
85 | */ | 102 | */ |
@@ -110,7 +127,7 @@ a_validate (void *cls, | |||
110 | void * | 127 | void * |
111 | libgnunet_plugin_gtk_namestore_a_init (void *cls) | 128 | libgnunet_plugin_gtk_namestore_a_init (void *cls) |
112 | { | 129 | { |
113 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 130 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
114 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 131 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
115 | 132 | ||
116 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 133 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
@@ -131,7 +148,7 @@ libgnunet_plugin_gtk_namestore_a_init (void *cls) | |||
131 | * @return always NULL | 148 | * @return always NULL |
132 | */ | 149 | */ |
133 | void * | 150 | void * |
134 | libgnunet_plugin_gtk_namestore_aaaa_done (void *cls) | 151 | libgnunet_plugin_gtk_namestore_a_done (void *cls) |
135 | { | 152 | { |
136 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin = cls; | 153 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin = cls; |
137 | 154 | ||
diff --git a/src/namestore/plugin_gtk_namestore_aaaa.c b/src/namestore/plugin_gtk_namestore_aaaa.c index d32fcc6b..08da0bec 100644 --- a/src/namestore/plugin_gtk_namestore_aaaa.c +++ b/src/namestore/plugin_gtk_namestore_aaaa.c | |||
@@ -28,11 +28,28 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the AAAA record value. Enable/disable 'save' | ||
32 | * button depending on the validity of the value. | ||
33 | * | ||
34 | * @param entry editing widget | ||
35 | * @param user_data the plugin environment | ||
36 | */ | ||
37 | void | ||
38 | GNS_edit_dialog_aaaa_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
42 | |||
43 | env->check_validity (env->cls); | ||
44 | } | ||
45 | |||
46 | |||
47 | /** | ||
31 | * Function that will be called to initialize the builder's | 48 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 49 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 50 | * The `n_value` is the existing value of the record as a string. |
34 | * | 51 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 53 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 54 | * @param builder the edit dialog's builder |
38 | */ | 55 | */ |
@@ -49,7 +66,7 @@ aaaa_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 66 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 67 | * record (in string format) once the dialog is being closed. |
51 | * | 68 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 69 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 70 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 71 | * @return record value as a string, as specified in the dialog |
55 | */ | 72 | */ |
@@ -57,8 +74,13 @@ static gchar * | |||
57 | aaaa_store (void *cls, | 74 | aaaa_store (void *cls, |
58 | GtkBuilder *builder) | 75 | GtkBuilder *builder) |
59 | { | 76 | { |
60 | GNUNET_break (0); | 77 | GtkEntry *entry; |
61 | return NULL; | 78 | const gchar *value; |
79 | |||
80 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
81 | "edit_dialog_aaaa_entry")); | ||
82 | value = gtk_entry_get_text (entry); | ||
83 | return g_strdup (value); | ||
62 | } | 84 | } |
63 | 85 | ||
64 | 86 | ||
@@ -69,7 +91,7 @@ aaaa_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 91 | * function should highlight fields with invalid inputs for the |
70 | * user. | 92 | * user. |
71 | * | 93 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 94 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 95 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 96 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 97 | */ |
@@ -77,7 +99,16 @@ static int | |||
77 | aaaa_validate (void *cls, | 99 | aaaa_validate (void *cls, |
78 | GtkBuilder *builder) | 100 | GtkBuilder *builder) |
79 | { | 101 | { |
80 | GNUNET_break (0); | 102 | GtkEditable *entry; |
103 | const gchar *preedit; | ||
104 | struct in6_addr v6; | ||
105 | |||
106 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
107 | "edit_dialog_aaaa_entry")), | ||
108 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
109 | if ( (NULL == preedit) || | ||
110 | (1 != inet_pton (AF_INET6, preedit, &v6)) ) | ||
111 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 112 | return GNUNET_OK; |
82 | } | 113 | } |
83 | 114 | ||
@@ -91,7 +122,7 @@ aaaa_validate (void *cls, | |||
91 | void * | 122 | void * |
92 | libgnunet_plugin_gtk_namestore_aaaa_init (void *cls) | 123 | libgnunet_plugin_gtk_namestore_aaaa_init (void *cls) |
93 | { | 124 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 125 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 126 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 127 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 128 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_cname.c b/src/namestore/plugin_gtk_namestore_cname.c index 581c740c..e9f2c119 100644 --- a/src/namestore/plugin_gtk_namestore_cname.c +++ b/src/namestore/plugin_gtk_namestore_cname.c | |||
@@ -28,11 +28,28 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the CNAME record value. Enable/disable 'save' | ||
32 | * button depending on the validity of the value. | ||
33 | * | ||
34 | * @param entry editing widget | ||
35 | * @param user_data the plugin environment | ||
36 | */ | ||
37 | void | ||
38 | GNS_edit_dialog_cname_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
42 | |||
43 | env->check_validity (env->cls); | ||
44 | } | ||
45 | |||
46 | |||
47 | /** | ||
31 | * Function that will be called to initialize the builder's | 48 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 49 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 50 | * The `n_value` is the existing value of the record as a string. |
34 | * | 51 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 53 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 54 | * @param builder the edit dialog's builder |
38 | */ | 55 | */ |
@@ -41,7 +58,12 @@ cname_load (void *cls, | |||
41 | gchar *n_value, | 58 | gchar *n_value, |
42 | GtkBuilder *builder) | 59 | GtkBuilder *builder) |
43 | { | 60 | { |
44 | GNUNET_break (0); | 61 | GtkEntry *entry; |
62 | |||
63 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
64 | "edit_dialog_cname_entry")); | ||
65 | gtk_entry_set_text (entry, | ||
66 | n_value); | ||
45 | } | 67 | } |
46 | 68 | ||
47 | 69 | ||
@@ -49,7 +71,7 @@ cname_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 71 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 72 | * record (in string format) once the dialog is being closed. |
51 | * | 73 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 74 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 75 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 76 | * @return record value as a string, as specified in the dialog |
55 | */ | 77 | */ |
@@ -57,8 +79,13 @@ static gchar * | |||
57 | cname_store (void *cls, | 79 | cname_store (void *cls, |
58 | GtkBuilder *builder) | 80 | GtkBuilder *builder) |
59 | { | 81 | { |
60 | GNUNET_break (0); | 82 | GtkEntry *entry; |
61 | return NULL; | 83 | const gchar *value; |
84 | |||
85 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
86 | "edit_dialog_cname_entry")); | ||
87 | value = gtk_entry_get_text (entry); | ||
88 | return g_strdup (value); | ||
62 | } | 89 | } |
63 | 90 | ||
64 | 91 | ||
@@ -69,7 +96,7 @@ cname_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 96 | * function should highlight fields with invalid inputs for the |
70 | * user. | 97 | * user. |
71 | * | 98 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 99 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 100 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 101 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 102 | */ |
@@ -77,7 +104,15 @@ static int | |||
77 | cname_validate (void *cls, | 104 | cname_validate (void *cls, |
78 | GtkBuilder *builder) | 105 | GtkBuilder *builder) |
79 | { | 106 | { |
80 | GNUNET_break (0); | 107 | GtkEditable *entry; |
108 | const gchar *preedit; | ||
109 | |||
110 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
111 | "edit_dialog_cname_entry")), | ||
112 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
113 | if ( (NULL == preedit) || | ||
114 | (GNUNET_OK != GNUNET_DNSPARSER_check_name (preedit)) ) | ||
115 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 116 | return GNUNET_OK; |
82 | } | 117 | } |
83 | 118 | ||
@@ -91,7 +126,7 @@ cname_validate (void *cls, | |||
91 | void * | 126 | void * |
92 | libgnunet_plugin_gtk_namestore_cname_init (void *cls) | 127 | libgnunet_plugin_gtk_namestore_cname_init (void *cls) |
93 | { | 128 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 129 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 130 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 131 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 132 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_gns2dns.c b/src/namestore/plugin_gtk_namestore_gns2dns.c index 76879194..88d41ba9 100644 --- a/src/namestore/plugin_gtk_namestore_gns2dns.c +++ b/src/namestore/plugin_gtk_namestore_gns2dns.c | |||
@@ -27,12 +27,30 @@ | |||
27 | #include "gnunet_gtk_namestore_plugin.h" | 27 | #include "gnunet_gtk_namestore_plugin.h" |
28 | 28 | ||
29 | 29 | ||
30 | |||
31 | /** | ||
32 | * The user has edited the GNS2DNS record value. Enable/disable 'save' | ||
33 | * button depending on the validity of the value. | ||
34 | * | ||
35 | * @param entry editing widget | ||
36 | * @param user_data the plugin environment | ||
37 | */ | ||
38 | void | ||
39 | GNS_edit_dialog_gns2dns_entry_changed_cb (GtkEditable *entry, | ||
40 | gpointer user_data) | ||
41 | { | ||
42 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
43 | |||
44 | env->check_validity (env->cls); | ||
45 | } | ||
46 | |||
47 | |||
30 | /** | 48 | /** |
31 | * Function that will be called to initialize the builder's | 49 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 50 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 51 | * The `n_value` is the existing value of the record as a string. |
34 | * | 52 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 53 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 54 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 55 | * @param builder the edit dialog's builder |
38 | */ | 56 | */ |
@@ -41,7 +59,9 @@ gns2dns_load (void *cls, | |||
41 | gchar *n_value, | 59 | gchar *n_value, |
42 | GtkBuilder *builder) | 60 | GtkBuilder *builder) |
43 | { | 61 | { |
44 | GNUNET_break (0); | 62 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, |
63 | "edit_dialog_gns2dns_entry")), | ||
64 | n_value); | ||
45 | } | 65 | } |
46 | 66 | ||
47 | 67 | ||
@@ -49,7 +69,7 @@ gns2dns_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 69 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 70 | * record (in string format) once the dialog is being closed. |
51 | * | 71 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 73 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 74 | * @return record value as a string, as specified in the dialog |
55 | */ | 75 | */ |
@@ -57,8 +77,13 @@ static gchar * | |||
57 | gns2dns_store (void *cls, | 77 | gns2dns_store (void *cls, |
58 | GtkBuilder *builder) | 78 | GtkBuilder *builder) |
59 | { | 79 | { |
60 | GNUNET_break (0); | 80 | GtkEntry *entry; |
61 | return NULL; | 81 | const gchar *value; |
82 | |||
83 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
84 | "edit_dialog_gns2dns_entry")); | ||
85 | value = gtk_entry_get_text (entry); | ||
86 | return g_strdup (value); | ||
62 | } | 87 | } |
63 | 88 | ||
64 | 89 | ||
@@ -69,7 +94,7 @@ gns2dns_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 94 | * function should highlight fields with invalid inputs for the |
70 | * user. | 95 | * user. |
71 | * | 96 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 97 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 98 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 99 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 100 | */ |
@@ -77,7 +102,15 @@ static int | |||
77 | gns2dns_validate (void *cls, | 102 | gns2dns_validate (void *cls, |
78 | GtkBuilder *builder) | 103 | GtkBuilder *builder) |
79 | { | 104 | { |
80 | GNUNET_break (0); | 105 | GtkEditable *entry; |
106 | const gchar *preedit; | ||
107 | |||
108 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
109 | "edit_dialog_gns2dns_entry")), | ||
110 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
111 | if ( (NULL == preedit) || | ||
112 | (GNUNET_OK != GNUNET_DNSPARSER_check_name (preedit)) ) | ||
113 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 114 | return GNUNET_OK; |
82 | } | 115 | } |
83 | 116 | ||
@@ -91,7 +124,7 @@ gns2dns_validate (void *cls, | |||
91 | void * | 124 | void * |
92 | libgnunet_plugin_gtk_namestore_gns2dns_init (void *cls) | 125 | libgnunet_plugin_gtk_namestore_gns2dns_init (void *cls) |
93 | { | 126 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 127 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 128 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 129 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 130 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_leho.c b/src/namestore/plugin_gtk_namestore_leho.c index abf33f6d..9187c4fd 100644 --- a/src/namestore/plugin_gtk_namestore_leho.c +++ b/src/namestore/plugin_gtk_namestore_leho.c | |||
@@ -27,12 +27,31 @@ | |||
27 | #include "gnunet_gtk_namestore_plugin.h" | 27 | #include "gnunet_gtk_namestore_plugin.h" |
28 | 28 | ||
29 | 29 | ||
30 | |||
31 | |||
32 | /** | ||
33 | * The user has edited the LEHO record value. Enable/disable 'save' | ||
34 | * button depending on the validity of the value. | ||
35 | * | ||
36 | * @param entry editing widget | ||
37 | * @param user_data the plugin environment | ||
38 | */ | ||
39 | void | ||
40 | GNS_edit_dialog_leho_entry_changed_cb (GtkEditable *entry, | ||
41 | gpointer user_data) | ||
42 | { | ||
43 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
44 | |||
45 | env->check_validity (env->cls); | ||
46 | } | ||
47 | |||
48 | |||
30 | /** | 49 | /** |
31 | * Function that will be called to initialize the builder's | 50 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 51 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 52 | * The `n_value` is the existing value of the record as a string. |
34 | * | 53 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 54 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 55 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 56 | * @param builder the edit dialog's builder |
38 | */ | 57 | */ |
@@ -41,7 +60,12 @@ leho_load (void *cls, | |||
41 | gchar *n_value, | 60 | gchar *n_value, |
42 | GtkBuilder *builder) | 61 | GtkBuilder *builder) |
43 | { | 62 | { |
44 | GNUNET_break (0); | 63 | GtkEntry *entry; |
64 | |||
65 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
66 | "edit_dialog_leho_entry")); | ||
67 | gtk_entry_set_text (entry, | ||
68 | n_value); | ||
45 | } | 69 | } |
46 | 70 | ||
47 | 71 | ||
@@ -49,7 +73,7 @@ leho_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 73 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 74 | * record (in string format) once the dialog is being closed. |
51 | * | 75 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 76 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 77 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 78 | * @return record value as a string, as specified in the dialog |
55 | */ | 79 | */ |
@@ -57,8 +81,13 @@ static gchar * | |||
57 | leho_store (void *cls, | 81 | leho_store (void *cls, |
58 | GtkBuilder *builder) | 82 | GtkBuilder *builder) |
59 | { | 83 | { |
60 | GNUNET_break (0); | 84 | GtkEntry *entry; |
61 | return NULL; | 85 | const gchar *value; |
86 | |||
87 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
88 | "edit_dialog_leho_entry")); | ||
89 | value = gtk_entry_get_text (entry); | ||
90 | return g_strdup (value); | ||
62 | } | 91 | } |
63 | 92 | ||
64 | 93 | ||
@@ -69,7 +98,7 @@ leho_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 98 | * function should highlight fields with invalid inputs for the |
70 | * user. | 99 | * user. |
71 | * | 100 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 101 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 102 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 103 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 104 | */ |
@@ -77,7 +106,15 @@ static int | |||
77 | leho_validate (void *cls, | 106 | leho_validate (void *cls, |
78 | GtkBuilder *builder) | 107 | GtkBuilder *builder) |
79 | { | 108 | { |
80 | GNUNET_break (0); | 109 | GtkEditable *entry; |
110 | const gchar *preedit; | ||
111 | |||
112 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
113 | "edit_dialog_leho_entry")), | ||
114 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
115 | if ( (NULL == preedit) || | ||
116 | (GNUNET_OK != GNUNET_DNSPARSER_check_name (preedit)) ) | ||
117 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 118 | return GNUNET_OK; |
82 | } | 119 | } |
83 | 120 | ||
@@ -91,7 +128,7 @@ leho_validate (void *cls, | |||
91 | void * | 128 | void * |
92 | libgnunet_plugin_gtk_namestore_leho_init (void *cls) | 129 | libgnunet_plugin_gtk_namestore_leho_init (void *cls) |
93 | { | 130 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 131 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 132 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 133 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 134 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_mx.c b/src/namestore/plugin_gtk_namestore_mx.c index 6a61a095..34b9df71 100644 --- a/src/namestore/plugin_gtk_namestore_mx.c +++ b/src/namestore/plugin_gtk_namestore_mx.c | |||
@@ -28,11 +28,28 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the MX record value. Enable/disable 'save' | ||
32 | * button depending on the validity of the value. | ||
33 | * | ||
34 | * @param entry editing widget | ||
35 | * @param user_data the plugin environment | ||
36 | */ | ||
37 | void | ||
38 | GNS_edit_dialog_mx_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
42 | |||
43 | env->check_validity (env->cls); | ||
44 | } | ||
45 | |||
46 | |||
47 | /** | ||
31 | * Function that will be called to initialize the builder's | 48 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 49 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 50 | * The `n_value` is the existing value of the record as a string. |
34 | * | 51 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 53 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 54 | * @param builder the edit dialog's builder |
38 | */ | 55 | */ |
@@ -41,7 +58,27 @@ mx_load (void *cls, | |||
41 | gchar *n_value, | 58 | gchar *n_value, |
42 | GtkBuilder *builder) | 59 | GtkBuilder *builder) |
43 | { | 60 | { |
44 | GNUNET_break (0); | 61 | uint16_t mx_pref; |
62 | char result[253 + 1]; | ||
63 | |||
64 | if (2 != SSCANF (n_value, | ||
65 | "%hu,%253s", | ||
66 | &mx_pref, result)) | ||
67 | { | ||
68 | GNUNET_break (0); | ||
69 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
70 | _("Unable to parse MX record `%s'\n"), | ||
71 | n_value); | ||
72 | return; | ||
73 | } | ||
74 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, | ||
75 | "edit_dialog_mx_entry")), | ||
76 | result); | ||
77 | gtk_spin_button_set_value | ||
78 | (GTK_SPIN_BUTTON | ||
79 | (gtk_builder_get_object (builder, | ||
80 | "edit_dialog_mx_distance_spinbutton")), | ||
81 | mx_pref); | ||
45 | } | 82 | } |
46 | 83 | ||
47 | 84 | ||
@@ -49,7 +86,7 @@ mx_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 86 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 87 | * record (in string format) once the dialog is being closed. |
51 | * | 88 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 89 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 90 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 91 | * @return record value as a string, as specified in the dialog |
55 | */ | 92 | */ |
@@ -57,8 +94,26 @@ static gchar * | |||
57 | mx_store (void *cls, | 94 | mx_store (void *cls, |
58 | GtkBuilder *builder) | 95 | GtkBuilder *builder) |
59 | { | 96 | { |
60 | GNUNET_break (0); | 97 | GtkEntry *entry; |
61 | return NULL; | 98 | const gchar *value; |
99 | char *result; | ||
100 | unsigned int distance; | ||
101 | gchar *ret; | ||
102 | |||
103 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
104 | "edit_dialog_mx_entry")); | ||
105 | value = gtk_entry_get_text (entry); | ||
106 | distance = gtk_spin_button_get_value | ||
107 | (GTK_SPIN_BUTTON | ||
108 | (gtk_builder_get_object (builder, | ||
109 | "edit_dialog_mx_distance_spinbutton"))); | ||
110 | GNUNET_asprintf (&result, | ||
111 | "%hu,%s", | ||
112 | distance, | ||
113 | value); | ||
114 | ret = g_strdup (result); | ||
115 | GNUNET_free (result); | ||
116 | return ret; | ||
62 | } | 117 | } |
63 | 118 | ||
64 | 119 | ||
@@ -69,7 +124,7 @@ mx_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 124 | * function should highlight fields with invalid inputs for the |
70 | * user. | 125 | * user. |
71 | * | 126 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 127 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 128 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 129 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 130 | */ |
@@ -77,7 +132,15 @@ static int | |||
77 | mx_validate (void *cls, | 132 | mx_validate (void *cls, |
78 | GtkBuilder *builder) | 133 | GtkBuilder *builder) |
79 | { | 134 | { |
80 | GNUNET_break (0); | 135 | GtkEditable *entry; |
136 | const gchar *preedit; | ||
137 | |||
138 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
139 | "edit_dialog_mx_entry")), | ||
140 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
141 | if ( (NULL == preedit) || | ||
142 | (GNUNET_OK != GNUNET_DNSPARSER_check_name (preedit)) ) | ||
143 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 144 | return GNUNET_OK; |
82 | } | 145 | } |
83 | 146 | ||
@@ -91,7 +154,7 @@ mx_validate (void *cls, | |||
91 | void * | 154 | void * |
92 | libgnunet_plugin_gtk_namestore_mx_init (void *cls) | 155 | libgnunet_plugin_gtk_namestore_mx_init (void *cls) |
93 | { | 156 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 157 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 158 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 159 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 160 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
@@ -112,7 +175,7 @@ libgnunet_plugin_gtk_namestore_mx_init (void *cls) | |||
112 | * @return always NULL | 175 | * @return always NULL |
113 | */ | 176 | */ |
114 | void * | 177 | void * |
115 | libgnunet_plugin_gtk_namestore_aaaa_done (void *cls) | 178 | libgnunet_plugin_gtk_namestore_mx_done (void *cls) |
116 | { | 179 | { |
117 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin = cls; | 180 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin = cls; |
118 | 181 | ||
diff --git a/src/namestore/plugin_gtk_namestore_phone.c b/src/namestore/plugin_gtk_namestore_phone.c index 29815538..33defbf7 100644 --- a/src/namestore/plugin_gtk_namestore_phone.c +++ b/src/namestore/plugin_gtk_namestore_phone.c | |||
@@ -27,12 +27,31 @@ | |||
27 | #include "gnunet_gtk_namestore_plugin.h" | 27 | #include "gnunet_gtk_namestore_plugin.h" |
28 | 28 | ||
29 | 29 | ||
30 | |||
31 | |||
32 | /** | ||
33 | * The user has edited the PHONE record value. Enable/disable 'save' | ||
34 | * button depending on the validity of the value. | ||
35 | * | ||
36 | * @param entry editing widget | ||
37 | * @param user_data the plugin environment | ||
38 | */ | ||
39 | void | ||
40 | GNS_edit_dialog_phone_peer_entry_changed_cb (GtkEditable *entry, | ||
41 | gpointer user_data) | ||
42 | { | ||
43 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
44 | |||
45 | env->check_validity (env->cls); | ||
46 | } | ||
47 | |||
48 | |||
30 | /** | 49 | /** |
31 | * Function that will be called to initialize the builder's | 50 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 51 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 52 | * The `n_value` is the existing value of the record as a string. |
34 | * | 53 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 54 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 55 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 56 | * @param builder the edit dialog's builder |
38 | */ | 57 | */ |
@@ -41,7 +60,28 @@ phone_load (void *cls, | |||
41 | gchar *n_value, | 60 | gchar *n_value, |
42 | GtkBuilder *builder) | 61 | GtkBuilder *builder) |
43 | { | 62 | { |
44 | GNUNET_break (0); | 63 | const char *minus; |
64 | unsigned int line; | ||
65 | |||
66 | if (1 != (sscanf (n_value, | ||
67 | "%u-", | ||
68 | &line))) | ||
69 | { | ||
70 | GNUNET_break (0); | ||
71 | return; | ||
72 | } | ||
73 | gtk_spin_button_set_value (GTK_SPIN_BUTTON | ||
74 | (gtk_builder_get_object (builder, | ||
75 | "edit_dialog_phone_line_spinbutton")), | ||
76 | line); | ||
77 | if (NULL == (minus = strchr (n_value, '-'))) | ||
78 | { | ||
79 | GNUNET_break (0); | ||
80 | return; | ||
81 | } | ||
82 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, | ||
83 | "edit_dialog_phone_peer_entry")), | ||
84 | minus + 1); | ||
45 | } | 85 | } |
46 | 86 | ||
47 | 87 | ||
@@ -49,7 +89,7 @@ phone_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 89 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 90 | * record (in string format) once the dialog is being closed. |
51 | * | 91 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 92 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 93 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 94 | * @return record value as a string, as specified in the dialog |
55 | */ | 95 | */ |
@@ -57,8 +97,23 @@ static gchar * | |||
57 | phone_store (void *cls, | 97 | phone_store (void *cls, |
58 | GtkBuilder *builder) | 98 | GtkBuilder *builder) |
59 | { | 99 | { |
60 | GNUNET_break (0); | 100 | GtkEntry *entry; |
61 | return NULL; | 101 | GtkSpinButton *spin; |
102 | const gchar *value; | ||
103 | unsigned int line; | ||
104 | char *ret; | ||
105 | |||
106 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
107 | "edit_dialog_phone_peer_entry")); | ||
108 | value = gtk_entry_get_text (entry); | ||
109 | spin = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | ||
110 | "edit_dialog_phone_line_spinbutton")); | ||
111 | line = gtk_spin_button_get_value (spin); | ||
112 | GNUNET_asprintf (&ret, | ||
113 | "%u-%s", | ||
114 | line, | ||
115 | value); | ||
116 | return ret; | ||
62 | } | 117 | } |
63 | 118 | ||
64 | 119 | ||
@@ -69,7 +124,7 @@ phone_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 124 | * function should highlight fields with invalid inputs for the |
70 | * user. | 125 | * user. |
71 | * | 126 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 127 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 128 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 129 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 130 | */ |
@@ -77,7 +132,19 @@ static int | |||
77 | phone_validate (void *cls, | 132 | phone_validate (void *cls, |
78 | GtkBuilder *builder) | 133 | GtkBuilder *builder) |
79 | { | 134 | { |
80 | GNUNET_break (0); | 135 | GtkEditable *entry; |
136 | const gchar *preedit; | ||
137 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | ||
138 | |||
139 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
140 | "edit_dialog_phone_peer_entry")); | ||
141 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
142 | if ( (NULL == preedit) || | ||
143 | (GNUNET_OK != | ||
144 | GNUNET_CRYPTO_ecdsa_public_key_from_string (preedit, | ||
145 | strlen (preedit), | ||
146 | &pub)) ) | ||
147 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 148 | return GNUNET_OK; |
82 | } | 149 | } |
83 | 150 | ||
@@ -91,7 +158,7 @@ phone_validate (void *cls, | |||
91 | void * | 158 | void * |
92 | libgnunet_plugin_gtk_namestore_phone_init (void *cls) | 159 | libgnunet_plugin_gtk_namestore_phone_init (void *cls) |
93 | { | 160 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 161 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 162 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 163 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 164 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_pkey.c b/src/namestore/plugin_gtk_namestore_pkey.c index 8b9e5c0a..f7cdc3de 100644 --- a/src/namestore/plugin_gtk_namestore_pkey.c +++ b/src/namestore/plugin_gtk_namestore_pkey.c | |||
@@ -28,11 +28,28 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the PKEY record value. Enable/disable 'save' | ||
32 | * button depending on the validity of the value. | ||
33 | * | ||
34 | * @param entry editing widget | ||
35 | * @param user_data the plugin environment | ||
36 | */ | ||
37 | void | ||
38 | GNS_edit_dialog_pkey_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
42 | |||
43 | env->check_validity (env->cls); | ||
44 | } | ||
45 | |||
46 | |||
47 | /** | ||
31 | * Function that will be called to initialize the builder's | 48 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 49 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 50 | * The `n_value` is the existing value of the record as a string. |
34 | * | 51 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 53 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 54 | * @param builder the edit dialog's builder |
38 | */ | 55 | */ |
@@ -41,7 +58,9 @@ pkey_load (void *cls, | |||
41 | gchar *n_value, | 58 | gchar *n_value, |
42 | GtkBuilder *builder) | 59 | GtkBuilder *builder) |
43 | { | 60 | { |
44 | GNUNET_break (0); | 61 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, |
62 | "edit_dialog_pkey_entry")), | ||
63 | n_value); | ||
45 | } | 64 | } |
46 | 65 | ||
47 | 66 | ||
@@ -49,7 +68,7 @@ pkey_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 68 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 69 | * record (in string format) once the dialog is being closed. |
51 | * | 70 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 71 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 72 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 73 | * @return record value as a string, as specified in the dialog |
55 | */ | 74 | */ |
@@ -57,8 +76,13 @@ static gchar * | |||
57 | pkey_store (void *cls, | 76 | pkey_store (void *cls, |
58 | GtkBuilder *builder) | 77 | GtkBuilder *builder) |
59 | { | 78 | { |
60 | GNUNET_break (0); | 79 | GtkEntry *entry; |
61 | return NULL; | 80 | const gchar *value; |
81 | |||
82 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
83 | "edit_dialog_pkey_entry")); | ||
84 | value = gtk_entry_get_text (entry); | ||
85 | return g_strdup (value); | ||
62 | } | 86 | } |
63 | 87 | ||
64 | 88 | ||
@@ -69,7 +93,7 @@ pkey_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 93 | * function should highlight fields with invalid inputs for the |
70 | * user. | 94 | * user. |
71 | * | 95 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 96 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 97 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 98 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 99 | */ |
@@ -77,7 +101,19 @@ static int | |||
77 | pkey_validate (void *cls, | 101 | pkey_validate (void *cls, |
78 | GtkBuilder *builder) | 102 | GtkBuilder *builder) |
79 | { | 103 | { |
80 | GNUNET_break (0); | 104 | GtkEditable *entry; |
105 | const gchar *preedit; | ||
106 | struct GNUNET_CRYPTO_EcdsaPublicKey pub; | ||
107 | |||
108 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
109 | "edit_dialog_pkey_entry")), | ||
110 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
111 | if ( (NULL == preedit) || | ||
112 | (GNUNET_OK != | ||
113 | GNUNET_CRYPTO_ecdsa_public_key_from_string (preedit, | ||
114 | strlen (preedit), | ||
115 | &pub)) ) | ||
116 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 117 | return GNUNET_OK; |
82 | } | 118 | } |
83 | 119 | ||
@@ -91,7 +127,7 @@ pkey_validate (void *cls, | |||
91 | void * | 127 | void * |
92 | libgnunet_plugin_gtk_namestore_pkey_init (void *cls) | 128 | libgnunet_plugin_gtk_namestore_pkey_init (void *cls) |
93 | { | 129 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 130 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 131 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 132 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 133 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_ptr.c b/src/namestore/plugin_gtk_namestore_ptr.c index ada87eef..adf89f23 100644 --- a/src/namestore/plugin_gtk_namestore_ptr.c +++ b/src/namestore/plugin_gtk_namestore_ptr.c | |||
@@ -28,11 +28,28 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the PTR record value. Enable/disable 'save' | ||
32 | * button depending on the validity of the value. | ||
33 | * | ||
34 | * @param entry editing widget | ||
35 | * @param user_data the plugin environment | ||
36 | */ | ||
37 | void | ||
38 | GNS_edit_dialog_ptr_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = user_data; | ||
42 | |||
43 | env->check_validity (env->cls); | ||
44 | } | ||
45 | |||
46 | |||
47 | /** | ||
31 | * Function that will be called to initialize the builder's | 48 | * Function that will be called to initialize the builder's |
32 | * widgets from the existing record (if there is one). | 49 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 50 | * The `n_value` is the existing value of the record as a string. |
34 | * | 51 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 53 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 54 | * @param builder the edit dialog's builder |
38 | */ | 55 | */ |
@@ -41,7 +58,9 @@ ptr_load (void *cls, | |||
41 | gchar *n_value, | 58 | gchar *n_value, |
42 | GtkBuilder *builder) | 59 | GtkBuilder *builder) |
43 | { | 60 | { |
44 | GNUNET_break (0); | 61 | gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (builder, |
62 | "edit_dialog_ptr_entry")), | ||
63 | n_value); | ||
45 | } | 64 | } |
46 | 65 | ||
47 | 66 | ||
@@ -49,7 +68,7 @@ ptr_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 68 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 69 | * record (in string format) once the dialog is being closed. |
51 | * | 70 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 71 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 72 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 73 | * @return record value as a string, as specified in the dialog |
55 | */ | 74 | */ |
@@ -57,8 +76,13 @@ static gchar * | |||
57 | ptr_store (void *cls, | 76 | ptr_store (void *cls, |
58 | GtkBuilder *builder) | 77 | GtkBuilder *builder) |
59 | { | 78 | { |
60 | GNUNET_break (0); | 79 | GtkEntry *entry; |
61 | return NULL; | 80 | const gchar *value; |
81 | |||
82 | entry = GTK_ENTRY (gtk_builder_get_object (builder, | ||
83 | "edit_dialog_ptr_entry")); | ||
84 | value = gtk_entry_get_text (entry); | ||
85 | return g_strdup (value); | ||
62 | } | 86 | } |
63 | 87 | ||
64 | 88 | ||
@@ -69,7 +93,7 @@ ptr_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 93 | * function should highlight fields with invalid inputs for the |
70 | * user. | 94 | * user. |
71 | * | 95 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 96 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 97 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 98 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 99 | */ |
@@ -77,7 +101,15 @@ static int | |||
77 | ptr_validate (void *cls, | 101 | ptr_validate (void *cls, |
78 | GtkBuilder *builder) | 102 | GtkBuilder *builder) |
79 | { | 103 | { |
80 | GNUNET_break (0); | 104 | GtkEditable *entry; |
105 | const gchar *preedit; | ||
106 | |||
107 | entry = GTK_EDITABLE (gtk_builder_get_object (builder, | ||
108 | "edit_dialog_ptr_entry")), | ||
109 | preedit = gtk_editable_get_chars (entry, 0, -1); | ||
110 | if ( (NULL == preedit) || | ||
111 | (GNUNET_OK != GNUNET_DNSPARSER_check_name (preedit)) ) | ||
112 | return GNUNET_SYSERR; | ||
81 | return GNUNET_OK; | 113 | return GNUNET_OK; |
82 | } | 114 | } |
83 | 115 | ||
@@ -91,7 +123,7 @@ ptr_validate (void *cls, | |||
91 | void * | 123 | void * |
92 | libgnunet_plugin_gtk_namestore_ptr_init (void *cls) | 124 | libgnunet_plugin_gtk_namestore_ptr_init (void *cls) |
93 | { | 125 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 126 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 127 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 128 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 129 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_soa.c b/src/namestore/plugin_gtk_namestore_soa.c index 920db7ba..20cc3920 100644 --- a/src/namestore/plugin_gtk_namestore_soa.c +++ b/src/namestore/plugin_gtk_namestore_soa.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * widgets from the existing record (if there is one). | 32 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 33 | * The `n_value` is the existing value of the record as a string. |
34 | * | 34 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 36 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 37 | * @param builder the edit dialog's builder |
38 | */ | 38 | */ |
@@ -49,7 +49,7 @@ soa_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 49 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 50 | * record (in string format) once the dialog is being closed. |
51 | * | 51 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 53 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 54 | * @return record value as a string, as specified in the dialog |
55 | */ | 55 | */ |
@@ -69,7 +69,7 @@ soa_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 69 | * function should highlight fields with invalid inputs for the |
70 | * user. | 70 | * user. |
71 | * | 71 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 73 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 74 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 75 | */ |
@@ -91,7 +91,7 @@ soa_validate (void *cls, | |||
91 | void * | 91 | void * |
92 | libgnunet_plugin_gtk_namestore_soa_init (void *cls) | 92 | libgnunet_plugin_gtk_namestore_soa_init (void *cls) |
93 | { | 93 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 94 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 96 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_srv.c b/src/namestore/plugin_gtk_namestore_srv.c index ea70d21f..f545d263 100644 --- a/src/namestore/plugin_gtk_namestore_srv.c +++ b/src/namestore/plugin_gtk_namestore_srv.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * widgets from the existing record (if there is one). | 32 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 33 | * The `n_value` is the existing value of the record as a string. |
34 | * | 34 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 36 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 37 | * @param builder the edit dialog's builder |
38 | */ | 38 | */ |
@@ -49,7 +49,7 @@ srv_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 49 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 50 | * record (in string format) once the dialog is being closed. |
51 | * | 51 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 53 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 54 | * @return record value as a string, as specified in the dialog |
55 | */ | 55 | */ |
@@ -69,7 +69,7 @@ srv_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 69 | * function should highlight fields with invalid inputs for the |
70 | * user. | 70 | * user. |
71 | * | 71 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 73 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 74 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 75 | */ |
@@ -91,7 +91,7 @@ srv_validate (void *cls, | |||
91 | void * | 91 | void * |
92 | libgnunet_plugin_gtk_namestore_srv_init (void *cls) | 92 | libgnunet_plugin_gtk_namestore_srv_init (void *cls) |
93 | { | 93 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 94 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 96 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_template.c b/src/namestore/plugin_gtk_namestore_template.c index e27d604b..1f477d09 100644 --- a/src/namestore/plugin_gtk_namestore_template.c +++ b/src/namestore/plugin_gtk_namestore_template.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * widgets from the existing record (if there is one). | 32 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 33 | * The `n_value` is the existing value of the record as a string. |
34 | * | 34 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 36 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 37 | * @param builder the edit dialog's builder |
38 | */ | 38 | */ |
@@ -49,7 +49,7 @@ a_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 49 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 50 | * record (in string format) once the dialog is being closed. |
51 | * | 51 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 53 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 54 | * @return record value as a string, as specified in the dialog |
55 | */ | 55 | */ |
@@ -69,7 +69,7 @@ a_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 69 | * function should highlight fields with invalid inputs for the |
70 | * user. | 70 | * user. |
71 | * | 71 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 73 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 74 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 75 | */ |
@@ -91,7 +91,7 @@ a_validate (void *cls, | |||
91 | void * | 91 | void * |
92 | libgnunet_plugin_gtk_namestore_a_init (void *cls) | 92 | libgnunet_plugin_gtk_namestore_a_init (void *cls) |
93 | { | 93 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 94 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 96 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_txt.c b/src/namestore/plugin_gtk_namestore_txt.c index b11ffacb..c8c84dd3 100644 --- a/src/namestore/plugin_gtk_namestore_txt.c +++ b/src/namestore/plugin_gtk_namestore_txt.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * widgets from the existing record (if there is one). | 32 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 33 | * The `n_value` is the existing value of the record as a string. |
34 | * | 34 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 36 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 37 | * @param builder the edit dialog's builder |
38 | */ | 38 | */ |
@@ -49,7 +49,7 @@ txt_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 49 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 50 | * record (in string format) once the dialog is being closed. |
51 | * | 51 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 53 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 54 | * @return record value as a string, as specified in the dialog |
55 | */ | 55 | */ |
@@ -69,7 +69,7 @@ txt_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 69 | * function should highlight fields with invalid inputs for the |
70 | * user. | 70 | * user. |
71 | * | 71 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 73 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 74 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 75 | */ |
@@ -91,7 +91,7 @@ txt_validate (void *cls, | |||
91 | void * | 91 | void * |
92 | libgnunet_plugin_gtk_namestore_txt_init (void *cls) | 92 | libgnunet_plugin_gtk_namestore_txt_init (void *cls) |
93 | { | 93 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 94 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 96 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
diff --git a/src/namestore/plugin_gtk_namestore_vpn.c b/src/namestore/plugin_gtk_namestore_vpn.c index d37dabd5..622c69e5 100644 --- a/src/namestore/plugin_gtk_namestore_vpn.c +++ b/src/namestore/plugin_gtk_namestore_vpn.c | |||
@@ -32,7 +32,7 @@ | |||
32 | * widgets from the existing record (if there is one). | 32 | * widgets from the existing record (if there is one). |
33 | * The `n_value` is the existing value of the record as a string. | 33 | * The `n_value` is the existing value of the record as a string. |
34 | * | 34 | * |
35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 35 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
36 | * @param n_value the record as a string | 36 | * @param n_value the record as a string |
37 | * @param builder the edit dialog's builder | 37 | * @param builder the edit dialog's builder |
38 | */ | 38 | */ |
@@ -49,7 +49,7 @@ vpn_load (void *cls, | |||
49 | * Function that will be called to retrieve the final value of the | 49 | * Function that will be called to retrieve the final value of the |
50 | * record (in string format) once the dialog is being closed. | 50 | * record (in string format) once the dialog is being closed. |
51 | * | 51 | * |
52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 52 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
53 | * @param builder the edit dialog's builder | 53 | * @param builder the edit dialog's builder |
54 | * @return record value as a string, as specified in the dialog | 54 | * @return record value as a string, as specified in the dialog |
55 | */ | 55 | */ |
@@ -69,7 +69,7 @@ vpn_store (void *cls, | |||
69 | * function should highlight fields with invalid inputs for the | 69 | * function should highlight fields with invalid inputs for the |
70 | * user. | 70 | * user. |
71 | * | 71 | * |
72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *` | 72 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment *` |
73 | * @param builder the edit dialog's builder | 73 | * @param builder the edit dialog's builder |
74 | * @return #GNUNET_OK if there is a valid record value in the dialog | 74 | * @return #GNUNET_OK if there is a valid record value in the dialog |
75 | */ | 75 | */ |
@@ -91,7 +91,7 @@ vpn_validate (void *cls, | |||
91 | void * | 91 | void * |
92 | libgnunet_plugin_gtk_namestore_vpn_init (void *cls) | 92 | libgnunet_plugin_gtk_namestore_vpn_init (void *cls) |
93 | { | 93 | { |
94 | struct GNUNET_GTK_NAMESTORE_PluginEnvirionment *env = cls; | 94 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 95 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
96 | 96 | ||
97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 97 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |