diff options
-rw-r--r-- | libempathy-gtk/empathy-accounts-dialog.c | 10 | ||||
-rw-r--r-- | libempathy-gtk/empathy-accounts-dialog.h | 5 | ||||
-rw-r--r-- | python/pyempathygtk/pyempathygtk.defs | 1 | ||||
-rw-r--r-- | src/empathy-accounts.c | 2 | ||||
-rw-r--r-- | src/empathy-main-window.c | 8 | ||||
-rw-r--r-- | src/empathy-status-icon.c | 2 |
6 files changed, 19 insertions, 9 deletions
diff --git a/libempathy-gtk/empathy-accounts-dialog.c b/libempathy-gtk/empathy-accounts-dialog.c index 177fc6fe8..a148ed24f 100644 --- a/libempathy-gtk/empathy-accounts-dialog.c +++ b/libempathy-gtk/empathy-accounts-dialog.c @@ -1003,7 +1003,8 @@ accounts_dialog_destroy_cb (GtkWidget *widget, } GtkWidget * -empathy_accounts_dialog_show (GtkWindow *parent) +empathy_accounts_dialog_show (GtkWindow *parent, + McAccount *selected_account) { static EmpathyAccountsDialog *dialog = NULL; GladeXML *glade; @@ -1086,7 +1087,12 @@ empathy_accounts_dialog_show (GtkWindow *parent) accounts_dialog_model_setup (dialog); accounts_dialog_setup (dialog); - accounts_dialog_model_select_first (dialog); + + if (selected_account) { + accounts_dialog_model_set_selected (dialog, selected_account); + } else { + accounts_dialog_model_select_first (dialog); + } if (parent) { gtk_window_set_transient_for (GTK_WINDOW (dialog->window), diff --git a/libempathy-gtk/empathy-accounts-dialog.h b/libempathy-gtk/empathy-accounts-dialog.h index d76a4dd12..369b2f75b 100644 --- a/libempathy-gtk/empathy-accounts-dialog.h +++ b/libempathy-gtk/empathy-accounts-dialog.h @@ -27,9 +27,12 @@ #include <gtk/gtkwidget.h> +#include <libmissioncontrol/mc-account.h> + G_BEGIN_DECLS -GtkWidget *empathy_accounts_dialog_show (GtkWindow *parent); +GtkWidget *empathy_accounts_dialog_show (GtkWindow *parent, + McAccount *selected_account); G_END_DECLS diff --git a/python/pyempathygtk/pyempathygtk.defs b/python/pyempathygtk/pyempathygtk.defs index 379f35cbf..ed3c2af71 100644 --- a/python/pyempathygtk/pyempathygtk.defs +++ b/python/pyempathygtk/pyempathygtk.defs @@ -418,6 +418,7 @@ (return-type "GtkWidget*") (parameters '("GtkWindow*" "parent") + '("McAccount*" "selected_account") ) ) diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c index 65ede78ac..98af6fc53 100644 --- a/src/empathy-accounts.c +++ b/src/empathy-accounts.c @@ -53,7 +53,7 @@ main (int argc, char *argv[]) gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), PKGDATADIR G_DIR_SEPARATOR_S "icons"); - dialog = empathy_accounts_dialog_show (NULL); + dialog = empathy_accounts_dialog_show (NULL, NULL); g_signal_connect (dialog, "destroy", G_CALLBACK (destroy_cb), diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 8a8117f6e..ea67634b2 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -645,7 +645,7 @@ static void main_window_edit_accounts_cb (GtkWidget *widget, EmpathyMainWindow *window) { - empathy_accounts_dialog_show (GTK_WINDOW (window->window)); + empathy_accounts_dialog_show (GTK_WINDOW (window->window), NULL); } static void @@ -710,7 +710,7 @@ main_window_throbber_button_press_event_cb (GtkWidget *throbber_ebox, return FALSE; } - empathy_accounts_dialog_show (GTK_WINDOW (window->window)); + empathy_accounts_dialog_show (GTK_WINDOW (window->window), NULL); return FALSE; } @@ -722,9 +722,9 @@ main_window_error_edit_clicked_cb (GtkButton *button, McAccount *account; GtkWidget *error_widget; - empathy_accounts_dialog_show (GTK_WINDOW (window->window)); - account = g_object_get_data (G_OBJECT (button), "account"); + empathy_accounts_dialog_show (GTK_WINDOW (window->window), account); + error_widget = g_hash_table_lookup (window->errors, account); gtk_widget_destroy (error_widget); g_hash_table_remove (window->errors, account); diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c index 3c2e7a679..b0f31c9da 100644 --- a/src/empathy-status-icon.c +++ b/src/empathy-status-icon.c @@ -283,7 +283,7 @@ status_icon_set_visibility (EmpathyStatusIcon *icon, mc_accounts_list_free (accounts); } else { DEBUG ("No enabled account, Showing account dialog"); - empathy_accounts_dialog_show (GTK_WINDOW (priv->window)); + empathy_accounts_dialog_show (GTK_WINDOW (priv->window), NULL); } } } |