#include "modest-marshal.h"
#include "modest-platform.h"
#include <modest-utils.h>
-#include <modest-maemo-utils.h>
+#include <modest-toolkit-utils.h>
#include <modest-tny-msg.h>
#include <modest-msg-view-window.h>
#include "modest-msg-view-window-ui-dimming.h"
#include <modest-account-protocol.h>
#include <modest-icon-names.h>
#include <modest-ui-actions.h>
-#include <modest-hildon2-window-mgr.h>
+#include <modest-window-mgr.h>
#include <tny-camel-msg.h>
+#include <modest-icon-names.h>
+
+#ifdef MODEST_PLATFORM_MAEMO
+#include <modest-maemo-utils.h>
+#endif
+
+#ifdef MODEST_TOOLKIT_HILDON2
+#include <hildon/hildon.h>
+#endif
#define MYDOCS_ENV "MYDOCSDIR"
#define DOCS_FOLDER ".documents"
(GInstanceInitFunc) modest_msg_view_window_init,
NULL
};
-#ifdef MODEST_TOOLKIT_GTK
- my_type = g_type_register_static (MODEST_TYPE_WINDOW,
+#ifndef MODEST_TOOLKIT_HILDON2
+ my_type = g_type_register_static (MODEST_TYPE_SHELL_WINDOW,
"ModestMsgViewWindow",
&my_info, 0);
#else
g_error_free (error);
error = NULL;
}
- /* ****** */
-
- /* Add accelerators */
- gtk_window_add_accel_group (GTK_WINDOW (obj),
- gtk_ui_manager_get_accel_group (parent_priv->ui_manager));
priv->is_search_result = FALSE;
priv->is_outbox = FALSE;
current_search = modest_isearch_toolbar_get_search (MODEST_ISEARCH_TOOLBAR (widget));
if ((current_search == NULL) || (strcmp (current_search, "") == 0)) {
- modest_platform_system_banner (NULL, NULL, _CS("ecdg_ib_find_rep_enter_text"));
+ modest_platform_system_banner (NULL, NULL, _CS_FIND_REP_ENTER_TEXT);
return;
}
priv->last_search);
if (!result) {
modest_platform_system_banner (NULL, NULL,
- _HL("ckct_ib_find_no_matches"));
+ _HL_IB_FIND_NO_MATCHES);
g_free (priv->last_search);
priv->last_search = NULL;
} else {
} else {
if (!modest_isearch_view_search_next (MODEST_ISEARCH_VIEW (priv->msg_view))) {
modest_platform_system_banner (NULL, NULL,
- _HL("ckct_ib_find_search_complete"));
+ _HL_IB_FIND_COMPLETE);
g_free (priv->last_search);
priv->last_search = NULL;
} else {
if (zoom_level >= 2.0) {
modest_platform_system_banner (NULL, NULL,
- _CS("ckct_ib_max_zoom_level_reached"));
+ _CS_MAX_ZOOM_LEVEL_REACHED);
return FALSE;
} else if (zoom_level >= 1.5) {
zoom_level = 2.0;
/* set zoom level */
int_zoom = (gint) rint (zoom_level*100.0+0.1);
- banner_text = g_strdup_printf (_HL("wdgt_ib_zoom"), int_zoom);
+ banner_text = g_strdup_printf (_HL_IB_ZOOM, int_zoom);
modest_platform_information_banner (GTK_WIDGET (window), NULL, banner_text);
g_free (banner_text);
modest_zoomable_set_zoom (MODEST_ZOOMABLE (priv->msg_view), zoom_level);
if (zoom_level <= 0.5) {
modest_platform_system_banner (NULL, NULL,
- _CS("ckct_ib_min_zoom_level_reached"));
+ _CS_MIN_ZOOM_LEVEL_REACHED);
return FALSE;
} else if (zoom_level <= 0.8) {
zoom_level = 0.5;
/* set zoom level */
int_zoom = (gint) rint (zoom_level*100.0+0.1);
- banner_text = g_strdup_printf (_HL("wdgt_ib_zoom"), int_zoom);
+ banner_text = g_strdup_printf (_HL_IB_ZOOM, int_zoom);
modest_platform_information_banner (GTK_WIDGET (window), NULL, banner_text);
g_free (banner_text);
modest_zoomable_set_zoom (MODEST_ZOOMABLE (priv->msg_view), zoom_level);
info = (MsgReaderInfo *) user_data;
if (canceled || err) {
update_window_title (MODEST_MSG_VIEW_WINDOW (parent_window));
+ modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (parent_window));
goto frees;
}
/* We set the header from model while we're loading */
tny_header_view_set_header (TNY_HEADER_VIEW (priv->msg_view), header);
- modest_window_set_title (MODEST_WINDOW (window), _CS("ckdg_pb_updating"));
+ modest_window_set_title (MODEST_WINDOW (window), _CS_UPDATING);
if (header)
folder = NULL;
if (self) {
priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self);
/* First we check if the parent is a folder window */
- if (priv->msg_uid && !modest_hildon2_window_mgr_get_folder_window (MODEST_HILDON2_WINDOW_MGR (modest_runtime_get_window_mgr ()))) {
+ if (priv->msg_uid && !modest_window_mgr_get_folder_window (MODEST_WINDOW_MGR (modest_runtime_get_window_mgr ()))) {
gboolean is_merge;
TnyAccount *account = NULL;
GtkWidget *header_window = NULL;
parent_priv->toolbar = gtk_ui_manager_get_widget (parent_priv->ui_manager,
"/ToolBar");
- /* We don't use HILDON_ICON_SIZE_FINGER in order to avoid the ifdef here */
- gtk_toolbar_set_icon_size (GTK_TOOLBAR (parent_priv->toolbar), gtk_icon_size_from_name ("hildon-finger"));
+#ifdef MODEST_TOOLKIT_HILDON2
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR (parent_priv->toolbar), HILDON_ICON_SIZE_FINGER);
+#else
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR (parent_priv->toolbar), GTK_ICON_SIZE_LARGE_TOOLBAR);
+#endif
gtk_widget_set_no_show_all (parent_priv->toolbar, TRUE);
priv->next_toolitem = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/ToolBar/ToolbarMessageNext");
gdk_threads_enter (); /* CHECKED */
if (info->result == GNOME_VFS_OK) {
- modest_platform_system_banner (NULL, NULL, _CS("sfil_ib_saved"));
+ modest_platform_system_banner (NULL, NULL, _CS_SAVED);
} else if (info->result == GNOME_VFS_ERROR_NO_SPACE) {
gchar *msg = NULL;
escaped_basename = g_uri_unescape_string (basename, NULL);
message = g_strdup_printf ("%s\n%s",
- _FM("docm_nc_replace_file"),
+ _FM_REPLACE_FILE,
(escaped_basename) ? escaped_basename : "");
response = modest_platform_run_confirmation_dialog (parent, message);
g_free (message);
g_free (escaped_basename);
} else {
response = modest_platform_run_confirmation_dialog (parent,
- _FM("docm_nc_replace_multiple"));
+ _FM_REPLACE_MULTIPLE);
}
if (response != GTK_RESPONSE_OK)
is_ok = FALSE;
if (modest_maemo_utils_in_usb_mode ()) {
err_msg = dgettext ("hildon-status-bar-usb", "usbh_ib_mmc_usb_connected");
} else {
- err_msg = _FM("sfil_ib_readonly_location");
+ err_msg = _FM_READ_ONLY_LOCATION;
}
#else
- err_msg = _FM("sfil_ib_readonly_location");
+ err_msg = _FM_READ_ONLY_LOCATION;
#endif
modest_platform_system_banner (NULL, NULL, err_msg);
} else {
/* In Hildon 2.2 save and delete operate over all the attachments as there's no
* selection available */
mime_parts = modest_msg_view_get_attachments (MODEST_MSG_VIEW (priv->msg_view));
- if (mime_parts && !modest_maemo_utils_select_attachments (GTK_WINDOW (window), mime_parts, FALSE)) {
+ if (mime_parts && !modest_toolkit_utils_select_attachments (GTK_WINDOW (gtk_widget_get_toplevel (window)), mime_parts, FALSE)) {
g_object_unref (mime_parts);
return;
}
/* if multiple, set multiple string */
if (save_multiple_str) {
g_object_set (G_OBJECT (save_dialog), "save-multiple", save_multiple_str, NULL);
- gtk_window_set_title (GTK_WINDOW (save_dialog), _FM("sfil_ti_save_objects_files"));
+ gtk_window_set_title (GTK_WINDOW (save_dialog), _FM_SAVE_OBJECT_FILES);
g_free (save_multiple_str);
}
g_object_unref (tmp);
g_object_unref (iter);
- if (!modest_maemo_utils_select_attachments (GTK_WINDOW (window), mime_parts, TRUE) ||
+ if (!modest_toolkit_utils_select_attachments (GTK_WINDOW (window), mime_parts, TRUE) ||
tny_list_get_length (mime_parts) == 0) {
g_object_unref (mime_parts);
return;