On opening a new window, if current window is an editor:
[modest] / src / widgets / modest-window.c
index 99b0015..b664960 100644 (file)
 #include "modest-defs.h"
 #include <string.h> /* for strcmp */
 #include <gdk/gdkkeysyms.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+#include <X11/Xatom.h>
+#include <X11/XKBlib.h>
+#include <X11/Xdmcp.h>
+#ifdef MODEST_TOOLKIT_HILDON2
+#include <hildon/hildon-defines.h>
+#endif
 
 /* 'private'/'protected' functions */
 static void modest_window_class_init (ModestWindowClass *klass);
@@ -59,7 +67,6 @@ static void     modest_window_set_zoom_default           (ModestWindow *window,
 
 static gboolean on_key_pressed (GtkWidget *self, GdkEventKey *event, gpointer user_data);
 
-
 /* list my signals  */
 enum {
        LAST_SIGNAL
@@ -141,6 +148,7 @@ modest_window_init (ModestWindow *obj)
        priv->dimming_state = NULL;
        priv->ui_dimming_enabled = TRUE;
        priv->active_account = NULL;
+       priv->active_mailbox = NULL;
 
        /* Connect signals */
        g_signal_connect (G_OBJECT (obj), 
@@ -161,6 +169,7 @@ modest_window_finalize (GObject *obj)
        }
 
        g_free (priv->active_account);
+       g_free (priv->active_mailbox);
        
        G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
@@ -168,7 +177,7 @@ modest_window_finalize (GObject *obj)
 static void
 modest_window_dispose (GObject *obj)
 {
-       ModestWindowPrivate *priv;      
+       ModestWindowPrivate *priv;
 
        priv = MODEST_WINDOW_GET_PRIVATE(obj);
 
@@ -183,6 +192,7 @@ modest_window_dispose (GObject *obj)
                g_object_unref (G_OBJECT(priv->ui_dimming_manager));
                priv->ui_dimming_manager = NULL;
        }
+
        G_OBJECT_CLASS(parent_class)->dispose (obj);
 }
 
@@ -228,6 +238,31 @@ modest_window_set_active_account (ModestWindow *self, const gchar *active_accoun
        }
 }
 
+const gchar*
+modest_window_get_active_mailbox (ModestWindow *self)
+{
+       g_return_val_if_fail (self, NULL);
+       return MODEST_WINDOW_GET_PRIVATE(self)->active_mailbox;
+}
+
+void
+modest_window_set_active_mailbox (ModestWindow *self, const gchar *active_mailbox)
+{
+       ModestWindowPrivate *priv;
+
+       g_return_if_fail (self);        
+       priv = MODEST_WINDOW_GET_PRIVATE(self);
+
+       if (active_mailbox == priv->active_mailbox)
+               return;
+       else {
+               g_free (priv->active_mailbox);
+               priv->active_mailbox = NULL;
+               if (active_mailbox)
+                       priv->active_mailbox = g_strdup (active_mailbox);
+       }
+}
+
 void
 modest_window_check_dimming_rules (ModestWindow *self)
 {
@@ -439,12 +474,27 @@ on_key_pressed (GtkWidget *self,
        case GDK_F6: 
                modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));
                return TRUE;
+#ifdef MODEST_TOOLKIT_HILDON2
+       case HILDON_HARDKEY_INCREASE:
+               if (MODEST_IS_MSG_VIEW_WINDOW (self)) {
+                       modest_ui_actions_on_zoom_plus (NULL, MODEST_WINDOW(self));
+                       return TRUE;
+               }
+               break;
+       case HILDON_HARDKEY_DECREASE:
+               if (MODEST_IS_MSG_VIEW_WINDOW (self)) {
+                       modest_ui_actions_on_zoom_minus (NULL, MODEST_WINDOW(self));
+                       return TRUE;
+               }
+               break;
+#else
        case GDK_F7: 
                modest_ui_actions_on_zoom_plus (NULL, MODEST_WINDOW(self));
                return TRUE;
        case GDK_F8: 
                modest_ui_actions_on_zoom_minus (NULL, MODEST_WINDOW(self));
                return TRUE;
+#endif
        case GDK_Escape: 
                if (modest_window_mgr_get_fullscreen_mode (mgr))
                        modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));