pidgin/pidginconversationwindow.c

branch
gtk4
changeset 41560
2579a5138f0c
parent 41527
4dff8cd4e9ea
child 41582
4ee4a8ddc190
equal deleted inserted replaced
41559:37ccc27ceeae 41560:2579a5138f0c
114 purple_chat_conversation_get_id(chat), 114 purple_chat_conversation_get_id(chat),
115 message, contact); 115 message, contact);
116 } 116 }
117 } 117 }
118 118
119 gtk_widget_destroy(GTK_WIDGET(invite_dialog)); 119 gtk_window_destroy(GTK_WINDOW(invite_dialog));
120 } 120 }
121 121
122 /****************************************************************************** 122 /******************************************************************************
123 * Actions 123 * Actions
124 *****************************************************************************/ 124 *****************************************************************************/
216 g_signal_connect(invite_dialog, "response", 216 g_signal_connect(invite_dialog, "response",
217 G_CALLBACK(pidgin_conversation_window_invite_cb), 217 G_CALLBACK(pidgin_conversation_window_invite_cb),
218 NULL); 218 NULL);
219 } 219 }
220 220
221 gtk_widget_show_all(invite_dialog); 221 gtk_widget_show(invite_dialog);
222 } 222 }
223 } 223 }
224 224
225 static void 225 static void
226 pidgin_conversation_window_send_file(G_GNUC_UNUSED GSimpleAction *simple, 226 pidgin_conversation_window_send_file(G_GNUC_UNUSED GSimpleAction *simple,
422 G_OBJECT_CLASS(pidgin_conversation_window_parent_class)->dispose(obj); 422 G_OBJECT_CLASS(pidgin_conversation_window_parent_class)->dispose(obj);
423 } 423 }
424 424
425 static void 425 static void
426 pidgin_conversation_window_init(PidginConversationWindow *window) { 426 pidgin_conversation_window_init(PidginConversationWindow *window) {
427 GtkEventController *key = NULL;
427 GtkTreeIter iter; 428 GtkTreeIter iter;
428 429
429 gtk_widget_init_template(GTK_WIDGET(window)); 430 gtk_widget_init_template(GTK_WIDGET(window));
430 431
431 gtk_window_set_application(GTK_WINDOW(window), 432 gtk_window_set_application(GTK_WINDOW(window),
432 GTK_APPLICATION(g_application_get_default())); 433 GTK_APPLICATION(g_application_get_default()));
433 434
434 g_action_map_add_action_entries(G_ACTION_MAP(window), win_entries, 435 g_action_map_add_action_entries(G_ACTION_MAP(window), win_entries,
435 G_N_ELEMENTS(win_entries), window); 436 G_N_ELEMENTS(win_entries), window);
436 437
437 key = gtk_event_controller_key_new(GTK_WIDGET(window)); 438 key = gtk_event_controller_key_new();
438 gtk_event_controller_set_propagation_phase(key, GTK_PHASE_CAPTURE); 439 gtk_event_controller_set_propagation_phase(key, GTK_PHASE_CAPTURE);
439 g_signal_connect(G_OBJECT(key), "key-pressed", 440 g_signal_connect(G_OBJECT(key), "key-pressed",
440 G_CALLBACK(pidgin_conversation_window_key_pressed_cb), 441 G_CALLBACK(pidgin_conversation_window_key_pressed_cb),
441 window); 442 window);
442 g_object_set_data_full(G_OBJECT(window), "key-press-controller", key, 443 gtk_widget_add_controller(GTK_WIDGET(window), key);
443 g_object_unref);
444 444
445 /* Add our toplevels to the tree store. */ 445 /* Add our toplevels to the tree store. */
446 gtk_tree_store_append(window->model, &iter, NULL); 446 gtk_tree_store_append(window->model, &iter, NULL);
447 gtk_tree_store_set(window->model, &iter, 447 gtk_tree_store_set(window->model, &iter,
448 PIDGIN_CONVERSATION_WINDOW_COLUMN_OBJECT, window->notification_list, 448 PIDGIN_CONVERSATION_WINDOW_COLUMN_OBJECT, window->notification_list,
630 630
631 name = purple_conversation_get_name(conversation); 631 name = purple_conversation_get_name(conversation);
632 child = gtk_stack_get_child_by_name(GTK_STACK(window->stack), 632 child = gtk_stack_get_child_by_name(GTK_STACK(window->stack),
633 name); 633 name);
634 if(GTK_IS_WIDGET(child)) { 634 if(GTK_IS_WIDGET(child)) {
635 gtk_container_remove(GTK_CONTAINER(window->stack), child); 635 gtk_widget_unparent(child);
636 } 636 }
637 637
638 gtk_tree_store_remove(window->model, &iter); 638 gtk_tree_store_remove(window->model, &iter);
639 639
640 g_clear_object(&obj); 640 g_clear_object(&obj);

mercurial