ModestWindow *window,
ModestWindow *parent)
{
- /* If this is the first registered window then reset the
- status of the TnyDevice as it might be forced to be offline
- when modest is running in the background (see
- modest_tny_account_store_new()) */
- if (modest_window_mgr_get_num_windows (self) == 0) {
+ gboolean no_windows, retval;
+
+ no_windows = (modest_window_mgr_get_num_windows (self) == 0);
+
+ retval = MODEST_WINDOW_MGR_GET_CLASS (self)->register_window (self, window, parent);
+
+ if (no_windows) {
+ /* If this is the first registered window then reset the
+ status of the TnyDevice as it might be forced to be offline
+ when modest is running in the background (see
+ modest_tny_account_store_new()) */
if (tny_device_is_forced (modest_runtime_get_device ()))
tny_device_reset (modest_runtime_get_device ());
- }
- return MODEST_WINDOW_MGR_GET_CLASS (self)->register_window (self, window, parent);
+ /* Do also allow modest to shutdown when the
+ application is closed */
+ modest_runtime_set_allow_shutdown (TRUE);
+ }
+ return retval;
}
static gboolean
(MODEST_MSG_VIEW_WINDOW (window));
MODEST_DEBUG_BLOCK(g_debug ("registering window for %s", uid ? uid : "<none>"););
-
+
if (has_uid (priv->preregistered_uids, uid)) {
priv->preregistered_uids =
remove_uid (priv->preregistered_uids,
} else if (MODEST_IS_MSG_EDIT_WINDOW(window)) {
const gchar *uid = modest_msg_edit_window_get_message_uid
(MODEST_MSG_EDIT_WINDOW (window));
-
+
MODEST_DEBUG_BLOCK(g_debug ("registering window for %s", uid););
priv->preregistered_uids =