diff options
Diffstat (limited to 'src/namestore/plugin_gtk_namestore_txt.c')
-rw-r--r-- | src/namestore/plugin_gtk_namestore_txt.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/namestore/plugin_gtk_namestore_txt.c b/src/namestore/plugin_gtk_namestore_txt.c index 9af4371d..2cf8c4f4 100644 --- a/src/namestore/plugin_gtk_namestore_txt.c +++ b/src/namestore/plugin_gtk_namestore_txt.c | |||
@@ -28,6 +28,23 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | /** | 30 | /** |
31 | * The user has edited the TXT 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 | static void | ||
38 | GNS_edit_dialog_txt_entry_changed_cb (GtkEditable *entry, | ||
39 | gpointer user_data) | ||
40 | { | ||
41 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *edc = user_data; | ||
42 | |||
43 | edc->check_validity (edc); | ||
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. |
@@ -57,7 +74,7 @@ txt_load (void *cls, | |||
57 | */ | 74 | */ |
58 | static gchar * | 75 | static gchar * |
59 | txt_store (void *cls, | 76 | txt_store (void *cls, |
60 | GtkBuilder *builder) | 77 | GtkBuilder *builder) |
61 | { | 78 | { |
62 | GtkEntry *entry; | 79 | GtkEntry *entry; |
63 | const gchar *value; | 80 | const gchar *value; |
@@ -82,7 +99,7 @@ txt_store (void *cls, | |||
82 | */ | 99 | */ |
83 | static int | 100 | static int |
84 | txt_validate (void *cls, | 101 | txt_validate (void *cls, |
85 | GtkBuilder *builder) | 102 | GtkBuilder *builder) |
86 | { | 103 | { |
87 | return GNUNET_OK; | 104 | return GNUNET_OK; |
88 | } | 105 | } |
@@ -91,7 +108,7 @@ txt_validate (void *cls, | |||
91 | /** | 108 | /** |
92 | * Entry point for the plugin. | 109 | * Entry point for the plugin. |
93 | * | 110 | * |
94 | * @param cls the "struct GNUNET_GTK_NAMESTORE_PluginEnvironment*" | 111 | * @param cls the `struct GNUNET_GTK_NAMESTORE_PluginEnvironment` |
95 | * @return NULL on error, otherwise the plugin context | 112 | * @return NULL on error, otherwise the plugin context |
96 | */ | 113 | */ |
97 | void * | 114 | void * |
@@ -99,11 +116,17 @@ libgnunet_plugin_gtk_namestore_txt_init (void *cls) | |||
99 | { | 116 | { |
100 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; | 117 | struct GNUNET_GTK_NAMESTORE_PluginEnvironment *env = cls; |
101 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; | 118 | struct GNUNET_GTK_NAMESTORE_PluginFunctions *plugin; |
119 | static struct GNUNET_GTK_NAMESTORE_Symbol symbols[] = { | ||
120 | { "GNS_edit_dialog_txt_entry_changed_cb", | ||
121 | G_CALLBACK (GNS_edit_dialog_txt_entry_changed_cb) }, | ||
122 | { NULL, NULL } | ||
123 | }; | ||
102 | 124 | ||
103 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); | 125 | plugin = GNUNET_new (struct GNUNET_GTK_NAMESTORE_PluginFunctions); |
104 | plugin->cls = env; | 126 | plugin->cls = env; |
105 | plugin->dialog_glade_filename = "gnunet_namestore_edit_txt.glade"; | 127 | plugin->dialog_glade_filename = "gnunet_namestore_edit_txt.glade"; |
106 | plugin->dialog_widget_name = "edit_txt_dialog"; | 128 | plugin->dialog_widget_name = "edit_txt_dialog"; |
129 | plugin->symbols = symbols; | ||
107 | plugin->load = &txt_load; | 130 | plugin->load = &txt_load; |
108 | plugin->store = &txt_store; | 131 | plugin->store = &txt_store; |
109 | plugin->validate = &txt_validate; | 132 | plugin->validate = &txt_validate; |