static gboolean
on_idle_open_message_performer (gpointer user_data)
{
- ModestWindow *main_win = NULL;
+ ModestWindow *top_win = NULL;
OpenMsgPerformerInfo *info = (OpenMsgPerformerInfo *) user_data;
- main_win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(),
- FALSE); /* don't create */
+ top_win = modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
/* Lock before the call as we're in an idle handler */
gdk_threads_enter ();
if (info->connect) {
- modest_platform_connect_and_perform (GTK_WINDOW (main_win), TRUE, info->account,
+ modest_platform_connect_and_perform (GTK_WINDOW (top_win), TRUE,
+ info->account,
on_open_message_performer, info);
} else {
- on_open_message_performer (FALSE, NULL, GTK_WINDOW (main_win), info->account, info);
+ on_open_message_performer (FALSE, NULL, GTK_WINDOW (top_win),
+ info->account, info);
}
gdk_threads_leave ();
gpointer user_data)
{
TnyHeader *header;
- ModestWindow *main_win = NULL, *msg_view = NULL;
+ ModestWindow *top_win = NULL, *msg_view = NULL;
header = (TnyHeader *) user_data;
/* Get the main window if exists */
- main_win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(),
- FALSE); /* don't create */
- if (!main_win) {
+ top_win = modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
+ if (!top_win) {
g_object_unref (header);
return;
}
char *uri;
gchar *uid = NULL;
ModestMailOperation *mail_op = NULL;
- ModestWindow *main_win = NULL;
+ ModestWindow *top_win = NULL;
uri = (char *) userdata;
g_free (uri);
return FALSE;
}
-
- main_win = modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(),
- FALSE); /* don't create */
-
+
+ top_win = modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
+
folder = tny_msg_get_folder (msg);
if (!folder) {
g_warning ("%s: Could not find folder (uri:'%s')", __FUNCTION__, uri);
* the code below is or does Gtk+ code */
gdk_threads_enter (); /* CHECKED */
- mail_op = modest_mail_operation_new (main_win ? G_OBJECT(main_win) : NULL);
+ mail_op = modest_mail_operation_new (top_win ? G_OBJECT(top_win) : NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
g_signal_connect (G_OBJECT (mail_op),
NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_send_receive),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_send_receive));
+
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_outbox_cancelsend"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_cancel_send),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_cancel_sending_all));
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_forward"), "<Control>d",
APP_MENU_CALLBACK (modest_ui_actions_on_forward),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_reply_msg));
-
+
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_mark_as_read"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_mark_as_read),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_mark_as_read_msg_in_view));
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_mark_as_unread"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_on_mark_as_unread),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_mark_as_unread_msg_in_view));
-
+
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_viewer_save_attachments"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_save_attachments),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_save_attachments));
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_remove_attachments"), NULL,
APP_MENU_CALLBACK (modest_ui_actions_remove_attachments),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_remove_attachments));
-
+
modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_message"), "<Control>n",
APP_MENU_CALLBACK (modest_ui_actions_on_new_msg),
MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_new_msg));
static void
show_password_warning_only (const gchar *msg)
{
- ModestWindow *main_window =
- modest_window_mgr_get_main_window (modest_runtime_get_window_mgr (), FALSE); /* don't create */
-
/* Show an explanatory temporary banner: */
- if (main_window)
+ if (modest_window_mgr_get_num_windows (modest_runtime_get_window_mgr ()))
modest_platform_information_banner (NULL, NULL, msg);
}
__FUNCTION__, server_account_name ? server_account_name : "<NULL>");
if (cancel)
*cancel = TRUE;
-
+
return NULL;
}
-
+
/* This hash map stores passwords, including passwords that are not stored in gconf. */
/* Is it in the hash? if it's already there, it must be wrong... */
pwd_ptr = (gpointer)&pwd; /* pwd_ptr so the compiler does not complained about
MODEST_DEBUG_BLOCK(
g_debug ("%s: Already asked = %d\n", __FUNCTION__, already_asked);
);
-
+
/* If the password is not already there, try ModestConf */
if (!already_asked) {
pwd = modest_account_mgr_get_server_account_password (priv->account_mgr,
if (settings_have_password) {
/* The password must be wrong, so show the account settings dialog so it can be corrected: */
show_wrong_password_dialog (account);
-
+
if (cancel)
*cancel = TRUE;
-
+
return NULL;
}
-
+
/* we don't have it yet. Get the password from the user */
const gchar* account_id = tny_account_get_id (account);
gboolean remember = FALSE;
pwd = NULL;
-
+
if (already_asked) {
const gchar *msg;
gboolean username_known =
gboolean
modest_ui_actions_on_edit_mode_move_to (ModestWindow *win)
{
- GtkWidget *dialog = NULL, *folder_view = NULL;
- ModestMainWindow *main_window;
+ GtkWidget *dialog = NULL;
MoveToInfo *helper = NULL;
TnyList *list_to_move;
g_return_val_if_fail (MODEST_IS_WINDOW (win), FALSE);
+#ifndef MODEST_TOOLKIT_HILDON2
/* Get the main window if exists */
+ ModestMainWindow *main_window;
if (MODEST_IS_MAIN_WINDOW (win))
main_window = MODEST_MAIN_WINDOW (win);
else
MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW);
else
folder_view = NULL;
+#endif
list_to_move = modest_platform_get_list_to_move (MODEST_WINDOW (win));
}
/* Create and run the dialog */
- dialog = create_move_to_dialog (GTK_WINDOW (win), folder_view);
+ dialog = create_move_to_dialog (GTK_WINDOW (win), NULL);
modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
GTK_WINDOW (dialog),
(GtkWindow *) win);
/* Create helper */
helper = g_slice_new0 (MoveToInfo);
- helper->list = modest_platform_get_list_to_move (MODEST_WINDOW (win));
+ helper->list = list_to_move;
helper->win = win;
/* Listen to response signal */
TnyFolderStore *selected_folder = NULL;
TnyFolderType folder_type;
+
+ /* TODO: this does not work in Fremantle */
mgr = modest_runtime_get_window_mgr ();
main_window = MODEST_MAIN_WINDOW (modest_window_mgr_get_main_window (mgr,
FALSE));/* don't create */
cache_mgr = modest_runtime_get_cache_mgr ();
send_queue_cache = modest_cache_mgr_get_cache (cache_mgr,
MODEST_CACHE_MGR_CACHE_TYPE_SEND_QUEUE);
-
+
g_hash_table_foreach (send_queue_cache, (GHFunc) fill_list_of_caches, &send_queues);
-
+
for (node = send_queues; node != NULL && !found; node = g_slist_next (node)) {
send_queue = MODEST_TNY_SEND_QUEUE (node->data);
-
+
/* Check if msg uid is being processed inside send queue */
if (modest_tny_send_queue_sending_in_progress (send_queue)) {
found = TRUE;