diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2023-03-20 22:25:54 -0500 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2023-03-20 22:25:54 -0500 |
commit | a4b8d956ca038d30a255b89e2871432e5ef7ac2a (patch) | |
tree | 004597abc8aea6ce4d0a327ea371ce76aa71d100 /pidgin/pidginaccountchooser.c | |
parent | e8df893735bca9036f2e03c6f2fc561d85846f8d (diff) | |
download | pidgin-a4b8d956ca038d30a255b89e2871432e5ef7ac2a.tar.gz |
Split account display from chooser into its own widget
This will allow re-using it elsewhere when we need to display the account.
Testing Done:
Compiled and opened Add a Buddy dialog, Room List, etc. that used the chooser.
Reviewed at https://reviews.imfreedom.org/r/2360/
Diffstat (limited to 'pidgin/pidginaccountchooser.c')
-rw-r--r-- | pidgin/pidginaccountchooser.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/pidgin/pidginaccountchooser.c b/pidgin/pidginaccountchooser.c index e6408a0243..3bbbbe15f0 100644 --- a/pidgin/pidginaccountchooser.c +++ b/pidgin/pidginaccountchooser.c @@ -46,49 +46,6 @@ static GParamSpec *properties[PROP_LAST] = {NULL}; /****************************************************************************** * Callbacks *****************************************************************************/ -static char * -pidgin_account_chooser_icon_name_cb(G_GNUC_UNUSED GObject *self, - PurpleAccount *account, - G_GNUC_UNUSED gpointer data) -{ - const char *icon_name = NULL; - - if(PURPLE_IS_ACCOUNT(account)) { - PurpleProtocol *protocol = purple_account_get_protocol(account); - icon_name = purple_protocol_get_icon_name(protocol); - } - - return g_strdup(icon_name); -} - -static char * -pidgin_account_chooser_label_cb(G_GNUC_UNUSED GObject *self, - PurpleAccount *account, - G_GNUC_UNUSED gpointer data) -{ - gchar *markup = NULL; - const char *alias = NULL; - const char *protocol_name = NULL; - const char *username = NULL; - - if(!PURPLE_IS_ACCOUNT(account)) { - return NULL; - } - - alias = purple_contact_info_get_alias(PURPLE_CONTACT_INFO(account)); - protocol_name = purple_account_get_protocol_name(account); - username = purple_contact_info_get_username(PURPLE_CONTACT_INFO(account)); - - if(alias != NULL) { - markup = g_strdup_printf(_("%s (%s) (%s)"), username, alias, - protocol_name); - } else { - markup = g_strdup_printf(_("%s (%s)"), username, protocol_name); - } - - return markup; -} - static void pidgin_account_chooser_changed_cb(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GParamSpec *pspec, @@ -175,10 +132,6 @@ pidgin_account_chooser_class_init(PidginAccountChooserClass *klass) filter); gtk_widget_class_bind_template_callback(widget_class, - pidgin_account_chooser_icon_name_cb); - gtk_widget_class_bind_template_callback(widget_class, - pidgin_account_chooser_label_cb); - gtk_widget_class_bind_template_callback(widget_class, pidgin_account_chooser_changed_cb); } |