#include "modest-window.h"
#include "modest-window-priv.h"
+#include "modest-ui-actions.h"
#include "modest-tny-platform-factory.h"
+#include "modest-runtime.h"
+#include "modest-window-mgr.h"
/* 'private'/'protected' functions */
static void modest_window_class_init (ModestWindowClass *klass);
static void modest_window_show_toolbar_default (ModestWindow *window,
gboolean show_toolbar);
+static gboolean on_key_pressed (GtkWidget *self, GdkEventKey *event, gpointer user_data);
+
+
/* list my signals */
enum {
LAST_SIGNAL
priv->menubar = NULL;
priv->active_account = NULL;
+
+ /* Connect signals */
+ g_signal_connect (G_OBJECT (obj),
+ "key-press-event",
+ G_CALLBACK (on_key_pressed), NULL);
}
static void
{
ModestWindowPrivate *priv;
+ g_return_if_fail (MODEST_IS_WINDOW (self));
priv = MODEST_WINDOW_GET_PRIVATE(self);
+
modest_ui_dimming_manager_process_dimming_rules (priv->ui_dimming_manager);
}
+void
+modest_window_check_dimming_rules_group (ModestWindow *self,
+ const gchar *group_name)
+{
+ ModestWindowPrivate *priv;
+
+ g_return_if_fail (MODEST_IS_WINDOW (self));
+ priv = MODEST_WINDOW_GET_PRIVATE(self);
+
+ modest_ui_dimming_manager_process_dimming_rules_group (priv->ui_dimming_manager, group_name);
+}
+
GtkAction *
modest_window_get_action (ModestWindow *window,
const gchar *action_path)
GtkAction *action = NULL;
ModestWindowPrivate *priv;
+ g_return_val_if_fail (MODEST_IS_WINDOW (window), NULL);
priv = MODEST_WINDOW_GET_PRIVATE(window);
action = gtk_ui_manager_get_action (priv->ui_manager, action_path);
return action;
}
+GtkWidget *
+modest_window_get_action_widget (ModestWindow *window,
+ const gchar *action_path)
+{
+ GtkWidget *widget = NULL;
+ ModestWindowPrivate *priv;
+
+ g_return_val_if_fail (MODEST_IS_WINDOW (window), NULL);
+ priv = MODEST_WINDOW_GET_PRIVATE(window);
+
+ widget = gtk_ui_manager_get_widget (priv->ui_manager, action_path);
+
+ return widget;
+}
+
void
modest_window_set_zoom (ModestWindow *window,
gdouble zoom)
g_warning ("modest: You should implement %s", __FUNCTION__);
}
+
+
void
modest_window_save_state (ModestWindow *window)
{
if (klass->save_state_func)
klass->save_state_func (window);
}
+
+static gboolean
+on_key_pressed (GtkWidget *self,
+ GdkEventKey *event,
+ gpointer user_data)
+{
+ ModestWindowMgr *mgr = NULL;
+
+ mgr = modest_runtime_get_window_mgr ();
+
+ switch (event->keyval) {
+ case GDK_F6:
+ modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));
+ return TRUE;
+ 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;
+ case GDK_Escape:
+ if (modest_window_mgr_get_fullscreen_mode (mgr))
+ modest_ui_actions_on_change_fullscreen (NULL, MODEST_WINDOW(self));
+ else if (MODEST_IS_MSG_VIEW_WINDOW (self)||MODEST_IS_MSG_EDIT_WINDOW (self))
+ modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (self));
+ break;
+ }
+
+ return FALSE;
+}