GtkWidget *cc_field;
GtkWidget *bcc_field;
GtkWidget *subject_field;
+
+ gboolean sent;
};
#define MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
priv->cc_field = NULL;
priv->bcc_field = NULL;
priv->subject_field = NULL;
+ priv->sent = FALSE;
}
/**
g_message ("not implemented yet %s", __FUNCTION__);
}
+
+gboolean
+modest_msg_edit_window_get_sent (ModestMsgEditWindow *window)
+{
+ ModestMsgEditWindowPrivate *priv;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(window);
+ return priv->sent;
+}
+
+void
+modest_msg_edit_window_set_sent (ModestMsgEditWindow *window,
+ gboolean sent)
+{
+ ModestMsgEditWindowPrivate *priv;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(window);
+ priv->sent = sent;
+}
gulong system_clipboard_change_handler_id;
TnyMsg *draft_msg;
+ gboolean sent;
};
#define MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
priv->draft_msg = NULL;
priv->clipboard_change_handler_id = 0;
priv->system_clipboard_change_handler_id = 0;
+ priv->sent = FALSE;
}
update_zoom_dimming (window);
}
+
+gboolean
+modest_msg_edit_window_get_sent (ModestMsgEditWindow *window)
+{
+ ModestMsgEditWindowPrivate *priv;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(window);
+ return priv->sent;
+}
+
+void
+modest_msg_edit_window_set_sent (ModestMsgEditWindow *window,
+ gboolean sent)
+{
+ ModestMsgEditWindowPrivate *priv;
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(window);
+ priv->sent = sent;
+}
}
}
} else {
- if (MODEST_IS_MSG_EDIT_WINDOW (window))
- /* Save currently edited message to Drafts */
- if (modest_msg_edit_window_is_modified (MODEST_MSG_EDIT_WINDOW (window))) {
+ if (MODEST_IS_MSG_EDIT_WINDOW (window)) {
+ gboolean sent;
+
+ sent = modest_msg_edit_window_get_sent (MODEST_MSG_EDIT_WINDOW (window));
+ /* Save currently edited message to Drafts if it was not sent */
+ if (!sent && modest_msg_edit_window_is_modified (MODEST_MSG_EDIT_WINDOW (window))) {
gint response =
modest_platform_run_confirmation_dialog (GTK_WINDOW (self),
_("mcen_nc_no_email_message_modified_save_changes"));
modest_ui_actions_on_save_to_drafts (NULL, MODEST_MSG_EDIT_WINDOW (window));
}
}
+ }
}
/* Unregister window */
{
GList *win;
ModestWindowMgrPrivate *priv;
- gint *handler_id;
+ gint *tmp, handler_id;
g_return_if_fail (MODEST_IS_WINDOW_MGR (self));
g_return_if_fail (MODEST_IS_WINDOW (window));
/* Save state */
modest_window_save_state (window);
- /* Remove from list */
+ /* Remove from list & hash table */
priv->window_list = g_list_remove_link (priv->window_list, win);
+ tmp = g_hash_table_lookup (priv->destroy_handlers, window);
+ handler_id = *tmp;
+ g_hash_table_remove (priv->destroy_handlers, window);
/* Remove the reference to the window. We need to block the
destroy event handler to avoid recursive calls */
- handler_id = g_hash_table_lookup (priv->destroy_handlers, window);
- g_signal_handler_block (window, *handler_id);
+ g_signal_handler_block (window, handler_id);
gtk_widget_destroy (win->data);
- if (G_IS_OBJECT (window)) {
- g_warning ("This should not happen the window was not completely destroyed");
- g_signal_handler_unblock (window, *handler_id);
- }
- g_hash_table_remove (priv->destroy_handlers, window);
+ if (G_IS_OBJECT (window))
+ g_signal_handler_unblock (window, handler_id);
/* If there are no more windows registered then exit program */
if (priv->window_list == NULL) {