aboutsummaryrefslogtreecommitdiff
path: root/src/ui/new_contact.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/new_contact.c')
-rw-r--r--src/ui/new_contact.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ui/new_contact.c b/src/ui/new_contact.c
index 1b79cdc..8267fab 100644
--- a/src/ui/new_contact.c
+++ b/src/ui/new_contact.c
@@ -339,6 +339,7 @@ iterate_global(void *obj,
339 -1 339 -1
340 ); 340 );
341 341
342 handle->camera_count++;
342 return 0; 343 return 0;
343} 344}
344 345
@@ -347,6 +348,8 @@ _init_camera_pipeline(MESSENGER_Application *app,
347 UI_NEW_CONTACT_Handle *handle, 348 UI_NEW_CONTACT_Handle *handle,
348 gboolean access) 349 gboolean access)
349{ 350{
351 handle->camera_count = 0;
352
350 if ((app->portal) && ((access) || xdp_portal_is_camera_present(app->portal))) 353 if ((app->portal) && ((access) || xdp_portal_is_camera_present(app->portal)))
351 { 354 {
352 app->pw.pending = pw_core_sync(app->pw.core, 0, 0); 355 app->pw.pending = pw_core_sync(app->pw.core, 0, 0);
@@ -354,11 +357,15 @@ _init_camera_pipeline(MESSENGER_Application *app,
354 pw_main_loop_run(app->pw.main_loop); 357 pw_main_loop_run(app->pw.main_loop);
355 pw_map_for_each(&(app->pw.globals), iterate_global, handle); 358 pw_map_for_each(&(app->pw.globals), iterate_global, handle);
356 359
357 GtkTreeIter iter; 360 if (handle->camera_count)
358 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(handle->camera_list_store), &iter))
359 gtk_combo_box_set_active(handle->camera_combo_box, 0); 361 gtk_combo_box_set_active(handle->camera_combo_box, 0);
360 } 362 }
361 363
364 gtk_revealer_set_reveal_child(
365 handle->camera_combo_box_revealer,
366 handle->camera_count > 1
367 );
368
362 pthread_create( 369 pthread_create(
363 &(handle->video_tid), 370 &(handle->video_tid),
364 NULL, 371 NULL,
@@ -428,6 +435,10 @@ ui_new_contact_dialog_init(MESSENGER_Application *app,
428 GTK_WINDOW(app->ui.messenger.main_window) 435 GTK_WINDOW(app->ui.messenger.main_window)
429 ); 436 );
430 437
438 handle->camera_combo_box_revealer = GTK_REVEALER(
439 gtk_builder_get_object(handle->builder, "camera_combo_box_revealer")
440 );
441
431 handle->camera_combo_box = GTK_COMBO_BOX( 442 handle->camera_combo_box = GTK_COMBO_BOX(
432 gtk_builder_get_object(handle->builder, "camera_combo_box") 443 gtk_builder_get_object(handle->builder, "camera_combo_box")
433 ); 444 );