[gnome-builder/wip/gtk4-port: 1523/1774] libide/foundry: remove accel parameter from handler registration




commit 01cc448e19878f14598abd59ffe53303049d1461
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 15 12:51:07 2022 -0700

    libide/foundry: remove accel parameter from handler registration
    
    This is all handled differently now, so there is no need to provide this
    as part of registration.

 src/libide/foundry/ide-run-manager-private.h       |  7 +++--
 src/libide/foundry/ide-run-manager.c               | 30 ----------------------
 src/libide/foundry/ide-run-manager.h               |  7 +++--
 src/libide/gui/ide-run-button.c                    |  9 +------
 .../debuggerui/ide-debugger-workspace-addin.c      |  1 -
 src/plugins/sysprof/gbp-sysprof-workspace-addin.c  |  1 -
 .../valgrind/gbp-valgrind-workbench-addin.c        |  1 -
 7 files changed, 7 insertions(+), 49 deletions(-)
---
diff --git a/src/libide/foundry/ide-run-manager-private.h b/src/libide/foundry/ide-run-manager-private.h
index c841a8948..5ec8a1f18 100644
--- a/src/libide/foundry/ide-run-manager-private.h
+++ b/src/libide/foundry/ide-run-manager-private.h
@@ -26,10 +26,9 @@ G_BEGIN_DECLS
 
 typedef struct
 {
-  gchar          *id;
-  gchar          *title;
-  gchar          *icon_name;
-  gchar          *accel;
+  char           *id;
+  char           *title;
+  char           *icon_name;
   gint            priority;
   IdeRunHandler   handler;
   gpointer        handler_data;
diff --git a/src/libide/foundry/ide-run-manager.c b/src/libide/foundry/ide-run-manager.c
index 2cc8b6bdc..1780cc9b7 100644
--- a/src/libide/foundry/ide-run-manager.c
+++ b/src/libide/foundry/ide-run-manager.c
@@ -258,7 +258,6 @@ ide_run_handler_info_free (gpointer data)
   g_free (info->id);
   g_free (info->title);
   g_free (info->icon_name);
-  g_free (info->accel);
 
   if (info->handler_data_destroy)
     info->handler_data_destroy (info->handler_data);
@@ -1180,7 +1179,6 @@ ide_run_manager_add_handler (IdeRunManager  *self,
                              const gchar    *id,
                              const gchar    *title,
                              const gchar    *icon_name,
-                             const gchar    *accel,
                              IdeRunHandler   run_handler,
                              gpointer        user_data,
                              GDestroyNotify  user_data_destroy)
@@ -1195,39 +1193,12 @@ ide_run_manager_add_handler (IdeRunManager  *self,
   info->id = g_strdup (id);
   info->title = g_strdup (title);
   info->icon_name = g_strdup (icon_name);
-  info->accel = g_strdup (accel);
   info->handler = run_handler;
   info->handler_data = user_data;
   info->handler_data_destroy = user_data_destroy;
 
   self->handlers = g_list_append (self->handlers, info);
 
-  /* FIXME: We need a new way to do this for GTK 4. */
-#if 0
-  DzlShortcutManager *manager;
-  DzlShortcutTheme *theme;
-  g_autofree gchar *action_name = NULL;
-  GApplication *app;
-
-  app = g_application_get_default ();
-  manager = dzl_application_get_shortcut_manager (DZL_APPLICATION (app));
-  theme = g_object_ref (dzl_shortcut_manager_get_theme (manager));
-
-  action_name = g_strdup_printf ("run-manager.run-with-handler('%s')", id);
-
-  dzl_shortcut_manager_add_action (manager,
-                                   action_name,
-                                   N_("Workbench shortcuts"),
-                                   N_("Build and Run"),
-                                   g_dgettext (GETTEXT_PACKAGE, title),
-                                   NULL);
-
-  dzl_shortcut_theme_set_accel_for_action (theme,
-                                           action_name,
-                                           accel,
-                                           DZL_SHORTCUT_PHASE_GLOBAL | DZL_SHORTCUT_PHASE_CAPTURE);
-#endif
-
   if (self->handler == NULL)
     self->handler = info;
 }
@@ -1592,7 +1563,6 @@ ide_run_manager_init (IdeRunManager *self)
                                "run",
                                _("Run"),
                                "builder-run-start-symbolic",
-                               "<primary>F5",
                                NULL,
                                NULL,
                                NULL);
diff --git a/src/libide/foundry/ide-run-manager.h b/src/libide/foundry/ide-run-manager.h
index aecf3cf7a..045322983 100644
--- a/src/libide/foundry/ide-run-manager.h
+++ b/src/libide/foundry/ide-run-manager.h
@@ -57,10 +57,9 @@ void            ide_run_manager_set_handler                    (IdeRunManager
                                                                 const gchar          *id);
 IDE_AVAILABLE_IN_ALL
 void            ide_run_manager_add_handler                    (IdeRunManager        *self,
-                                                                const gchar          *id,
-                                                                const gchar          *title,
-                                                                const gchar          *icon_name,
-                                                                const gchar          *accel,
+                                                                const char           *id,
+                                                                const char           *title,
+                                                                const char           *icon_name,
                                                                 IdeRunHandler         run_handler,
                                                                 gpointer              user_data,
                                                                 GDestroyNotify        user_data_destroy);
diff --git a/src/libide/gui/ide-run-button.c b/src/libide/gui/ide-run-button.c
index be466a1c9..a942f34d2 100644
--- a/src/libide/gui/ide-run-button.c
+++ b/src/libide/gui/ide-run-button.c
@@ -186,8 +186,6 @@ ide_run_button_query_tooltip (IdeRunButton *self,
 
       if (g_strcmp0 (info->id, handler) == 0)
         {
-          g_autofree char *text = NULL;
-
           gboolean enabled;
 
           /* Figure out if the run action is enabled. If it
@@ -208,12 +206,7 @@ ide_run_button_query_tooltip (IdeRunButton *self,
               return TRUE;
             }
 
-          if (info->accel && info->title)
-            text = g_strdup_printf ("%s %s", info->accel, info->title);
-          else if (info->title)
-            text = g_strdup (info->title);
-
-          gtk_tooltip_set_text (tooltip, text);
+          gtk_tooltip_set_text (tooltip, info->title);
         }
     }
 
diff --git a/src/plugins/debuggerui/ide-debugger-workspace-addin.c 
b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
index 63989f59a..3100f5690 100644
--- a/src/plugins/debuggerui/ide-debugger-workspace-addin.c
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
@@ -365,7 +365,6 @@ ide_debugger_workspace_addin_load (IdeWorkspaceAddin *addin,
                                "debugger",
                                _("Run with Debugger"),
                                "builder-debugger-symbolic",
-                               "F5",
                                debugger_run_handler,
                                g_object_ref (self),
                                g_object_unref);
diff --git a/src/plugins/sysprof/gbp-sysprof-workspace-addin.c 
b/src/plugins/sysprof/gbp-sysprof-workspace-addin.c
index 861365bae..acd7be9c4 100644
--- a/src/plugins/sysprof/gbp-sysprof-workspace-addin.c
+++ b/src/plugins/sysprof/gbp-sysprof-workspace-addin.c
@@ -420,7 +420,6 @@ gbp_sysprof_workspace_addin_check_supported_cb (GObject      *object,
                                "sysprof",
                                _("Run with Profiler"),
                                "builder-profiler-symbolic",
-                               "<Control>F8",
                                profiler_run_handler,
                                self,
                                NULL);
diff --git a/src/plugins/valgrind/gbp-valgrind-workbench-addin.c 
b/src/plugins/valgrind/gbp-valgrind-workbench-addin.c
index 36aa6bfcb..059bd9601 100644
--- a/src/plugins/valgrind/gbp-valgrind-workbench-addin.c
+++ b/src/plugins/valgrind/gbp-valgrind-workbench-addin.c
@@ -225,7 +225,6 @@ not_found:
                                      "valgrind",
                                      _("Run with Valgrind"),
                                      "system-run-symbolic",
-                                     "<Control><Shift><Alt>v",
                                      gbp_valgrind_workbench_addin_run_handler,
                                      g_object_ref (self),
                                      g_object_unref);


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