aboutsummaryrefslogtreecommitdiff
path: root/src/ui/messenger.c
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2021-10-30 21:13:51 +0200
committerTheJackiMonster <thejackimonster@gmail.com>2021-10-30 21:13:51 +0200
commitee55ecb8712955fc1d982b3a271c909896eb0631 (patch)
treef7413f1a3bd1ec433f3a7aa506c012ada82812ca /src/ui/messenger.c
parent7e0a36c3954f7a054a3a7acab1cdfb239a466917 (diff)
downloadmessenger-gtk-ee55ecb8712955fc1d982b3a271c909896eb0631.tar.gz
messenger-gtk-ee55ecb8712955fc1d982b3a271c909896eb0631.zip
Separated gtk, gnunet and events using both
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/ui/messenger.c')
-rw-r--r--src/ui/messenger.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
index 059927a..5a9796f 100644
--- a/src/ui/messenger.c
+++ b/src/ui/messenger.c
@@ -24,8 +24,11 @@
24 24
25#include "messenger.h" 25#include "messenger.h"
26 26
27void handle_flap_via_button_click(UI_UNUSED GtkButton* button, 27#include "../application.h"
28 gpointer user_data) 28
29static void
30handle_flap_via_button_click(UNUSED GtkButton* button,
31 gpointer user_data)
29{ 32{
30 HdyFlap* flap = HDY_FLAP(user_data); 33 HdyFlap* flap = HDY_FLAP(user_data);
31 34
@@ -36,8 +39,9 @@ void handle_flap_via_button_click(UI_UNUSED GtkButton* button,
36 } 39 }
37} 40}
38 41
39void handle_account_details_button_click(UI_UNUSED GtkButton* button, 42static void
40 gpointer user_data) 43handle_account_details_button_click(UNUSED GtkButton* button,
44 gpointer user_data)
41{ 45{
42 GtkRevealer* revealer = GTK_REVEALER(user_data); 46 GtkRevealer* revealer = GTK_REVEALER(user_data);
43 47
@@ -48,9 +52,10 @@ void handle_account_details_button_click(UI_UNUSED GtkButton* button,
48 } 52 }
49} 53}
50 54
51void handle_chats_listbox_row_activated(UI_UNUSED GtkListBox* listbox, 55static void
52 UI_UNUSED GtkListBoxRow* row, 56handle_chats_listbox_row_activated(UNUSED GtkListBox* listbox,
53 gpointer user_data) 57 UNUSED GtkListBoxRow* row,
58 gpointer user_data)
54{ 59{
55 HdyLeaflet* leaflet = HDY_LEAFLET(user_data); 60 HdyLeaflet* leaflet = HDY_LEAFLET(user_data);
56 61
@@ -61,8 +66,9 @@ void handle_chats_listbox_row_activated(UI_UNUSED GtkListBox* listbox,
61 } 66 }
62} 67}
63 68
64void handle_back_button_click(UI_UNUSED GtkButton* button, 69static void
65 gpointer user_data) 70handle_back_button_click(UNUSED GtkButton* button,
71 gpointer user_data)
66{ 72{
67 HdyLeaflet* leaflet = HDY_LEAFLET(user_data); 73 HdyLeaflet* leaflet = HDY_LEAFLET(user_data);
68 74
@@ -73,8 +79,17 @@ void handle_back_button_click(UI_UNUSED GtkButton* button,
73 } 79 }
74} 80}
75 81
82static void
83handle_main_window_destroy(gpointer user_data)
84{
85 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
86
87 application_exit(app, MESSENGER_QUIT);
88}
89
76void 90void
77ui_messenger_init(struct UI_MESSENGER_Handle *handle) 91ui_messenger_init(MESSENGER_Application *app,
92 UI_MESSENGER_Handle *handle)
78{ 93{
79 GtkBuilder* builder = gtk_builder_new(); 94 GtkBuilder* builder = gtk_builder_new();
80 gtk_builder_add_from_file( 95 gtk_builder_add_from_file(
@@ -220,5 +235,10 @@ ui_messenger_init(struct UI_MESSENGER_Handle *handle)
220 235
221 gtk_widget_show(GTK_WIDGET(handle->main_window)); 236 gtk_widget_show(GTK_WIDGET(handle->main_window));
222 237
223 g_signal_connect(handle->main_window, "destroy", G_CALLBACK(gtk_main_quit), NULL); 238 g_signal_connect(
239 handle->main_window,
240 "destroy",
241 G_CALLBACK(handle_main_window_destroy),
242 app
243 );
224} 244}