From a0fa16f3639e4a61fff2aebb6da268797d752a36 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Fri, 28 Aug 2020 07:57:52 +0200 Subject: [PATCH] Issue #760: add an appropriate error message when trying to change the case of a session name only --- out/locale/en/LC_MESSAGES/default.po | 5 ++++- source/connections.pas | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/out/locale/en/LC_MESSAGES/default.po b/out/locale/en/LC_MESSAGES/default.po index f7efbac7..ae9b6c45 100644 --- a/out/locale/en/LC_MESSAGES/default.po +++ b/out/locale/en/LC_MESSAGES/default.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: HeidiSQL\n" "POT-Creation-Date: 2012-11-05 21:40\n" -"PO-Revision-Date: 2020-08-17 18:07+0200\n" +"PO-Revision-Date: 2020-08-28 07:56+0200\n" "Last-Translator: Ansgar Becker \n" "Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n" "MIME-Version: 1.0\n" @@ -3922,6 +3922,9 @@ msgstr "Delete session \"%s\"?" msgid "Session \"%s\" already exists!" msgstr "Session \"%s\" already exists!" +msgid "If you want to change the case of a session name, you need to rename it before doing the actual case change." +msgstr "If you want to change the case of a session name, you need to rename it before doing the actual case change." + #: connections.pas:658 msgid "Error while moving registry key: %s" msgstr "Error while moving registry key: %s" diff --git a/source/connections.pas b/source/connections.pas index 1f5abe73..4540a5b7 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -1039,10 +1039,17 @@ var SiblingSessions: TStringList; begin // Rename session + // Note that this is triggered only if the text was effectively changed Sess := Sender.GetNodeData(Node); + SiblingSessions := NodeSessionNames(Node.Parent, ParentKey); + if SiblingSessions.IndexOf(NewText) > -1 then begin - ErrorDialog(f_('Session "%s" already exists!', [ParentKey+NewText])); + ErrorDialog( + f_('Session "%s" already exists!', [ParentKey+NewText]) + + sLineBreak + sLineBreak + + _('If you want to change the case of a session name, you need to rename it before doing the actual case change.') + ); NewText := Sess.SessionName; end else begin AppSettings.SessionPath := Sess.SessionPath;