diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-10-30 15:41:51 +0200 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-10-30 15:41:51 +0200 |
commit | 7e0a36c3954f7a054a3a7acab1cdfb239a466917 (patch) | |
tree | a30968da2107a85094127e9262b6ba394d54fc49 | |
parent | ed38dc013434e1711087964169b6f99ffec4f0c1 (diff) | |
download | messenger-gtk-7e0a36c3954f7a054a3a7acab1cdfb239a466917.tar.gz messenger-gtk-7e0a36c3954f7a054a3a7acab1cdfb239a466917.zip |
Removed debug print and hooked up chat details buttons
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | resources/ui/messenger.ui | 4 | ||||
-rw-r--r-- | src/messenger_gtk.c | 2 | ||||
-rw-r--r-- | src/ui/messenger.c | 42 | ||||
-rw-r--r-- | src/ui/messenger.h | 3 |
4 files changed, 43 insertions, 8 deletions
diff --git a/resources/ui/messenger.ui b/resources/ui/messenger.ui index d4282a4..a776361 100644 --- a/resources/ui/messenger.ui +++ b/resources/ui/messenger.ui | |||
@@ -930,7 +930,7 @@ Author: Tobias Frisch | |||
930 | </packing> | 930 | </packing> |
931 | </child> | 931 | </child> |
932 | <child> | 932 | <child> |
933 | <object class="GtkButton"> | 933 | <object class="GtkButton" id="chat_details_button"> |
934 | <property name="visible">True</property> | 934 | <property name="visible">True</property> |
935 | <property name="can-focus">True</property> | 935 | <property name="can-focus">True</property> |
936 | <property name="receives-default">True</property> | 936 | <property name="receives-default">True</property> |
@@ -1598,7 +1598,7 @@ Author: Tobias Frisch | |||
1598 | </packing> | 1598 | </packing> |
1599 | </child> | 1599 | </child> |
1600 | <child> | 1600 | <child> |
1601 | <object class="GtkButton"> | 1601 | <object class="GtkButton" id="hide_chat_details_button"> |
1602 | <property name="visible">True</property> | 1602 | <property name="visible">True</property> |
1603 | <property name="can-focus">True</property> | 1603 | <property name="can-focus">True</property> |
1604 | <property name="receives-default">True</property> | 1604 | <property name="receives-default">True</property> |
diff --git a/src/messenger_gtk.c b/src/messenger_gtk.c index 7ec3da0..a91a35e 100644 --- a/src/messenger_gtk.c +++ b/src/messenger_gtk.c | |||
@@ -61,8 +61,6 @@ int gnunet_chat_message(void *cls, | |||
61 | { | 61 | { |
62 | struct main_program *program = (struct main_program*) cls; | 62 | struct main_program *program = (struct main_program*) cls; |
63 | 63 | ||
64 | printf("Hello world\n"); | ||
65 | |||
66 | if (GNUNET_CHAT_KIND_LOGIN == GNUNET_CHAT_message_get_kind(message)) | 64 | if (GNUNET_CHAT_KIND_LOGIN == GNUNET_CHAT_message_get_kind(message)) |
67 | g_idle_add(gtk_set_profile_name, program); | 65 | g_idle_add(gtk_set_profile_name, program); |
68 | 66 | ||
diff --git a/src/ui/messenger.c b/src/ui/messenger.c index 829d31a..059927a 100644 --- a/src/ui/messenger.c +++ b/src/ui/messenger.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "messenger.h" | 25 | #include "messenger.h" |
26 | 26 | ||
27 | void handle_user_details_button_click(UI_UNUSED GtkButton* button, | 27 | void handle_flap_via_button_click(UI_UNUSED GtkButton* button, |
28 | gpointer user_data) | 28 | gpointer user_data) |
29 | { | 29 | { |
30 | HdyFlap* flap = HDY_FLAP(user_data); | 30 | HdyFlap* flap = HDY_FLAP(user_data); |
31 | 31 | ||
@@ -131,14 +131,14 @@ ui_messenger_init(struct UI_MESSENGER_Handle *handle) | |||
131 | g_signal_connect( | 131 | g_signal_connect( |
132 | handle->user_details_button, | 132 | handle->user_details_button, |
133 | "clicked", | 133 | "clicked", |
134 | G_CALLBACK(handle_user_details_button_click), | 134 | G_CALLBACK(handle_flap_via_button_click), |
135 | handle->flap_user_details | 135 | handle->flap_user_details |
136 | ); | 136 | ); |
137 | 137 | ||
138 | g_signal_connect( | 138 | g_signal_connect( |
139 | handle->hide_user_details_button, | 139 | handle->hide_user_details_button, |
140 | "clicked", | 140 | "clicked", |
141 | G_CALLBACK(handle_user_details_button_click), | 141 | G_CALLBACK(handle_flap_via_button_click), |
142 | handle->flap_user_details | 142 | handle->flap_user_details |
143 | ); | 143 | ); |
144 | 144 | ||
@@ -184,6 +184,40 @@ ui_messenger_init(struct UI_MESSENGER_Handle *handle) | |||
184 | G_BINDING_INVERT_BOOLEAN | 184 | G_BINDING_INVERT_BOOLEAN |
185 | ); | 185 | ); |
186 | 186 | ||
187 | handle->flap_chat_details = HDY_FLAP( | ||
188 | gtk_builder_get_object(builder, "flap_chat_details") | ||
189 | ); | ||
190 | |||
191 | handle->chat_title = GTK_LABEL( | ||
192 | gtk_builder_get_object(builder, "chat_title") | ||
193 | ); | ||
194 | |||
195 | handle->chat_subtitle = GTK_LABEL( | ||
196 | gtk_builder_get_object(builder, "chat_subtitle") | ||
197 | ); | ||
198 | |||
199 | handle->chat_details_button = GTK_BUTTON( | ||
200 | gtk_builder_get_object(builder, "chat_details_button") | ||
201 | ); | ||
202 | |||
203 | handle->hide_chat_details_button = GTK_BUTTON( | ||
204 | gtk_builder_get_object(builder, "hide_chat_details_button") | ||
205 | ); | ||
206 | |||
207 | g_signal_connect( | ||
208 | handle->chat_details_button, | ||
209 | "clicked", | ||
210 | G_CALLBACK(handle_flap_via_button_click), | ||
211 | handle->flap_chat_details | ||
212 | ); | ||
213 | |||
214 | g_signal_connect( | ||
215 | handle->hide_chat_details_button, | ||
216 | "clicked", | ||
217 | G_CALLBACK(handle_flap_via_button_click), | ||
218 | handle->flap_chat_details | ||
219 | ); | ||
220 | |||
187 | gtk_widget_show(GTK_WIDGET(handle->main_window)); | 221 | gtk_widget_show(GTK_WIDGET(handle->main_window)); |
188 | 222 | ||
189 | g_signal_connect(handle->main_window, "destroy", G_CALLBACK(gtk_main_quit), NULL); | 223 | g_signal_connect(handle->main_window, "destroy", G_CALLBACK(gtk_main_quit), NULL); |
diff --git a/src/ui/messenger.h b/src/ui/messenger.h index 2bb8d8b..b309dea 100644 --- a/src/ui/messenger.h +++ b/src/ui/messenger.h | |||
@@ -64,6 +64,9 @@ struct UI_MESSENGER_Handle | |||
64 | 64 | ||
65 | GtkLabel *chat_title; | 65 | GtkLabel *chat_title; |
66 | GtkLabel *chat_subtitle; | 66 | GtkLabel *chat_subtitle; |
67 | GtkButton *chat_details_button; | ||
68 | |||
69 | GtkButton *hide_chat_details_button; | ||
67 | }; | 70 | }; |
68 | 71 | ||
69 | void | 72 | void |