Browse Source

Using an en-dash instead of a minus sign in window titles, local-local session names and various other places

Source commit: c4ea12980c1d69fe0a9560bcc5ba00810949212c
Martin Prikryl 4 years ago
parent
commit
2ec882ed95

+ 2 - 1
source/core/Common.cpp

@@ -37,6 +37,7 @@ const wchar_t TokenReplacement = wchar_t(true);
 const UnicodeString LocalInvalidChars(TraceInitStr(L"/\\:*?\"<>|"));
 const UnicodeString PasswordMask(TraceInitStr(L"***"));
 const UnicodeString Ellipsis(TraceInitStr(L"..."));
+const UnicodeString TitleSeparator(TraceInitStr(L" \u2013 ")); // En-Dash
 //---------------------------------------------------------------------------
 UnicodeString ReplaceChar(UnicodeString Str, wchar_t A, wchar_t B)
 {
@@ -1540,7 +1541,7 @@ bool __fastcall IsRealFile(const UnicodeString & FileName)
 UnicodeString GetOSInfo()
 {
   UnicodeString Result = WindowsVersionLong();
-  AddToList(Result, WindowsProductName(), L" - ");
+  AddToList(Result, WindowsProductName(), TitleSeparator);
   return Result;
 }
 //---------------------------------------------------------------------------

+ 1 - 0
source/core/Common.h

@@ -29,6 +29,7 @@ extern const wchar_t TokenReplacement;
 extern const UnicodeString LocalInvalidChars;
 extern const UnicodeString PasswordMask;
 extern const UnicodeString Ellipsis;
+extern const UnicodeString TitleSeparator;
 //---------------------------------------------------------------------------
 extern const UnicodeString HttpProtocol;
 extern const UnicodeString HttpsProtocol;

+ 1 - 1
source/core/SessionData.cpp

@@ -3068,7 +3068,7 @@ UnicodeString __fastcall TSessionData::GetDefaultSessionName()
     // See also TScpCommanderForm::GetLocalBrowserSessionTitle
     UnicodeString Path1 = ExtractShortName(LocalDirectory, false);
     UnicodeString Path2 = ExtractShortName(OtherLocalDirectory, false);
-    return FORMAT(L"%s - %s", (Path1, Path2));
+    return Path1 + TitleSeparator + Path2;
   }
   else if (!HostName.IsEmpty() && !UserName.IsEmpty())
   {

+ 1 - 1
source/forms/Authenticate.cpp

@@ -202,7 +202,7 @@ void __fastcall TAuthenticateForm::AdjustControls()
   }
   else
   {
-    ACaption = FORMAT(L"%s - %s", (FStatus, FSessionData->SessionName));
+    ACaption = FStatus + TitleSeparator + FSessionData->SessionName;
   }
   Caption = FormatFormCaption(this, ACaption);
 }

+ 3 - 4
source/forms/CustomScpExplorer.cpp

@@ -3199,8 +3199,8 @@ void __fastcall TCustomScpExplorerForm::CustomExecuteFile(TOperationSide Side,
   {
     if (!IsSideLocalBrowser(Side))
     {
-      UnicodeString Caption = UnixIncludeTrailingBackslash(RemoteDirectory) + OriginalFileName +
-        L" - " + Terminal->SessionData->SessionName;
+      UnicodeString RemotePath = UnixCombinePaths(RemoteDirectory, OriginalFileName);
+      UnicodeString Caption = RemotePath + TitleSeparator + Terminal->SessionData->SessionName;
       TForm * Editor;
       try
       {
@@ -7248,8 +7248,7 @@ void __fastcall TCustomScpExplorerForm::PopupTrayBalloon(TTerminal * Terminal,
       if (Terminal != NULL)
       {
         TManagedTerminal * Session = DebugNotNull(dynamic_cast<TManagedTerminal *>(Terminal));
-        Title = FORMAT(L"%s - %s",
-          (TTerminalManager::Instance()->GetSessionTitle(Session, true), Title));
+        Title = TTerminalManager::Instance()->GetSessionTitle(Session, true) + TitleSeparator + Title;
       }
     }
 

+ 1 - 1
source/forms/Editor.cpp

@@ -35,7 +35,7 @@ TForm * __fastcall ShowEditorForm(const UnicodeString FileName, TForm * ParentFo
     Dialog->FileName = FileName;
     Dialog->ParentForm = ParentForm;
     UnicodeString ACaption = Caption.IsEmpty() ? FileName : Caption;
-    Dialog->Caption = ACaption + L" - " + LoadStr(EDITOR_CAPTION) + L" - " + AppName;
+    Dialog->Caption = ACaption + TitleSeparator + LoadStr(EDITOR_CAPTION) + TitleSeparator + AppName;
     Dialog->OnFileChanged = OnFileChanged;
     Dialog->OnFileReload = OnFileReload;
     Dialog->OnSaveAll = OnSaveAll;

+ 1 - 1
source/forms/FileFind.cpp

@@ -99,7 +99,7 @@ bool __fastcall TFileFindDialog::IsFinding()
 void __fastcall TFileFindDialog::UpdateControls()
 {
   bool Finding = IsFinding();
-  Caption = FORMAT("%s - %s", (LoadStr(Finding ? FIND_FILE_FINDING : FIND_FILE_TITLE), FTerminalName));
+  Caption = LoadStr(Finding ? FIND_FILE_FINDING : FIND_FILE_TITLE) + TitleSeparator + FTerminalName;
   UnicodeString StartStopCaption;
   if (Finding)
   {

+ 1 - 1
source/forms/Progress.cpp

@@ -49,7 +49,7 @@ UnicodeString __fastcall TProgressForm::ProgressStr(
   UnicodeString Result = LoadStr(Id);
   if (SynchronizeProgress != NULL)
   {
-    Result = FORMAT(L"%s - %s", (LoadStr(SYNCHRONIZE_PROGRESS_SYNCHRONIZE2), Result));
+    Result = LoadStr(SYNCHRONIZE_PROGRESS_SYNCHRONIZE2) + TitleSeparator + Result;
   }
   if (!TFileOperationProgressType::IsIndeterminateOperation(ProgressData->Operation))
   {

+ 1 - 1
source/forms/ScpCommander.cpp

@@ -2804,6 +2804,6 @@ UnicodeString TScpCommanderForm::GetLocalBrowserSessionTitle(TManagedTerminal *
   // See also TSessionData::GetDefaultSessionName()
   Path1 = Manager->GetPathForSessionTabName(ExtractShortName(Path1, false));
   Path2 = Manager->GetPathForSessionTabName(ExtractShortName(Path2, false));
-  UnicodeString Result = FORMAT(L"%s - %s", (Path1, Path2));
+  UnicodeString Result = Path1 + TitleSeparator + Path2;
   return Result;
 }

+ 1 - 1
source/forms/SynchronizeChecklist.cpp

@@ -132,7 +132,7 @@ void __fastcall TSynchronizeChecklistDialog::UpdateCaption()
   UnicodeString StatusTitle = LoadStr(FSynchronizing ? SYNCHRONIZE_PROGRESS_SYNCHRONIZE2 : SYNCHRONIZE_CHECKLIST_CAPTION);
   if (Title.Pos(StatusTitle) <= 0)
   {
-    AddToList(Title, StatusTitle, L" - ");
+    AddToList(Title, StatusTitle, TitleSeparator);
   }
   Caption = Manager->FormatFormCaptionWithSession(this, Title);
 }

+ 1 - 1
source/resource/Propagation.rc

@@ -28,7 +28,7 @@ BEGIN
   FUNCTIONS_DOCUMENTATION, "A comprehensive WinSCP documentation and an active user forum are freely accessible at WinSCP site"
 
   STORE_BUYING, "By buying WinSCP from Microsoft Store you support WinSCP development. Thank you!"
-  STORE_TITLE, "WinSCP - SFTP, FTP, WebDAV, SCP and S3 client"
+  STORE_TITLE, "WinSCP  SFTP, FTP, WebDAV, SCP and S3 client"
 
   KEYWORD_SFTP_CLIENT, "sftp client"
   KEYWORD_FTP_CLIENT, "ftp client"

+ 1 - 1
source/resource/TextsCore1.rc

@@ -288,7 +288,7 @@ BEGIN
   VERIFY_CERT_PROMPT3, "**The server's certificate is not known. You have no guarantee that the server is the computer you think it is.**\n\nServer's certificate details follow:\n\n%s\n\nIf you trust this certificate, press Yes. To connect without storing certificate, press No. To abandon the connection press Cancel.\n\nContinue connecting and store the certificate?"
   VERIFY_CERT_CONTACT, "- Organization: %s\n|- Location: %s\n|- Other: %s\n"
   VERIFY_CERT_CONTACT_LIST, "%s, %s"
-  CERT_TEXT2, "Issuer:\n%s\nSubject:\n%s\nValid: %s - %s\n\nFingerprints:\n- SHA-256: %s\n- SHA-1: %s\n\nSummary: %s"
+  CERT_TEXT2, "Issuer:\n%s\nSubject:\n%s\nValid: %s  %s\n\nFingerprints:\n- SHA-256: %s\n- SHA-1: %s\n\nSummary: %s"
   CERTIFICATE_PASSPHRASE_PROMPT, "&Passphrase for client certificate:"
   CERTIFICATE_PASSPHRASE_TITLE, "Client certificate passphrase"
   KEY_TYPE_CONVERT3, "**Do you want to convert this %s private key to PuTTY format?**\n\n%s"

+ 1 - 1
source/resource/TextsCore2.rc

@@ -17,7 +17,7 @@ BEGIN
     "To connect without adding host key to the cache, press No. "
     "To abandon the connection press Cancel."
   DIFFERENT_KEY5,
-    "**WARNING - POTENTIAL SECURITY BREACH!**\n"
+    "**WARNING  POTENTIAL SECURITY BREACH!**\n"
     "\n"
     "The server's host key does not match the one WinSCP has "
     "in cache. This means that either the "

+ 1 - 1
source/windows/ConsoleRunner.cpp

@@ -2498,7 +2498,7 @@ int __fastcall BatchSettings(TConsole * Console, TProgramParams * Params)
               Changes++;
             }
             UnicodeString StateStr = LoadStr(Changed ? BATCH_SET_CHANGED : BATCH_SET_NOT_CHANGED);
-            Console->PrintLine(FORMAT(L"%s - %s", (Data->Name, StateStr)));
+            Console->PrintLine(Data->Name + TitleSeparator + StateStr);
           }
         }
 

+ 1 - 1
source/windows/GUIConfiguration.cpp

@@ -1204,7 +1204,7 @@ TObjectList * __fastcall TGUIConfiguration::GetLocales()
         GetLocaleInfo(Locale, LOCALE_SENGLANGUAGE,
           LocaleStr, LENOF(LocaleStr));
         UnicodeString Name = LocaleStr;
-        Name += L" - ";
+        Name += TitleSeparator;
         // LOCALE_SNATIVELANGNAME
         GetLocaleInfo(Locale, LOCALE_SLANGUAGE,
           LocaleStr, LENOF(LocaleStr));

+ 2 - 2
source/windows/TerminalManager.cpp

@@ -859,14 +859,14 @@ void __fastcall TTerminalManager::UpdateAppTitle()
     UnicodeString ProgressTitle = GetAppProgressTitle();
     if (!ProgressTitle.IsEmpty())
     {
-      NewTitle = ProgressTitle + L" - " + NewTitle;
+      NewTitle = ProgressTitle + TitleSeparator + NewTitle;
     }
     else if (ScpExplorer != NULL)
     {
       UnicodeString Path = ScpExplorer->PathForCaption();
       if (!Path.IsEmpty())
       {
-        NewTitle = Path + L" - " + NewTitle;
+        NewTitle = Path + TitleSeparator + NewTitle;
       }
     }
 

+ 2 - 2
source/windows/VCLCommon.cpp

@@ -421,7 +421,7 @@ UnicodeString __fastcall FormatMainFormCaption(const UnicodeString & Caption, co
   UnicodeString Suffix = AppName;
   if (!SessionName.IsEmpty())
   {
-    Suffix = SessionName + L" - " + Suffix;
+    Suffix = SessionName + TitleSeparator + Suffix;
   }
   UnicodeString Result = Caption;
   if (Result.IsEmpty())
@@ -430,7 +430,7 @@ UnicodeString __fastcall FormatMainFormCaption(const UnicodeString & Caption, co
   }
   else
   {
-    Suffix = L" - " + Suffix;
+    Suffix = TitleSeparator + Suffix;
     if (!EndsStr(Suffix, Result))
     {
       Result += Suffix;

+ 1 - 1
source/windows/WinInterface.cpp

@@ -1677,7 +1677,7 @@ void __fastcall ::TTrayIcon::PopupBalloon(UnicodeString Title,
     Timeout = 30000;
   }
   FTrayIcon->uFlags |= NIF_INFO;
-  Title = FORMAT(L"%s - %s", (Title, AppNameString()));
+  Title = Title + TitleSeparator + AppNameString();
   StrPLCopy(FTrayIcon->szInfoTitle, Title, LENOF(FTrayIcon->szInfoTitle) - 1);
   UnicodeString Info = Str;
   // When szInfo is empty, balloon is not shown