[epiphany/wip/gtkaction-to-gaction: 26/57] Port ToggleInspector to GAction



commit 2a7dffe264d9a2509d2e97ef65926ecc4c1d62a8
Author: Iulian Radu <iulian radu67 gmail com>
Date:   Mon Jun 20 20:30:41 2016 +0300

    Port ToggleInspector to GAction

 src/ephy-window.c     |   11 ++++-------
 src/window-commands.c |    7 ++++---
 src/window-commands.h |    5 +++--
 3 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 810ebda..84bfca5 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -111,8 +111,6 @@ static const GtkActionEntry ephy_menu_entries [] = {
     NULL, G_CALLBACK (window_cmd_view_stop) },
   { "ViewReload", NULL, N_("_Reload"), "<control>R", NULL,
     G_CALLBACK (window_cmd_view_reload) },
-  { "ViewToggleInspector", NULL, N_("_Toggle Inspector"), "<shift><control>I", NULL,
-    G_CALLBACK (window_cmd_view_toggle_inspector) },
 
   /* Bookmarks actions. */
 
@@ -236,9 +234,6 @@ static const struct {
   { GDK_KEY_R, GDK_CONTROL_MASK, "ViewReload", FALSE },
   { GDK_KEY_R, GDK_CONTROL_MASK |
     GDK_SHIFT_MASK, "ViewReload", FALSE },
-  { GDK_KEY_F12, 0, "ViewToggleInspector", FALSE },
-  { GDK_KEY_I, GDK_CONTROL_MASK |
-    GDK_SHIFT_MASK, "ViewToggleInspector", FALSE },
 
   /* Tab navigation */
   { GDK_KEY_Page_Up, GDK_CONTROL_MASK, "TabsPrevious", FALSE },
@@ -318,6 +313,7 @@ const struct {
   { "win.find-next", { "<Primary>G", NULL } },
   { "win.encoding", { NULL } },
   { "win.page-source", { "<Primary>U", NULL } },
+  { "win.toggle-inspector", { "<shift><Primary>I", "F12", NULL } },
   { "win.close", { "<Primary>W", NULL } }
 };
 
@@ -3065,7 +3061,6 @@ setup_location_controller (EphyWindow  *window,
 
 static const char *disabled_actions_for_app_mode[] = { "FileNewWindow",
                                                        "FileNewWindowIncognito",
-                                                       "ViewToggleInspector",
                                                        "FileBookmarkPage",
                                                        "EditBookmarks",
                                                        "EditHistory",
@@ -3075,7 +3070,8 @@ static const char *new_disabled_actions_for_app_mode[] = { "open",
                                                        "save-as",
                                                        "save-as-application",
                                                        "encoding",
-                                                       "page-source" };
+                                                       "page-source",
+                                                       "toggle-inspector" };
 
 static void
 parse_css_error (GtkCssProvider *provider,
@@ -3147,6 +3143,7 @@ static const GActionEntry new_ephy_page_menu_entries [] =
   // { "bookmark-page", },
   { "encoding", window_cmd_view_encoding },
   { "page-source", window_cmd_view_page_source },
+  { "toggle-inspector", window_cmd_view_toggle_inspector },
   { "close-tab", window_cmd_file_close_window }
 };
 
diff --git a/src/window-commands.c b/src/window-commands.c
index a85b717..84e5b56 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -1399,10 +1399,11 @@ window_cmd_view_page_source (GSimpleAction *action,
 }
 
 void
-window_cmd_view_toggle_inspector (GtkAction  *action,
-                                  EphyWindow *window)
+window_cmd_view_toggle_inspector (GSimpleAction *action,
+                                  GVariant      *value,
+                                  gpointer       user_data)
 {
-
+  EphyWindow *window = user_data;
   EphyEmbed *embed;
   WebKitWebView *view;
   WebKitWebInspector *inspector_window;
diff --git a/src/window-commands.h b/src/window-commands.h
index 907059f..c5252d8 100644
--- a/src/window-commands.h
+++ b/src/window-commands.h
@@ -92,14 +92,15 @@ void window_cmd_view_zoom_out             (GSimpleAction *action,
 void window_cmd_view_zoom_normal          (GSimpleAction *action,
                                            GVariant      *value,
                                            gpointer       user_data);
-void window_cmd_view_toggle_inspector     (GtkAction  *action,
-                                           EphyWindow *window);
 void window_cmd_view_encoding             (GSimpleAction *action,
                                            GVariant      *value,
                                            gpointer       user_data);
 void window_cmd_view_page_source          (GSimpleAction *action,
                                            GVariant      *value,
                                            gpointer       user_data);
+void window_cmd_view_toggle_inspector     (GSimpleAction *action,
+                                           GVariant      *value,
+                                           gpointer       user_data);
 void window_cmd_file_close_window         (GSimpleAction *action,
                                            GVariant      *value,
                                            gpointer       user_data);


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