#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
-#include "modest-widget-factory.h"
-#include <modest-widget-memory.h>
-#include <modest-protocol-mgr.h>
#include <tny-gtk-account-list-model.h>
#include <tny-gtk-folder-store-tree-model.h>
#include <tny-account-store.h>
#include <tny-device.h>
#include <tny-folder-store-query.h>
-
+#include "modest-widget-factory.h"
+#include "modest-widget-memory.h"
+#include "modest-protocol-mgr.h"
#include "modest-tny-platform-factory.h"
#include "modest-account-mgr.h"
#include "modest-mail-operation.h"
-
+#include "widgets/modest-header-view-priv.h"
/* 'private'/'protected' functions */
static void modest_widget_factory_class_init (ModestWidgetFactoryClass *klass);
ModestWidgetFactory *self)
{
ModestWidgetFactoryPrivate *priv;
+
priv = MODEST_WIDGET_FACTORY_GET_PRIVATE(self);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->online_toggle),
online ? _("Online") : _("Offline"));
statusbar_push (self, 0, online ? _("Modest went online") : _("Modest went offline"));
+
+ /* If Modest has became online and the header view has a
+ header selected then show it */
+ if (online) {
+ GtkTreeSelection *selected;
+
+ selected = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->header_view));
+ _modest_header_view_change_selection (selected, priv->header_view);
+ }
}
ModestWidgetFactory *self)
{
/* FIXME ==> ask from UI... */
- GtkWidget *dialog;
+ GtkWidget *dialog, *window;
gchar *txt;
gboolean online;
gchar *item = type == MODEST_ITEM_TYPE_FOLDER ? "folder" : "message";
gdk_threads_enter ();
online = tny_device_is_online (device);
+ /* FIXME: get main window */
+ window = NULL;
if (online) {
/* already online -- the item is simply not there... */
- dialog = gtk_message_dialog_new (NULL,
+ dialog = gtk_message_dialog_new (window,
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
} else {
dialog = gtk_dialog_new_with_buttons (_("Connection requested"),
- NULL,
+ window,
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
gchar **password, gboolean *cancel, gboolean *remember, ModestWidgetFactory *self)
{
gchar *txt;
- GtkWidget *dialog, *entry, *remember_pass_check;
+ GtkWidget *dialog, *entry, *remember_pass_check, *window;
+ /* FIXME: get main window */
+ window = NULL;
dialog = gtk_dialog_new_with_buttons (_("Password requested"),
- NULL,
+ window,
GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,