pidgin/pidgin

Use gtk_widget_set_visible for everything

12 months ago, Gary Kramlich
2273647d24b0
Parents f4c0e44c3e20
Children 9cb78e799a79
Use gtk_widget_set_visible for everything

gtk_widget_show and gtk_widget_hide are deprecated in GTK 4.10. However,
gtk_widget_set_visible has been around forever so we just need to move to that.

I didn't test all of these and there are probably some that can still be
removed, but most of those are in code that is going to get refreshed in the
future so I didn't bother for now.

Testing Done:
I tested the join chat, add chat, and add buddy dialogs, as well as the contact added notification.

Reviewed at https://reviews.imfreedom.org/r/2430/
--- a/pidgin/gtkblist.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtkblist.c Tue Apr 11 00:17:15 2023 -0500
@@ -439,7 +439,7 @@
rebuild_chat_entries(data, NULL);
- gtk_widget_show(data->rq_data.window);
+ gtk_widget_set_visible(data->rq_data.window, TRUE);
}
static void
@@ -451,7 +451,7 @@
dialog = pidgin_add_buddy_dialog_new(account, username, alias, NULL, group);
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
}
static void
@@ -463,7 +463,7 @@
dialog = pidgin_add_chat_dialog_new(account, group, alias, name);
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
}
static void
--- a/pidgin/gtkmedia.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtkmedia.c Tue Apr 11 00:17:15 2023 -0500
@@ -688,7 +688,7 @@
sink = gst_bin_get_by_name(GST_BIN(pipeline), "gtksink");
}
g_object_get(G_OBJECT(sink), "widget", &remote_video, NULL);
- gtk_widget_show(remote_video);
+ gtk_widget_set_visible(remote_video, TRUE);
gtk_widget_set_vexpand(remote_video, TRUE);
gtk_box_append(GTK_BOX(recv_widget), remote_video);
@@ -710,7 +710,7 @@
sink = gst_bin_get_by_name(GST_BIN(pipeline), "gtksink");
}
g_object_get(G_OBJECT(sink), "widget", &local_video, NULL);
- gtk_widget_show(local_video);
+ gtk_widget_set_visible(local_video, TRUE);
gtk_widget_set_vexpand(local_video, TRUE);
gtk_box_append(GTK_BOX(send_widget), local_video);
@@ -819,7 +819,7 @@
pidgin_media_emit_message(gtkmedia, _("Call in progress."));
gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar),
0, _("Call in progress"));
- gtk_widget_show(GTK_WIDGET(gtkmedia));
+ gtk_widget_set_visible(GTK_WIDGET(gtkmedia), TRUE);
} else if (type == PURPLE_MEDIA_INFO_MUTE && !local) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtkmedia->priv->mute), TRUE);
} else if (type == PURPLE_MEDIA_INFO_UNMUTE && !local) {
--- a/pidgin/gtknotify.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtknotify.c Tue Apr 11 00:17:15 2023 -0500
@@ -223,7 +223,7 @@
purple_request_cpar_get_parent_from(cpar));
pidgin_auto_parent_window(dialog);
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
return dialog;
}
@@ -321,7 +321,7 @@
/* Show the window */
pidgin_auto_parent_window(window);
- gtk_widget_show(window);
+ gtk_widget_set_visible(window, TRUE);
return window;
}
@@ -524,7 +524,7 @@
/* Show the window */
pidgin_auto_parent_window(window);
- gtk_widget_show(window);
+ gtk_widget_set_visible(window, TRUE);
return data;
}
--- a/pidgin/gtkrequest.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtkrequest.c Tue Apr 11 00:17:15 2023 -0500
@@ -550,7 +550,7 @@
pidgin_auto_parent_window(dialog);
/* Show everything. */
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
return data;
}
@@ -683,7 +683,7 @@
/* Show everything. */
pidgin_auto_parent_window(dialog);
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
return data;
}
@@ -811,7 +811,7 @@
/* Show everything. */
pidgin_auto_parent_window(dialog);
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
return data;
}
@@ -929,7 +929,7 @@
/* Show everything. */
pidgin_auto_parent_window(dialog);
- gtk_widget_show(dialog);
+ gtk_widget_set_visible(dialog, TRUE);
return data;
}
@@ -2002,7 +2002,7 @@
pidgin_auto_parent_window(win);
- gtk_widget_show(win);
+ gtk_widget_set_visible(win, TRUE);
return data;
}
--- a/pidgin/gtkroomlist.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtkroomlist.c Tue Apr 11 00:17:15 2023 -0500
@@ -437,7 +437,7 @@
}
/* show the dialog window and return the dialog */
- gtk_widget_show(GTK_WIDGET(dialog));
+ gtk_widget_set_visible(GTK_WIDGET(dialog), TRUE);
return dialog;
}
--- a/pidgin/gtkwhiteboard.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtkwhiteboard.c Tue Apr 11 00:17:15 2023 -0500
@@ -518,7 +518,7 @@
&color);
/* Make all this (window) visible */
- gtk_widget_show(GTK_WIDGET(gtkwb));
+ gtk_widget_set_visible(GTK_WIDGET(gtkwb), TRUE);
/* TODO Specific protocol/whiteboard assignment here? Needs a UI Op? */
/* Set default brush size and color */
--- a/pidgin/gtkxfer.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/gtkxfer.c Tue Apr 11 00:17:15 2023 -0500
@@ -311,8 +311,8 @@
gtk_widget_set_sensitive(dialog->open_button, FALSE);
gtk_widget_set_sensitive(dialog->stop_button, FALSE);
- gtk_widget_show(dialog->stop_button);
- gtk_widget_hide(dialog->remove_button);
+ gtk_widget_set_visible(dialog->stop_button, TRUE);
+ gtk_widget_set_visible(dialog->remove_button, FALSE);
return;
}
@@ -321,8 +321,8 @@
return;
if (purple_xfer_is_completed(xfer)) {
- gtk_widget_hide(dialog->stop_button);
- gtk_widget_show(dialog->remove_button);
+ gtk_widget_set_visible(dialog->stop_button, FALSE);
+ gtk_widget_set_visible(dialog->remove_button, TRUE);
#ifdef _WIN32
/* If using Win32... */
@@ -341,15 +341,15 @@
gtk_widget_set_sensitive(dialog->remove_button, TRUE);
} else if (purple_xfer_is_cancelled(xfer)) {
- gtk_widget_hide(dialog->stop_button);
- gtk_widget_show(dialog->remove_button);
+ gtk_widget_set_visible(dialog->stop_button, FALSE);
+ gtk_widget_set_visible(dialog->remove_button, TRUE);
gtk_widget_set_sensitive(dialog->open_button, FALSE);
gtk_widget_set_sensitive(dialog->remove_button, TRUE);
} else {
- gtk_widget_show(dialog->stop_button);
- gtk_widget_hide(dialog->remove_button);
+ gtk_widget_set_visible(dialog->stop_button, TRUE);
+ gtk_widget_set_visible(dialog->remove_button, FALSE);
gtk_widget_set_sensitive(dialog->open_button, FALSE);
gtk_widget_set_sensitive(dialog->stop_button, TRUE);
@@ -582,7 +582,7 @@
pidgin_set_xfer_dialog(tmp);
}
- gtk_widget_show(GTK_WIDGET(tmp));
+ gtk_widget_set_visible(GTK_WIDGET(tmp), TRUE);
} else {
gtk_window_present(GTK_WINDOW(dialog));
}
@@ -595,7 +595,7 @@
purple_notify_close_with_handle(dialog);
- gtk_widget_hide(GTK_WIDGET(dialog));
+ gtk_widget_set_visible(GTK_WIDGET(dialog), FALSE);
}
void
--- a/pidgin/pidgindisplaywindow.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/pidgindisplaywindow.c Tue Apr 11 00:17:15 2023 -0500
@@ -233,7 +233,7 @@
NULL);
}
- gtk_widget_show(invite_dialog);
+ gtk_widget_set_visible(invite_dialog, TRUE);
}
}
--- a/pidgin/pidginnotificationaddcontact.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/pidginnotificationaddcontact.c Tue Apr 11 00:17:15 2023 -0500
@@ -68,8 +68,8 @@
gtk_image_set_from_icon_name(GTK_IMAGE(add_contact->icon), NULL);
adw_action_row_set_subtitle(ADW_ACTION_ROW(add_contact), NULL);
- gtk_widget_hide(add_contact->add);
- gtk_widget_hide(add_contact->message);
+ gtk_widget_set_visible(add_contact->add, FALSE);
+ gtk_widget_set_visible(add_contact->message, FALSE);
return;
}
@@ -82,8 +82,8 @@
gtk_image_set_from_icon_name(GTK_IMAGE(add_contact->icon), NULL);
adw_action_row_set_subtitle(ADW_ACTION_ROW(add_contact), NULL);
- gtk_widget_hide(add_contact->add);
- gtk_widget_hide(add_contact->message);
+ gtk_widget_set_visible(add_contact->add, FALSE);
+ gtk_widget_set_visible(add_contact->message, FALSE);
return;
}
@@ -110,8 +110,8 @@
message = purple_add_contact_request_get_message(request);
adw_action_row_set_subtitle(ADW_ACTION_ROW(add_contact), message);
- gtk_widget_show(add_contact->add);
- gtk_widget_show(add_contact->message);
+ gtk_widget_set_visible(add_contact->add, TRUE);
+ gtk_widget_set_visible(add_contact->message, TRUE);
}
static void
--- a/pidgin/pidginnotificationauthorizationrequest.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/pidginnotificationauthorizationrequest.c Tue Apr 11 00:17:15 2023 -0500
@@ -68,9 +68,9 @@
gtk_image_set_from_icon_name(GTK_IMAGE(request->icon), NULL);
adw_action_row_set_subtitle(ADW_ACTION_ROW(request), NULL);
- gtk_widget_hide(request->accept);
- gtk_widget_hide(request->deny);
- gtk_widget_hide(request->message);
+ gtk_widget_set_visible(request->accept, FALSE);
+ gtk_widget_set_visible(request->deny, FALSE);
+ gtk_widget_set_visible(request->message, FALSE);
return;
}
@@ -83,9 +83,9 @@
gtk_image_set_from_icon_name(GTK_IMAGE(request->icon), NULL);
adw_action_row_set_subtitle(ADW_ACTION_ROW(request), NULL);
- gtk_widget_hide(request->accept);
- gtk_widget_hide(request->deny);
- gtk_widget_hide(request->message);
+ gtk_widget_set_visible(request->accept, FALSE);
+ gtk_widget_set_visible(request->deny, FALSE);
+ gtk_widget_set_visible(request->message, FALSE);
return;
}
@@ -112,9 +112,9 @@
message = purple_authorization_request_get_message(purple_request);
adw_action_row_set_subtitle(ADW_ACTION_ROW(request), message);
- gtk_widget_show(request->accept);
- gtk_widget_show(request->deny);
- gtk_widget_show(request->message);
+ gtk_widget_set_visible(request->accept, TRUE);
+ gtk_widget_set_visible(request->deny, TRUE);
+ gtk_widget_set_visible(request->message, TRUE);
}
static void
--- a/pidgin/pidginnotificationconnectionerror.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/pidginnotificationconnectionerror.c Tue Apr 11 00:17:15 2023 -0500
@@ -66,9 +66,9 @@
gtk_image_set_from_icon_name(GTK_IMAGE(error->icon), NULL);
adw_action_row_set_subtitle(ADW_ACTION_ROW(error), NULL);
- gtk_widget_hide(error->reconnect);
- gtk_widget_hide(error->reenable);
- gtk_widget_hide(error->modify);
+ gtk_widget_set_visible(error->reconnect, FALSE);
+ gtk_widget_set_visible(error->reenable, FALSE);
+ gtk_widget_set_visible(error->modify, FALSE);
return;
}
@@ -81,9 +81,9 @@
gtk_image_set_from_icon_name(GTK_IMAGE(error->icon), NULL);
adw_action_row_set_subtitle(ADW_ACTION_ROW(error), NULL);
- gtk_widget_hide(error->reconnect);
- gtk_widget_hide(error->reenable);
- gtk_widget_hide(error->modify);
+ gtk_widget_set_visible(error->reconnect, FALSE);
+ gtk_widget_set_visible(error->reenable, FALSE);
+ gtk_widget_set_visible(error->modify, FALSE);
return;
}
--- a/pidgin/pidginstatusmanager.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/pidginstatusmanager.c Tue Apr 11 00:17:15 2023 -0500
@@ -84,7 +84,7 @@
G_CALLBACK(pidgin_status_editor_destroy_cb),
manager, 0);
- gtk_widget_show(editor);
+ gtk_widget_set_visible(editor, TRUE);
} else {
gtk_window_present_with_time(GTK_WINDOW(editor), GDK_CURRENT_TIME);
}
@@ -190,7 +190,7 @@
editor = pidgin_status_editor_new(NULL);
gtk_window_set_transient_for(GTK_WINDOW(editor),
GTK_WINDOW(manager));
- gtk_widget_show(editor);
+ gtk_widget_set_visible(editor, TRUE);
break;
case RESPONSE_MODIFY:
pidgin_status_manager_show_editor(manager);
--- a/pidgin/plugins/disco/gtkdisco.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/plugins/disco/gtkdisco.c Tue Apr 11 00:17:15 2023 -0500
@@ -519,7 +519,7 @@
pidgin_disco_dialog_new(void)
{
PidginDiscoDialog *dialog = g_object_new(PIDGIN_TYPE_DISCO_DIALOG, NULL);
- gtk_widget_show(GTK_WIDGET(dialog));
+ gtk_widget_set_visible(GTK_WIDGET(dialog), TRUE);
return dialog;
}
--- a/pidgin/plugins/gestures/gestures.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/plugins/gestures/gestures.c Tue Apr 11 00:17:15 2023 -0500
@@ -94,7 +94,7 @@
conv);
pidgin_display_window_add(PIDGIN_DISPLAY_WINDOW(new_win), conv);
- gtk_widget_show_all(new_win);
+ gtk_widget_set_visible(new_win, TRUE);
}
static void
@@ -185,7 +185,7 @@
g_signal_connect(G_OBJECT(toggle), "toggled",
G_CALLBACK(toggle_draw_cb), NULL);
- gtk_widget_show_all(ret);
+ gtk_widget_set_visible(ret, TRUE);
return ret;
}
--- a/pidgin/plugins/gestures/stroke-draw.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/plugins/gestures/stroke-draw.c Tue Apr 11 00:17:15 2023 -0500
@@ -233,7 +233,7 @@
GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON2_MOTION_MASK);
gtk_widget_set_app_paintable(event, TRUE);
- gtk_widget_show(event);
+ gtk_widget_set_visible(event, TRUE);
parent = gtk_widget_get_parent(widget);
g_object_ref(widget);
--- a/pidgin/plugins/notify/notify.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/plugins/notify/notify.c Tue Apr 11 00:17:15 2023 -0500
@@ -876,7 +876,7 @@
G_CALLBACK(notify_toggle_cb), "notify_switch");
#endif
- gtk_widget_show_all(ret);
+ gtk_widget_set_visible(ret, TRUE);
return ret;
}
--- a/pidgin/plugins/spellchk/spellchk.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/plugins/spellchk/spellchk.c Tue Apr 11 00:17:15 2023 -0500
@@ -2127,7 +2127,6 @@
vbox = pidgin_make_frame(ret, _("Text Replacements"));
gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
- gtk_widget_show(vbox);
tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
gtk_widget_set_size_request(tree, -1, 200);
@@ -2196,7 +2195,6 @@
hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
- gtk_widget_show(hbox);
button = gtk_button_new_with_mnemonic(_("_Delete"));
g_signal_connect(G_OBJECT(button), "clicked",
@@ -2207,16 +2205,12 @@
g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))),
"changed", G_CALLBACK(on_selection_changed), button);
- gtk_widget_show(button);
-
vbox = pidgin_make_frame(ret, _("Add a new text replacement"));
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
- gtk_widget_show(hbox);
vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
- gtk_widget_show(vbox2);
sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
sg2 = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
@@ -2238,12 +2232,10 @@
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(complete_toggle), TRUE);
g_signal_connect(G_OBJECT(complete_toggle), "clicked",
G_CALLBACK(whole_words_button_toggled), case_toggle);
- gtk_widget_show(complete_toggle);
gtk_box_pack_start(GTK_BOX(vbox2), complete_toggle, FALSE, FALSE, 0);
/* The button is created above so it can be passed to whole_words_button_toggled. */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(case_toggle), FALSE);
- gtk_widget_show(case_toggle);
gtk_box_pack_start(GTK_BOX(vbox2), case_toggle, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic(_("_Add"));
@@ -2251,12 +2243,10 @@
G_CALLBACK(list_add_new), NULL);
vbox3 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_box_pack_start(GTK_BOX(hbox), vbox3, TRUE, FALSE, 0);
- gtk_widget_show(vbox3);
gtk_box_pack_end(GTK_BOX(vbox3), button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(bad_entry), "changed", G_CALLBACK(on_entry_changed), button);
g_signal_connect(G_OBJECT(good_entry), "changed", G_CALLBACK(on_entry_changed), button);
gtk_widget_set_sensitive(button, FALSE);
- gtk_widget_show(button);
#if 0
vbox = pidgin_make_frame(ret, _("General Text Replacement Options"));
@@ -2264,7 +2254,6 @@
"/plugins/gtk/spellchk/last_word_replace", vbox);
#endif
- gtk_widget_show_all(ret);
g_object_unref(sg);
g_object_unref(sg2);
return ret;
--- a/pidgin/plugins/xmppconsole/xmppconsole.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/plugins/xmppconsole/xmppconsole.c Tue Apr 11 00:17:15 2023 -0500
@@ -598,8 +598,6 @@
dropdown_changed_cb(G_OBJECT(console->account_chooser), NULL, console);
entry_changed_cb(console->entry_buffer, console);
-
- gtk_widget_show(GTK_WIDGET(console));
}
/******************************************************************************
--- a/pidgin/prefs/pidginconversationprefs.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/prefs/pidginconversationprefs.c Tue Apr 11 00:17:15 2023 -0500
@@ -92,7 +92,7 @@
pidgin_prefs_bind_switch(PIDGIN_PREFS_ROOT "/win32/blink_im",
prefs->win32.blink_im);
#else
- gtk_widget_hide(prefs->win32.blink_im_row);
+ gtk_widget_set_visible(prefs->win32.blink_im_row, FALSE);
#endif
pidgin_prefs_bind_spin_button(
--- a/pidgin/prefs/pidginvvprefs.c Mon Apr 10 23:47:15 2023 -0500
+++ b/pidgin/prefs/pidginvvprefs.c Tue Apr 11 00:17:15 2023 -0500
@@ -369,7 +369,7 @@
sink = g_object_get_data(G_OBJECT(prefs->video.pipeline), "sink");
g_object_get(sink, "widget", &video, NULL);
- gtk_widget_show(video);
+ gtk_widget_set_visible(video, TRUE);
gtk_widget_set_size_request(prefs->video.frame, 400, 300);
gtk_aspect_frame_set_child(GTK_ASPECT_FRAME(prefs->video.frame), video);