|
@@ -701,26 +701,30 @@ UnicodeString __fastcall TTerminalManager::GetAppProgressTitle()
|
|
|
//---------------------------------------------------------------------------
|
|
|
void __fastcall TTerminalManager::UpdateAppTitle()
|
|
|
{
|
|
|
- if (ScpExplorer) // We should better check for GetMainForm() here
|
|
|
+ if (ScpExplorer)
|
|
|
{
|
|
|
TForm * MainForm = GetMainForm();
|
|
|
- if (MainForm->Perform(WM_MANAGES_CAPTION, 0, 0) == 0)
|
|
|
+ if (MainForm != ScpExplorer)
|
|
|
{
|
|
|
- UnicodeString NewTitle = FormatMainFormCaption(GetActiveTerminalTitle(false));
|
|
|
+ // triggers caption update for some forms
|
|
|
+ MainForm->Perform(WM_MANAGES_CAPTION, 0, 0);
|
|
|
+ }
|
|
|
|
|
|
- UnicodeString ProgressTitle = GetAppProgressTitle();
|
|
|
- if (!ProgressTitle.IsEmpty())
|
|
|
- {
|
|
|
- NewTitle = ProgressTitle + NewTitle;
|
|
|
- }
|
|
|
- else if (ActiveTerminal && (ScpExplorer != NULL))
|
|
|
- {
|
|
|
- AddToList(NewTitle, ScpExplorer->PathForCaption(), L" - ");
|
|
|
- }
|
|
|
+ UnicodeString NewTitle = FormatMainFormCaption(GetActiveTerminalTitle(false));
|
|
|
|
|
|
- MainForm->Caption = NewTitle;
|
|
|
+ UnicodeString ProgressTitle = GetAppProgressTitle();
|
|
|
+ if (!ProgressTitle.IsEmpty())
|
|
|
+ {
|
|
|
+ NewTitle = ProgressTitle + NewTitle;
|
|
|
+ }
|
|
|
+ else if (ActiveTerminal && (ScpExplorer != NULL))
|
|
|
+ {
|
|
|
+ AddToList(NewTitle, ScpExplorer->PathForCaption(), L" - ");
|
|
|
}
|
|
|
|
|
|
+ // Not updating MainForm here, as for all other possible main forms, this code is actually not what we want.
|
|
|
+ // And they all update their title on their own (some using GetAppProgressTitle()).
|
|
|
+ ScpExplorer->Caption = NewTitle;
|
|
|
ScpExplorer->ApplicationTitleChanged();
|
|
|
}
|
|
|
}
|