talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 2319aaaf6f28c88c2d04a2b1afd8366363dfc73b
parent 09953e4005573c130e48edab594c2de95d23dadb
Author: Paul <paul@claws-mail.org>
Date:   Tue, 13 Aug 2024 12:24:37 +0100

add hidden pref, passphrase_dialog_msg_title_switch, which switches the message and title placement in the passphrase dialog

implements RFE 4821, 'Add more information to server password dialog's title for KeePassXC'

Diffstat:
Msrc/gtk/inputdialog.c | 32+++++++++++++++++++++-----------
Msrc/prefs_common.c | 3+++
Msrc/prefs_common.h | 4+++-
3 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/src/gtk/inputdialog.c b/src/gtk/inputdialog.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 the Claws Mail team and Hiroyuki Yamamoto * * 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 @@ -122,7 +122,10 @@ gchar *input_dialog_with_invisible(const gchar *title, const gchar *message, is_pass = TRUE; gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); - return input_dialog_open(title, message, NULL, default_string, FALSE, NULL); + if (prefs_common.passphrase_dialog_msg_title_switch) + return input_dialog_open(message, title, NULL, default_string, FALSE, NULL); + else + return input_dialog_open(title, message, NULL, default_string, FALSE, NULL); } gchar *input_dialog_with_invisible_checkbtn(const gchar *title, const gchar *message, @@ -152,7 +155,14 @@ gchar *input_dialog_with_invisible_checkbtn(const gchar *title, const gchar *mes is_pass = TRUE; gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); - return input_dialog_open(title, message, checkbtn_label, default_string, (checkbtn_state? *checkbtn_state:FALSE), checkbtn_state); + if (prefs_common.passphrase_dialog_msg_title_switch) + return input_dialog_open(message, title, checkbtn_label, + default_string, (checkbtn_state? *checkbtn_state:FALSE), + checkbtn_state); + else + return input_dialog_open(title, message, checkbtn_label, + default_string, (checkbtn_state? *checkbtn_state:FALSE), + checkbtn_state); } gchar *input_dialog_combo(const gchar *title, const gchar *message, @@ -224,16 +234,16 @@ gchar *input_dialog_query_password(const gchar *server, const gchar *user) gchar *pass; if (server && user) - message = g_strdup_printf(_("Input password for %s on %s:"), + message = g_strdup_printf(_("Input password for %s on %s"), user, server); else if (server) - message = g_strdup_printf(_("Input password for %s:"), + message = g_strdup_printf(_("Input password for %s"), server); else if (user) - message = g_strdup_printf(_("Input password for %s:"), + message = g_strdup_printf(_("Input password for %s"), user); else - message = g_strdup_printf(_("Input password:")); + message = g_strdup_printf(_("Input password")); pass = input_dialog_with_invisible(_("Input password"), message, NULL); g_free(message); @@ -246,16 +256,16 @@ gchar *input_dialog_query_password_keep(const gchar *server, const gchar *user, gchar *pass; if (server && user) - message = g_strdup_printf(_("Input password for %s on %s:"), + message = g_strdup_printf(_("Input password for %s on %s"), user, server); else if (server) - message = g_strdup_printf(_("Input password for %s:"), + message = g_strdup_printf(_("Input password for %s"), server); else if (user) - message = g_strdup_printf(_("Input password for %s:"), + message = g_strdup_printf(_("Input password for %s"), user); else - message = g_strdup_printf(_("Input password:")); + message = g_strdup_printf(_("Input password")); if (keep) { if (*keep != NULL) { pass = g_strdup (*keep); diff --git a/src/prefs_common.c b/src/prefs_common.c @@ -1320,6 +1320,9 @@ static PrefParam param[] = { {"qs_press_timeout", "500", &prefs_common.qs_press_timeout, P_INT, NULL, NULL, NULL}, + {"passphrase_dialog_msg_title_switch", "FALSE", &prefs_common.passphrase_dialog_msg_title_switch, + P_BOOL, NULL, NULL, NULL}, + {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL} }; diff --git a/src/prefs_common.h b/src/prefs_common.h @@ -590,6 +590,8 @@ struct _PrefsCommon guint primary_passphrase_pbkdf2_rounds; #endif + gboolean passphrase_dialog_msg_title_switch; + /* Proxy */ gboolean use_proxy; ProxyInfo proxy_info; @@ -603,7 +605,7 @@ extern PrefsCommon prefs_common; PrefsCommon *prefs_common_get_prefs(void); GList *prefs_common_read_history_from_dir_with_defaults(const gchar *dirname, const gchar *history, - GList *default_list); + GList *default_list); void prefs_common_read_config (void); void prefs_common_write_config (void); void prefs_common_open (void);