[gnome-builder/document-manager] editor: reimplement find with local action in frame



commit faa2e05134d98baad3545c0827a5694072094ba1
Author: Christian Hergert <christian hergert me>
Date:   Mon Dec 8 18:11:03 2014 -0800

    editor: reimplement find with local action in frame

 src/editor/gb-editor-frame.c          |   13 +++++++++++++
 src/editor/gb-editor-workspace.c      |   16 ----------------
 src/resources/keybindings/default.ini |    2 +-
 src/workbench/gb-workbench-actions.c  |    1 -
 4 files changed, 14 insertions(+), 18 deletions(-)
---
diff --git a/src/editor/gb-editor-frame.c b/src/editor/gb-editor-frame.c
index 29a43c9..14ce46d 100644
--- a/src/editor/gb-editor-frame.c
+++ b/src/editor/gb-editor-frame.c
@@ -775,6 +775,18 @@ gb_editor_frame_find (GbEditorFrame *frame,
                                    frame->priv->source_view);
 }
 
+static void
+gb_editor_frame_find_activate (GSimpleAction *action,
+                               GVariant      *parameter,
+                               gpointer       user_data)
+{
+  GbEditorFrame *frame = user_data;
+
+  g_return_if_fail (GB_IS_EDITOR_FRAME (frame));
+
+  gb_editor_frame_find (frame, "");
+}
+
 static gboolean
 gb_editor_frame_on_query_tooltip (GbEditorFrame *frame,
                                   gint           x,
@@ -1215,6 +1227,7 @@ static void
 gb_editor_frame_init (GbEditorFrame *self)
 {
   const GActionEntry entries[] = {
+    { "find", gb_editor_frame_find_activate },
     { "scroll-up", gb_editor_frame_scroll_up },
     { "scroll-down", gb_editor_frame_scroll_down },
   };
diff --git a/src/editor/gb-editor-workspace.c b/src/editor/gb-editor-workspace.c
index 0cc77cc..beb054e 100644
--- a/src/editor/gb-editor-workspace.c
+++ b/src/editor/gb-editor-workspace.c
@@ -88,21 +88,6 @@ save_as_tab (GSimpleAction *action,
 }
 
 static void
-find_tab (GSimpleAction *action,
-          GVariant      *parameter,
-          gpointer       user_data)
-{
-#if 0
-  GbEditorWorkspace *workspace = user_data;
-  GbTab *tab;
-
-  tab = gb_tab_grid_get_active (workspace->priv->tab_grid);
-  if (GB_IS_EDITOR_TAB (tab))
-    gb_editor_tab_find (GB_EDITOR_TAB (tab));
-#endif
-}
-
-static void
 reformat_tab (GSimpleAction *action,
               GVariant      *parameter,
               gpointer       user_data)
@@ -402,7 +387,6 @@ gb_editor_workspace_init (GbEditorWorkspace *workspace)
       { "open", open_tab },
       { "save", save_tab },
       { "save-as", save_as_tab },
-      { "find", find_tab },
       { "reformat", reformat_tab },
       { "preview", preview_tab },
       { "jump-to-doc", jump_to_doc_tab, "s" },
diff --git a/src/resources/keybindings/default.ini b/src/resources/keybindings/default.ini
index accac6e..bcb7e54 100644
--- a/src/resources/keybindings/default.ini
+++ b/src/resources/keybindings/default.ini
@@ -14,7 +14,6 @@ global-search = <Control>period
 # Temporary, so we can test vim.
 # Longer term, I want a custom vim.ini for when using vim for which
 # this will be ignored.
-find = <Control><Shift>F
 new-tab = <Control><Shift>T
 
 [editor]
@@ -30,6 +29,7 @@ switch-pane = <Control><Shift>K
 [editor-frame]
 scroll-up = <Control>Y
 scroll-down = <Control>E
+find = <Control><Shift>F
 
 [editor-view]
 toggle-split = <Control><Shift>J
diff --git a/src/workbench/gb-workbench-actions.c b/src/workbench/gb-workbench-actions.c
index f8862e1..fc49842 100644
--- a/src/workbench/gb-workbench-actions.c
+++ b/src/workbench/gb-workbench-actions.c
@@ -177,7 +177,6 @@ gb_workbench_actions_constructed (GObject *object)
 {
    GbWorkbenchActions *actions = (GbWorkbenchActions *)object;
    static const GActionEntry action_entries[] = {
-      { "find", proxy_action },
       { "new-tab", proxy_action },
       { "open", proxy_action },
       { "save", proxy_action },


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