diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c b/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c index 2068d69a..bb3265e0 100644 --- a/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c +++ b/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c | |||
@@ -83,6 +83,7 @@ GNUNET_GTK_advertise_pseudonym_keyword_list_del_button_clicked_cb () | |||
83 | GtkTreeSelection *sel; | 83 | GtkTreeSelection *sel; |
84 | GtkTreeModel *tm; | 84 | GtkTreeModel *tm; |
85 | GtkTreeIter iter; | 85 | GtkTreeIter iter; |
86 | GtkWidget *w; | ||
86 | 87 | ||
87 | tv = GTK_TREE_VIEW (gtk_builder_get_object | 88 | tv = GTK_TREE_VIEW (gtk_builder_get_object |
88 | (builder, | 89 | (builder, |
@@ -94,6 +95,13 @@ GNUNET_GTK_advertise_pseudonym_keyword_list_del_button_clicked_cb () | |||
94 | return; | 95 | return; |
95 | } | 96 | } |
96 | gtk_list_store_remove (GTK_LIST_STORE (tm), &iter); | 97 | gtk_list_store_remove (GTK_LIST_STORE (tm), &iter); |
98 | if (TRUE != gtk_tree_model_get_iter_first (tm, &iter)) | ||
99 | { | ||
100 | /* keyword list now empty, disable 'Ok' button! */ | ||
101 | w = GTK_WIDGET (gtk_builder_get_object (builder, | ||
102 | "GNUNET_GTK_advertise_pseudonym_confirm_button")); | ||
103 | gtk_widget_set_sensitive (w, FALSE); | ||
104 | } | ||
97 | } | 105 | } |
98 | 106 | ||
99 | 107 | ||
@@ -107,6 +115,7 @@ GNUNET_GTK_advertise_pseudonym_keyword_list_add_button_clicked_cb () | |||
107 | GtkEntry *entry; | 115 | GtkEntry *entry; |
108 | GtkListStore *ls; | 116 | GtkListStore *ls; |
109 | GtkTreeIter iter; | 117 | GtkTreeIter iter; |
118 | GtkWidget *w; | ||
110 | 119 | ||
111 | ls = GTK_LIST_STORE (gtk_builder_get_object | 120 | ls = GTK_LIST_STORE (gtk_builder_get_object |
112 | (builder, "GNUNET_GTK_keyword_list_store")); | 121 | (builder, "GNUNET_GTK_keyword_list_store")); |
@@ -115,7 +124,12 @@ GNUNET_GTK_advertise_pseudonym_keyword_list_add_button_clicked_cb () | |||
115 | (builder, "GNUNET_GTK_advertise_pseudonym_keyword_entry")); | 124 | (builder, "GNUNET_GTK_advertise_pseudonym_keyword_entry")); |
116 | keyword = gtk_entry_get_text (entry); | 125 | keyword = gtk_entry_get_text (entry); |
117 | if (strlen (keyword) > 0) | 126 | if (strlen (keyword) > 0) |
118 | gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, keyword, -1); | 127 | { |
128 | gtk_list_store_insert_with_values (ls, &iter, G_MAXINT, 0, keyword, -1); | ||
129 | /* enable OK button */ | ||
130 | w = GTK_WIDGET (gtk_builder_get_object (builder, "GNUNET_GTK_advertise_pseudonym_confirm_button")); | ||
131 | gtk_widget_set_sensitive (w, TRUE); | ||
132 | } | ||
119 | gtk_entry_set_text (entry, ""); | 133 | gtk_entry_set_text (entry, ""); |
120 | } | 134 | } |
121 | 135 | ||