Merge pull request #412 from Flow-Launcher/add_api_errormsg

Add API error msg method
This commit is contained in:
Jeremy Wu 2021-04-22 18:16:59 +10:00 committed by GitHub
commit f2f0120916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 6 deletions

View file

@ -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>

View file

@ -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)

View file

@ -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;
}
},

View file

@ -7,7 +7,7 @@
"Name": "Explorer",
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
"Author": "Jeremy Wu",
"Version": "1.7.4",
"Version": "1.7.5",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",