Removing action on folder result, and displaying folder path on selecting a folder result from the folder plugin.

This commit is contained in:
ryanbodrug-microsoft
2020-04-25 09:49:06 -07:00
parent 9d3720557e
commit 8f7305e347
3 changed files with 8 additions and 23 deletions

View File

@@ -94,29 +94,8 @@ namespace Wox.Plugin.Folder
Title = title,
IcoPath = path,
SubTitle = subtitle,
QueryTextDisplay = path,
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
Action = c =>
{
if (c.SpecialKeyState.CtrlPressed)
{
try
{
Process.Start(_fileExplorerProgramName, path);
return true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Could not start " + path);
return false;
}
}
string changeTo = path.EndsWith("\\") ? path : path + "\\";
changeTo = string.IsNullOrEmpty(query.ActionKeyword) ? changeTo : query.ActionKeyword + " " + changeTo;
bool requery = true;
_context.API.ChangeQuery(changeTo, requery);
return false;
},
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path }
};
}

View File

@@ -18,6 +18,11 @@ namespace Wox.Plugin
public string FontFamily { get; set; }
/// <summary>
/// The text that will get displayed in the Search text box, when this item is selected in the result list.
/// </summary>
public string QueryTextDisplay { get; set; }
public string IcoPath
{
get { return _icoPath; }

View File

@@ -255,7 +255,8 @@ namespace Wox.ViewModel
public override string ToString()
{
return Result.Title.ToString();
var display = String.IsNullOrEmpty(Result.QueryTextDisplay) ? Result.Title : Result.QueryTextDisplay;
return display;
}
}
}