From 9936a3252f26ddd99e936ad41dc03b1e83eba6ea Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Fri, 21 May 2010 19:23:22 +1000 Subject: Support Account.Interface.Storage Also support org.moblin.libsocialweb for Meego --- configure.ac | 1 + libempathy-gtk/empathy-account-widget.c | 169 +++++++++++++++++++++++++++----- libempathy/empathy-account-settings.c | 92 +++++++++++++++++ libempathy/empathy-account-settings.h | 10 ++ 4 files changed, 246 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac index 8b498d97d..ff16da156 100644 --- a/configure.ac +++ b/configure.ac @@ -389,6 +389,7 @@ if test "x$enable_meego" != "xno"; then PKG_CHECK_MODULES(MEEGO, [ mx-gtk-1.0 + gio-unix-2.0 ], have_meego="yes", have_meego="no") if test "x$have_meego" = "xyes"; then diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index a32666325..5af18eddf 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -32,6 +32,7 @@ #ifdef HAVE_MEEGO #include +#include #endif /* HAVE_MEEGO */ #include @@ -111,6 +112,10 @@ enum { static void account_widget_apply_and_log_in (EmpathyAccountWidget *); +enum { + RESPONSE_LAUNCH +}; + static guint signals[LAST_SIGNAL] = { 0 }; #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountWidget) @@ -914,6 +919,97 @@ account_widget_build_generic (EmpathyAccountWidget *self, G_CALLBACK (account_widget_settings_ready_cb), self); } +#ifdef HAVE_MEEGO +static void +account_widget_launch_external_clicked (GtkWidget *button, + gpointer user_data) +{ + GDesktopAppInfo *app_info; + const gchar *args[3] = { NULL, }; + GError *error = NULL; + + app_info = g_desktop_app_info_new ("gnome-control-center.desktop"); + + if (app_info == NULL) + { + g_critical ("Could not locate 'gnome-control-center.desktop'"); + return; + } + + args[0] = g_app_info_get_commandline (G_APP_INFO (app_info)); + args[1] = "bisho.desktop"; + args[2] = NULL; + + gdk_spawn_on_screen (gtk_widget_get_screen (button), + NULL, (gchar **) args, NULL, + G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); + if (error != NULL) + { + g_critical ("Failed to launch editor: %s", error->message); + g_clear_error (&error); + } + + g_object_unref (app_info); +} +#endif /* HAVE_MEEGO */ + +static void +account_widget_build_external (EmpathyAccountWidget *self, + EmpathyAccountSettings *settings) +{ + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + GtkWidget *bar, *widget; + gchar *str; + + self->ui_details->widget = gtk_vbox_new (FALSE, 6); + priv->table_common_settings = gtk_table_new (1, 2, FALSE); + + if (!tp_strdiff (empathy_account_settings_get_storage_provider (settings), + "org.moblin.libsocialweb")) + { + /* we know how to handle this external provider */ + str = g_strdup_printf ( + _("The account %s is edited via My Web Accounts."), + empathy_account_settings_get_display_name (settings)); + } + else + { + str = g_strdup_printf ( + _("The account %s cannot be edited in Empathy."), + empathy_account_settings_get_display_name (settings)); + } + + widget = gtk_label_new (str); + gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); + g_free (str); + + bar = gtk_info_bar_new (); + gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO); + gtk_container_add ( + GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), + widget); + gtk_container_set_border_width (GTK_CONTAINER (bar), 6); + +#ifdef HAVE_MEEGO + if (!tp_strdiff (empathy_account_settings_get_storage_provider (settings), + "org.moblin.libsocialweb")) + { + widget = gtk_info_bar_add_button (GTK_INFO_BAR (bar), + _("Launch My Web Accounts"), RESPONSE_LAUNCH); + + g_signal_connect (widget, "clicked", + G_CALLBACK (account_widget_launch_external_clicked), NULL); + } +#endif + + gtk_box_pack_start (GTK_BOX (self->ui_details->widget), bar, + FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (self->ui_details->widget), + priv->table_common_settings, FALSE, TRUE, 0); + + gtk_widget_show_all (self->ui_details->widget); +} + static void account_widget_build_salut (EmpathyAccountWidget *self, const char *filename) @@ -1710,7 +1806,6 @@ do_constructed (GObject *obj) EmpathyAccountWidget *self = EMPATHY_ACCOUNT_WIDGET (obj); EmpathyAccountWidgetPriv *priv = GET_PRIV (self); TpAccount *account; - const gchar *protocol, *cm_name; const gchar *display_name, *default_display_name; guint i = 0; struct { @@ -1731,31 +1826,46 @@ do_constructed (GObject *obj) WIDGET (sofiasip, sip), }; - cm_name = empathy_account_settings_get_cm (priv->settings); - protocol = empathy_account_settings_get_protocol (priv->settings); + account = empathy_account_settings_get_account (priv->settings); - for (i = 0 ; i < G_N_ELEMENTS (widgets); i++) + /* Empathy can only edit accounts without the Cannot_Set_Parameters flag */ + if (empathy_account_settings_get_storage_restrictions (priv->settings) & + TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS) + { + DEBUG ("Account is provided by an external storage provider"); + + account_widget_build_external (self, priv->settings); + } + else { - if (!tp_strdiff (widgets[i].cm_name, cm_name) && - !tp_strdiff (widgets[i].protocol, protocol)) + const gchar *protocol, *cm_name; + + cm_name = empathy_account_settings_get_cm (priv->settings); + protocol = empathy_account_settings_get_protocol (priv->settings); + + for (i = 0 ; i < G_N_ELEMENTS (widgets); i++) { - gchar *filename; + if (!tp_strdiff (widgets[i].cm_name, cm_name) && + !tp_strdiff (widgets[i].protocol, protocol)) + { + gchar *filename; - filename = empathy_file_lookup (widgets[i].file, - "libempathy-gtk"); - widgets[i].func (self, filename); - g_free (filename); + filename = empathy_file_lookup (widgets[i].file, + "libempathy-gtk"); + widgets[i].func (self, filename); + g_free (filename); - break; + break; + } } - } - if (i == G_N_ELEMENTS (widgets)) - { - gchar *filename = empathy_file_lookup ( - "empathy-account-widget-generic.ui", "libempathy-gtk"); - account_widget_build_generic (self, filename); - g_free (filename); + if (i == G_N_ELEMENTS (widgets)) + { + gchar *filename = empathy_file_lookup ( + "empathy-account-widget-generic.ui", "libempathy-gtk"); + account_widget_build_generic (self, filename); + g_free (filename); + } } /* handle default focus */ @@ -1778,7 +1888,9 @@ do_constructed (GObject *obj) account_manager_ready_cb, self); /* handle apply and cancel button */ - if (!priv->simple) + if (!priv->simple && + !(empathy_account_settings_get_storage_restrictions (priv->settings) & + TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS)) { GtkWidget *hbox = gtk_hbox_new (TRUE, 3); GtkWidget *image; @@ -1827,8 +1939,6 @@ do_constructed (GObject *obj) account_widget_set_control_buttons_sensitivity (self, FALSE); } - account = empathy_account_settings_get_account (priv->settings); - if (account != NULL) { g_signal_connect (account, "notify::enabled", @@ -1838,15 +1948,22 @@ do_constructed (GObject *obj) #ifndef HAVE_MEEGO add_register_buttons (self, account); #endif /* HAVE_MEEGO */ - add_enable_checkbox (self, account); + + /* add the Enable checkbox to accounts that support it */ + if (!(empathy_account_settings_get_storage_restrictions (priv->settings) & + TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED)) + add_enable_checkbox (self, account); /* hook up to widget destruction to unref ourselves */ g_signal_connect (self->ui_details->widget, "destroy", G_CALLBACK (account_widget_destroy_cb), self); - empathy_builder_unref_and_keep_widget (self->ui_details->gui, - self->ui_details->widget); - self->ui_details->gui = NULL; + if (self->ui_details->gui != NULL) + { + empathy_builder_unref_and_keep_widget (self->ui_details->gui, + self->ui_details->widget); + self->ui_details->gui = NULL; + } display_name = empathy_account_settings_get_display_name (priv->settings); default_display_name = empathy_account_widget_get_default_display_name (self); diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 29ff3f1b7..1f0d35cb8 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -76,6 +76,13 @@ struct _EmpathyAccountSettingsPriv gulong managers_ready_id; GSimpleAsyncResult *apply_result; + + gboolean storage; + gboolean attempted_storage_properties; + gchar *storage_provider; + GValue *storage_identifier; + GHashTable *storage_specific_information; + TpStorageRestrictionFlags storage_restrictions; }; static void @@ -104,6 +111,9 @@ static void empathy_account_settings_managers_ready_cb (GObject *obj, GParamSpec *pspec, gpointer user_data); static void empathy_account_settings_check_readyness ( EmpathyAccountSettings *self); +static void empathy_account_settings_got_account_storage (TpProxy *account, + GHashTable *properties, const GError *error, gpointer user_data, + GObject *object); static void empathy_account_settings_set_property (GObject *object, @@ -214,6 +224,15 @@ empathy_account_settings_constructed (GObject *object) empathy_account_settings_account_ready_cb, self); tp_g_signal_connect_object (priv->managers, "notify::ready", G_CALLBACK (empathy_account_settings_managers_ready_cb), object, 0); + + priv->storage = tp_proxy_has_interface_by_id (priv->account, + TP_IFACE_QUARK_ACCOUNT_INTERFACE_STORAGE); + + if (priv->storage) + tp_cli_dbus_properties_call_get_all (priv->account, -1, + TP_IFACE_ACCOUNT_INTERFACE_STORAGE, + empathy_account_settings_got_account_storage, + NULL, NULL, object); } if (G_OBJECT_CLASS ( @@ -350,6 +369,13 @@ empathy_account_settings_finalize (GObject *object) g_free (priv->service); g_free (priv->display_name); g_free (priv->icon_name); + g_free (priv->storage_provider); + + if (priv->storage_identifier != NULL) + tp_g_value_slice_free (priv->storage_identifier); + + if (priv->storage_specific_information != NULL) + g_hash_table_unref (priv->storage_specific_information); if (priv->required_params != NULL) g_array_free (priv->required_params, TRUE); @@ -421,6 +447,9 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self) } } + if (priv->storage && !priv->attempted_storage_properties) + return; + g_object_ref (priv->manager); priv->ready = TRUE; @@ -456,6 +485,43 @@ empathy_account_settings_managers_ready_cb (GObject *object, empathy_account_settings_check_readyness (settings); } +static void +empathy_account_settings_got_account_storage (TpProxy *account, + GHashTable *properties, + const GError *error, + gpointer user_data, + GObject *object) +{ + EmpathyAccountSettingsPriv *priv = GET_PRIV (object); + + priv->attempted_storage_properties = TRUE; + + if (error != NULL) + { + DEBUG ("Failed to get Account.Iface.Storage properties: %s", + error->message); + return; + } + + /* Note to the unwary, GetAll() does not returned fully-qualified property + * names as is common for Telepathy APIs */ + priv->storage_provider = g_strdup (tp_asv_get_string (properties, + "StorageProvider")); + + if (!EMP_STR_EMPTY (priv->storage_provider)) + { + priv->storage_identifier = tp_g_value_slice_dup ( + tp_asv_lookup (properties, "StorageIdentifier")); + priv->storage_specific_information = g_hash_table_ref ( + tp_asv_get_boxed (properties, "StorageSpecificInformation", + TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP)); + priv->storage_restrictions = tp_asv_get_uint32 (properties, + "StorageRestrictions", NULL); + } + + empathy_account_settings_check_readyness (EMPATHY_ACCOUNT_SETTINGS (object)); +} + EmpathyAccountSettings * empathy_account_settings_new (const gchar *connection_manager, const gchar *protocol, @@ -1384,3 +1450,29 @@ empathy_account_settings_get_tp_protocol (EmpathyAccountSettings *self) return tp_connection_manager_get_protocol (priv->manager, priv->protocol); } + +const char * +empathy_account_settings_get_storage_provider (EmpathyAccountSettings *self) +{ + return GET_PRIV (self)->storage_provider; +} + +const GValue * +empathy_account_settings_get_storage_identifier (EmpathyAccountSettings *self) +{ + return GET_PRIV (self)->storage_identifier; +} + +GHashTable * +empathy_account_settings_get_storage_specific_information ( + EmpathyAccountSettings *self) +{ + return GET_PRIV (self)->storage_specific_information; +} + +TpStorageRestrictionFlags +empathy_account_settings_get_storage_restrictions ( + EmpathyAccountSettings *self) +{ + return GET_PRIV (self)->storage_restrictions; +} diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h index d3276e1a5..1ce3f53c0 100644 --- a/libempathy/empathy-account-settings.h +++ b/libempathy/empathy-account-settings.h @@ -181,6 +181,16 @@ gboolean empathy_account_settings_is_valid (EmpathyAccountSettings *settings); const TpConnectionManagerProtocol * empathy_account_settings_get_tp_protocol ( EmpathyAccountSettings *settings); +const gchar *empathy_account_settings_get_storage_provider ( + EmpathyAccountSettings *self); +const GValue *empathy_account_settings_get_storage_identifier ( + EmpathyAccountSettings *self); +GHashTable *empathy_account_settings_get_storage_specific_information ( + EmpathyAccountSettings *self); +TpStorageRestrictionFlags empathy_account_settings_get_storage_restrictions ( + EmpathyAccountSettings *self); + + G_END_DECLS #endif /* #ifndef __EMPATHY_ACCOUNT_SETTINGS_H__*/ -- cgit v1.2.3 From aaebc7e2323b89aa577d7d724257522fd0407d3f Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Fri, 8 Oct 2010 12:27:17 +1100 Subject: Revert changes to empathy-account-settings --- libempathy/empathy-account-settings.c | 92 ----------------------------------- libempathy/empathy-account-settings.h | 10 ---- 2 files changed, 102 deletions(-) diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 1f0d35cb8..29ff3f1b7 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -76,13 +76,6 @@ struct _EmpathyAccountSettingsPriv gulong managers_ready_id; GSimpleAsyncResult *apply_result; - - gboolean storage; - gboolean attempted_storage_properties; - gchar *storage_provider; - GValue *storage_identifier; - GHashTable *storage_specific_information; - TpStorageRestrictionFlags storage_restrictions; }; static void @@ -111,9 +104,6 @@ static void empathy_account_settings_managers_ready_cb (GObject *obj, GParamSpec *pspec, gpointer user_data); static void empathy_account_settings_check_readyness ( EmpathyAccountSettings *self); -static void empathy_account_settings_got_account_storage (TpProxy *account, - GHashTable *properties, const GError *error, gpointer user_data, - GObject *object); static void empathy_account_settings_set_property (GObject *object, @@ -224,15 +214,6 @@ empathy_account_settings_constructed (GObject *object) empathy_account_settings_account_ready_cb, self); tp_g_signal_connect_object (priv->managers, "notify::ready", G_CALLBACK (empathy_account_settings_managers_ready_cb), object, 0); - - priv->storage = tp_proxy_has_interface_by_id (priv->account, - TP_IFACE_QUARK_ACCOUNT_INTERFACE_STORAGE); - - if (priv->storage) - tp_cli_dbus_properties_call_get_all (priv->account, -1, - TP_IFACE_ACCOUNT_INTERFACE_STORAGE, - empathy_account_settings_got_account_storage, - NULL, NULL, object); } if (G_OBJECT_CLASS ( @@ -369,13 +350,6 @@ empathy_account_settings_finalize (GObject *object) g_free (priv->service); g_free (priv->display_name); g_free (priv->icon_name); - g_free (priv->storage_provider); - - if (priv->storage_identifier != NULL) - tp_g_value_slice_free (priv->storage_identifier); - - if (priv->storage_specific_information != NULL) - g_hash_table_unref (priv->storage_specific_information); if (priv->required_params != NULL) g_array_free (priv->required_params, TRUE); @@ -447,9 +421,6 @@ empathy_account_settings_check_readyness (EmpathyAccountSettings *self) } } - if (priv->storage && !priv->attempted_storage_properties) - return; - g_object_ref (priv->manager); priv->ready = TRUE; @@ -485,43 +456,6 @@ empathy_account_settings_managers_ready_cb (GObject *object, empathy_account_settings_check_readyness (settings); } -static void -empathy_account_settings_got_account_storage (TpProxy *account, - GHashTable *properties, - const GError *error, - gpointer user_data, - GObject *object) -{ - EmpathyAccountSettingsPriv *priv = GET_PRIV (object); - - priv->attempted_storage_properties = TRUE; - - if (error != NULL) - { - DEBUG ("Failed to get Account.Iface.Storage properties: %s", - error->message); - return; - } - - /* Note to the unwary, GetAll() does not returned fully-qualified property - * names as is common for Telepathy APIs */ - priv->storage_provider = g_strdup (tp_asv_get_string (properties, - "StorageProvider")); - - if (!EMP_STR_EMPTY (priv->storage_provider)) - { - priv->storage_identifier = tp_g_value_slice_dup ( - tp_asv_lookup (properties, "StorageIdentifier")); - priv->storage_specific_information = g_hash_table_ref ( - tp_asv_get_boxed (properties, "StorageSpecificInformation", - TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP)); - priv->storage_restrictions = tp_asv_get_uint32 (properties, - "StorageRestrictions", NULL); - } - - empathy_account_settings_check_readyness (EMPATHY_ACCOUNT_SETTINGS (object)); -} - EmpathyAccountSettings * empathy_account_settings_new (const gchar *connection_manager, const gchar *protocol, @@ -1450,29 +1384,3 @@ empathy_account_settings_get_tp_protocol (EmpathyAccountSettings *self) return tp_connection_manager_get_protocol (priv->manager, priv->protocol); } - -const char * -empathy_account_settings_get_storage_provider (EmpathyAccountSettings *self) -{ - return GET_PRIV (self)->storage_provider; -} - -const GValue * -empathy_account_settings_get_storage_identifier (EmpathyAccountSettings *self) -{ - return GET_PRIV (self)->storage_identifier; -} - -GHashTable * -empathy_account_settings_get_storage_specific_information ( - EmpathyAccountSettings *self) -{ - return GET_PRIV (self)->storage_specific_information; -} - -TpStorageRestrictionFlags -empathy_account_settings_get_storage_restrictions ( - EmpathyAccountSettings *self) -{ - return GET_PRIV (self)->storage_restrictions; -} diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h index 1ce3f53c0..d3276e1a5 100644 --- a/libempathy/empathy-account-settings.h +++ b/libempathy/empathy-account-settings.h @@ -181,16 +181,6 @@ gboolean empathy_account_settings_is_valid (EmpathyAccountSettings *settings); const TpConnectionManagerProtocol * empathy_account_settings_get_tp_protocol ( EmpathyAccountSettings *settings); -const gchar *empathy_account_settings_get_storage_provider ( - EmpathyAccountSettings *self); -const GValue *empathy_account_settings_get_storage_identifier ( - EmpathyAccountSettings *self); -GHashTable *empathy_account_settings_get_storage_specific_information ( - EmpathyAccountSettings *self); -TpStorageRestrictionFlags empathy_account_settings_get_storage_restrictions ( - EmpathyAccountSettings *self); - - G_END_DECLS #endif /* #ifndef __EMPATHY_ACCOUNT_SETTINGS_H__*/ -- cgit v1.2.3 From 99651e27bfe1dd1be31db6119f2cbd8686a905d0 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Fri, 8 Oct 2010 13:06:14 +1100 Subject: Access Account.I.Storage properties via TpAccount --- libempathy-gtk/empathy-account-widget.c | 73 +++++++++++++++++---------------- libempathy/empathy-account-settings.c | 9 +++- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 5af18eddf..d32a16563 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -32,8 +32,8 @@ #ifdef HAVE_MEEGO #include -#include #endif /* HAVE_MEEGO */ +#include #include @@ -919,53 +919,57 @@ account_widget_build_generic (EmpathyAccountWidget *self, G_CALLBACK (account_widget_settings_ready_cb), self); } -#ifdef HAVE_MEEGO static void account_widget_launch_external_clicked (GtkWidget *button, - gpointer user_data) + TpAccount *account) { - GDesktopAppInfo *app_info; - const gchar *args[3] = { NULL, }; - GError *error = NULL; + if (!tp_strdiff (tp_account_get_storage_provider (account), + "com.meego.libsocialweb")) + { + /* we know how to handle this external provider */ + GDesktopAppInfo *app_info; + const gchar *args[3] = { NULL, }; + GError *error = NULL; - app_info = g_desktop_app_info_new ("gnome-control-center.desktop"); + app_info = g_desktop_app_info_new ("gnome-control-center.desktop"); - if (app_info == NULL) - { - g_critical ("Could not locate 'gnome-control-center.desktop'"); - return; - } + if (app_info == NULL) + { + g_critical ("Could not locate 'gnome-control-center.desktop'"); + return; + } - args[0] = g_app_info_get_commandline (G_APP_INFO (app_info)); - args[1] = "bisho.desktop"; - args[2] = NULL; + args[0] = g_app_info_get_commandline (G_APP_INFO (app_info)); + args[1] = "bisho.desktop"; + args[2] = NULL; - gdk_spawn_on_screen (gtk_widget_get_screen (button), - NULL, (gchar **) args, NULL, - G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); - if (error != NULL) - { - g_critical ("Failed to launch editor: %s", error->message); - g_clear_error (&error); - } + gdk_spawn_on_screen (gtk_widget_get_screen (button), + NULL, (gchar **) args, NULL, + G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); + if (error != NULL) + { + g_critical ("Failed to launch editor: %s", error->message); + g_clear_error (&error); + } - g_object_unref (app_info); + g_object_unref (app_info); + } } -#endif /* HAVE_MEEGO */ static void account_widget_build_external (EmpathyAccountWidget *self, EmpathyAccountSettings *settings) { EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + TpAccount *account = empathy_account_settings_get_account (settings); GtkWidget *bar, *widget; gchar *str; self->ui_details->widget = gtk_vbox_new (FALSE, 6); priv->table_common_settings = gtk_table_new (1, 2, FALSE); - if (!tp_strdiff (empathy_account_settings_get_storage_provider (settings), - "org.moblin.libsocialweb")) + if (!tp_strdiff (tp_account_get_storage_provider (account), + "com.meego.libsocialweb")) { /* we know how to handle this external provider */ str = g_strdup_printf ( @@ -990,17 +994,16 @@ account_widget_build_external (EmpathyAccountWidget *self, widget); gtk_container_set_border_width (GTK_CONTAINER (bar), 6); -#ifdef HAVE_MEEGO - if (!tp_strdiff (empathy_account_settings_get_storage_provider (settings), - "org.moblin.libsocialweb")) + if (!tp_strdiff (tp_account_get_storage_provider (account), + "com.meego.libsocialweb")) { + /* we know how to handle this external provider */ widget = gtk_info_bar_add_button (GTK_INFO_BAR (bar), _("Launch My Web Accounts"), RESPONSE_LAUNCH); g_signal_connect (widget, "clicked", - G_CALLBACK (account_widget_launch_external_clicked), NULL); + G_CALLBACK (account_widget_launch_external_clicked), account); } -#endif gtk_box_pack_start (GTK_BOX (self->ui_details->widget), bar, FALSE, TRUE, 0); @@ -1829,7 +1832,7 @@ do_constructed (GObject *obj) account = empathy_account_settings_get_account (priv->settings); /* Empathy can only edit accounts without the Cannot_Set_Parameters flag */ - if (empathy_account_settings_get_storage_restrictions (priv->settings) & + if (tp_account_get_storage_restrictions (account) & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS) { DEBUG ("Account is provided by an external storage provider"); @@ -1889,7 +1892,7 @@ do_constructed (GObject *obj) /* handle apply and cancel button */ if (!priv->simple && - !(empathy_account_settings_get_storage_restrictions (priv->settings) & + !(tp_account_get_storage_restrictions (account) & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS)) { GtkWidget *hbox = gtk_hbox_new (TRUE, 3); @@ -1950,7 +1953,7 @@ do_constructed (GObject *obj) #endif /* HAVE_MEEGO */ /* add the Enable checkbox to accounts that support it */ - if (!(empathy_account_settings_get_storage_restrictions (priv->settings) & + if (!(tp_account_get_storage_restrictions (account) & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED)) add_enable_checkbox (self, account); diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c index 29ff3f1b7..06e6ccd19 100644 --- a/libempathy/empathy-account-settings.c +++ b/libempathy/empathy-account-settings.c @@ -210,7 +210,12 @@ empathy_account_settings_constructed (GObject *object) if (!priv->ready) { - tp_account_prepare_async (priv->account, NULL, + GQuark features[] = { + TP_ACCOUNT_FEATURE_CORE, + TP_ACCOUNT_FEATURE_STORAGE, + 0 }; + + tp_proxy_prepare_async (priv->account, features, empathy_account_settings_account_ready_cb, self); tp_g_signal_connect_object (priv->managers, "notify::ready", G_CALLBACK (empathy_account_settings_managers_ready_cb), object, 0); @@ -436,7 +441,7 @@ empathy_account_settings_account_ready_cb (GObject *source_object, TpAccount *account = TP_ACCOUNT (source_object); GError *error = NULL; - if (!tp_account_prepare_finish (account, result, &error)) + if (!tp_proxy_prepare_finish (account, result, &error)) { DEBUG ("Failed to prepare account: %s", error->message); g_error_free (error); -- cgit v1.2.3 From 53ca6d2ca5de5401e55171bc71a3d75cc7e18fb8 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Mon, 11 Oct 2010 19:13:26 +1100 Subject: Bump required tp-glib version to 0.13.1.1 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ff16da156..faa18f493 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ KEYRING_REQUIRED=2.26.0 LIBCANBERRA_GTK_REQUIRED=0.25 LIBNOTIFY_REQUIRED=0.5.1 TELEPATHY_FARSIGHT_REQUIRED=0.0.14 -TELEPATHY_GLIB_REQUIRED=0.11.16 +TELEPATHY_GLIB_REQUIRED=0.13.1.1 TELEPATHY_LOGGER=0.1.5 UNIQUE_REQUIRED=1.1.2 -- cgit v1.2.3