aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-07-31 17:44:35 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-07-31 17:46:42 +0800
commit0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d (patch)
treef942e691af02f8429f4c45b3c8310372b24e0a55
parent8d2d494e21dd76251ce3fff3301bf007eb514f53 (diff)
downloadgsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.tar
gsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.tar.gz
gsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.tar.bz2
gsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.tar.lz
gsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.tar.xz
gsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.tar.zst
gsoc2013-empathy-0279ad1b9504f81dbe6773eab9fdbd6ffdbfca3d.zip
Make protocol icons work also with account == NULL
-rw-r--r--libempathy/empathy-account-settings.c7
-rw-r--r--libempathy/empathy-account-settings.h2
-rw-r--r--src/empathy-accounts-dialog.c11
3 files changed, 14 insertions, 6 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 1c5bc719a..256d05ba4 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -447,13 +447,16 @@ empathy_account_settings_get_protocol (EmpathyAccountSettings *settings)
return priv->protocol;
}
-const gchar *
+gchar *
empathy_account_settings_get_icon_name (EmpathyAccountSettings *settings)
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
if (priv->account != NULL)
- return empathy_account_get_icon_name (priv->account);
+ return g_strdup (empathy_account_get_icon_name (priv->account));
+
+ if (priv->tp_protocol != NULL)
+ return g_strdup_printf ("im-%s", priv->tp_protocol->name);
return NULL;
}
diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h
index 06e5e69e3..8ae692212 100644
--- a/libempathy/empathy-account-settings.h
+++ b/libempathy/empathy-account-settings.h
@@ -127,7 +127,7 @@ void empathy_account_settings_set_uint64 (EmpathyAccountSettings *settings,
void empathy_account_settings_set_boolean (EmpathyAccountSettings *settings,
const gchar *param, gboolean value);
-const gchar *empathy_account_settings_get_icon_name (
+gchar *empathy_account_settings_get_icon_name (
EmpathyAccountSettings *settings);
const gchar *empathy_account_settings_get_display_name (
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 7a9dffb79..974b6dcc4 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -175,6 +175,7 @@ account_dialog_create_settings_widget (EmpathyAccountsDialog *dialog,
EmpathyAccountSettings *settings)
{
EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
+ gchar *icon_name;
priv->settings_widget = get_account_setup_widget (settings);
@@ -182,14 +183,16 @@ account_dialog_create_settings_widget (EmpathyAccountsDialog *dialog,
priv->settings_widget);
gtk_widget_show (priv->settings_widget);
+ icon_name = empathy_account_settings_get_icon_name (settings);
gtk_image_set_from_icon_name (GTK_IMAGE (priv->image_type),
- empathy_account_settings_get_icon_name (settings),
- GTK_ICON_SIZE_DIALOG);
+ icon_name, GTK_ICON_SIZE_DIALOG);
gtk_widget_set_tooltip_text (priv->image_type,
empathy_account_settings_get_protocol (settings));
accounts_dialog_update_name_label (dialog, settings);
+
+ g_free (icon_name);
}
static void
@@ -379,7 +382,7 @@ accounts_dialog_model_pixbuf_data_func (GtkTreeViewColumn *tree_column,
EmpathyAccountsDialog *dialog)
{
EmpathyAccountSettings *settings;
- const gchar *icon_name;
+ gchar *icon_name;
GdkPixbuf *pixbuf;
TpConnectionStatus status;
EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
@@ -392,6 +395,8 @@ accounts_dialog_model_pixbuf_data_func (GtkTreeViewColumn *tree_column,
icon_name = empathy_account_settings_get_icon_name (settings);
pixbuf = empathy_pixbuf_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
+ g_free (icon_name);
+
if (pixbuf)
{
if (status == TP_CONNECTION_STATUS_DISCONNECTED ||