[Xfce4-commits] [apps/gigolo] 24/26: Fix accelerators
noreply at xfce.org
noreply at xfce.org
Thu Oct 25 08:04:16 CEST 2018
This is an automated email from the git hooks/post-receive script.
l a n d r y 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/gigolo.
commit 2f2ac8b022164e3576f03c634e2a9a3191a51999
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Wed Oct 24 20:44:31 2018 -0400
Fix accelerators
---
src/window.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/window.c b/src/window.c
index 70262c1..d82db49 100644
--- a/src/window.c
+++ b/src/window.c
@@ -77,6 +77,8 @@ struct _GigoloWindowPrivate
GtkStatusIcon *systray_icon;
GtkWidget *systray_icon_popup_menu;
+ GtkAccelGroup *accel_group;
+
guint autoconnect_timeout_id;
};
@@ -1273,6 +1275,8 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_Preferences"));
g_signal_connect (widget, "activate", G_CALLBACK(preferences_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_p, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
widget = GTK_WIDGET (gtk_builder_get_object (builder, "systray_Preferences"));
g_signal_connect (widget, "activate", G_CALLBACK(preferences_cb), window);
@@ -1290,10 +1294,14 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "popupitem_EditBookmark"));
g_signal_connect (widget, "activate", G_CALLBACK(create_bookmark_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_n, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
/* Edit Bookmarks (Ctrl + B) */
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_EditBookmarks"));
g_signal_connect (widget, "activate", G_CALLBACK(bookmark_edit_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_b, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
widget = GTK_WIDGET (gtk_builder_get_object (builder, "toolitem_EditBookmarks"));
g_signal_connect (widget, "clicked", G_CALLBACK(bookmark_edit_cb), window);
@@ -1323,10 +1331,12 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "popupitem_Disconnect"));
g_signal_connect (widget, "activate", G_CALLBACK(unmount_cb), window);
- /* Open */
+ /* Open (Ctrl + O) */
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_Open"));
g_signal_connect (widget, "activate", G_CALLBACK(open_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_o, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
widget = GTK_WIDGET (gtk_builder_get_object (builder, "toolitem_Open"));
g_signal_connect (widget, "clicked", G_CALLBACK(open_cb), window);
@@ -1337,6 +1347,8 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_OpenTerminal"));
g_signal_connect (widget, "activate", G_CALLBACK(open_terminal_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_t, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
widget = GTK_WIDGET (gtk_builder_get_object (builder, "toolitem_OpenTerminal"));
g_signal_connect (widget, "clicked", G_CALLBACK(open_terminal_cb), window);
@@ -1347,6 +1359,8 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_CopyURI"));
g_signal_connect (widget, "activate", G_CALLBACK(copy_uri_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_c, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
widget = GTK_WIDGET (gtk_builder_get_object (builder, "popupitem_CopyURI"));
g_signal_connect (widget, "activate", G_CALLBACK(copy_uri_cb), window);
@@ -1354,6 +1368,8 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_Quit"));
g_signal_connect (widget, "activate", G_CALLBACK(quit_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
widget = GTK_WIDGET (gtk_builder_get_object (builder, "toolitem_Quit"));
g_signal_connect (widget, "clicked", G_CALLBACK(quit_cb), window);
@@ -1364,6 +1380,8 @@ static void bind_actions (GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_OnlineHelp"));
g_signal_connect (widget, "activate", G_CALLBACK(help_cb), window);
+ gtk_widget_add_accelerator (widget, "activate", priv->accel_group, GDK_KEY_h, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+
/* Supported Schemes */
widget = GTK_WIDGET (gtk_builder_get_object (builder, "menuitem_SupportedSchemes"));
g_signal_connect (widget, "activate", G_CALLBACK(supported_schemes_cb), window);
@@ -1423,6 +1441,9 @@ static void create_ui_elements(GigoloWindow *window)
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "toolitem_Bookmarks"));
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (widget), GTK_WIDGET (priv->toolbar_bookmarks_menu));
+ priv->accel_group = gtk_accel_group_new ();
+ gtk_window_add_accel_group (GTK_WINDOW (window), priv->accel_group);
+
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook_store), 0);
g_object_ref (priv->vbox);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list