pidgin/pidginnotificationconnectionerror.c

changeset 41500
9a1ad10a0940
parent 41479
3d2e114380f6
child 41514
a96768bacb59
equal deleted inserted replaced
41499:a80a41434f44 41500:9a1ad10a0940
51 *****************************************************************************/ 51 *****************************************************************************/
52 static void 52 static void
53 pidgin_notification_connection_error_update(PidginNotificationConnectionError *error) { 53 pidgin_notification_connection_error_update(PidginNotificationConnectionError *error) {
54 PurpleAccount *account = NULL; 54 PurpleAccount *account = NULL;
55 PurpleConnectionErrorInfo *info = NULL; 55 PurpleConnectionErrorInfo *info = NULL;
56 gchar *title = NULL; 56 const gchar *icon_name = NULL, *account_id = NULL, *title = NULL;
57 const gchar *username = NULL, *icon_name = NULL, *account_id = NULL;
58 gboolean enabled = FALSE; 57 gboolean enabled = FALSE;
59 58
60 g_return_if_fail(PIDGIN_IS_NOTIFICATION_CONNECTION_ERROR(error)); 59 g_return_if_fail(PIDGIN_IS_NOTIFICATION_CONNECTION_ERROR(error));
61 60
62 if(!PURPLE_IS_NOTIFICATION(error->notification)) { 61 if(!PURPLE_IS_NOTIFICATION(error->notification)) {
101 icon_name = purple_notification_get_icon_name(error->notification); 100 icon_name = purple_notification_get_icon_name(error->notification);
102 if(icon_name != NULL) { 101 if(icon_name != NULL) {
103 hdy_action_row_set_icon_name(HDY_ACTION_ROW(error), icon_name); 102 hdy_action_row_set_icon_name(HDY_ACTION_ROW(error), icon_name);
104 } 103 }
105 104
106 username = purple_account_get_username(account);
107
108 enabled = purple_account_get_enabled(account); 105 enabled = purple_account_get_enabled(account);
109 if(enabled) { 106
110 title = g_strdup_printf(_("%s disconnected"), username); 107 title = purple_notification_get_title(error->notification);
111 } else {
112 title = g_strdup_printf(_("%s disabled"), username);
113 }
114 hdy_preferences_row_set_title(HDY_PREFERENCES_ROW(error), title); 108 hdy_preferences_row_set_title(HDY_PREFERENCES_ROW(error), title);
115 g_free(title);
116 109
117 info = purple_notification_get_data(error->notification); 110 info = purple_notification_get_data(error->notification);
118 if(info != NULL) { 111 if(info != NULL) {
119 hdy_action_row_set_subtitle(HDY_ACTION_ROW(error), info->description); 112 hdy_action_row_set_subtitle(HDY_ACTION_ROW(error), info->description);
120 } else { 113 } else {

mercurial