mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add error message method to api to allow the use of standard error icon
This commit is contained in:
parent
41c3f8a793
commit
e7127cf514
3 changed files with 14 additions and 5 deletions
|
|
@ -47,6 +47,13 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
void CheckForNewUpdate();
|
||||
|
||||
/// <summary>
|
||||
/// Show the error message using Flow's standard error icon.
|
||||
/// </summary>
|
||||
/// <param name="title">Message title</param>
|
||||
/// <param name="subTitle">Optional message subtitle</param>
|
||||
void ShowMsgError(string title, string subTitle = "");
|
||||
|
||||
/// <summary>
|
||||
/// Show message box
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ namespace Flow.Launcher
|
|||
|
||||
public Task ReloadAllPluginData() => PluginManager.ReloadData();
|
||||
|
||||
public void ShowMsgError(string title, string subTitle = "") => ShowMsg(title, subTitle, Constant.ErrorIcon, true);
|
||||
|
||||
public void ShowMsg(string title, string subTitle = "", string iconPath = "") => ShowMsg(title, subTitle, iconPath, true);
|
||||
|
||||
public void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true)
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
{
|
||||
var message = $"Fail to delete {fileOrFolder} at {record.FullPath}";
|
||||
LogException(message, e);
|
||||
Context.API.ShowMsg(message);
|
||||
Context.API.ShowMsgError(message);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
{
|
||||
var name = "Plugin: Folder";
|
||||
var message = $"File not found: {e.Message}";
|
||||
Context.API.ShowMsg(name, message);
|
||||
Context.API.ShowMsgError(name, message);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -236,7 +236,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
{
|
||||
var message = $"Fail to open file at {record.FullPath}";
|
||||
LogException(message, e);
|
||||
Context.API.ShowMsg(message);
|
||||
Context.API.ShowMsgError(message);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -267,7 +267,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
{
|
||||
var message = $"Failed to open editor for file at {record.FullPath}";
|
||||
LogException(message, e);
|
||||
Context.API.ShowMsg(message);
|
||||
Context.API.ShowMsgError(message);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
@ -326,7 +326,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
{
|
||||
var message = Context.API.GetTranslation("plugin_explorer_openindexingoptions_errormsg");
|
||||
LogException(message, e);
|
||||
Context.API.ShowMsg(message);
|
||||
Context.API.ShowMsgError(message);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue