Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ public bool KeepMaxResults

public bool DontPromptUpdateMsg { get; set; }
public bool EnableUpdateLog { get; set; }
public bool DisableSuccessNotifications { get; set; }

public bool StartFlowLauncherOnSystemStartup { get; set; } = false;
public bool UseLogonTaskForStartup { get; set; } = false;
Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
<system:String x:Key="hideOnStartupToolTip">Flow Launcher search window is hidden in the tray after starting up.</system:String>
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
<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>
<system:String x:Key="disableSuccessNotifications">Disable notifications (non-error)</system:String>
<system:String x:Key="disableSuccessNotificationsToolTip">Hide non-error notifications shown after actions (e.g. copy completed). Error notifications are still shown.</system:String>
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
<system:String x:Key="querySearchPrecisionToolTip">Changes minimum match score required for results.</system:String>
<system:String x:Key="SearchPrecisionNone">None</system:String>
Expand Down
12 changes: 12 additions & 0 deletions Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ public void ShowMsg(string title, string subTitle = "", string iconPath = "") =>

Comment on lines +122 to 129

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have useMainWindowAsOwner default as true in the method, you don't need to pass it again right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, this is for the issue of function overloading? And I think it is more clear to provide this parameter here

public void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
{
if (_settings.DisableSuccessNotifications &&
!string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
{
return;
}
Comment thread
Jack251970 marked this conversation as resolved.
Outdated

Notification.Show(title, subTitle, iconPath);
}
Comment thread
Jack251970 marked this conversation as resolved.

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

public void ShowMsgWithButton(string title, string buttonText, Action buttonAction, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
{
if (_settings.DisableSuccessNotifications &&
!string.Equals(iconPath, Constant.ErrorIcon, StringComparison.OrdinalIgnoreCase))
{
return;
}

Notification.ShowWithButton(title, buttonText, buttonAction, subTitle, iconPath);
}

Expand Down
10 changes: 10 additions & 0 deletions Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>

<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource disableSuccessNotificationsToolTip}"
Header="{DynamicResource disableSuccessNotifications}">
<ui:ToggleSwitch
IsOn="{Binding Settings.DisableSuccessNotifications}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
Comment thread
Jack251970 marked this conversation as resolved.

<ui:SettingsCard
Margin="0 14 0 0"
Description="{DynamicResource showAtTopmostToolTip}"
Expand Down
Loading