#include <libosso.h>
#include <hildon/hildon-pannable-area.h>
#include <hildon/hildon-banner.h>
+#include <hildon/hildon-helper.h>
#include <modest-ui-actions.h>
#include <modest-window-mgr.h>
#include <modest-signal-mgr.h>
#include <modest-ui-dimming-manager.h>
#include <modest-window-priv.h>
#include <modest-ui-constants.h>
+#include <modest-account-mgr-helpers.h>
+#include <modest-mailboxes-window.h>
/* 'private'/'protected' functions */
GtkAccelGroup *accel_group;
GtkWidget *no_accounts_label;
GtkWidget *empty_view_new_message_button;
+ GtkWidget *box_alignment;
self = MODEST_ACCOUNTS_WINDOW(g_object_new(MODEST_TYPE_ACCOUNTS_WINDOW, NULL));
priv = MODEST_ACCOUNTS_WINDOW_GET_PRIVATE(self);
new_message_pixbuf = modest_platform_get_icon ("general_add", MODEST_ICON_SIZE_BIG);
+ box_alignment = gtk_alignment_new (0, 0, 1.0, 1.0);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (box_alignment),
+ 0, 0,
+ HILDON_MARGIN_DOUBLE, HILDON_MARGIN_DOUBLE);
priv->box = gtk_vbox_new (FALSE, 0);
no_accounts_label = gtk_label_new (_("mcen_ia_noaccounts"));
- gtk_misc_set_alignment (GTK_MISC (no_accounts_label), 0.5, 0.0);
+
+ gtk_misc_set_alignment (GTK_MISC (no_accounts_label), 0.5, 0.5);
+ hildon_helper_set_logical_font (no_accounts_label, "LargeSystemFont");
empty_view_new_message_button = hildon_button_new (MODEST_EDITABLE_SIZE, HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
hildon_button_set_title (HILDON_BUTTON (empty_view_new_message_button), _("mcen_ti_new_message"));
gtk_container_add (GTK_CONTAINER (priv->pannable), priv->account_view);
gtk_box_pack_start (GTK_BOX (priv->box), priv->pannable, TRUE, TRUE, 0);
- gtk_container_add (GTK_CONTAINER (self), priv->box);
+ gtk_container_add (GTK_CONTAINER (box_alignment), priv->box);
+ gtk_container_add (GTK_CONTAINER (self), box_alignment);
- gtk_widget_show (priv->account_view);
gtk_widget_show (priv->pannable);
gtk_widget_show (priv->box);
+ gtk_widget_show (box_alignment);
connect_signals (MODEST_ACCOUNTS_WINDOW (self));
{
ModestAccountsWindowPrivate *priv;
gchar* account_name;
- GtkWidget *folder_window;
+ GtkWidget *new_window;
gboolean registered;
+ ModestProtocolType store_protocol;
+ gboolean mailboxes_protocol;
priv = MODEST_ACCOUNTS_WINDOW_GET_PRIVATE (self);
if (!account_name)
return;
- folder_window = GTK_WIDGET (modest_folder_window_new (NULL));
+ /* If it's a multimailbox container, we have to show the mailboxes window */
+ store_protocol = modest_account_mgr_get_store_protocol (modest_runtime_get_account_mgr (),
+ account_name);
+ mailboxes_protocol =
+ modest_protocol_registry_protocol_type_has_tag (modest_runtime_get_protocol_registry (),
+ store_protocol,
+ MODEST_PROTOCOL_REGISTRY_MULTI_MAILBOX_PROVIDER_PROTOCOLS);
+ if (mailboxes_protocol) {
+ new_window = GTK_WIDGET (modest_mailboxes_window_new (account_name));
+ } else {
+
+ new_window = GTK_WIDGET (modest_folder_window_new (NULL));
+ }
+
registered = modest_window_mgr_register_window (modest_runtime_get_window_mgr (),
- MODEST_WINDOW (folder_window),
+ MODEST_WINDOW (new_window),
MODEST_WINDOW (self));
if (!registered) {
- gtk_widget_destroy (folder_window);
- folder_window = NULL;
+ gtk_widget_destroy (new_window);
+ new_window = NULL;
} else {
- modest_folder_window_set_account (MODEST_FOLDER_WINDOW (folder_window), account_name);
- gtk_widget_show (folder_window);
+ if (!mailboxes_protocol) {
+ modest_folder_window_set_account (MODEST_FOLDER_WINDOW (new_window), account_name);
+ }
+ gtk_widget_show (new_window);
}
g_free (account_name);
}
count = gtk_tree_model_iter_n_children (model, NULL);
if (count == 0) {
+ gtk_widget_hide (priv->account_view);
gtk_widget_show (priv->no_accounts_container);
} else {
gtk_widget_hide (priv->no_accounts_container);
+ gtk_widget_show (priv->account_view);
}
gtk_container_child_set (GTK_CONTAINER(priv->box), priv->pannable,
"expand", count > 0,