[bijiben] controller: do not force main view if note opened



commit 96d245e8e4851f0e1e9b6ba13356d105050d2728
Author: Pierre-Yves Luyten <py luyten fr>
Date:   Fri Sep 6 00:47:37 2013 +0200

    controller: do not force main view if note opened
    
    When the book is loaded, this is usually the right time to switch to main view. But not is a note is 
opened.

 src/bjb-controller.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/bjb-controller.c b/src/bjb-controller.c
index 1f8eab7..0794a81 100644
--- a/src/bjb-controller.c
+++ b/src/bjb-controller.c
@@ -421,9 +421,14 @@ notify_displayed_items_changed (BjbController *self)
 static void
 update (BjbController *self)
 {
-  bjb_window_base_switch_to (self->priv->window, BJB_WINDOW_BASE_MAIN_VIEW);
-  bjb_controller_update_view (self);
+  /* If the user already edits a note, he does not want the view
+   * to go back */
+  if (bjb_window_base_get_view_type (self->priv->window) !=
+      BJB_WINDOW_BASE_NOTE_VIEW)
+    bjb_window_base_switch_to (self->priv->window, BJB_WINDOW_BASE_MAIN_VIEW);
+
 
+  bjb_controller_update_view (self);
   notify_displayed_items_changed (self);
 }
 


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