diff options
Diffstat (limited to 'src/ui/contacts.c')
-rw-r--r-- | src/ui/contacts.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/ui/contacts.c b/src/ui/contacts.c index cc349f3..1a9b83b 100644 --- a/src/ui/contacts.c +++ b/src/ui/contacts.c | |||
@@ -36,6 +36,17 @@ handle_close_button_click(UNUSED GtkButton *button, | |||
36 | gtk_window_close(GTK_WINDOW(dialog)); | 36 | gtk_window_close(GTK_WINDOW(dialog)); |
37 | } | 37 | } |
38 | 38 | ||
39 | static gboolean | ||
40 | _open_new_contact_dialog(gpointer user_data) | ||
41 | { | ||
42 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | ||
43 | |||
44 | ui_new_contact_dialog_init(app, &(app->ui.new_contact)); | ||
45 | |||
46 | gtk_widget_show(GTK_WIDGET(app->ui.new_contact.dialog)); | ||
47 | return FALSE; | ||
48 | } | ||
49 | |||
39 | static void | 50 | static void |
40 | handle_contacts_listbox_row_activated(UNUSED GtkListBox* listbox, | 51 | handle_contacts_listbox_row_activated(UNUSED GtkListBox* listbox, |
41 | GtkListBoxRow* row, | 52 | GtkListBoxRow* row, |
@@ -43,6 +54,12 @@ handle_contacts_listbox_row_activated(UNUSED GtkListBox* listbox, | |||
43 | { | 54 | { |
44 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; | 55 | MESSENGER_Application *app = (MESSENGER_Application*) user_data; |
45 | 56 | ||
57 | if (!gtk_list_box_row_get_selectable(row)) | ||
58 | { | ||
59 | g_idle_add(G_SOURCE_FUNC(_open_new_contact_dialog), app); | ||
60 | goto close_dialog; | ||
61 | } | ||
62 | |||
46 | struct GNUNET_CHAT_Contact *contact = (struct GNUNET_CHAT_Contact*) ( | 63 | struct GNUNET_CHAT_Contact *contact = (struct GNUNET_CHAT_Contact*) ( |
47 | g_hash_table_lookup(app->ui.bindings, row) | 64 | g_hash_table_lookup(app->ui.bindings, row) |
48 | ); | 65 | ); |
@@ -135,8 +152,8 @@ _iterate_contacts(void *cls, | |||
135 | const char *key = GNUNET_CHAT_contact_get_key(contact); | 152 | const char *key = GNUNET_CHAT_contact_get_key(contact); |
136 | 153 | ||
137 | UI_CONTACT_ENTRY_Handle *entry = ui_contact_entry_new(); | 154 | UI_CONTACT_ENTRY_Handle *entry = ui_contact_entry_new(); |
138 | gtk_container_add( | 155 | gtk_list_box_prepend( |
139 | GTK_CONTAINER(app->ui.contacts.contacts_listbox), | 156 | app->ui.contacts.contacts_listbox, |
140 | entry->entry_box | 157 | entry->entry_box |
141 | ); | 158 | ); |
142 | 159 | ||