[epiphany/mcatanzaro/popup-cmds: 47/47] Rename popup-commands to context-menu-commands




commit e94198162c3130d9e485b2f3213805e6094e59d1
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri Jun 3 09:37:56 2022 -0500

    Rename popup-commands to context-menu-commands
    
    It's not very clear what a "popup" is, especially in the context of a
    web browser where websites can create popups, but the answer is it's the
    context menu.
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1128>

 po/POTFILES.in                                    |   2 +-
 src/{popup-commands.c => context-menu-commands.c} | 126 +++++++++++-----------
 src/context-menu-commands.h                       |  93 ++++++++++++++++
 src/ephy-window.c                                 |  48 ++++-----
 src/meson.build                                   |   2 +-
 src/popup-commands.h                              |  93 ----------------
 6 files changed, 182 insertions(+), 182 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f4f4e811a..6f4486476 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -55,7 +55,7 @@ src/ephy-suggestion-model.c
 src/ephy-tab-view.c
 src/ephy-web-extension-dialog.c
 src/ephy-window.c
-src/popup-commands.c
+src/context-menu-commands.c
 src/preferences/clear-data-view.c
 src/preferences/ephy-search-engine-listbox.c
 src/preferences/ephy-search-engine-row.c
diff --git a/src/popup-commands.c b/src/context-menu-commands.c
similarity index 83%
rename from src/popup-commands.c
rename to src/context-menu-commands.c
index f316af8fa..a04ee7e04 100644
--- a/src/popup-commands.c
+++ b/src/context-menu-commands.c
@@ -20,7 +20,7 @@
  */
 
 #include "config.h"
-#include "popup-commands.h"
+#include "context-menu-commands.h"
 
 #include "ephy-downloads-manager.h"
 #include "ephy-embed-container.h"
@@ -88,33 +88,33 @@ view_in_destination (EphyWindow      *window,
 }
 
 void
-popup_cmd_link_in_new_window (GSimpleAction *action,
-                              GVariant      *parameter,
-                              gpointer       user_data)
+context_cmd_link_in_new_window (GSimpleAction *action,
+                                GVariant      *parameter,
+                                gpointer       user_data)
 {
   view_in_destination (EPHY_WINDOW (user_data), "link-uri", NEW_WINDOW);
 }
 
 void
-popup_cmd_media_in_new_window (GSimpleAction *action,
-                               GVariant      *parameter,
-                               gpointer       user_data)
+context_cmd_media_in_new_window (GSimpleAction *action,
+                                 GVariant      *parameter,
+                                 gpointer       user_data)
 {
   view_in_destination (EPHY_WINDOW (user_data), "media-uri", NEW_WINDOW);
 }
 
 static void
-popup_cmd_copy_to_clipboard (EphyWindow *window,
-                             const char *text)
+context_cmd_copy_to_clipboard (EphyWindow *window,
+                               const char *text)
 {
   gtk_clipboard_set_text (gtk_clipboard_get_default (gdk_display_get_default ()),
                           text, -1);
 }
 
 void
-popup_cmd_copy_link_address (GSimpleAction *action,
-                             GVariant      *parameter,
-                             gpointer       user_data)
+context_cmd_copy_link_address (GSimpleAction *action,
+                               GVariant      *parameter,
+                               gpointer       user_data)
 {
   WebKitHitTestResult *hit_test_result;
   guint context;
@@ -131,7 +131,7 @@ popup_cmd_copy_link_address (GSimpleAction *action,
     if (g_str_has_prefix (address, "mailto:";))
       address = address + 7;
 
-    popup_cmd_copy_to_clipboard (EPHY_WINDOW (user_data), address);
+    context_cmd_copy_to_clipboard (EPHY_WINDOW (user_data), address);
   }
 }
 
@@ -264,25 +264,25 @@ save_property_url (const char *title,
 }
 
 void
-popup_cmd_download_link_as (GSimpleAction *action,
-                            GVariant      *parameter,
-                            gpointer       user_data)
+context_cmd_download_link_as (GSimpleAction *action,
+                              GVariant      *parameter,
+                              gpointer       user_data)
 {
   save_property_url (_("Save Link As"), EPHY_WINDOW (user_data), "link-uri");
 }
 
 void
-popup_cmd_save_image_as (GSimpleAction *action,
-                         GVariant      *parameter,
-                         gpointer       user_data)
+context_cmd_save_image_as (GSimpleAction *action,
+                           GVariant      *parameter,
+                           gpointer       user_data)
 {
   save_property_url (_("Save Image As"), EPHY_WINDOW (user_data), "image-uri");
 }
 
 void
-popup_cmd_save_media_as (GSimpleAction *action,
-                         GVariant      *parameter,
-                         gpointer       user_data)
+context_cmd_save_media_as (GSimpleAction *action,
+                           GVariant      *parameter,
+                           gpointer       user_data)
 {
   save_property_url (_("Save Media As"), EPHY_WINDOW (user_data), "media-uri");
 }
@@ -300,9 +300,9 @@ background_download_completed (EphyDownload *download,
 }
 
 void
-popup_cmd_set_image_as_background (GSimpleAction *action,
-                                   GVariant      *parameter,
-                                   gpointer       user_data)
+context_cmd_set_image_as_background (GSimpleAction *action,
+                                     GVariant      *parameter,
+                                     gpointer       user_data)
 {
   WebKitHitTestResult *hit_test_result;
   const char *location;
@@ -340,61 +340,61 @@ popup_cmd_set_image_as_background (GSimpleAction *action,
 }
 
 static void
-popup_cmd_copy_location (EphyWindow *window,
-                         const char *property_name)
+context_cmd_copy_location (EphyWindow *window,
+                           const char *property_name)
 {
   WebKitHitTestResult *hit_test_result;
   g_autofree char *location = NULL;
 
   hit_test_result = ephy_window_get_context_event (window);
   g_object_get (hit_test_result, property_name, &location, NULL);
-  popup_cmd_copy_to_clipboard (window, location);
+  context_cmd_copy_to_clipboard (window, location);
 }
 
 void
-popup_cmd_copy_image_location (GSimpleAction *action,
-                               GVariant      *parameter,
-                               gpointer       user_data)
+context_cmd_copy_image_location (GSimpleAction *action,
+                                 GVariant      *parameter,
+                                 gpointer       user_data)
 {
-  popup_cmd_copy_location (EPHY_WINDOW (user_data), "image-uri");
+  context_cmd_copy_location (EPHY_WINDOW (user_data), "image-uri");
 }
 
 void
-popup_cmd_copy_media_location (GSimpleAction *action,
-                               GVariant      *parameter,
-                               gpointer       user_data)
+context_cmd_copy_media_location (GSimpleAction *action,
+                                 GVariant      *parameter,
+                                 gpointer       user_data)
 {
-  popup_cmd_copy_location (EPHY_WINDOW (user_data), "media-uri");
+  context_cmd_copy_location (EPHY_WINDOW (user_data), "media-uri");
 }
 
 void
-popup_cmd_link_in_new_tab (GSimpleAction *action,
-                           GVariant      *parameter,
-                           gpointer       user_data)
+context_cmd_link_in_new_tab (GSimpleAction *action,
+                             GVariant      *parameter,
+                             gpointer       user_data)
 {
   view_in_destination (EPHY_WINDOW (user_data), "link-uri", NEW_TAB);
 }
 
 void
-popup_cmd_view_image_in_new_tab (GSimpleAction *action,
-                                 GVariant      *parameter,
-                                 gpointer       user_data)
+context_cmd_view_image_in_new_tab (GSimpleAction *action,
+                                   GVariant      *parameter,
+                                   gpointer       user_data)
 {
   view_in_destination (EPHY_WINDOW (user_data), "image-uri", NEW_TAB);
 }
 
 void
-popup_cmd_media_in_new_tab (GSimpleAction *action,
-                            GVariant      *parameter,
-                            gpointer       user_data)
+context_cmd_media_in_new_tab (GSimpleAction *action,
+                              GVariant      *parameter,
+                              gpointer       user_data)
 {
   view_in_destination (EPHY_WINDOW (user_data), "media-uri", NEW_TAB);
 }
 
 void
-popup_cmd_link_in_incognito_window (GSimpleAction *action,
-                                    GVariant      *parameter,
-                                    gpointer       user_data)
+context_cmd_link_in_incognito_window (GSimpleAction *action,
+                                      GVariant      *parameter,
+                                      gpointer       user_data)
 {
   WebKitHitTestResult *hit_test_result;
   const char *link_uri;
@@ -408,9 +408,9 @@ popup_cmd_link_in_incognito_window (GSimpleAction *action,
 }
 
 void
-popup_cmd_search_selection (GSimpleAction *action,
-                            GVariant      *parameter,
-                            gpointer       user_data)
+context_cmd_search_selection (GSimpleAction *action,
+                              GVariant      *parameter,
+                              gpointer       user_data)
 {
   EphyEmbed *embed, *new_embed;
   const char *search_term;
@@ -428,9 +428,9 @@ popup_cmd_search_selection (GSimpleAction *action,
 }
 
 void
-popup_cmd_open_selection (GSimpleAction *action,
-                          GVariant      *parameter,
-                          gpointer       user_data)
+context_cmd_open_selection (GSimpleAction *action,
+                            GVariant      *parameter,
+                            gpointer       user_data)
 {
   EphyEmbed *embed;
   const char *open_term;
@@ -443,9 +443,9 @@ popup_cmd_open_selection (GSimpleAction *action,
 }
 
 void
-popup_cmd_open_selection_in_new_tab (GSimpleAction *action,
-                                     GVariant      *parameter,
-                                     gpointer       user_data)
+context_cmd_open_selection_in_new_tab (GSimpleAction *action,
+                                       GVariant      *parameter,
+                                       gpointer       user_data)
 {
   EphyEmbed *embed, *new_embed;
   const char *open_term;
@@ -460,9 +460,9 @@ popup_cmd_open_selection_in_new_tab (GSimpleAction *action,
 }
 
 void
-popup_cmd_open_selection_in_new_window (GSimpleAction *action,
-                                        GVariant      *parameter,
-                                        gpointer       user_data)
+context_cmd_open_selection_in_new_window (GSimpleAction *action,
+                                          GVariant      *parameter,
+                                          gpointer       user_data)
 {
   EphyEmbed *embed, *new_embed;
   const char *open_term;
@@ -477,9 +477,9 @@ popup_cmd_open_selection_in_new_window (GSimpleAction *action,
 }
 
 void
-popup_cmd_open_selection_in_incognito_window (GSimpleAction *action,
-                                              GVariant      *parameter,
-                                              gpointer       user_data)
+context_cmd_open_selection_in_incognito_window (GSimpleAction *action,
+                                                GVariant      *parameter,
+                                                gpointer       user_data)
 {
   const char *open_term;
 
diff --git a/src/context-menu-commands.h b/src/context-menu-commands.h
new file mode 100644
index 000000000..d86c6a5bc
--- /dev/null
+++ b/src/context-menu-commands.h
@@ -0,0 +1,93 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ *  Copyright © 2000, 2001, 2002 Marco Pesenti Gritti
+ *
+ *  This file is part of Epiphany.
+ *
+ *  Epiphany is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  Epiphany is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with Epiphany.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <gtk/gtk.h>
+
+#include "ephy-window.h"
+
+G_BEGIN_DECLS
+
+void context_cmd_link_in_new_window       (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_link_in_new_tab          (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_link_in_incognito_window (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_view_source              (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_copy_link_address        (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_copy_link_location       (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_download_link_as         (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_set_image_as_background  (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_copy_image_location      (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_view_image_in_new_tab    (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_download_link            (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_save_image_as            (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_media_in_new_window      (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_media_in_new_tab         (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_copy_media_location      (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_save_media_as            (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_search_selection         (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_open_selection           (GSimpleAction *action,
+                                           GVariant      *parameter,
+                                           gpointer       user_data);
+void context_cmd_open_selection_in_new_tab          (GSimpleAction *action,
+                                                     GVariant      *parameter,
+                                                     gpointer       user_data);
+void context_cmd_open_selection_in_new_window       (GSimpleAction *action,
+                                                     GVariant      *parameter,
+                                                     gpointer       user_data);
+void context_cmd_open_selection_in_incognito_window (GSimpleAction *action,
+                                                     GVariant      *parameter,
+                                                     gpointer       user_data);
+
+G_END_DECLS
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 801fdb5fb..650adce80 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "ephy-window.h"
 
+#include "context-menu-commands.h"
 #include "ephy-action-bar.h"
 #include "ephy-action-helper.h"
 #include "ephy-bookmark-states.h"
@@ -62,7 +63,6 @@
 #include "ephy-web-app-utils.h"
 #include "ephy-web-view.h"
 #include "ephy-zoom.h"
-#include "popup-commands.h"
 #include "window-commands.h"
 
 #include <gdk/gdkkeysyms.h>
@@ -888,40 +888,40 @@ static const GActionEntry popup_entries [] = {
   { "context-bookmark-page", window_cmd_bookmark_page },
   /* Links. */
 
-  { "open-link-in-new-window", popup_cmd_link_in_new_window },
-  { "open-link-in-new-tab", popup_cmd_link_in_new_tab },
-  { "open-link-in-incognito-window", popup_cmd_link_in_incognito_window },
-  { "download-link-as", popup_cmd_download_link_as },
-  { "copy-link-address", popup_cmd_copy_link_address },
-  { "copy-email-address", popup_cmd_copy_link_address },
+  { "open-link-in-new-window", context_cmd_link_in_new_window },
+  { "open-link-in-new-tab", context_cmd_link_in_new_tab },
+  { "open-link-in-incognito-window", context_cmd_link_in_incognito_window },
+  { "download-link-as", context_cmd_download_link_as },
+  { "copy-link-address", context_cmd_copy_link_address },
+  { "copy-email-address", context_cmd_copy_link_address },
 
   /* Images. */
 
-  { "view-image", popup_cmd_view_image_in_new_tab },
-  { "copy-image-location", popup_cmd_copy_image_location },
-  { "save-image-as", popup_cmd_save_image_as },
-  { "set-image-as-background", popup_cmd_set_image_as_background },
+  { "view-image", context_cmd_view_image_in_new_tab },
+  { "copy-image-location", context_cmd_copy_image_location },
+  { "save-image-as", context_cmd_save_image_as },
+  { "set-image-as-background", context_cmd_set_image_as_background },
 
   /* Video. */
 
-  { "open-video-in-new-window", popup_cmd_media_in_new_window },
-  { "open-video-in-new-tab", popup_cmd_media_in_new_tab },
-  { "save-video-as", popup_cmd_save_media_as },
-  { "copy-video-location", popup_cmd_copy_media_location },
+  { "open-video-in-new-window", context_cmd_media_in_new_window },
+  { "open-video-in-new-tab", context_cmd_media_in_new_tab },
+  { "save-video-as", context_cmd_save_media_as },
+  { "copy-video-location", context_cmd_copy_media_location },
 
   /* Audio. */
 
-  { "open-audio-in-new-window", popup_cmd_media_in_new_window },
-  { "open-audio-in-new-tab", popup_cmd_media_in_new_tab },
-  { "save-audios-as", popup_cmd_save_media_as },
-  { "copy-audio-location", popup_cmd_copy_media_location },
+  { "open-audio-in-new-window", context_cmd_media_in_new_window },
+  { "open-audio-in-new-tab", context_cmd_media_in_new_tab },
+  { "save-audios-as", context_cmd_save_media_as },
+  { "copy-audio-location", context_cmd_copy_media_location },
 
   /* Selection */
-  { "search-selection", popup_cmd_search_selection, "s" },
-  { "open-selection", popup_cmd_open_selection, "s" },
-  { "open-selection-in-new-tab", popup_cmd_open_selection_in_new_tab, "s" },
-  { "open-selection-in-new-window", popup_cmd_open_selection_in_new_window, "s" },
-  { "open-selection-in-incognito-window", popup_cmd_open_selection_in_incognito_window, "s" },
+  { "search-selection", context_cmd_search_selection, "s" },
+  { "open-selection", context_cmd_open_selection, "s" },
+  { "open-selection-in-new-tab", context_cmd_open_selection_in_new_tab, "s" },
+  { "open-selection-in-new-window", context_cmd_open_selection_in_new_window, "s" },
+  { "open-selection-in-incognito-window", context_cmd_open_selection_in_incognito_window, "s" },
 };
 
 const struct {
diff --git a/src/meson.build b/src/meson.build
index 54964d150..0e18d9790 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -46,7 +46,7 @@ libephymain_sources = [
   'ephy-tab-view.c',
   'ephy-web-extension-dialog.c',
   'ephy-window.c',
-  'popup-commands.c',
+  'context-menu-commands.c',
   'preferences/clear-data-view.c',
   'preferences/ephy-data-view.c',
   'preferences/ephy-lang-row.c',


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