mime_str = g_string_new (mime_type);
g_string_ascii_down (mime_str);
}
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_MIME
icons = osso_mime_get_icon_names (mime_str->str, NULL);
#else
icons = hildon_mime_get_icon_names (mime_str->str, NULL);
-#endif /*MODEST_HILDON_VERSION_0*/
+#endif /*MODEST_HAVE_OSSO_MIME*/
for (cursor = icons; cursor; ++cursor) {
if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), *cursor)) {
icon_name = g_strdup (*cursor);
-#ifdef MODEST_HILDON_VERSION_0
-
+#ifdef MODEST_HAVE_OSSO_MIME
gboolean
modest_platform_activate_uri (const gchar *uri)
{
return result;
}
-#else /* !MODEST_HILDON_VERSION_0*/
-
+#else /* !MODEST_HAVE_OSSO_MIME*/
gboolean
modest_platform_activate_uri (const gchar *uri)
}
-#endif /* MODEST_HILDON_VERSION_0*/
+#endif /* MODEST_HAVE_OSSO_MIME*/
gboolean
modest_platform_activate_file (const gchar *path, const gchar *mime_type)
uri_path = g_strconcat ("file://", path, NULL);
con = osso_get_dbus_connection (osso_context);
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_MIME
result = osso_mime_open_file_with_mime_type (con, uri_path, mime_str->str);
g_string_free (mime_str, TRUE);
if (result != 1)
hildon_banner_show_information (NULL, NULL, _("mcen_ni_noregistered_viewer"));
return result != 1;
-#endif
+#endif /*MODEST_HAVE_OSSO_MIME*/
}
ModestPlatformPopupInfo *popup_info = (ModestPlatformPopupInfo *) userdata;
g_free (popup_info->uri);
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_MIME
osso_uri_free_actions (popup_info->actions);
#else
hildon_uri_free_actions (popup_info->actions);
-#endif
+#endif /*MODEST_HAVE_OSSO_MIME*/
return FALSE;
}
/* now, the real uri-actions... */
for (node = popup_info->actions; node != NULL; node = g_slist_next (node)) {
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_MIME
OssoURIAction *action = (OssoURIAction *) node->data;
if (strcmp (action_name, osso_uri_action_get_name (action))==0) {
osso_uri_open (popup_info->uri, action, NULL);
hildon_uri_open (popup_info->uri, action, NULL);
break;
}
-#endif
+#endif /*MODEST_HAVE_OSSO_MIME*/
}
}
if (uri == NULL)
return FALSE;
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_MIME
scheme = osso_uri_get_scheme_from_uri (uri, NULL);
actions_list = osso_uri_get_actions (scheme, NULL);
#else
scheme = hildon_uri_get_scheme_from_uri (uri, NULL);
actions_list = hildon_uri_get_actions (scheme, NULL);
-#endif
+#endif /* MODEST_HAVE_OSSO_MIME */
if (actions_list != NULL) {
GSList *node;
GtkWidget *menu = gtk_menu_new ();
GtkWidget *menu_item;
const gchar *action_name;
const gchar *translation_domain;
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_MIME
OssoURIAction *action = (OssoURIAction *) node->data;
action_name = osso_uri_action_get_name (action);
translation_domain = osso_uri_action_get_translation_domain (action);
} else {
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
}
-#endif
+#endif /*MODEST_HAVE_OSSO_MIME*/
gtk_widget_show (menu_item);
}
/* Show WID-INF036 */
if (chars_length == 20) {
hildon_banner_show_information (gtk_widget_get_parent (GTK_WIDGET (data)), NULL,
- _("mcen_ib_maxchar_reached"));
+ dgettext("hildon-common-strings", "ckdg_ib_maximum_characters_reached"));
} else {
if (chars_length == 0) {
/* A blank space is not valid as first character */
g_list_free(cols);
}
-
-
-gint
-modest_platform_run_new_folder_dialog (GtkWindow *parent_window,
- TnyFolderStore *parent_folder,
- gchar *suggested_name,
- gchar **folder_name)
+static gint
+modest_platform_run_folder_name_dialog (GtkWindow *parent_window,
+ const gchar *dialog_title,
+ const gchar *label_text,
+ const gchar *suggested_name,
+ gchar **folder_name)
{
GtkWidget *dialog, *entry, *label, *hbox;
gint result;
/* Ask the user for the folder name */
- dialog = gtk_dialog_new_with_buttons (_("mcen_ti_new_folder"),
+ dialog = gtk_dialog_new_with_buttons (dialog_title,
parent_window,
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK,
NULL);
/* Create label and entry */
- label = gtk_label_new (_("mcen_fi_new_folder_name"));
+ label = gtk_label_new (label_text);
/* TODO: check that the suggested name does not exist */
/* We set 21 as maximum because we want to show WID-INF036
when the user inputs more that 20 */
}
gint
+modest_platform_run_new_folder_dialog (GtkWindow *parent_window,
+ TnyFolderStore *parent_folder,
+ gchar *suggested_name,
+ gchar **folder_name)
+{
+ return modest_platform_run_folder_name_dialog (parent_window,
+ _("mcen_ti_new_folder"),
+ _("mcen_fi_new_folder_name"),
+ suggested_name,
+ folder_name);
+}
+
+gint
+modest_platform_run_rename_folder_dialog (GtkWindow *parent_window,
+ TnyFolderStore *parent_folder,
+ const gchar *suggested_name,
+ gchar **folder_name)
+{
+ return modest_platform_run_folder_name_dialog (parent_window,
+ _("New folder name"),
+ _("Enter new folder name:"),
+ suggested_name,
+ folder_name);
+}
+
+gint
modest_platform_run_confirmation_dialog (GtkWindow *parent_window,
const gchar *message)
{
void
modest_platform_on_new_msg (void)
{
-/* HildonNotification *not; */
-
-/* /\* Create a new notification. FIXME put the right values, need */
-/* some more specs *\/ */
-/* not = hildon_notification_new ("TODO: (new email) Summary", */
-/* "TODO: (new email) Description", */
-/* "qgn_contact_group_chat_invitation", */
-/* "system.note.dialog"); */
-
-/* /\* Play sound SR-SND-18. TODO: play the right file *\/ */
-/* hildon_notification_set_sound (not, "/usr/share/sounds/ui-new_email.wav"); */
-
-/* /\* Set the led pattern *\/ */
-/* notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION (not), "led-pattern", 3); */
-
-/* /\* Notify. We need to do this in an idle because this function */
-/* could be called from a thread *\/ */
-/* if (!notify_notification_show (NOTIFY_NOTIFICATION (not), NULL)) */
-/* g_error ("Failed to send notification"); */
+#ifdef MODEST_HAVE_HILDON_NOTIFY
+ HildonNotification *not;
+
+ /* Create a new notification. FIXME put the right values, need
+ some more specs */
+ not = hildon_notification_new ("TODO: (new email) Summary",
+ "TODO: (new email) Description",
+ "qgn_contact_group_chat_invitation",
+ "system.note.dialog");
+
+ /* Play sound SR-SND-18. TODO: play the right file */
+ /* TODO: Where is this declared? hildon_notification_set_sound (not, "/usr/share/sounds/ui-new_email.wav"); */
+
+ /* Set the led pattern */
+ notify_notification_set_hint_int32 (NOTIFY_NOTIFICATION (not), "led-pattern", 3);
+
+ /* Notify. We need to do this in an idle because this function
+ could be called from a thread */
+ if (!notify_notification_show (NOTIFY_NOTIFICATION (not), NULL))
+ g_error ("Failed to send notification");
-/* g_object_unref (not); */
+ g_object_unref (not);
+#endif /*MODEST_HAVE_HILDON_NOTIFY*/
}
g_return_if_fail (osso_context);
/* Show help */
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_OSSO_HELP
result = ossohelp_show (osso_context, help_id, OSSO_HELP_SHOW_DIALOG);
#else
result = hildon_help_show (osso_context, help_id, OSSO_HELP_SHOW_DIALOG);