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.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
index 3de94de..bc3a8dd 100644
--- a/src/ui/messenger.c
+++ b/src/ui/messenger.c
@@ -131,10 +131,10 @@ ui_messenger_init(MESSENGER_Application *app,
131{ 131{
132 handle->chat_entries = g_list_alloc(); 132 handle->chat_entries = g_list_alloc();
133 133
134 GtkBuilder* builder = gtk_builder_new_from_file("resources/ui/messenger.ui"); 134 handle->builder = gtk_builder_new_from_file("resources/ui/messenger.ui");
135 135
136 handle->main_window = GTK_APPLICATION_WINDOW( 136 handle->main_window = GTK_APPLICATION_WINDOW(
137 gtk_builder_get_object(builder, "main_window") 137 gtk_builder_get_object(handle->builder, "main_window")
138 ); 138 );
139 139
140 gtk_application_add_window( 140 gtk_application_add_window(
@@ -148,19 +148,19 @@ ui_messenger_init(MESSENGER_Application *app,
148 ); 148 );
149 149
150 handle->leaflet_chat = HDY_LEAFLET( 150 handle->leaflet_chat = HDY_LEAFLET(
151 gtk_builder_get_object(builder, "leaflet_chat") 151 gtk_builder_get_object(handle->builder, "leaflet_chat")
152 ); 152 );
153 153
154 handle->flap_user_details = HDY_FLAP( 154 handle->flap_user_details = HDY_FLAP(
155 gtk_builder_get_object(builder, "flap_user_details") 155 gtk_builder_get_object(handle->builder, "flap_user_details")
156 ); 156 );
157 157
158 handle->flap_chat_details = HDY_FLAP( 158 handle->flap_chat_details = HDY_FLAP(
159 gtk_builder_get_object(builder, "flap_chat_details") 159 gtk_builder_get_object(handle->builder, "flap_chat_details")
160 ); 160 );
161 161
162 handle->title_bar = HDY_HEADER_BAR( 162 handle->title_bar = HDY_HEADER_BAR(
163 gtk_builder_get_object(builder, "title_bar") 163 gtk_builder_get_object(handle->builder, "title_bar")
164 ); 164 );
165 165
166 g_object_bind_property( 166 g_object_bind_property(
@@ -182,15 +182,15 @@ ui_messenger_init(MESSENGER_Application *app,
182 ); 182 );
183 183
184 handle->profile_avatar = HDY_AVATAR( 184 handle->profile_avatar = HDY_AVATAR(
185 gtk_builder_get_object(builder, "profile_avatar") 185 gtk_builder_get_object(handle->builder, "profile_avatar")
186 ); 186 );
187 187
188 handle->profile_label = GTK_LABEL( 188 handle->profile_label = GTK_LABEL(
189 gtk_builder_get_object(builder, "profile_label") 189 gtk_builder_get_object(handle->builder, "profile_label")
190 ); 190 );
191 191
192 handle->hide_user_details_button = GTK_BUTTON( 192 handle->hide_user_details_button = GTK_BUTTON(
193 gtk_builder_get_object(builder, "hide_user_details_button") 193 gtk_builder_get_object(handle->builder, "hide_user_details_button")
194 ); 194 );
195 195
196 g_signal_connect( 196 g_signal_connect(
@@ -201,19 +201,19 @@ ui_messenger_init(MESSENGER_Application *app,
201 ); 201 );
202 202
203 handle->favourites_button = GTK_BUTTON( 203 handle->favourites_button = GTK_BUTTON(
204 gtk_builder_get_object(builder, "favourites_button") 204 gtk_builder_get_object(handle->builder, "favourites_button")
205 ); 205 );
206 206
207 handle->account_details_button = GTK_BUTTON( 207 handle->account_details_button = GTK_BUTTON(
208 gtk_builder_get_object(builder, "account_details_button") 208 gtk_builder_get_object(handle->builder, "account_details_button")
209 ); 209 );
210 210
211 handle->account_details_symbol = GTK_IMAGE( 211 handle->account_details_symbol = GTK_IMAGE(
212 gtk_builder_get_object(builder, "account_details_symbol") 212 gtk_builder_get_object(handle->builder, "account_details_symbol")
213 ); 213 );
214 214
215 handle->account_details_revealer = GTK_REVEALER( 215 handle->account_details_revealer = GTK_REVEALER(
216 gtk_builder_get_object(builder, "account_details_revealer") 216 gtk_builder_get_object(handle->builder, "account_details_revealer")
217 ); 217 );
218 218
219 g_signal_connect( 219 g_signal_connect(
@@ -224,19 +224,19 @@ ui_messenger_init(MESSENGER_Application *app,
224 ); 224 );
225 225
226 handle->accounts_listbox = GTK_LIST_BOX( 226 handle->accounts_listbox = GTK_LIST_BOX(
227 gtk_builder_get_object(builder, "accounts_listbox") 227 gtk_builder_get_object(handle->builder, "accounts_listbox")
228 ); 228 );
229 229
230 handle->new_contact_button = GTK_BUTTON( 230 handle->new_contact_button = GTK_BUTTON(
231 gtk_builder_get_object(builder, "new_contact_button") 231 gtk_builder_get_object(handle->builder, "new_contact_button")
232 ); 232 );
233 233
234 handle->new_group_button = GTK_BUTTON( 234 handle->new_group_button = GTK_BUTTON(
235 gtk_builder_get_object(builder, "new_group_button") 235 gtk_builder_get_object(handle->builder, "new_group_button")
236 ); 236 );
237 237
238 handle->new_platform_button = GTK_BUTTON( 238 handle->new_platform_button = GTK_BUTTON(
239 gtk_builder_get_object(builder, "new_platform_button") 239 gtk_builder_get_object(handle->builder, "new_platform_button")
240 ); 240 );
241 241
242 g_signal_connect( 242 g_signal_connect(
@@ -254,15 +254,15 @@ ui_messenger_init(MESSENGER_Application *app,
254 ); 254 );
255 255
256 handle->contacts_button = GTK_BUTTON( 256 handle->contacts_button = GTK_BUTTON(
257 gtk_builder_get_object(builder, "contacts_button") 257 gtk_builder_get_object(handle->builder, "contacts_button")
258 ); 258 );
259 259
260 handle->settings_button = GTK_BUTTON( 260 handle->settings_button = GTK_BUTTON(
261 gtk_builder_get_object(builder, "settings_button") 261 gtk_builder_get_object(handle->builder, "settings_button")
262 ); 262 );
263 263
264 handle->user_details_button = GTK_BUTTON( 264 handle->user_details_button = GTK_BUTTON(
265 gtk_builder_get_object(builder, "user_details_button") 265 gtk_builder_get_object(handle->builder, "user_details_button")
266 ); 266 );
267 267
268 g_signal_connect( 268 g_signal_connect(
@@ -273,11 +273,11 @@ ui_messenger_init(MESSENGER_Application *app,
273 ); 273 );
274 274
275 handle->chats_search = GTK_SEARCH_ENTRY( 275 handle->chats_search = GTK_SEARCH_ENTRY(
276 gtk_builder_get_object(builder, "chats_search") 276 gtk_builder_get_object(handle->builder, "chats_search")
277 ); 277 );
278 278
279 handle->chats_listbox = GTK_LIST_BOX( 279 handle->chats_listbox = GTK_LIST_BOX(
280 gtk_builder_get_object(builder, "chats_listbox") 280 gtk_builder_get_object(handle->builder, "chats_listbox")
281 ); 281 );
282 282
283 g_signal_connect( 283 g_signal_connect(
@@ -288,11 +288,11 @@ ui_messenger_init(MESSENGER_Application *app,
288 ); 288 );
289 289
290 handle->chats_stack = GTK_STACK( 290 handle->chats_stack = GTK_STACK(
291 gtk_builder_get_object(builder, "chats_stack") 291 gtk_builder_get_object(handle->builder, "chats_stack")
292 ); 292 );
293 293
294 handle->hide_chat_details_button = GTK_BUTTON( 294 handle->hide_chat_details_button = GTK_BUTTON(
295 gtk_builder_get_object(builder, "hide_chat_details_button") 295 gtk_builder_get_object(handle->builder, "hide_chat_details_button")
296 ); 296 );
297 297
298 g_signal_connect( 298 g_signal_connect(
@@ -315,6 +315,8 @@ ui_messenger_init(MESSENGER_Application *app,
315void 315void
316ui_messenger_cleanup(UI_MESSENGER_Handle *handle) 316ui_messenger_cleanup(UI_MESSENGER_Handle *handle)
317{ 317{
318 g_object_unref(handle->builder);
319
318 GList *list = handle->chat_entries; 320 GList *list = handle->chat_entries;
319 321
320 while (list) { 322 while (list) {