pidgin/pidgin

Parents 4be2eda9548a
Children 65cf7357277d
Update some deprecated api in gtksavedstatues.c that was missed.

Testing Done:
Verified the substatus okay and cancel buttons continued to work as expected.

Reviewed at https://reviews.imfreedom.org/r/918/
--- a/pidgin/gtksavedstatuses.c Thu Sep 02 21:28:40 2021 -0500
+++ b/pidgin/gtksavedstatuses.c Sat Sep 11 10:18:20 2021 -0500
@@ -633,7 +633,7 @@
* Status editor
**************************************************************************/
-static void substatus_editor_cancel_cb(GtkButton *button, gpointer user_data);
+static void substatus_editor_cancel(SubStatusEditor *dialog);
static void
status_editor_remove_dialog(StatusEditor *dialog)
@@ -664,7 +664,7 @@
gtk_list_store_set(dialog->model, &iter,
STATUS_EDITOR_COLUMN_WINDOW, NULL,
-1);
- substatus_editor_cancel_cb(NULL, substatus_dialog);
+ substatus_editor_cancel(substatus_dialog);
}
} while (gtk_tree_model_iter_next(model, &iter));
}
@@ -1297,17 +1297,15 @@
}
static void
-substatus_editor_cancel_cb(GtkButton *button, gpointer user_data)
+substatus_editor_cancel(SubStatusEditor *dialog)
{
- SubStatusEditor *dialog = user_data;
gtk_widget_destroy(dialog->window);
}
static void
-substatus_editor_ok_cb(GtkButton *button, gpointer user_data)
+substatus_editor_ok(SubStatusEditor *dialog)
{
- SubStatusEditor *dialog = user_data;
StatusEditor *status_editor;
GtkTreeIter iter;
PurpleStatusType *type;
@@ -1351,6 +1349,24 @@
}
static void
+substatus_editor_response_cb(GtkDialog *dialog, gint response_id,
+ gpointer data)
+{
+ SubStatusEditor *editor = data;
+
+ switch(response_id) {
+ case GTK_RESPONSE_CANCEL:
+ substatus_editor_cancel(editor);
+ break;
+ case GTK_RESPONSE_OK:
+ substatus_editor_ok(editor);
+ break;
+ default:
+ break;
+ }
+}
+
+static void
edit_substatus(StatusEditor *status_editor, PurpleAccount *account)
{
char *tmp;
@@ -1396,6 +1412,8 @@
g_signal_connect(G_OBJECT(win), "destroy",
G_CALLBACK(substatus_editor_destroy_cb), dialog);
+ g_signal_connect(win, "response", G_CALLBACK(substatus_editor_response_cb),
+ dialog);
/* Setup the vbox */
vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, 12);
@@ -1449,13 +1467,9 @@
dialog->message_buffer = talkatu_html_buffer_new();
gtk_text_view_set_buffer(GTK_TEXT_VIEW(dialog->message_view), dialog->message_buffer);
- /* Cancel button */
- pidgin_dialog_add_button(GTK_DIALOG(win), _("Cancel"),
- G_CALLBACK(substatus_editor_cancel_cb), dialog);
-
- /* OK button */
- pidgin_dialog_add_button(GTK_DIALOG(win), _("Okay"),
- G_CALLBACK(substatus_editor_ok_cb), dialog);
+ /* Add the buttons */
+ gtk_dialog_add_button(GTK_DIALOG(win), _("Cancel"), GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button(GTK_DIALOG(win), _("Okay"), GTK_RESPONSE_OK);
/* Seed the input widgets with the current values */