for (cursor = icon_names; cursor; ++cursor) {
if (!g_ascii_strcasecmp (*cursor, "gnome-mime-message") ||
!g_ascii_strcasecmp (*cursor, "gnome-mime-message-rfc822")) {
- icon_name = g_strdup ("qgn_list_messagin");
+ icon_name = g_strdup ("stock_message-display");
break;
} else if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default(), *cursor)) {
icon_name = g_strdup (*cursor);
gboolean
modest_platform_activate_uri (const gchar *uri)
{
- g_warning ("Not implemented %s", __FUNCTION__);
+ GAppLaunchContext *al_context;
+ gboolean retval;
- return FALSE;
+ al_context = gdk_app_launch_context_new ();
+ retval = g_app_info_launch_default_for_uri (uri, al_context, NULL);
+ g_object_unref (al_context);
+
+ return retval;
}
gboolean
modest_platform_activate_file (const gchar *path, const gchar *mime_type)
{
- g_warning ("Not implemented %s", __FUNCTION__);
+ gchar *content_type;
+ gboolean retval;
+ GAppInfo *app_info;
+ GList *list;
+ GFile *file;
+ GAppLaunchContext *al_context;
+
+ content_type = g_content_type_from_mime_type (mime_type);
+ if (!content_type)
+ return FALSE;
- return FALSE;
+ app_info = g_app_info_get_default_for_type (content_type, FALSE);
+ g_free (content_type);
+ if (!app_info) {
+ content_type = g_content_type_guess (path, NULL, 0, NULL);
+ if (!content_type)
+ return FALSE;
+
+ app_info = g_app_info_get_default_for_type (content_type, FALSE);
+ g_free (content_type);
+
+ if (!app_info)
+ return FALSE;
+
+ }
+
+ file = g_file_new_for_path (path);
+ list = g_list_prepend (NULL, file);
+ al_context = gdk_app_launch_context_new ();
+ retval = g_app_info_launch (app_info, list, al_context, NULL);
+ g_object_unref (al_context);
+
+ g_list_free (list);
+ g_object_unref (file);
+
+ return retval;
}
gboolean
/* Show WID-INF036 */
if (chars_length >= 20) {
modest_platform_information_banner (gtk_widget_get_parent (GTK_WIDGET (data)), NULL,
- _CS("ckdg_ib_maximum_characters_reached"));
+ _CS_MAXIMUM_CHARACTERS_REACHED);
} else {
if (modest_text_utils_is_forbidden_char (*text, FOLDER_NAME_FORBIDDEN_CHARS)) {
/* Show an error */
tmp = g_strndup (folder_name_forbidden_chars,
FOLDER_NAME_FORBIDDEN_CHARS_LENGTH);
- msg = g_strdup_printf (_CS("ckdg_ib_illegal_characters_entered"), tmp);
+ msg = g_strdup_printf (_CS_ILLEGAL_CHARACTERS_ENTERED, tmp);
modest_platform_information_banner (gtk_widget_get_parent (GTK_WIDGET (data)),
NULL, msg);
g_free (msg);
} else {
if (length >= 20) {
modest_platform_information_banner (gtk_widget_get_parent (GTK_WIDGET (data)), NULL,
- _CS("ckdg_ib_maximum_characters_reached"));
+ _CS_MAXIMUM_CHARACTERS_REACHED);
}
/* Write the text in the entry if it's valid */
g_signal_handlers_block_by_func (editable,
if (g_utf8_strlen (chars,-1) >= 20) {
modest_platform_information_banner (gtk_widget_get_parent (GTK_WIDGET (user_data)), NULL,
- _CS("ckdg_ib_maximum_characters_reached"));
+ _CS_MAXIMUM_CHARACTERS_REACHED);
}
gtk_widget_set_sensitive (ok_button, modest_text_utils_validate_folder_name(chars));
if (exists) {
/* Show an error */
modest_platform_information_banner (gtk_widget_get_parent (GTK_WIDGET (dialog)),
- NULL, _CS("ckdg_ib_folder_already_exists"));
+ NULL, _CS_FOLDER_ALREADY_EXISTS);
/* Select the text */
gtk_entry_select_region (GTK_ENTRY (entry), 0, -1);
gtk_widget_grab_focus (entry);
scrollable = modest_toolkit_factory_create_scrollable (modest_runtime_get_toolkit_factory ());
folder_view = modest_platform_create_folder_view (NULL);
- gtk_window_set_title (GTK_WINDOW (userdata.dialog), _FM("ckdg_ti_change_folder"));
+ gtk_window_set_title (GTK_WINDOW (userdata.dialog), _FM_CHANGE_FOLDER);
modest_folder_view_copy_model (MODEST_FOLDER_VIEW (original),
MODEST_FOLDER_VIEW (folder_view));
get_next_folder_name (const gchar *suggested_name,
TnyFolderStore *suggested_folder)
{
- const gchar *default_name = _FM("ckdg_va_new_folder_name_stub");
+ const gchar *default_name = _FM_NEW_FOLDER_NAME_STUB;
unsigned int i;
gchar *real_suggested_name;
real_suggested_name = g_strdup (default_name);
else
real_suggested_name = g_strdup_printf ("%s(%d)",
- _FM("ckdg_va_new_folder_name_stub"),
+ _FM_NEW_FOLDER_NAME_STUB,
i);
exists = modest_tny_folder_has_subfolder_with_name (suggested_folder,
real_suggested_name,
dialog = gtk_dialog_new_with_buttons (dialog_title,
parent_window,
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
- _FM("ckdg_bd_new_folder_dialog_ok"),
+ _FM_NEW_FOLDER_DIALOG_OK,
GTK_RESPONSE_ACCEPT,
NULL);
if (suggested_name)
gtk_entry_set_text (GTK_ENTRY (entry), suggested_name);
else
- gtk_entry_set_text (GTK_ENTRY (entry), _FM("ckdg_va_new_folder_name_stub"));
+ gtk_entry_set_text (GTK_ENTRY (entry), _FM_NEW_FOLDER_NAME_STUB);
gtk_entry_set_width_chars (GTK_ENTRY (entry),
MAX (g_utf8_strlen (gtk_entry_get_text (GTK_ENTRY (entry)), -1),
- g_utf8_strlen (_FM("ckdg_va_new_folder_name_stub"), -1)));
+ g_utf8_strlen (_FM_NEW_FOLDER_NAME_STUB, -1)));
gtk_entry_select_region (GTK_ENTRY (entry), 0, -1);
}
if (show_parent) {
- label_location = gtk_label_new (_FM("ckdg_fi_new_folder_location"));
+ label_location = gtk_label_new (_FM_NEW_FOLDER_LOCATION);
gtk_misc_set_alignment (GTK_MISC (label_location), 0.0, 0.5);
gtk_size_group_add_widget (sizegroup, label_location);
result = modest_platform_run_folder_common_dialog (parent_window,
suggested_folder,
_HL_TITLE_NEW_FOLDER,
- _FM("ckdg_fi_new_folder_name"),
+ _FM_NEW_FOLDER_NAME,
real_suggested_name,
TRUE,
TRUE,
GTK_WINDOW (parent_window),
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR |
GTK_DIALOG_DESTROY_WITH_PARENT,
- _FM ("ckdg_bd_change_folder_new_folder"),
+ _FM_CHANGE_FOLDER_NEW_FOLDER,
MODEST_GTK_RESPONSE_NEW_FOLDER,
NULL);
buttons_hbox = gtk_hbox_new (FALSE, MODEST_MARGIN_HALF);
back_button = gtk_button_new ();
- back_pixbuf = modest_platform_get_icon (_FM("filemanager_folder_up"), MODEST_ICON_SIZE_BIG);
+ back_pixbuf = modest_platform_get_icon (_FM_FOLDER_UP, MODEST_ICON_SIZE_BIG);
if (back_pixbuf) {
gtk_button_set_image (GTK_BUTTON (back_button), gtk_image_new_from_pixbuf (back_pixbuf));
g_object_unref (back_pixbuf);