From eca7888e5b1854e1bc95f0de26ea4904f7ac51f1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 22 Oct 2019 22:59:40 -0400 Subject: [PATCH] xfce4-hdaps-dialogs.c: update to newer combo box API. The gtk_combo_box_get_active_text() and gtk_combo_box_append_text() functions have apparently been deprecated since gtk+-2.24. Instead of calling those functions on a GtkComboBox pointer, we're instead supposed to call e.g. gtk_combo_box_text_get_active_text() on a GtkComboBoxText pointer. Since our "cb_device_name" member was only ever declared as a GtkWidget, all we have to do is switch everything to the new functions so that they create, access, and modify the GtkComboBoxText referred to by cb_device_name instead of a GtkComboBox in the same place. --- panel-plugin/xfce4-hdaps-dialogs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panel-plugin/xfce4-hdaps-dialogs.c b/panel-plugin/xfce4-hdaps-dialogs.c index b6da7cb..78fecdb 100644 --- a/panel-plugin/xfce4-hdaps-dialogs.c +++ b/panel-plugin/xfce4-hdaps-dialogs.c @@ -62,7 +62,7 @@ static void hdaps_configure_response(GtkWidget *dialog, want to save any settings that may have changed. */ g_object_set_data(G_OBJECT(hdaps->plugin), "dialog", NULL); hdaps->poll_frequency = gtk_spin_button_get_value_as_int((GtkSpinButton*)hdaps->sb_poll_frequency); - hdaps->device_name = gtk_combo_box_get_active_text((GtkComboBox*)hdaps->cb_device_name); + hdaps->device_name = gtk_combo_box_text_get_active_text((GtkComboBoxText*)hdaps->cb_device_name); snprintf(hdaps->sysfs_file, FILENAME_MAX, UNLOAD_HEADS_FMT, hdaps->device_name); hdaps_save(hdaps->plugin, hdaps); hdaps_reset_timeout(hdaps); @@ -155,11 +155,11 @@ void hdaps_configure(XfcePanelPlugin *plugin, gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); - hdaps->cb_device_name = gtk_combo_box_new_text(); + hdaps->cb_device_name = gtk_combo_box_text_new(); /* Add the current device name, it should always be available. Oh, and it should be the default, too. */ - gtk_combo_box_append_text((GtkComboBox*)hdaps->cb_device_name, hdaps->device_name); + gtk_combo_box_text_append_text((GtkComboBoxText*)hdaps->cb_device_name, hdaps->device_name); /* This function takes an index, and 0 should be the first (only) index at this point. */ @@ -177,7 +177,7 @@ void hdaps_configure(XfcePanelPlugin *plugin, the only entry. Therefore, to avoid duplicates, we only have to avoid adding the current device name a second time. */ if (strcmp(hdaps_devices[list_idx], hdaps->device_name) != 0) { - gtk_combo_box_append_text((GtkComboBox*)hdaps->cb_device_name, hdaps_devices[list_idx]); + gtk_combo_box_text_append_text((GtkComboBoxText*)hdaps->cb_device_name, hdaps_devices[list_idx]); } } -- 2.44.2