Skip to content

Commit b80b4a6

Browse files
committed
Add setting to disable non-error notifications
1 parent d0d41c6 commit b80b4a6

4 files changed

Lines changed: 25 additions & 0 deletions

File tree

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ public bool KeepMaxResults
462462

463463
public bool DontPromptUpdateMsg { get; set; }
464464
public bool EnableUpdateLog { get; set; }
465+
public bool DisableSuccessNotifications { get; set; }
465466

466467
public bool StartFlowLauncherOnSystemStartup { get; set; } = false;
467468
public bool UseLogonTaskForStartup { get; set; } = false;

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
<system:String x:Key="hideOnStartupToolTip">Flow Launcher search window is hidden in the tray after starting up.</system:String>
126126
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
127127
<system:String x:Key="hideNotifyIconToolTip">When the icon is hidden from the tray, the Settings menu can be opened by right-clicking on the search window.</system:String>
128+
<system:String x:Key="disableSuccessNotifications">Disable notifications (non-error)</system:String>
129+
<system:String x:Key="disableSuccessNotificationsToolTip">Hide non-error notifications shown after actions (e.g. copy completed). Error notifications are still shown.</system:String>
128130
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
129131
<system:String x:Key="querySearchPrecisionToolTip">Changes minimum match score required for results.</system:String>
130132
<system:String x:Key="SearchPrecisionNone">None</system:String>

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ public void ShowMsg(string title, string subTitle = "", string iconPath = "") =>
129129

130130
public void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
131131
{
132+
if (_settings.DisableSuccessNotifications &&
133+
!string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
134+
{
135+
return;
136+
}
137+
132138
Notification.Show(title, subTitle, iconPath);
133139
}
134140

@@ -137,6 +143,12 @@ public void ShowMsgWithButton(string title, string buttonText, Action buttonActi
137143

138144
public void ShowMsgWithButton(string title, string buttonText, Action buttonAction, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
139145
{
146+
if (_settings.DisableSuccessNotifications &&
147+
!string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
148+
{
149+
return;
150+
}
151+
140152
Notification.ShowWithButton(title, buttonText, buttonAction, subTitle, iconPath);
141153
}
142154

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@
9292
OnContent="{DynamicResource enable}" />
9393
</ui:SettingsCard>
9494

95+
<ui:SettingsCard
96+
Margin="0 4 0 0"
97+
Description="{DynamicResource disableSuccessNotificationsToolTip}"
98+
Header="{DynamicResource disableSuccessNotifications}">
99+
<ui:ToggleSwitch
100+
IsOn="{Binding Settings.DisableSuccessNotifications}"
101+
OffContent="{DynamicResource disable}"
102+
OnContent="{DynamicResource enable}" />
103+
</ui:SettingsCard>
104+
95105
<ui:SettingsCard
96106
Margin="0 14 0 0"
97107
Description="{DynamicResource showAtTopmostToolTip}"

0 commit comments

Comments
 (0)