* src/maemo/modest-ui-actions.c: Use current account instead of
default account for creating viewer windows, so that the viewer
window knows to which account the viewed message belongs.
* src/maemo/modest-msg-view-window.c: Destroy the window when the
corresponding account is deleted. This fixes projects.maemo.org bug
pmo-trunk-r2763
+2007-07-22 Armin Burgmeier <armin@openismus.com>
+
+ * src/maemo/modest-ui-actions.c: Use current account instead of
+ default account for creating viewer windows, so that the viewer
+ window knows to which account the viewed message belongs.
+
+ * src/maemo/modest-msg-view-window.c: Destroy the window when the
+ corresponding account is deleted. This fixes projects.maemo.org bug
+ NB#62936.
+
2007-07-18 Armin Burgmeier <armin@openismus.com>
* src/maemo/modest-connection-specific-smtp-edit-window.c: Don't let
2007-07-18 Armin Burgmeier <armin@openismus.com>
* src/maemo/modest-connection-specific-smtp-edit-window.c: Don't let
#include <gtkhtml/gtkhtml-search.h>
#include "modest-ui-dimming-manager.h"
#include <gdk/gdkkeysyms.h>
#include <gtkhtml/gtkhtml-search.h>
#include "modest-ui-dimming-manager.h"
#include <gdk/gdkkeysyms.h>
+#include <modest-tny-account.h>
#define DEFAULT_FOLDER "MyDocs/.documents"
#define DEFAULT_FOLDER "MyDocs/.documents"
ModestMailOperation *mail_op,
ModestMailOperationQueueNotification type,
ModestMsgViewWindow *self);
ModestMailOperation *mail_op,
ModestMailOperationQueueNotification type,
ModestMsgViewWindow *self);
+static void on_account_removed (ModestAccountMgr *obj,
+ const gchar *account,
+ gboolean server_account,
+ gpointer user_data);
static void view_msg_cb (ModestMailOperation *mail_op, TnyHeader *header, TnyMsg *msg, gpointer user_data);
static void view_msg_cb (ModestMailOperation *mail_op, TnyHeader *header, TnyMsg *msg, gpointer user_data);
guint clipboard_change_handler;
guint queue_change_handler;
guint clipboard_change_handler;
guint queue_change_handler;
+ guint account_removed_handler;
guint progress_bar_timeout;
guint progress_bar_timeout;
priv->msg_view = NULL;
priv->header_model = NULL;
priv->clipboard_change_handler = 0;
priv->msg_view = NULL;
priv->header_model = NULL;
priv->clipboard_change_handler = 0;
+ priv->queue_change_handler = 0;
+ priv->account_removed_handler = 0;
priv->current_toolbar_mode = TOOLBAR_MODE_NORMAL;
priv->optimized_view = FALSE;
priv->current_toolbar_mode = TOOLBAR_MODE_NORMAL;
priv->optimized_view = FALSE;
g_signal_handler_disconnect (G_OBJECT (modest_runtime_get_mail_operation_queue ()), priv->queue_change_handler);
priv->queue_change_handler = 0;
}
g_signal_handler_disconnect (G_OBJECT (modest_runtime_get_mail_operation_queue ()), priv->queue_change_handler);
priv->queue_change_handler = 0;
}
+ if (priv->account_removed_handler > 0) {
+ g_signal_handler_disconnect (G_OBJECT (modest_runtime_get_account_mgr ()), priv->account_removed_handler);
+ priv->account_removed_handler = 0;
+ }
if (priv->header_model != NULL) {
g_object_unref (priv->header_model);
priv->header_model = NULL;
}
if (priv->header_model != NULL) {
g_object_unref (priv->header_model);
priv->header_model = NULL;
}
- /* disconnet operations queue observer */
-
if (priv->progress_bar_timeout > 0) {
g_source_remove (priv->progress_bar_timeout);
priv->progress_bar_timeout = 0;
if (priv->progress_bar_timeout > 0) {
g_source_remove (priv->progress_bar_timeout);
priv->progress_bar_timeout = 0;
G_CALLBACK (on_queue_changed),
obj);
G_CALLBACK (on_queue_changed),
obj);
+ /* Account manager */
+ priv->account_removed_handler = g_signal_connect (G_OBJECT(modest_runtime_get_account_mgr()),
+ "account-removed",
+ G_CALLBACK(on_account_removed),
+ obj);
+
modest_window_set_active_account (MODEST_WINDOW(obj), modest_account_name);
priv->last_search = NULL;
modest_window_set_active_account (MODEST_WINDOW(obj), modest_account_name);
priv->last_search = NULL;
+static void
+on_account_removed (ModestAccountMgr *mgr,
+ const gchar *account,
+ gboolean server_account,
+ gpointer user_data)
+{
+ ModestTnyAccountStore *store = modest_runtime_get_account_store ();
+ const gchar *our_acc = modest_window_get_active_account (MODEST_WINDOW (user_data));
+
+ TnyAccount *tny_acc = modest_tny_account_store_get_tny_account_by (store, MODEST_TNY_ACCOUNT_STORE_QUERY_ID, account);
+ if(tny_acc != NULL)
+ {
+ const gchar* parent_acc = modest_tny_account_get_parent_modest_account_name_for_server_account (tny_acc);
+ if (strcmp (parent_acc, our_acc) == 0)
+ {
+ gtk_widget_destroy (GTK_WIDGET (user_data));
+ }
+ }
+}
static void
on_queue_changed (ModestMailOperationQueue *queue,
static void
on_queue_changed (ModestMailOperationQueue *queue,
headers_action_mark_as_read (header, MODEST_WINDOW(parent_win), NULL);
/* Get account */
headers_action_mark_as_read (header, MODEST_WINDOW(parent_win), NULL);
/* Get account */
- account = modest_account_mgr_get_default_account (modest_runtime_get_account_mgr());
+ account = g_strdup (modest_window_get_active_account (MODEST_WINDOW (parent_win)));
- account = g_strdup (modest_window_get_active_account (MODEST_WINDOW (parent_win)));
+ account = modest_account_mgr_get_default_account (modest_runtime_get_account_mgr());
/* Gets folder type (OUTBOX headers will be opened in edit window */
if (modest_tny_folder_is_local_folder (folder))
/* Gets folder type (OUTBOX headers will be opened in edit window */
if (modest_tny_folder_is_local_folder (folder))