[gnome-photos/wip/rishi/edit-mode: 4/27] Add a new mode for Edit



commit 7de8841f9ed64eeb154ed441ac08a12eff07cafa
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 26 10:28:28 2015 +0100

    Add a new mode for Edit

 src/photos-embed.c             |    4 ++++
 src/photos-empty-results-box.c |    2 ++
 src/photos-item-manager.c      |    3 ++-
 src/photos-item-manager.h      |    1 +
 src/photos-main-window.c       |    2 ++
 src/photos-preview-view.c      |    1 +
 src/photos-view-container.c    |    1 +
 src/photos-view-model.c        |    1 +
 8 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index b04909e..a3f8966 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -166,6 +166,7 @@ photos_embed_get_view_container_from_mode (PhotosEmbed *self, PhotosWindowMode m
       break;
 
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_PREVIEW:
     default:
       g_assert_not_reached ();
@@ -592,6 +593,9 @@ photos_embed_window_mode_changed (PhotosModeController *mode_cntrlr,
 
   switch (mode)
     {
+    case PHOTOS_WINDOW_MODE_EDIT:
+      break;
+
     case PHOTOS_WINDOW_MODE_COLLECTIONS:
       photos_embed_prepare_for_collections (self, old_mode);
       goto set_toolbar_model;
diff --git a/src/photos-empty-results-box.c b/src/photos-empty-results-box.c
index 80c53ae..42dda65 100644
--- a/src/photos-empty-results-box.c
+++ b/src/photos-empty-results-box.c
@@ -193,6 +193,7 @@ photos_empty_results_box_constructed (GObject *object)
       break;
 
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_PREVIEW:
     default:
       g_assert_not_reached ();
@@ -237,6 +238,7 @@ photos_empty_results_box_constructed (GObject *object)
       break;
 
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_PREVIEW:
     default:
       g_assert_not_reached ();
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 09d1226..2db3368 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -753,7 +753,8 @@ photos_mode_controller_set_window_mode (PhotosModeController *self, PhotosWindow
 
   g_return_if_fail (mode != PHOTOS_WINDOW_MODE_NONE);
   g_return_if_fail (mode != PHOTOS_WINDOW_MODE_PREVIEW);
-  g_return_if_fail (self->mode != PHOTOS_WINDOW_MODE_PREVIEW);
+  g_return_if_fail (self->mode != PHOTOS_WINDOW_MODE_PREVIEW
+                    || (self->mode == PHOTOS_WINDOW_MODE_PREVIEW && mode == PHOTOS_WINDOW_MODE_EDIT));
 
   if (!photos_item_manager_set_window_mode_internal (self, mode, &old_mode))
     return;
diff --git a/src/photos-item-manager.h b/src/photos-item-manager.h
index 69a8fe8..0e8ca14 100644
--- a/src/photos-item-manager.h
+++ b/src/photos-item-manager.h
@@ -58,6 +58,7 @@ typedef enum
 {
   PHOTOS_WINDOW_MODE_NONE,
   PHOTOS_WINDOW_MODE_COLLECTIONS,
+  PHOTOS_WINDOW_MODE_EDIT,
   PHOTOS_WINDOW_MODE_FAVORITES,
   PHOTOS_WINDOW_MODE_OVERVIEW,
   PHOTOS_WINDOW_MODE_PREVIEW,
diff --git a/src/photos-main-window.c b/src/photos-main-window.c
index 075de5e..76b8343 100644
--- a/src/photos-main-window.c
+++ b/src/photos-main-window.c
@@ -175,6 +175,7 @@ photos_main_window_go_back (PhotosMainWindow *self)
       break;
 
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_OVERVIEW:
     default:
       handled = FALSE;
@@ -284,6 +285,7 @@ photos_main_window_key_press_event (GtkWidget *widget, GdkEventKey *event)
   switch (mode)
     {
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
       handled = GDK_EVENT_PROPAGATE;
       break;
 
diff --git a/src/photos-preview-view.c b/src/photos-preview-view.c
index a5bc5f4..9e7ea87 100644
--- a/src/photos-preview-view.c
+++ b/src/photos-preview-view.c
@@ -165,6 +165,7 @@ photos_preview_view_window_mode_changed (PhotosPreviewView *self, PhotosWindowMo
   switch (mode)
     {
     case PHOTOS_WINDOW_MODE_COLLECTIONS:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_FAVORITES:
     case PHOTOS_WINDOW_MODE_OVERVIEW:
     case PHOTOS_WINDOW_MODE_SEARCH:
diff --git a/src/photos-view-container.c b/src/photos-view-container.c
index cb1f85f..fbd891f 100644
--- a/src/photos-view-container.c
+++ b/src/photos-view-container.c
@@ -334,6 +334,7 @@ photos_view_container_constructed (GObject *object)
       break;
 
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_PREVIEW:
     default:
       g_assert_not_reached ();
diff --git a/src/photos-view-model.c b/src/photos-view-model.c
index c5a3388..a23d921 100644
--- a/src/photos-view-model.c
+++ b/src/photos-view-model.c
@@ -398,6 +398,7 @@ photos_view_model_constructed (GObject *object)
       break;
 
     case PHOTOS_WINDOW_MODE_NONE:
+    case PHOTOS_WINDOW_MODE_EDIT:
     case PHOTOS_WINDOW_MODE_PREVIEW:
     default:
       g_assert_not_reached ();


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