Fri, 09 Aug 2019 01:51:47 -0400
Rename pidgin_account_option_menu_* to pidgin_account_chooser_*.
Also, try to clean up documentation a bit.
--- a/ChangeLog.API Fri Aug 09 00:41:13 2019 -0400 +++ b/ChangeLog.API Fri Aug 09 01:51:47 2019 -0400 @@ -580,6 +580,8 @@ * FULL_CIRCLE_DEGREES renamed to PIDGIN_FULL_CIRCLE_DEGREES * NUM_NICK_SEED_COLORS renamed to PIDGIN_NUM_NICK_SEED_COLORS * PALETTE_NUM_COLORS renamed to PIDGIN_PALETTE_NUM_COLORS + * pidgin_account_option_menu_* renamed to + pidgin_account_chooser_* * pidgin_new_item_from_stock renamed to pidgin_new_menu_item and removed the accel related parameters. * pidgin_setup_screenname_autocomplete now takes a filter function and
--- a/pidgin/gtkblist.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/gtkblist.c Fri Aug 09 01:51:47 2019 -0400 @@ -1012,8 +1012,8 @@ data->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); - data->account_menu = pidgin_account_option_menu_new(account, FALSE, - callback_func, filter_func, data); + data->account_menu = pidgin_account_chooser_new( + account, FALSE, callback_func, filter_func, data); pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("A_ccount"), data->sg, data->account_menu, TRUE, NULL); data->vbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL, 5)); @@ -1146,7 +1146,8 @@ gtk_dialog_set_default_response(GTK_DIALOG(data->rq_data.window), GTK_RESPONSE_OK); data->default_chat_name = NULL; - data->rq_data.account = pidgin_account_option_menu_get_selected(data->rq_data.account_menu); + data->rq_data.account = + pidgin_account_chooser_get_selected(data->rq_data.account_menu); rebuild_chat_entries(data, NULL);
--- a/pidgin/gtkpounce.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/gtkpounce.c Fri Aug 09 01:51:47 2019 -0400 @@ -444,7 +444,8 @@ gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), purple_buddy_get_name(buddy)); dialog->account = purple_buddy_get_account(buddy); - pidgin_account_option_menu_set_selected(dialog->account_menu, purple_buddy_get_account(buddy)); + pidgin_account_chooser_set_selected( + dialog->account_menu, purple_buddy_get_account(buddy)); gtk_drag_finish(dc, TRUE, (gdk_drag_context_get_actions(dc) == GDK_ACTION_MOVE), t); } @@ -469,7 +470,8 @@ gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry), username); dialog->account = account; - pidgin_account_option_menu_set_selected(dialog->account_menu, account); + pidgin_account_chooser_set_selected( + dialog->account_menu, account); } } @@ -489,7 +491,8 @@ static void reset_send_msg_entry(PidginPounceDialog *dialog, GtkWidget *dontcare) { - PurpleAccount *account = pidgin_account_option_menu_get_selected(dialog->account_menu); + PurpleAccount *account = + pidgin_account_chooser_get_selected(dialog->account_menu); if(GTK_IS_TEXT_BUFFER(dialog->send_msg_buffer)) { g_object_unref(dialog->send_msg_buffer); @@ -590,10 +593,9 @@ gtk_widget_show(label); gtk_size_group_add_widget(sg, label); - dialog->account_menu = - pidgin_account_option_menu_new(dialog->account, TRUE, - G_CALLBACK(pounce_choose_cb), - NULL, dialog); + dialog->account_menu = pidgin_account_chooser_new( + dialog->account, TRUE, G_CALLBACK(pounce_choose_cb), NULL, + dialog); gtk_box_pack_start(GTK_BOX(hbox), dialog->account_menu, FALSE, FALSE, 0); gtk_widget_show(dialog->account_menu);
--- a/pidgin/gtkprivacy.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/gtkprivacy.c Fri Aug 09 01:51:47 2019 -0400 @@ -356,10 +356,10 @@ gtk_widget_show(label); /* Accounts drop-down */ - dropdown = pidgin_account_option_menu_new(NULL, FALSE, - G_CALLBACK(select_account_cb), NULL, dialog); + dropdown = pidgin_account_chooser_new( + NULL, FALSE, G_CALLBACK(select_account_cb), NULL, dialog); pidgin_add_widget_to_vbox(GTK_BOX(vbox), _("Set privacy for:"), NULL, dropdown, TRUE, NULL); - dialog->account = pidgin_account_option_menu_get_selected(dropdown); + dialog->account = pidgin_account_chooser_get_selected(dropdown); /* Add the drop-down list with the allow/block types. */ dialog->type_menu = gtk_combo_box_text_new();
--- a/pidgin/gtkrequest.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/gtkrequest.c Fri Aug 09 01:51:47 2019 -0400 @@ -1351,12 +1351,11 @@ { GtkWidget *widget; - widget = pidgin_account_option_menu_new( - purple_request_field_account_get_default_value(field), - purple_request_field_account_get_show_all(field), - G_CALLBACK(field_account_cb), - purple_request_field_account_get_filter(field), - field); + widget = pidgin_account_chooser_new( + purple_request_field_account_get_default_value(field), + purple_request_field_account_get_show_all(field), + G_CALLBACK(field_account_cb), + purple_request_field_account_get_filter(field), field); gtk_widget_set_tooltip_text(widget, purple_request_field_get_tooltip(field)); g_signal_connect(widget, "changed",
--- a/pidgin/gtkroomlist.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/gtkroomlist.c Fri Aug 09 01:51:47 2019 -0400 @@ -546,10 +546,12 @@ gtk_widget_show(vbox2); /* accounts dropdown list */ - dialog->account_widget = pidgin_account_option_menu_new(dialog->account, FALSE, - G_CALLBACK(dialog_select_account_cb), account_filter_func, dialog); + dialog->account_widget = pidgin_account_chooser_new( + dialog->account, FALSE, G_CALLBACK(dialog_select_account_cb), + account_filter_func, dialog); if (!dialog->account) /* this is normally null, and we normally don't care what the first selected item is */ - dialog->account = pidgin_account_option_menu_get_selected(dialog->account_widget); + dialog->account = pidgin_account_chooser_get_selected( + dialog->account_widget); pidgin_add_widget_to_vbox(GTK_BOX(vbox2), _("_Account:"), NULL, dialog->account_widget, TRUE, NULL); /* scrolled window */
--- a/pidgin/gtkutils.h Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/gtkutils.h Fri Aug 09 01:51:47 2019 -0400 @@ -275,7 +275,7 @@ /** * pidgin_protocol_option_menu_get_selected: * @optmenu: The drop-down option menu created by - * pidgin_account_option_menu_new. + * pidgin_protocol_option_menu_new(). * * Gets the currently selected protocol from a protocol drop down box. * @@ -286,9 +286,9 @@ /** * pidgin_setup_screenname_autocomplete: * @entry: The GtkEntry on which to setup autocomplete. - * @optmenu: A menu for accounts, returned by pidgin_account_option_menu_new(). - * If @optmenu is not %NULL, it'll be updated when a username is chosen - * from the autocomplete list. + * @optmenu: A menu for accounts, returned by pidgin_account_chooser_new(). If + * @optmenu is not %NULL, it'll be updated when a username is chosen + * from the autocomplete list. * @filter_func: (scope call): A function for checking if an autocomplete entry * should be shown. This can be %NULL. * @user_data: The data to be passed to the filter_func function.
--- a/pidgin/pidginaccountchooser.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/pidginaccountchooser.c Fri Aug 09 01:51:47 2019 -0400 @@ -131,7 +131,7 @@ } PurpleAccount * -pidgin_account_option_menu_get_selected(GtkWidget *optmenu) +pidgin_account_chooser_get_selected(GtkWidget *optmenu) { return (PurpleAccount *)aop_option_menu_get_selected(optmenu); } @@ -253,17 +253,15 @@ } void -pidgin_account_option_menu_set_selected(GtkWidget *optmenu, - PurpleAccount *account) +pidgin_account_chooser_set_selected(GtkWidget *optmenu, PurpleAccount *account) { aop_option_menu_select_by_data(optmenu, account); } GtkWidget * -pidgin_account_option_menu_new(PurpleAccount *default_account, - gboolean show_all, GCallback cb, - PurpleFilterAccountFunc filter_func, - gpointer user_data) +pidgin_account_chooser_new(PurpleAccount *default_account, gboolean show_all, + GCallback cb, PurpleFilterAccountFunc filter_func, + gpointer user_data) { GtkWidget *optmenu;
--- a/pidgin/pidginaccountchooser.h Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/pidginaccountchooser.h Fri Aug 09 01:51:47 2019 -0400 @@ -25,7 +25,7 @@ * SECTION:pidgin-account-chooser * @section_id: pidgin-account-chooser * @short_description: <filename>pidginaccountchooser.h</filename> - * @title: Pidgin Account Chooser Widget + * @title: Pidgin Account Chooser Combo Box Widget */ #include "pidgin.h" @@ -35,46 +35,50 @@ G_BEGIN_DECLS /** - * pidgin_account_option_menu_new: + * pidgin_account_chooser_new: * @default_account: The account to select by default. - * @show_all: Whether or not to show all accounts, or just - * active accounts. + * @show_all: Whether or not to show all accounts, or just active accounts. * @cb: (scope call): The callback to call when an account is selected. - * @filter_func: (scope call): A function for checking if an account should - * be shown. This can be NULL. + * @filter_func: (scope call): A function for checking if an account should be + * shown. This can be %NULL. * @user_data: Data to pass to the callback function. * * Creates a drop-down option menu filled with accounts. * - * Returns: (transfer full): The drop-down option menu. + * Returns: (transfer full): The account chooser combo box. + * + * Since: 3.0.0 */ -GtkWidget *pidgin_account_option_menu_new(PurpleAccount *default_account, - gboolean show_all, GCallback cb, - PurpleFilterAccountFunc filter_func, - gpointer user_data); +GtkWidget *pidgin_account_chooser_new(PurpleAccount *default_account, + gboolean show_all, GCallback cb, + PurpleFilterAccountFunc filter_func, + gpointer user_data); /** - * pidgin_account_option_menu_get_selected: - * @optmenu: The drop-down option menu created by - * pidgin_account_option_menu_new. + * pidgin_account_chooser_get_selected: + * @chooser: The chooser created by pidgin_account_chooser_new(). + * + * Gets the currently selected account from an account combo box. * - * Gets the currently selected account from an account drop down box. + * Returns: (transfer none): Returns the #PurpleAccount that is currently + * selected. * - * Returns: (transfer none): Returns the PurpleAccount that is currently - * selected. + * Since: 3.0.0 */ -PurpleAccount *pidgin_account_option_menu_get_selected(GtkWidget *optmenu); +PurpleAccount *pidgin_account_chooser_get_selected(GtkWidget *chooser); /** - * pidgin_account_option_menu_set_selected: - * @optmenu: The GtkOptionMenu created by - * pidgin_account_option_menu_new. + * pidgin_account_chooser_set_selected: + * @chooser: The GtkOptionMenu created by + * pidgin_account_chooser_new. * @account: The PurpleAccount to select. * - * Sets the currently selected account for an account drop down box. + * Sets the currently selected account for an account combo box. + * + * Since: 3.0.0 */ -void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, - PurpleAccount *account); +void pidgin_account_chooser_set_selected(GtkWidget *chooser, + PurpleAccount *account); G_END_DECLS
--- a/pidgin/plugins/contact_priority.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/plugins/contact_priority.c Fri Aug 09 01:51:47 2019 -0400 @@ -42,7 +42,7 @@ { PurpleAccount *account = NULL; - account = pidgin_account_option_menu_get_selected(optmenu); + account = pidgin_account_chooser_get_selected(optmenu); purple_account_set_int(account, "score", gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget))); } @@ -146,13 +146,12 @@ adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, -500, 500, 1, 1, 1)); spin = gtk_spin_button_new(adj, 1, 0); - optmenu = pidgin_account_option_menu_new(NULL, TRUE, - G_CALLBACK(select_account), - NULL, spin); + optmenu = pidgin_account_chooser_new( + NULL, TRUE, G_CALLBACK(select_account), NULL, spin); gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 0); /* this is where we set up the spin button we made above */ - account = pidgin_account_option_menu_get_selected(optmenu); + account = pidgin_account_chooser_get_selected(optmenu); gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), (gdouble)purple_account_get_int(account, "score", 0)); gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(spin), GTK_ADJUSTMENT(adj));
--- a/pidgin/plugins/disco/gtkdisco.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/plugins/disco/gtkdisco.c Fri Aug 09 01:51:47 2019 -0400 @@ -613,8 +613,10 @@ pidgin_disco_list_unref(list); dialog->discolist = NULL; - gtk_widget_set_sensitive(dialog->browse_button, - pidgin_account_option_menu_get_selected(dialog->account_widget) != NULL); + gtk_widget_set_sensitive( + dialog->browse_button, + pidgin_account_chooser_get_selected( + dialog->account_widget) != NULL); gtk_widget_set_sensitive(dialog->register_button, FALSE); gtk_widget_set_sensitive(dialog->add_button, FALSE); @@ -654,9 +656,11 @@ gtk_widget_show(vbox2); /* accounts dropdown list */ - dialog->account_widget = pidgin_account_option_menu_new(NULL, FALSE, - G_CALLBACK(dialog_select_account_cb), account_filter_func, dialog); - dialog->account = pidgin_account_option_menu_get_selected(dialog->account_widget); + dialog->account_widget = pidgin_account_chooser_new( + NULL, FALSE, G_CALLBACK(dialog_select_account_cb), + account_filter_func, dialog); + dialog->account = + pidgin_account_chooser_get_selected(dialog->account_widget); pidgin_add_widget_to_vbox(GTK_BOX(vbox2), _("_Account:"), NULL, dialog->account_widget, TRUE, NULL); /* scrolled window */
--- a/pidgin/plugins/gevolution/new_person_dialog.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/plugins/gevolution/new_person_dialog.c Fri Aug 09 01:51:47 2019 -0400 @@ -277,10 +277,9 @@ if (!person_only) { /* Add the account type stuff. */ - dialog->accounts_menu = - pidgin_account_option_menu_new(account, FALSE, - G_CALLBACK(select_account_cb), - NULL, dialog); + dialog->accounts_menu = pidgin_account_chooser_new( + account, FALSE, G_CALLBACK(select_account_cb), NULL, + dialog); add_pref_box(sg, vbox, _("Account type:"), dialog->accounts_menu); /* Username */
--- a/pidgin/plugins/raw.c Fri Aug 09 00:41:13 2019 -0400 +++ b/pidgin/plugins/raw.c Fri Aug 09 01:51:47 2019 -0400 @@ -150,8 +150,8 @@ gtk_container_add(GTK_CONTAINER(window), hbox); /* Account drop-down menu. */ - dropdown = pidgin_account_option_menu_new(NULL, FALSE, - G_CALLBACK(account_changed_cb), NULL, NULL); + dropdown = pidgin_account_chooser_new( + NULL, FALSE, G_CALLBACK(account_changed_cb), NULL, NULL); if (purple_connections_get_all()) account = (PurpleAccount *)purple_connections_get_all()->data;