1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

Bug 2067: Optionally do not flash taskbar button when WinSCP needs attention while in the background

https://winscp.net/tracker/2067

Source commit: 158316599bcdb4c2a07f53333e94bf3e0ed33b49
This commit is contained in:
Martin Prikryl
2022-04-04 14:52:04 +00:00
parent 8b1b3a355c
commit 7e83fd9207
3 changed files with 11 additions and 1 deletions

View File

@@ -109,7 +109,7 @@ void __fastcall SetOnForeground(bool OnForeground)
void __fastcall FlashOnBackground()
{
DebugAssert(Application);
if (!ForcedOnForeground && !ForegroundTask())
if (WinConfiguration->FlashTaskbar && !ForcedOnForeground && !ForegroundTask())
{
FlashWindow(Application->MainFormHandle, true);
}

View File

@@ -604,6 +604,7 @@ void __fastcall TWinConfiguration::Default()
FShowLoginWhenNoSession = true;
FKeepOpenWhenNoSession = true;
FLocalIconsByExt = false;
FFlashTaskbar = true;
FMaxSessions = 100;
FBidiModeOverride = lfoLanguageIfRecommended;
FFlipChildrenOverride = lfoLanguageIfRecommended;
@@ -1050,6 +1051,7 @@ THierarchicalStorage * TWinConfiguration::CreateScpStorage(bool & SessionList)
KEY(Bool, ShowLoginWhenNoSession); \
KEY(Bool, KeepOpenWhenNoSession); \
KEY(Bool, LocalIconsByExt); \
KEY(Bool, FlashTaskbar); \
KEY(Integer, MaxSessions); \
KEY(Integer, BidiModeOverride); \
KEY(Integer, FlipChildrenOverride); \
@@ -2335,6 +2337,11 @@ void __fastcall TWinConfiguration::SetLocalIconsByExt(bool value)
SET_CONFIG_PROPERTY(LocalIconsByExt);
}
//---------------------------------------------------------------------------
void __fastcall TWinConfiguration::SetFlashTaskbar(bool value)
{
SET_CONFIG_PROPERTY(FlashTaskbar);
}
//---------------------------------------------------------------------------
void __fastcall TWinConfiguration::SetBidiModeOverride(TLocaleFlagOverride value)
{
SET_CONFIG_PROPERTY(BidiModeOverride);

View File

@@ -451,6 +451,7 @@ private:
bool FShowLoginWhenNoSession;
bool FKeepOpenWhenNoSession;
bool FLocalIconsByExt;
bool FFlashTaskbar;
int FMaxSessions;
TLocaleFlagOverride FBidiModeOverride;
TLocaleFlagOverride FFlipChildrenOverride;
@@ -556,6 +557,7 @@ private:
void __fastcall SetShowLoginWhenNoSession(bool value);
void __fastcall SetKeepOpenWhenNoSession(bool value);
void __fastcall SetLocalIconsByExt(bool value);
void __fastcall SetFlashTaskbar(bool value);
void __fastcall SetBidiModeOverride(TLocaleFlagOverride value);
void __fastcall SetFlipChildrenOverride(TLocaleFlagOverride value);
void __fastcall SetShowTips(bool value);
@@ -753,6 +755,7 @@ public:
__property bool ShowLoginWhenNoSession = { read = FShowLoginWhenNoSession, write = SetShowLoginWhenNoSession };
__property bool KeepOpenWhenNoSession = { read = FKeepOpenWhenNoSession, write = SetKeepOpenWhenNoSession };
__property bool LocalIconsByExt = { read = FLocalIconsByExt, write = SetLocalIconsByExt };
__property bool FlashTaskbar = { read = FFlashTaskbar, write = SetFlashTaskbar };
__property int MaxSessions = { read = FMaxSessions, write = FMaxSessions };
__property TLocaleFlagOverride BidiModeOverride = { read = FBidiModeOverride, write = SetBidiModeOverride };
__property TLocaleFlagOverride FlipChildrenOverride = { read = FFlipChildrenOverride, write = SetFlipChildrenOverride };