[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix Alt+n shortcuts for switching tabs
noreply at xfce.org
noreply at xfce.org
Sun Feb 25 23:08:20 CET 2018
This is an automated email from the git hooks/post-receive script.
f 2 4 0 4 p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-terminal.
commit b1d245d26ed28f13a952ac62fbe3185ef93bfa09
Author: Igor <f2404 at yandex.ru>
Date: Sun Feb 25 17:07:15 2018 -0500
Fix Alt+n shortcuts for switching tabs
Also, update tabs menu after reordering tabs.
Fixes bug #14247
---
terminal/terminal-window.c | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index e678c8f..eca35ba 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -1106,8 +1106,9 @@ terminal_window_notebook_page_reordered (GtkNotebook *notebook,
TerminalWindow *window)
{
- /* Regenerate the "Go" menu */
- terminal_window_rebuild_tabs_menu (window);
+ /* update actions in the window */
+ terminal_window_update_actions (window);
+
}
@@ -2956,7 +2957,7 @@ terminal_window_rebuild_tabs_menu (TerminalWindow *window)
GtkWidget *page;
GSList *group = NULL;
GtkRadioAction *radio_action;
- gchar name[50], menu_item_name[100];
+ gchar name[50], buf[100];
GSList *lp;
GtkAccelKey key = {0};
@@ -3011,33 +3012,35 @@ G_GNUC_END_IGNORE_DEPRECATIONS
g_object_set_qdata_full (G_OBJECT (page), tabs_menu_action_quark,
radio_action, g_object_unref);
+ /* set an accelerator path */
+ g_snprintf (buf, sizeof (buf), "<Actions>/terminal-window/%s", name);
+ if (gtk_accel_map_lookup_entry (buf, &key) && key.accel_key != 0)
+ {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+ gtk_action_set_accel_path (GTK_ACTION (radio_action), buf);
+G_GNUC_END_IGNORE_DEPRECATIONS
+ }
+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* add action in the menu */
gtk_ui_manager_add_ui (window->priv->ui_manager, window->priv->tabs_menu_merge_id,
"/main-menu/tabs-menu/placeholder-tab-items",
name, name, GTK_UI_MANAGER_MENUITEM, FALSE);
/* allow underscore to be shown */
- g_snprintf (menu_item_name, sizeof (menu_item_name), "/main-menu/tabs-menu/placeholder-tab-items/%s", name);
- gtk_menu_item_set_use_underline (GTK_MENU_ITEM (gtk_ui_manager_get_widget (window->priv->ui_manager, menu_item_name)), FALSE);
+ g_snprintf (buf, sizeof (buf), "/main-menu/tabs-menu/placeholder-tab-items/%s", name);
+ gtk_menu_item_set_use_underline (GTK_MENU_ITEM (gtk_ui_manager_get_widget (window->priv->ui_manager, buf)), FALSE);
+G_GNUC_END_IGNORE_DEPRECATIONS
if (npages > 1)
{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* add to right-click tab menu */
gtk_ui_manager_add_ui (window->priv->ui_manager, window->priv->tabs_menu_merge_id,
"/tab-menu/tabs-menu/placeholder-tab-items",
name, name, GTK_UI_MANAGER_MENUITEM, FALSE);
/* allow underscore to be shown */
- g_snprintf (menu_item_name, sizeof (menu_item_name), "/tab-menu/tabs-menu/placeholder-tab-items/%s", name);
- gtk_menu_item_set_use_underline (GTK_MENU_ITEM (gtk_ui_manager_get_widget (window->priv->ui_manager, menu_item_name)), FALSE);
- }
-G_GNUC_END_IGNORE_DEPRECATIONS
-
- /* set an accelerator path */
- g_snprintf (name, sizeof (name), "<Actions>/terminal-window/goto-tab-%d", n + 1);
- if (gtk_accel_map_lookup_entry (name, &key) && key.accel_key != 0)
- {
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- gtk_action_set_accel_path (GTK_ACTION (radio_action), name);
+ g_snprintf (buf, sizeof (buf), "/tab-menu/tabs-menu/placeholder-tab-items/%s", name);
+ gtk_menu_item_set_use_underline (GTK_MENU_ITEM (gtk_ui_manager_get_widget (window->priv->ui_manager, buf)), FALSE);
G_GNUC_END_IGNORE_DEPRECATIONS
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list