}
static void
-on_wizard_response (GtkDialog *dialog, gint response, gpointer user_data)
+on_wizard_response (GtkDialog *dialog,
+ gint response,
+ gpointer user_data)
{
/* The response has already been handled by the wizard dialog itself,
* creating the new account.
*/
- /* Destroy the dialog: */
if (dialog)
gtk_widget_destroy (GTK_WIDGET (dialog));
+
+ /* Re-focus the account list view widget */
+ if (MODEST_IS_ACCOUNT_VIEW_WINDOW (user_data)) {
+ ModestAccountViewWindowPrivate *priv;
+ priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE (user_data);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->account_view));
+ }
}
static void
{
GtkDialog *wizard;
GtkWindow *dialog;
-
+
/* Show the easy-setup wizard: */
dialog = modest_window_mgr_get_modal (modest_runtime_get_window_mgr());
if (dialog && MODEST_IS_EASYSETUP_WIZARD_DIALOG(dialog)) {
gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
}
-
-
static GtkWidget*
button_box_new (ModestAccountViewWindow *self)
{
g_signal_connect (G_OBJECT(priv->close_button), "clicked",
G_CALLBACK(on_close_button_clicked),
self);
-
+
gtk_box_pack_start (GTK_BOX(button_box), priv->new_button, FALSE, FALSE,2);
gtk_box_pack_start (GTK_BOX(button_box), priv->edit_button, FALSE, FALSE,2);
gtk_box_pack_start (GTK_BOX(button_box), priv->delete_button, FALSE, FALSE,2);
const gchar *account,
gpointer user_data)
{
+ ModestAccountViewWindowPrivate *priv;
+
/* If there is no account left then close the window */
if (!modest_account_mgr_has_accounts (acc_mgr, TRUE)) {
gboolean ret_value;
g_signal_emit_by_name (G_OBJECT (user_data), "delete-event", NULL, &ret_value);
+ } else {
+ /* Re-focus the account list view widget */
+ priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE (user_data);
+ gtk_widget_grab_focus (GTK_WIDGET (priv->account_view));
}
}
const gchar *account_name,
const gchar *display_name)
{
+ gboolean notify = TRUE;
+
+ if (!modest_account_mgr_get_display_name (self, account_name))
+ notify = FALSE;
+
modest_account_mgr_set_string (self,
account_name,
MODEST_ACCOUNT_DISPLAY_NAME,
FALSE /* not server account */);
/* Notify about the change in the display name */
- g_signal_emit (self, signals[DISPLAY_NAME_CHANGED_SIGNAL], 0, account_name);
+ if (notify)
+ g_signal_emit (self, signals[DISPLAY_NAME_CHANGED_SIGNAL], 0, account_name);
}
if (selected_name) {
modest_account_view_select_account (view, selected_name);
g_free (selected_name);
+ } else {
+ modest_account_view_select_first_account (view);
}
}
{
ModestAccountView *self;
ModestAccountViewPrivate *priv;
+ gchar *selected_name;
g_return_if_fail (MODEST_IS_ACCOUNT_VIEW (user_data));
self = MODEST_ACCOUNT_VIEW (user_data);
priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE (self);
+
+ /* Do not refresh the view with transport accounts */
+ if (!TNY_IS_STORE_ACCOUNT (account))
+ return;
- gchar *selected_name = modest_account_view_get_selected_account (self);
+ selected_name = modest_account_view_get_selected_account (self);
if (selected_name == NULL) {
/* we select the first account if none is selected */
modest_account_view_select_first_account (self);