#include <modest-defs.h>
#include <modest-scrollable.h>
#include <modest-runtime.h>
-#include <modest-main-window.h>
#include <modest-header-view.h>
#include "modest-widget-memory.h"
#include <modest-utils.h>
#include <modest-default-global-settings-dialog.h>
#include <math.h>
#include "widgets/modest-toolkit-utils.h"
+#include "widgets/modest-msg-view-window.h"
#include <modest-shell-banner.h>
+#include <modest-ui-actions.h>
+#include <modest-gtk-window-mgr.h>
#define HILDON_OSSO_URI_ACTION "uri-action"
#define URI_ACTION_COPY "copy:"
const gchar *visible_id = NULL;
userdata.dialog = gtk_dialog_new ();
+
+ gtk_widget_set_size_request (GTK_WIDGET (userdata.dialog),
+ MODEST_DIALOG_WINDOW_MAX_WIDTH,
+ MODEST_DIALOG_WINDOW_MAX_HEIGHT);
+
+ gtk_dialog_add_button (GTK_DIALOG (userdata.dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+
scrollable = modest_toolkit_factory_create_scrollable (modest_runtime_get_toolkit_factory ());
folder_view = modest_platform_create_folder_view (NULL);
dialog = gtk_dialog_new_with_buttons (dialog_title,
parent_window,
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL,
_FM_NEW_FOLDER_DIALOG_OK,
GTK_RESPONSE_ACCEPT,
NULL);
}
+static guint timeout_handler_id = 0;
+static gboolean weak_ref_enabled = FALSE;
+
+static void
+shell_weak_ref (gpointer data,
+ GObject *was)
+{
+ if (timeout_handler_id > 0) {
+ g_source_remove (timeout_handler_id);
+ timeout_handler_id = 0;
+ }
+}
+
+static gboolean
+update_timeout_handler (gpointer userdata)
+{
+ gboolean auto_update;
+ gboolean right_connection = FALSE;
+
+ /* Check if the autoupdate feature is on */
+ auto_update = modest_conf_get_bool (modest_runtime_get_conf (),
+ MODEST_CONF_AUTO_UPDATE, NULL);
+
+ if (auto_update) {
+ gint connect_when;
+ /* Do send receive. Never set the current top window
+ as we always assume that DBus send/receive requests
+ are not user driven */
+
+ connect_when = modest_conf_get_int (modest_runtime_get_conf (),
+ MODEST_CONF_UPDATE_WHEN_CONNECTED_BY, NULL);
+ /* Perform a send and receive if the user selected to connect
+ via any mean or if the current connection method is the
+ same as the one specified by the user */
+ if (connect_when == MODEST_CONNECTED_VIA_ANY ||
+ connect_when == modest_platform_get_current_connection ()) {
+ right_connection = TRUE;
+ }
+ } else {
+ /* Disable auto update */
+ modest_platform_set_update_interval (0);
+ }
+
+ if (auto_update && right_connection) {
+ modest_ui_actions_do_send_receive_all (NULL, FALSE, FALSE, FALSE);
+ }
+
+ return TRUE;
+}
+
gboolean
modest_platform_set_update_interval (guint minutes)
{
+ if (!weak_ref_enabled) {
+ ModestWindowMgr *mgr;
+ GtkWidget *shell;
+ mgr = modest_runtime_get_window_mgr ();
+ shell = modest_gtk_window_mgr_get_shell (MODEST_GTK_WINDOW_MGR (mgr));
+ g_object_weak_ref ((GObject *) shell, shell_weak_ref, NULL);
+ weak_ref_enabled = TRUE;
+ }
+ if (timeout_handler_id > 0) {
+ g_source_remove (timeout_handler_id);
+ timeout_handler_id = 0;
+ }
+ if (minutes > 0)
+ timeout_handler_id = g_timeout_add_seconds (minutes*60, update_timeout_handler, NULL);
+
return TRUE;
}
}
void
-modest_platform_remove_new_mail_notifications (gboolean only_visuals)
+modest_platform_remove_new_mail_notifications (gboolean only_visuals, const gchar *acc_name)
{
return;
}
GTK_WINDOW (parent_window),
GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR |
GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL,
_FM_CHANGE_FOLDER_NEW_FOLDER,
MODEST_GTK_RESPONSE_NEW_FOLDER,
NULL);
return list;
}
+
+void
+modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id)
+{
+ return;
+}
+
+
+void
+modest_platform_emit_account_created_signal (const gchar *account_id)
+{
+ return;
+}
+
+void
+modest_platform_emit_account_removed_signal (const gchar *account_id)
+{
+ return;
+}
+
+void
+modest_platform_emit_msg_read_changed_signal (const gchar *msg_uid,
+ gboolean is_read)
+{
+ return;
+}