aboutsummaryrefslogtreecommitdiff
path: root/src/ui/messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/messenger.c')
-rw-r--r--src/ui/messenger.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
index afea63e..17b30a5 100644
--- a/src/ui/messenger.c
+++ b/src/ui/messenger.c
@@ -70,6 +70,26 @@ handle_account_details_button_click(UNUSED GtkButton* button,
70} 70}
71 71
72static void 72static void
73handle_accounts_listbox_row_activated(UNUSED GtkListBox* listbox,
74 GtkListBoxRow* row,
75 gpointer user_data)
76{
77 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
78
79 if (row == app->ui.messenger.add_account_listbox_row)
80 {
81 hdy_flap_set_reveal_flap(HDY_FLAP(app->ui.messenger.flap_user_details), FALSE);
82
83 ui_new_profile_dialog_init(app, &(app->ui.new_profile));
84
85 gtk_widget_show(GTK_WIDGET(app->ui.new_profile.dialog));
86 return;
87 }
88
89 // TODO: switch to selected profile
90}
91
92static void
73handle_new_contact_button_click(UNUSED GtkButton* button, 93handle_new_contact_button_click(UNUSED GtkButton* button,
74 gpointer user_data) 94 gpointer user_data)
75{ 95{
@@ -274,6 +294,17 @@ ui_messenger_init(MESSENGER_Application *app,
274 gtk_builder_get_object(handle->builder, "accounts_listbox") 294 gtk_builder_get_object(handle->builder, "accounts_listbox")
275 ); 295 );
276 296
297 handle->add_account_listbox_row = GTK_LIST_BOX_ROW(
298 gtk_builder_get_object(handle->builder, "add_account_listbox_row")
299 );
300
301 g_signal_connect(
302 handle->accounts_listbox,
303 "row-activated",
304 G_CALLBACK(handle_accounts_listbox_row_activated),
305 app
306 );
307
277 handle->new_contact_button = GTK_BUTTON( 308 handle->new_contact_button = GTK_BUTTON(
278 gtk_builder_get_object(handle->builder, "new_contact_button") 309 gtk_builder_get_object(handle->builder, "new_contact_button")
279 ); 310 );