[dconf-editor] Some more shortcuts fixes.



commit 51ba2c18f703ecfa33f89e50aabe78d3c0202f4e
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Oct 22 18:31:31 2018 +0200

    Some more shortcuts fixes.

 editor/browser-view.vala |  7 ++++++-
 editor/dconf-window.vala | 38 +++++++++++++++++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 2 deletions(-)
---
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index d91b8d4..3635438 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -422,7 +422,12 @@ private class BrowserView : Stack, AdaptativeWidget
             return current_child.down_pressed ();
     }
 
-    internal bool toggle_row_popover () { return current_child.toggle_row_popover (); }   // Menu
+    internal bool toggle_row_popover ()     // Menu
+    {
+        if (in_window_bookmarks)
+            return false;
+        return current_child.toggle_row_popover ();
+    }
 
     internal void toggle_boolean_key ()      { current_child.toggle_boolean_key ();      }
     internal void set_selected_to_default () { current_child.set_selected_to_default (); }
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 7c056c6..d0d5ee2 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -1064,6 +1064,9 @@ private class DConfWindow : ApplicationWindow
 
     private void copy_path                              (/* SimpleAction action, Variant? path_variant */)
     {
+        if (browser_view.in_window_bookmarks) // TODO better
+            return;
+
         browser_view.discard_row_popover ();
 
         if (headerbar.search_mode_enabled)
@@ -1082,18 +1085,27 @@ private class DConfWindow : ApplicationWindow
 
     private void bookmark                               (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks) // TODO better
+            return;
+
         browser_view.discard_row_popover ();
         headerbar.bookmark_current_path ();
     }
 
     private void unbookmark                             (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks) // TODO better
+            return;
+
         browser_view.discard_row_popover ();
         headerbar.unbookmark_current_path ();
     }
 
     private void _toggle_search                         (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks) // TODO better
+            return;
+
         headerbar.close_popovers ();    // should never be needed if headerbar.search_mode_enabled
         browser_view.discard_row_popover ();   // could be needed if headerbar.search_mode_enabled
 
@@ -1125,35 +1137,53 @@ private class DConfWindow : ApplicationWindow
 
     private void _request_config                        (/* SimpleAction action, Variant? variant */)  // 
TODO unduplicate method name
     {
+        if (browser_view.in_window_bookmarks) // TODO better
+            return;
+
         if (browser_view.current_view == ViewType.FOLDER)
             request_config (current_path);
     }
 
     private void modifications_list                     (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         if (revealer.reveal_child)
             revealer.toggle_modifications_list ();
     }
 
     private void edit_path_end                          (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         if (!headerbar.search_mode_enabled)
             request_search (true, PathEntry.SearchMode.EDIT_PATH_MOVE_END);
     }
 
     private void edit_path_last                         (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         if (!headerbar.search_mode_enabled)
             request_search (true, PathEntry.SearchMode.EDIT_PATH_SELECT_LAST_WORD);
     }
 
     private void open_root                              (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         go_backward (true);
     }
 
     private void open_current_parent                    (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         if (browser_view.current_view == ViewType.CONFIG)
             request_folder (current_path);
         else
@@ -1162,11 +1192,17 @@ private class DConfWindow : ApplicationWindow
 
     private void open_child                             (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         go_forward (false);
     }
 
     private void open_last_child                        (/* SimpleAction action, Variant? variant */)
     {
+        if (browser_view.in_window_bookmarks)
+            return;
+
         go_forward (true);
     }
 
@@ -1192,7 +1228,7 @@ private class DConfWindow : ApplicationWindow
 
     private void menu_pressed                           (/* SimpleAction action, Variant? variant */)
     {
-        if (browser_view.toggle_row_popover ())
+        if (browser_view.toggle_row_popover ()) // handles in-window bookmarks
             headerbar.close_popovers ();
         else
         {


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