Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit 49a20c7

Browse files
committed
remove unneccessary code and implement launch hidden
1 parent d480732 commit 49a20c7

1 file changed

Lines changed: 8 additions & 30 deletions

File tree

Main.cs

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ public List<Result> Query(Query query)
5757
IcoPath = "Images\\warning.png",
5858
Action = _ =>
5959
{
60-
if (FilesFolders.FileExists(_settings.EverythingInstalledPath))
61-
FilesFolders.OpenPath(_settings.EverythingInstalledPath);
60+
if (_settings.EverythingInstalledPath.FileExists())
61+
{
62+
Process.Start(new ProcessStartInfo
63+
{
64+
FileName = _settings.EverythingInstalledPath,
65+
Arguments = $"{(_settings.LaunchHidden ? "-startup" : "")}"
66+
})?.Dispose();
67+
}
6268

6369
return true;
6470
}
@@ -140,34 +146,6 @@ private Result CreateResult(string keyword, SearchResult searchResult)
140146
return r;
141147
}
142148

143-
private List<ContextMenu> GetDefaultContextMenu()
144-
{
145-
List<ContextMenu> defaultContextMenus = new List<ContextMenu>();
146-
ContextMenu openFolderContextMenu = new ContextMenu
147-
{
148-
Name = _context.API.GetTranslation("flowlauncher_plugin_everything_open_containing_folder"),
149-
Command = _settings.ExplorerPath,
150-
Argument = $"{_settings.ExplorerArgs}",
151-
ImagePath = "Images\\folder.png"
152-
};
153-
154-
defaultContextMenus.Add(openFolderContextMenu);
155-
156-
string editorPath = string.IsNullOrEmpty(_settings.EditorPath) ? "notepad.exe" : _settings.EditorPath;
157-
158-
ContextMenu openWithEditorContextMenu = new ContextMenu
159-
{
160-
Name = string.Format(_context.API.GetTranslation("flowlauncher_plugin_everything_open_with_editor"), Path.GetFileNameWithoutExtension(editorPath)),
161-
Command = editorPath,
162-
Argument = $" {Settings.FilePathPlaceHolder}",
163-
ImagePath = editorPath
164-
};
165-
166-
defaultContextMenus.Add(openWithEditorContextMenu);
167-
168-
return defaultContextMenus;
169-
}
170-
171149
public void Init(PluginInitContext context)
172150
{
173151
_context = context;

0 commit comments

Comments
 (0)