[Commits] [SCM] claws branch, master, updated. 3.17.3-37-g18bdfb6

claws at claws-mail.org claws at claws-mail.org
Tue Jan 8 08:57:30 CET 2019


The branch, master has been updated
       via  18bdfb6b6c4c69c79b7948c1ef70246737fa4e2e (commit)
      from  7efc008db2cb63dc7d4ac0f0c7f9046742ceae49 (commit)

Summary of changes:
 src/prefs_common.c |    4 +++-
 src/prefs_common.h |    3 ++-
 src/prefs_other.c  |   40 +++++++++++++++++++++++++++++++++++++++-
 3 files changed, 44 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit 18bdfb6b6c4c69c79b7948c1ef70246737fa4e2e
Author: Paul <paul at claws-mail.org>
Date:   Tue Jan 8 07:57:25 2019 +0000

    add option 'enable keyboard shortcuts'

diff --git a/src/prefs_common.c b/src/prefs_common.c
index 5ce34dd..bc8cc23 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2019 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1017,6 +1017,8 @@ static PrefParam param[] = {
 
 	{"gtk_can_change_accels", "FALSE", &prefs_common.gtk_can_change_accels, P_BOOL,
 	 NULL, NULL, NULL},
+	{"gtk_enable_accels", "TRUE", &prefs_common.gtk_enable_accels, P_BOOL,
+	 NULL, NULL, NULL},
 
 	{"color_new", "#0000b3", &prefs_common.color[COL_NEW],
 	 P_COLOR, NULL, NULL, NULL},
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 05a7896..d4f746a 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2019 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -458,6 +458,7 @@ struct _PrefsCommon
 	gint io_timeout_secs;
 
 	gboolean gtk_can_change_accels;
+	gboolean gtk_enable_accels;
 	
 	/* Memory cache*/
 	gint cache_max_mem_usage;
diff --git a/src/prefs_other.c b/src/prefs_other.c
index 9bd90e2..ead5f9c 100644
--- a/src/prefs_other.c
+++ b/src/prefs_other.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2005-2015 Colin Leroy and The Claws Mail Team
+ * Copyright (C) 2005-2019 Colin Leroy and The Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -59,6 +59,7 @@ typedef struct _OtherPage
 	GtkWidget *checkbtn_askonclean;
 	GtkWidget *checkbtn_warnqueued;
 	GtkWidget *spinbtn_iotimeout;
+	GtkWidget *checkbtn_gtk_enable_accels;
 	GtkWidget *checkbtn_gtk_can_change_accels;
 	GtkWidget *checkbtn_askonfilter;
 	GtkWidget *checkbtn_use_shred;
@@ -454,6 +455,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 
 	GtkWidget *frame_keys;
 	GtkWidget *vbox_keys;
+	GtkWidget *checkbtn_gtk_enable_accels;
 	GtkWidget *checkbtn_gtk_can_change_accels;
 	GtkWidget *button_keybind;
 
@@ -511,6 +513,9 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 
 	vbox_keys = gtkut_get_options_frame(vbox1, &frame_keys, _("Keyboard shortcuts"));
 
+	PACK_CHECK_BUTTON(vbox_keys, checkbtn_gtk_enable_accels,
+			_("Enable keyboard shortcuts"));
+
 	PACK_CHECK_BUTTON(vbox_keys, checkbtn_gtk_can_change_accels,
 			_("Enable customisable keyboard shortcuts"));
 
@@ -629,6 +634,8 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 	g_signal_connect (G_OBJECT (button_change_passphrase), "clicked",
 			  G_CALLBACK (prefs_change_master_passphrase), NULL);
 #endif
+	SET_TOGGLE_SENSITIVITY(checkbtn_gtk_enable_accels, checkbtn_gtk_can_change_accels);
+	SET_TOGGLE_SENSITIVITY(checkbtn_gtk_enable_accels, button_keybind);
 
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_addaddrbyclick), 
 		prefs_common.add_address_by_click);
@@ -640,6 +647,8 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 		prefs_common.ask_on_clean);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_warnqueued), 
 		prefs_common.warn_queued_on_exit);
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_gtk_enable_accels),
+		prefs_common.gtk_enable_accels);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_gtk_can_change_accels),
 		prefs_common.gtk_can_change_accels);
 
@@ -669,6 +678,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 	prefs_other->checkbtn_warnqueued = checkbtn_warnqueued;
 	prefs_other->spinbtn_iotimeout = spinbtn_iotimeout;
 	prefs_other->checkbtn_transhdr = checkbtn_transhdr;
+	prefs_other->checkbtn_gtk_enable_accels = checkbtn_gtk_enable_accels;
 	prefs_other->checkbtn_gtk_can_change_accels = checkbtn_gtk_can_change_accels;
 	prefs_other->checkbtn_askonfilter = checkbtn_askonfilter;
 	prefs_other->checkbtn_use_shred = checkbtn_use_shred;
@@ -684,6 +694,7 @@ static void prefs_other_create_widget(PrefsPage *_page, GtkWindow *window,
 static void prefs_other_save(PrefsPage *_page)
 {
 	OtherPage *page = (OtherPage *) _page;
+	gboolean gtk_enable_accels;
 	gboolean gtk_can_change_accels;
 
 	prefs_common.add_address_by_click = gtk_toggle_button_get_active(
@@ -763,7 +774,26 @@ static void prefs_other_save(PrefsPage *_page)
 				"gtk-can-change-accels",
 				(glong)prefs_common.gtk_can_change_accels,
 				"XProperty");
+	}
+	gtk_enable_accels = gtk_toggle_button_get_active(
+		GTK_TOGGLE_BUTTON(page->checkbtn_gtk_enable_accels));
 
+	if (prefs_common.gtk_enable_accels != gtk_enable_accels) {
+		prefs_common.gtk_enable_accels = gtk_enable_accels;
+
+		gtk_settings_set_long_property(gtk_settings_get_default(),
+				"gtk-enable-accels",
+				(glong)prefs_common.gtk_enable_accels,
+				"XProperty");
+		
+		gtk_settings_set_long_property(gtk_settings_get_default(),
+				"gtk-enable-mnemonics",
+				(glong)prefs_common.gtk_enable_accels,
+				"XProperty");
+	}
+	
+	if (prefs_common.gtk_enable_accels != gtk_enable_accels ||
+	    prefs_common.gtk_can_change_accels != gtk_can_change_accels) {		
 		/* gtk_can_change_accels value changed : we have (only if changed)
 		 * to apply the gtk property to all widgets : */
 		gtk_rc_reparse_all_for_settings(gtk_settings_get_default(), TRUE);
@@ -798,6 +828,14 @@ void prefs_other_init(void)
 			"gtk-can-change-accels",
 			(glong)prefs_common.gtk_can_change_accels,
 			"XProperty");
+	gtk_settings_set_long_property(gtk_settings_get_default(),
+			"gtk-enable-accels",
+			(glong)prefs_common.gtk_enable_accels,
+			"XProperty");
+	gtk_settings_set_long_property(gtk_settings_get_default(),
+			"gtk-enable-mnemonics",
+			(glong)prefs_common.gtk_enable_accels,
+			"XProperty");
 }
 
 void prefs_other_done(void)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list