[balsa] application-helpers: Add capability to block accels
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] application-helpers: Add capability to block accels
- Date: Thu, 4 Jun 2020 19:48:30 +0000 (UTC)
commit 2cb194d374e74d11a2f099cabc5b96898d141c12
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu Jun 4 15:43:19 2020 -0400
application-helpers: Add capability to block accels
* libbalsa/application-helpers.c
(accel_activate): check whether they are blocked;
(libbalsa_window_block_accels): new function;
* libbalsa/application-helpers.h: ditto.
ChangeLog | 9 +++++++++
libbalsa/application-helpers.c | 12 ++++++++++++
libbalsa/application-helpers.h | 2 ++
3 files changed, 23 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index fa7b79a17..8966bd659 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2020-06-04 Peter Bloomfield <pbloomfield bellsouth net>
+
+ application-helpers: Add the capability to block accels
+
+ * libbalsa/application-helpers.c
+ (accel_activate): check whether they are blocked;
+ (libbalsa_window_block_accels): new function;
+ * libbalsa/application-helpers.h: ditto.
+
2020-06-03 Peter Bloomfield <pbloomfield bellsouth net>
mime-widget-text: Connect to the "pressed" signal of a
diff --git a/libbalsa/application-helpers.c b/libbalsa/application-helpers.c
index 53039cb64..c6f9ce71e 100644
--- a/libbalsa/application-helpers.c
+++ b/libbalsa/application-helpers.c
@@ -49,6 +49,11 @@ accel_activate(GtkAccelGroup * accel_group,
gpointer user_data)
{
AccelInfo *info = user_data;
+ gboolean block_accels;
+
+ block_accels = GPOINTER_TO_INT(g_object_get_data(acceleratable, "block-accels"));
+ if (block_accels)
+ return FALSE;
g_action_activate(info->action, info->parameter);
@@ -216,6 +221,13 @@ libbalsa_window_set_accels(GtkApplicationWindow * window,
g_object_unref(accel_group);
}
+void
+libbalsa_window_block_accels(GtkApplicationWindow * window,
+ gboolean block)
+{
+ g_object_set_data(G_OBJECT(window), "block-accels", GINT_TO_POINTER(!!block));
+}
+
/*
* libbalsa_window_add_accelerator
*
diff --git a/libbalsa/application-helpers.h b/libbalsa/application-helpers.h
index 9e07c30a7..a525e21bb 100644
--- a/libbalsa/application-helpers.h
+++ b/libbalsa/application-helpers.h
@@ -40,6 +40,8 @@ GtkWidget *libbalsa_window_get_menu_bar(GtkApplicationWindow * window,
void libbalsa_window_set_accels (GtkApplicationWindow * window,
GMenuModel * menu_model);
+void libbalsa_window_block_accels (GtkApplicationWindow * window,
+ gboolean block);
void libbalsa_window_add_accelerator (GtkApplicationWindow * window,
const gchar * accel,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]