#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);
static gboolean on_key_pressed (GtkWidget *self, GdkEventKey *event, gpointer user_data);
-
/* list my signals */
enum {
LAST_SIGNAL
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),
}
g_free (priv->active_account);
+ g_free (priv->active_mailbox);
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
static void
modest_window_dispose (GObject *obj)
{
- ModestWindowPrivate *priv;
+ ModestWindowPrivate *priv;
priv = MODEST_WINDOW_GET_PRIVATE(obj);
g_object_unref (G_OBJECT(priv->ui_dimming_manager));
priv->ui_dimming_manager = NULL;
}
+
G_OBJECT_CLASS(parent_class)->dispose (obj);
}
}
}
+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)
{
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));