-
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge pull request #1061 from Flow-Launcher/remove_winget_ci * Merge pull request #991 from Flow-Launcher/context_menu_plugin_site * Merge pull request #1080 from gissehel/caret-position-fix * Caret position fix : Include PR #1074 * Merge pull request #1283 from nachmore/dev * Merge pull request #1296 from nachmore/bug_1284 * Merge pull request #1294 from Flow-Launcher/pluginInfoMultipleActionKeyword * Merge pull request #1299 from nachmore/bug_1269 * Plugin Exception Draft (#1147) * Merge pull request #1355 from onesounds/LimitWidth * Merge pull request #1088 from Flow-Launcher/add_spanish_latin_america * Merge pull request #1387 from Flow-Launcher/fix_exception_duplicate_url_opening * Merge pull request #1390 from Flow-Launcher/issue_1371 * Merge pull request #1391 from Flow-Launcher/issue_1366
- Loading branch information
Showing
53 changed files
with
1,499 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Flow.Launcher.Plugin; | ||
using System; | ||
|
||
namespace Flow.Launcher.Core.ExternalPlugins | ||
{ | ||
public class FlowPluginException : Exception | ||
{ | ||
public PluginMetadata Metadata { get; set; } | ||
|
||
public FlowPluginException(PluginMetadata metadata, Exception e) : base(e.Message, e) | ||
{ | ||
Metadata = metadata; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $@"{Metadata.Name} Exception: | ||
Websites: {Metadata.Website} | ||
Author: {Metadata.Author} | ||
Version: {Metadata.Version} | ||
{base.ToString()}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Flow.Launcher.Infrastructure; | ||
using Flow.Launcher.Infrastructure.Logger; | ||
using Microsoft.Win32; | ||
|
||
namespace Flow.Launcher.Helper | ||
{ | ||
public class AutoStartup | ||
{ | ||
private const string StartupPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"; | ||
|
||
public static bool IsEnabled | ||
{ | ||
get | ||
{ | ||
try | ||
{ | ||
using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true); | ||
var path = key?.GetValue(Constant.FlowLauncher) as string; | ||
return path == Constant.ExecutablePath; | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error("AutoStartup", $"Ignoring non-critical registry error (querying if enabled): {e}"); | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
|
||
public static void Disable() | ||
{ | ||
try | ||
{ | ||
using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true); | ||
key?.DeleteValue(Constant.FlowLauncher, false); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error("AutoStartup", $"Failed to disable auto-startup: {e}"); | ||
throw; | ||
} | ||
} | ||
|
||
internal static void Enable() | ||
{ | ||
try | ||
{ | ||
using var key = Registry.CurrentUser.OpenSubKey(StartupPath, true); | ||
key?.SetValue(Constant.FlowLauncher, Constant.ExecutablePath); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error("AutoStartup", $"Failed to enable auto-startup: {e}"); | ||
throw; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.