/* Signal handlers for the send queues */
static GSList *_sig_handlers = NULL;
+/* will modest shut down when window list and mail op queue are empty? */
+static gboolean _allow_shutdown = TRUE;
+
/*
* private functions declared in modest-runtime-priv.h -
* only to be called from modest-init.c
g_printerr ("modest: modest_runtime_init can only be run once\n");
return FALSE;
}
-
+
_singletons = modest_singletons_new ();
if (!_singletons) {
g_printerr ("modest: failed to create singletons\n");
return FALSE;
}
-
+
return TRUE;
}
ModestTnyAccountStore*
modest_runtime_get_account_store (void)
{
- // we get the account store here instead of in Singletons
- // as it leads to various chicken & problems with initialization
- g_return_val_if_fail (_singletons, NULL);
+ g_return_val_if_fail (_singletons, NULL);
+ /* we get the account store here instead of in Singletons as
+ it leads to various chicken & egg problems with
+ initialization */
if (!_account_store) {
_account_store = modest_tny_account_store_new (modest_runtime_get_account_mgr(),
modest_runtime_get_device());
return modest_singletons_get_platform_factory (_singletons);
}
+ModestToolkitFactory*
+modest_runtime_get_toolkit_factory (void)
+{
+ g_return_val_if_fail (_singletons, NULL);
+ return modest_singletons_get_toolkit_factory (_singletons);
+}
+
ModestTnySendQueue*
modest_runtime_get_send_queue (TnyTransportAccount *account,
gboolean create)
return debug_flags;
}
+gboolean
+modest_runtime_get_allow_shutdown (void)
+{
+ return _allow_shutdown;
+}
-
-
+void
+modest_runtime_set_allow_shutdown (gboolean allow)
+{
+ _allow_shutdown = allow;
+}