#include <glib/gprintf.h>
#include <string.h>
#include <modest-runtime.h>
+#include <modest-defs.h>
#include <modest-tny-folder.h>
#include <modest-tny-msg.h>
#include <modest-tny-account.h>
#include <hildon/hildon-gtk.h>
#include <modest-header-window.h>
#include <modest-folder-window.h>
+#include <modest-maemo-utils.h>
#endif
#ifdef MODEST_PLATFORM_MAEMO
const gchar *value;
gboolean any_value_empty = FALSE;
+#ifdef MODEST_TOOLKIT_HILDON2
+ value = hildon_entry_get_text (HILDON_ENTRY (fields->username));
+#else
value = gtk_entry_get_text (GTK_ENTRY (fields->username));
+#endif
if ((value == NULL) || value[0] == '\0') {
any_value_empty = TRUE;
}
+#ifdef MODEST_TOOLKIT_HILDON2
+ value = hildon_entry_get_text (HILDON_ENTRY (fields->password));
+#else
value = gtk_entry_get_text (GTK_ENTRY (fields->password));
+#endif
if ((value == NULL) || value[0] == '\0') {
any_value_empty = TRUE;
}
_HL("wdgt_bd_done"),
GTK_RESPONSE_ACCEPT,
NULL);
+ gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
+ HILDON_MARGIN_DOUBLE);
#else
GtkWidget *dialog =
gtk_dialog_new_with_buttons (_("mail_ti_password_protected"),
}
gchar *txt = g_strdup_printf (_("mail_ia_password_info"), server_name);
- gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), gtk_label_new(txt),
- FALSE, FALSE, 0);
+ GtkWidget *label = gtk_label_new (txt);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
g_free (txt);
g_free (server_name);
+ gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), label,
+ FALSE, FALSE, 0);
server_name = NULL;
/* username: */
gchar *initial_username = modest_account_mgr_get_server_account_username (
modest_runtime_get_account_mgr(), server_account_name);
+#ifdef MODEST_TOOLKIT_HILDON2
+ GtkWidget *entry_username = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+ if (initial_username)
+ hildon_entry_set_text (HILDON_ENTRY (entry_username), initial_username);
+#else
GtkWidget *entry_username = gtk_entry_new ();
if (initial_username)
gtk_entry_set_text (GTK_ENTRY (entry_username), initial_username);
+#endif
/* Dim this if a connection has ever succeeded with this username,
* as per the UI spec: */
/* const gboolean username_known = */
* We use GTK_SIZE_GROUP_HORIZONTAL, so that the widths are the same. */
GtkSizeGroup *sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+#ifdef MODEST_TOOLKIT_HILDON2
+ GtkWidget *caption = modest_maemo_utils_create_captioned (sizegroup, NULL,
+ _("mail_fi_username"), FALSE,
+ entry_username);
+#else
GtkWidget *caption = hildon_caption_new (sizegroup,
_("mail_fi_username"), entry_username, NULL, HILDON_CAPTION_MANDATORY);
+#endif
gtk_widget_show (entry_username);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), caption,
FALSE, FALSE, MODEST_MARGIN_HALF);
#endif /* !MODEST_TOOLKIT_GTK */
/* password: */
+#ifdef MODEST_TOOLKIT_HILDON2
+ GtkWidget *entry_password = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+#else
GtkWidget *entry_password = gtk_entry_new ();
+#endif
gtk_entry_set_visibility (GTK_ENTRY(entry_password), FALSE);
/* gtk_entry_set_invisible_char (GTK_ENTRY(entry_password), "*"); */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry_password),
HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
+#ifdef MODEST_TOOLKIT_HILDON2
+ caption = modest_maemo_utils_create_captioned (sizegroup, NULL,
+ _("mail_fi_password"), FALSE,
+ entry_password);
+#else
caption = hildon_caption_new (sizegroup,
_("mail_fi_password"), entry_password, NULL, HILDON_CAPTION_MANDATORY);
+#endif
gtk_widget_show (entry_password);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), caption,
FALSE, FALSE, MODEST_MARGIN_HALF);
if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
if (username) {
+#ifdef MODEST_TOOLKIT_HILDON2
+ *username = g_strdup (hildon_entry_get_text (HILDON_ENTRY(entry_username)));
+#else
*username = g_strdup (gtk_entry_get_text (GTK_ENTRY(entry_username)));
+#endif
/* Note that an empty field becomes the "" string */
if (*username && strlen (*username) > 0) {
}
if (password) {
+#ifdef MODEST_TOOLKIT_HILDON2
+ *password = g_strdup (hildon_entry_get_text (HILDON_ENTRY(entry_password)));
+#else
*password = g_strdup (gtk_entry_get_text (GTK_ENTRY(entry_password)));
+#endif
/* We do not save the password in the configuration,
* because this function is only called for passwords that should
gint response,
gpointer user_data)
{
- GtkWidget *parent_win, *folder_view;
+ GtkWidget *parent_win;
MoveToInfo *helper = NULL;
+ ModestFolderView *folder_view;
helper = (MoveToInfo *) user_data;
parent_win = (GtkWidget *) helper->win;
- folder_view = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog),
- MODEST_MOVE_TO_DIALOG_FOLDER_VIEW));
+ folder_view = MODEST_FOLDER_VIEW (g_object_get_data (G_OBJECT (dialog),
+ MODEST_MOVE_TO_DIALOG_FOLDER_VIEW));
switch (response) {
TnyFolderStore *dst_folder;
case MODEST_GTK_RESPONSE_NEW_FOLDER:
- modest_ui_actions_create_folder (GTK_WIDGET (dialog), folder_view);
+ modest_ui_actions_create_folder (GTK_WIDGET (dialog), GTK_WIDGET (folder_view));
return;
case GTK_RESPONSE_NONE:
case GTK_RESPONSE_CANCEL:
case GTK_RESPONSE_DELETE_EVENT:
break;
case GTK_RESPONSE_OK:
- dst_folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view));
- /* Do window specific stuff */
+ dst_folder = modest_folder_view_get_selected (folder_view);
+
if (MODEST_IS_MAIN_WINDOW (parent_win)) {
+ /* Clean list to move used for filtering */
+ modest_folder_view_set_list_to_move (folder_view, NULL);
+
modest_ui_actions_on_main_window_move_to (NULL,
- folder_view,
+ GTK_WIDGET (folder_view),
dst_folder,
MODEST_MAIN_WINDOW (parent_win));
#ifdef MODEST_TOOLKIT_HILDON2
} else if (MODEST_IS_FOLDER_WINDOW (parent_win)) {
- modest_ui_actions_on_folder_window_move_to (folder_view,
+ /* Clean list to move used for filtering */
+ modest_folder_view_set_list_to_move (folder_view, NULL);
+
+ modest_ui_actions_on_folder_window_move_to (GTK_WIDGET (folder_view),
dst_folder,
helper->list,
GTK_WINDOW (parent_win));
#endif
} else {
+ /* if the user selected a root folder
+ (account) then do not perform any action */
+ if (TNY_IS_ACCOUNT (dst_folder)) {
+ g_signal_stop_emission_by_name (dialog, "response");
+ return;
+ }
+
+ /* Clean list to move used for filtering */
+ modest_folder_view_set_list_to_move (folder_view, NULL);
+
/* Moving from headers window in edit mode */
modest_ui_actions_on_window_move_to (NULL, helper->list,
dst_folder,
static GtkWidget*
create_move_to_dialog (GtkWindow *win,
- GtkWidget *folder_view)
+ GtkWidget *folder_view,
+ TnyList *list_to_move)
{
GtkWidget *dialog, *tree_view = NULL;
/* Hide special folders */
modest_folder_view_show_non_move_folders (MODEST_FOLDER_VIEW (tree_view), FALSE);
+ if (list_to_move)
+ modest_folder_view_set_list_to_move (MODEST_FOLDER_VIEW (tree_view), list_to_move);
#ifndef MODEST_TOOLKIT_HILDON2
modest_folder_view_select_first_inbox_or_local (MODEST_FOLDER_VIEW (tree_view));
#endif
}
/* Create and run the dialog */
- dialog = create_move_to_dialog (GTK_WINDOW (win), NULL);
+ dialog = create_move_to_dialog (GTK_WINDOW (win), NULL, list_to_move);
modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
GTK_WINDOW (dialog),
(GtkWindow *) win);
}
-void
+void
modest_ui_actions_on_send_queue_error_happened (TnySendQueue *self,
TnyHeader *header,
TnyMsg *msg,
/* Get the server name: */
- server_account =
+ server_account =
TNY_TRANSPORT_ACCOUNT (tny_camel_send_queue_get_transport_account (TNY_CAMEL_SEND_QUEUE (self)));
if (server_account)
- server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
+ server_name = tny_account_get_hostname (TNY_ACCOUNT (server_account));
else
g_return_if_reached ();
g_warning ("%s: unexpected ERROR %d",
__FUNCTION__, err->code);
message = g_strdup (_CS("sfil_ib_unable_to_send"));
- break;
+ break;
}
modest_platform_run_information_dialog (NULL, message, FALSE);