Work to fix NB#84828.
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 24 Apr 2008 15:47:03 +0000 (15:47 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 24 Apr 2008 15:47:03 +0000 (15:47 +0000)
* src/modest-ui-actions.c:
        * Dim the username in get password dialog _always_. We don't want to
          allow to change the username from here, as we can cause hangs
          because tny_account_set_user here is inside a lock.
* src/modest-tny-account-store.c:
        * Remove the call to set user as we never change the password from the
          get_password dialog.
* src/maemo/modest-account-settings-dialog.c:
        * Allow to change the smtp username in account settings dialog.
* src/modest-window-mgr.c:
        * A minor issue with modality. If the window we're destroying is
          on top, we remove the current_top reference, to prevent one warning.

pmo-trunk-r4460

src/maemo/modest-account-settings-dialog.c
src/modest-tny-account-store.c
src/modest-ui-actions.c
src/widgets/modest-window-mgr.c

index b7a5bb3..7746939 100644 (file)
@@ -1643,8 +1643,8 @@ modest_account_settings_dialog_check_allow_changes (ModestAccountSettingsDialog
        /* Enable or disable widgets */
        gtk_widget_set_sensitive (self->entry_user_username, !username_known);
        gtk_widget_set_sensitive (self->entry_incomingserver, !username_known);
-       gtk_widget_set_sensitive (self->entry_outgoingserver, !username_known);
-       gtk_widget_set_sensitive (self->entry_outgoing_username, !username_known);
+       /* gtk_widget_set_sensitive (self->entry_outgoingserver, !username_known); */
+       /* gtk_widget_set_sensitive (self->entry_outgoing_username, !username_known); */
        gtk_widget_set_sensitive (self->entry_incoming_port, !username_known);
 /*     gtk_widget_set_sensitive (self->entry_outgoing_port, !username_known); */
        gtk_widget_set_sensitive (self->combo_incoming_security, !username_known);
index 45a0a31..4d29902 100644 (file)
@@ -700,7 +700,13 @@ get_password (TnyAccount *account, const gchar * prompt_not_used, gboolean *canc
                if (!*cancel) {
                        /* The password will be returned as the result,
                         * but we need to tell tinymail about the username too: */
-                       tny_account_set_user (account, username);
+
+                       /* WARNING: I disabled setting username as this can cause locks. Anyway,
+                        * as now we have the password dialog username entry always dimmed
+                        * this shouldn't be a problem */
+
+                       /* if (username) */
+                       /*      tny_account_set_user (account, username); */
                        
                        /* Do not save the password in gconf, because
                         * the UI spec says "The password will never
index ecae79a..1c86dc9 100644 (file)
@@ -526,7 +526,7 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win)
                        if (prev_row_reference != NULL) 
                                gtk_tree_row_reference_free (prev_row_reference);
                        if (prev_path != NULL) 
-                               gtk_tree_path_free (prev_path);                         
+                               gtk_tree_path_free (prev_path);
                }
                
                /* Update toolbar dimming state */
@@ -3464,10 +3464,15 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store,
                gtk_entry_set_text (GTK_ENTRY (entry_username), initial_username);
        /* Dim this if a connection has ever succeeded with this username,
         * as per the UI spec: */
-       const gboolean username_known = 
-               modest_account_mgr_get_server_account_username_has_succeeded(
-                       modest_runtime_get_account_mgr(), server_account_name);
-       gtk_widget_set_sensitive (entry_username, !username_known);
+       /* const gboolean username_known =  */
+       /*      modest_account_mgr_get_server_account_username_has_succeeded( */
+       /*              modest_runtime_get_account_mgr(), server_account_name); */
+       /* gtk_widget_set_sensitive (entry_username, !username_known); */
+
+       /* We drop the username sensitive code and disallow changing it here
+        * as tinymail does not support really changing the username in the callback
+        */
+       gtk_widget_set_sensitive (entry_username, FALSE);
 
 #ifdef MODEST_PLATFORM_MAEMO
        /* Auto-capitalization is the default, so let's turn it off: */
index b4cda24..6e93da1 100644 (file)
@@ -915,6 +915,13 @@ modest_window_mgr_unregister_window (ModestWindowMgr *self,
        /* cancel open and receive operations */
        cancel_window_operations (window);
 
+       /* Check if it's the topmost window, and remove the window from the stack.
+        * This is needed for the cases there's no other topmost window that will
+        * replace it in topmost handler.
+        */
+        if (window == priv->current_top)
+                priv->current_top = NULL;
+
        /* Disconnect the "window-state-event" handler, we won't need it anymore */
        if (priv->window_state_uids) {
 #ifdef MODEST_PLATFORM_MAEMO