[gnome-photos/wip/rishi/edit-mode: 5/33] application: Add an edit-current action



commit 162763968b377d70e0dd60336b06e255234bd827
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Mar 25 09:40:38 2015 +0100

    application: Add an edit-current action

 src/photos-application.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index f909d27..3dc2d90 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -495,6 +495,20 @@ photos_application_can_fullscreen_changed (PhotosApplication *self)
 
 
 static void
+photos_application_edit_current (PhotosApplication *self)
+{
+  PhotosApplicationPrivate *priv = self->priv;
+  PhotosBaseItem *item;
+
+  item = PHOTOS_BASE_ITEM (photos_base_manager_get_active_object (priv->state->item_mngr));
+  if (item == NULL)
+    return;
+
+  photos_mode_controller_set_window_mode (priv->state->mode_cntrlr, PHOTOS_WINDOW_MODE_EDIT);
+}
+
+
+static void
 photos_application_fullscreen (PhotosApplication *self, GVariant *parameter)
 {
   PhotosApplicationPrivate *priv = self->priv;
@@ -1005,6 +1019,11 @@ photos_application_startup (GApplication *application)
   g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
   g_object_unref (action);
 
+  action = g_simple_action_new ("edit-current", NULL);
+  g_signal_connect_swapped (action, "activate", G_CALLBACK (photos_application_edit_current), self);
+  g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
+  g_object_unref (action);
+
   priv->fs_action = g_simple_action_new ("fullscreen", NULL);
   g_signal_connect_swapped (priv->fs_action, "activate", G_CALLBACK (photos_application_fullscreen), self);
   g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (priv->fs_action));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]