}
}
+
+
+static gboolean
+check_required_files (void)
+{
+ FILE *mcc_file = modest_maemo_open_mcc_mapping_file ();
+ if (!mcc_file) {
+ g_printerr ("modest: check for mcc file failed\n");
+ return FALSE;
+ } else
+ fclose (mcc_file);
+
+ if (access (MODEST_PROVIDERS_DATA_PATH, R_OK) != 0) {
+ g_printerr ("modest: cannot find providers data\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+
gboolean
modest_platform_init (int argc, char *argv[])
{
osso_hw_state_t hw_state = { 0 };
DBusConnection *con;
+ if (!check_required_files ()) {
+ g_printerr ("modest: missing required files\n");
+ return FALSE;
+ }
+
+
osso_context =
osso_initialize(PACKAGE,PACKAGE_VERSION,
FALSE, NULL);
return FALSE;
}
-
+
/* Add a D-Bus handler to be used when the main osso-rpc
* D-Bus handler has not handled something.
* We use this for D-Bus methods that need to use more complex types
HildonURIAction *action;
gboolean result = FALSE;
GSList *actions, *iter = NULL;
- const gchar *scheme;
g_return_val_if_fail (uri, FALSE);
if (!uri)
return FALSE;
-
- scheme = hildon_uri_get_scheme_from_uri (uri, NULL);
- actions = hildon_uri_get_actions (scheme, NULL);
+
+ actions = hildon_uri_get_actions_by_uri (uri, -1, NULL);
for (iter = actions; iter; iter = g_slist_next (iter)) {
action = (HildonURIAction*) iter->data;
}
}
- /* if we could open it with email, try something else */
+ /* if we could not open it with email, try something else */
if (!result)
result = hildon_uri_open (uri, NULL, NULL);
gboolean
modest_platform_show_uri_popup (const gchar *uri)
{
- gchar *scheme;
GSList *actions_list;
if (uri == NULL)
return FALSE;
-
- scheme = hildon_uri_get_scheme_from_uri (uri, NULL);
- actions_list = hildon_uri_get_actions (scheme, NULL);
+
+ actions_list = hildon_uri_get_actions_by_uri (uri, -1, NULL);
if (actions_list != NULL) {
GSList *node;
GtkWidget *menu = gtk_menu_new ();
} else {
hildon_banner_show_information (NULL, NULL, _("mcen_ib_unsupported_link"));
}
-
- g_free (scheme);
+
return TRUE;
}
* a) They fundamentally need network access, so they can't really be offline.
* b) That might cause a transport connection to happen too early.
*/
- GError *error = NULL;
- tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (account), TRUE, &error);
- if (error) {
- g_warning ("%s: tny_camel_account_set_online() returned a GError:\n %s\n",
- __FUNCTION__, error->message);
- g_error_free (error);
- }
+
+ /* The last argument is user_data, the NULL before that is the callback */
+ tny_camel_account_set_online (TNY_CAMEL_ACCOUNT (account), TRUE, NULL, NULL);
}
#endif
}
-1);
g_free (url);
- /* Play sound SR-SND-18 */
- hildon_notification_set_sound (HILDON_NOTIFICATION(notification),
- "/usr/share/sounds/ui-new_email.wav");
- notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION(notification),
- "dialog-type", 4);
+ /* Play sound if the user wants */
+ if (modest_conf_get_bool (modest_runtime_get_conf (),
+ MODEST_CONF_PLAY_SOUND_MSG_ARRIVE,
+ NULL)) {
+ hildon_notification_set_sound (HILDON_NOTIFICATION(notification),
+ "/usr/share/sounds/ui-new_email.wav");
+ }
/* Set the led pattern */
+ notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION(notification),
+ "dialog-type", 4);
notify_notification_set_hint_string(NOTIFY_NOTIFICATION(notification),
"led-pattern",
"PatternCommunicationEmail");
} else {
/* Just show the error text and use the default response: */
- modest_maemo_show_information_note_and_forget(GTK_WINDOW (main_window),
- prompt);
+ modest_platform_run_information_dialog (GTK_WINDOW (main_window),
+ prompt);
}
return retval;
}