[gtk+] Display invalid accelerators as "Invalid" in GTK mode.
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+] Display invalid accelerators as "Invalid" in GTK mode.
- Date: Mon, 20 Apr 2009 08:56:03 -0400 (EDT)
commit 45d076fcc2ae6f03a34d9b2018fcd53e9d2bddfe
Author: Christian Persch <chpe gnome org>
Date: Wed Apr 8 19:18:44 2009 +0200
Display invalid accelerators as "Invalid" in GTK mode.
When in GTK_CELL_RENDERER_ACCEL_MODE_GTK, display accelerator key
combinations that don't pass gtk_accelerator_valid() as "Invalid".
Bug #572799.
---
gtk/gtkcellrendereraccel.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index 306bc5e..f3e2296 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -244,7 +244,16 @@ convert_keysym_state_to_string (GtkCellRendererAccel *accel,
else
{
if (accel->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK)
- return gtk_accelerator_get_label (keysym, mask);
+ {
+ if (!gtk_accelerator_valid (keysym, mask))
+ /* This label is displayed in a treeview cell displaying
+ * an accelerator key combination that is not valid according
+ * to gtk_accelerator_valid().
+ */
+ return g_strdup (C_("Accelerator", "Invalid"));
+
+ return gtk_accelerator_get_label (keysym, mask);
+ }
else
{
gchar *name;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]