Skip to content

Commit 1c356d0

Browse files
authored
Merge pull request #2066 from Flow-Launcher/dev
Release 1.15.0 | Plugin 4.0.1
2 parents 3b478b5 + 803633f commit 1c356d0

File tree

148 files changed

+1763
-1170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1763
-1170
lines changed

.github/ISSUE_TEMPLATE/bug-report.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ body:
1414
options:
1515
- label: >
1616
I have checked that this issue has not already been reported.
17-
17+
- label: >
18+
I am using the latest version of Flow Launcher.
19+
1820
- type: textarea
1921
attributes:
2022
label: Problem Description
@@ -54,7 +56,6 @@ body:
5456
validations:
5557
required: true
5658

57-
5859
- type: textarea
5960
id: logs
6061
attributes:

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ github
22
https
33
ssh
44
ubuntu
5+
runcount

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
crowdin
22
DWM
33
workflows
4+
Wpf
45
wpf
56
actionkeyword
67
stackoverflow

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
issues: write
1414
pull-requests: write
1515
steps:
16-
- uses: actions/stale@v7
16+
- uses: actions/stale@v8
1717
with:
1818
stale-issue-message: 'This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
1919
days-before-stale: 45

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ private static void DeletePythonBinding()
4848
}
4949
}
5050

51+
/// <summary>
52+
/// Save json and ISavable
53+
/// </summary>
5154
public static void Save()
5255
{
5356
foreach (var plugin in AllPlugins)

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static class Constant
1919
public static readonly string RootDirectory = Directory.GetParent(ApplicationDirectory).ToString();
2020

2121
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
22-
public const string Issue = "https://github.com/Flow-Launcher/Flow.Launcher/issues/new";
22+
public const string IssuesUrl = "https://github.com/Flow-Launcher/Flow.Launcher/issues";
2323
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;
2424
public static readonly string Dev = "Dev";
2525
public const string Documentation = "https://flowlauncher.com/docs/#/usage-tips";

Flow.Launcher.Infrastructure/Exception/ExceptionFormatter.cs

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Globalization;
44
using System.Linq;
55
using System.Text;
6-
using System.Xml;
76
using Microsoft.Win32;
87

98
namespace Flow.Launcher.Infrastructure.Exception
@@ -63,7 +62,7 @@ private static string CreateExceptionReport(System.Exception ex)
6362
sb.AppendLine($"* Command Line: {Environment.CommandLine}");
6463
sb.AppendLine($"* Timestamp: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
6564
sb.AppendLine($"* Flow Launcher version: {Constant.Version}");
66-
sb.AppendLine($"* OS Version: {Environment.OSVersion.VersionString}");
65+
sb.AppendLine($"* OS Version: {GetWindowsFullVersionFromRegistry()}");
6766
sb.AppendLine($"* IntPtr Length: {IntPtr.Size}");
6867
sb.AppendLine($"* x64: {Environment.Is64BitOperatingSystem}");
6968
sb.AppendLine($"* Python Path: {Constant.PythonPath}");
@@ -173,5 +172,35 @@ private static List<string> GetFrameworkVersionFromRegistry()
173172
}
174173

175174
}
175+
176+
public static string GetWindowsFullVersionFromRegistry()
177+
{
178+
try
179+
{
180+
var buildRevision = GetWindowsRevisionFromRegistry();
181+
var currentBuild = Environment.OSVersion.Version.Build;
182+
return currentBuild.ToString() + "." + buildRevision;
183+
}
184+
catch
185+
{
186+
return Environment.OSVersion.VersionString;
187+
}
188+
}
189+
190+
public static string GetWindowsRevisionFromRegistry()
191+
{
192+
try
193+
{
194+
using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\"))
195+
{
196+
var buildRevision = registryKey.GetValue("UBR").ToString();
197+
return buildRevision;
198+
}
199+
}
200+
catch
201+
{
202+
return "0";
203+
}
204+
}
176205
}
177206
}

Flow.Launcher.Infrastructure/Image/ImageCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class ImageCache
2828
private const int permissibleFactor = 2;
2929
private SemaphoreSlim semaphore = new(1, 1);
3030

31-
public void Initialization(Dictionary<(string, bool), int> usage)
31+
public void Initialize(Dictionary<(string, bool), int> usage)
3232
{
3333
foreach (var key in usage.Keys)
3434
{

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public static void Initialize()
4040

4141
var usage = LoadStorageToConcurrentDictionary();
4242

43+
ImageCache.Initialize(usage.ToDictionary(x => x.Key, x => x.Value));
44+
4345
foreach (var icon in new[]
4446
{
4547
Constant.DefaultIcon, Constant.MissingImgIcon
@@ -269,7 +271,7 @@ public static async ValueTask<ImageSource> LoadAsync(string path, bool loadFullI
269271

270272
if (GuidToKey.TryGetValue(hash, out string key))
271273
{ // image already exists
272-
img = ImageCache[key, false] ?? img;
274+
img = ImageCache[key, loadFullImage] ?? img;
273275
}
274276
else
275277
{ // new guid

Flow.Launcher.Infrastructure/Logger/Log.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
using NLog.Config;
66
using NLog.Targets;
77
using Flow.Launcher.Infrastructure.UserSettings;
8-
using JetBrains.Annotations;
98
using NLog.Fluent;
109
using NLog.Targets.Wrappers;
1110
using System.Runtime.ExceptionServices;
12-
using System.Text;
1311

1412
namespace Flow.Launcher.Infrastructure.Logger
1513
{
@@ -76,7 +74,6 @@ private static bool FormatValid(string message)
7674
return valid;
7775
}
7876

79-
8077
public static void Exception(string className, string message, System.Exception exception, [CallerMemberName] string methodName = "")
8178
{
8279
exception = exception.Demystify();
@@ -115,8 +112,6 @@ private static void ExceptionInternal(string classAndMethod, string message, Sys
115112
{
116113
var logger = LogManager.GetLogger(classAndMethod);
117114

118-
var messageBuilder = new StringBuilder();
119-
120115
logger.Error(e, message);
121116
}
122117

@@ -136,7 +131,8 @@ private static void LogInternal(string message, LogLevel level)
136131
}
137132
}
138133

139-
/// <param name="message">example: "|prefix|unprefixed" </param>
134+
/// Example: "|ClassName.MethodName|Message"
135+
/// <param name="message">Example: "|ClassName.MethodName|Message" </param>
140136
/// <param name="e">Exception</param>
141137
public static void Exception(string message, System.Exception e)
142138
{
@@ -158,7 +154,7 @@ public static void Exception(string message, System.Exception e)
158154
#endif
159155
}
160156

161-
/// <param name="message">example: "|prefix|unprefixed" </param>
157+
/// Example: "|ClassName.MethodName|Message"
162158
public static void Error(string message)
163159
{
164160
LogInternal(message, LogLevel.Error);
@@ -183,7 +179,7 @@ public static void Debug(string className, string message, [CallerMemberName] st
183179
LogInternal(LogLevel.Debug, className, message, methodName);
184180
}
185181

186-
/// <param name="message">example: "|prefix|unprefixed" </param>
182+
/// Example: "|ClassName.MethodName|Message""
187183
public static void Debug(string message)
188184
{
189185
LogInternal(message, LogLevel.Debug);
@@ -194,7 +190,7 @@ public static void Info(string className, string message, [CallerMemberName] str
194190
LogInternal(LogLevel.Info, className, message, methodName);
195191
}
196192

197-
/// <param name="message">example: "|prefix|unprefixed" </param>
193+
/// Example: "|ClassName.MethodName|Message"
198194
public static void Info(string message)
199195
{
200196
LogInternal(message, LogLevel.Info);
@@ -205,7 +201,7 @@ public static void Warn(string className, string message, [CallerMemberName] str
205201
LogInternal(LogLevel.Warn, className, message, methodName);
206202
}
207203

208-
/// <param name="message">example: "|prefix|unprefixed" </param>
204+
/// Example: "|ClassName.MethodName|Message"
209205
public static void Warn(string message)
210206
{
211207
LogInternal(message, LogLevel.Warn);

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,17 @@ public string QuerySearchPrecisionString
195195

196196
public double WindowLeft { get; set; }
197197
public double WindowTop { get; set; }
198+
199+
/// <summary>
200+
/// Custom left position on selected monitor
201+
/// </summary>
202+
public double CustomWindowLeft { get; set; } = 0;
203+
204+
/// <summary>
205+
/// Custom top position on selected monitor
206+
/// </summary>
207+
public double CustomWindowTop { get; set; } = 0;
208+
198209
public int MaxResultsToShow { get; set; } = 5;
199210
public int ActivateTimes { get; set; }
200211

@@ -227,7 +238,15 @@ public bool HideNotifyIcon
227238
}
228239
public bool LeaveCmdOpen { get; set; }
229240
public bool HideWhenDeactivated { get; set; } = true;
230-
public SearchWindowPositions SearchWindowPosition { get; set; } = SearchWindowPositions.MouseScreenCenter;
241+
242+
[JsonConverter(typeof(JsonStringEnumConverter))]
243+
public SearchWindowScreens SearchWindowScreen { get; set; } = SearchWindowScreens.Cursor;
244+
245+
[JsonConverter(typeof(JsonStringEnumConverter))]
246+
public SearchWindowAligns SearchWindowAlign { get; set; } = SearchWindowAligns.Center;
247+
248+
public int CustomScreenNumber { get; set; } = 1;
249+
231250
public bool IgnoreHotkeysOnFullscreen { get; set; }
232251

233252
public HttpProxy Proxy { get; set; } = new HttpProxy();
@@ -253,12 +272,22 @@ public enum ColorSchemes
253272
Light,
254273
Dark
255274
}
256-
public enum SearchWindowPositions
275+
276+
public enum SearchWindowScreens
257277
{
258278
RememberLastLaunchLocation,
259-
MouseScreenCenter,
260-
MouseScreenCenterTop,
261-
MouseScreenLeftTop,
262-
MouseScreenRightTop
279+
Cursor,
280+
Focus,
281+
Primary,
282+
Custom
283+
}
284+
285+
public enum SearchWindowAligns
286+
{
287+
Center,
288+
CenterTop,
289+
LeftTop,
290+
RightTop,
291+
Custom
263292
}
264293
}

Flow.Launcher.Plugin/ActionContext.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Flow.Launcher.Plugin
1+
using System.Windows.Input;
2+
3+
namespace Flow.Launcher.Plugin
24
{
35
public class ActionContext
46
{
@@ -11,5 +13,13 @@ public class SpecialKeyState
1113
public bool ShiftPressed { get; set; }
1214
public bool AltPressed { get; set; }
1315
public bool WinPressed { get; set; }
16+
17+
public ModifierKeys ToModifierKeys()
18+
{
19+
return (CtrlPressed ? ModifierKeys.Control : ModifierKeys.None) |
20+
(ShiftPressed ? ModifierKeys.Shift : ModifierKeys.None) |
21+
(AltPressed ? ModifierKeys.Alt : ModifierKeys.None) |
22+
(WinPressed ? ModifierKeys.Windows : ModifierKeys.None);
23+
}
1424
}
15-
}
25+
}

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<Version>4.0.0</Version>
18-
<PackageVersion>4.0.0</PackageVersion>
19-
<AssemblyVersion>4.0.0</AssemblyVersion>
20-
<FileVersion>4.0.0</FileVersion>
17+
<Version>4.0.1</Version>
18+
<PackageVersion>4.0.1</PackageVersion>
19+
<AssemblyVersion>4.0.1</AssemblyVersion>
20+
<FileVersion>4.0.1</FileVersion>
2121
<PackageId>Flow.Launcher.Plugin</PackageId>
2222
<Authors>Flow-Launcher</Authors>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public interface IPublicAPI
2020
/// </summary>
2121
/// <param name="query">query text</param>
2222
/// <param name="requery">
23-
/// force requery By default, Flow Launcher will not fire query if your query is same with existing one.
24-
/// Set this to true to force Flow Launcher requerying
23+
/// Force requery. By default, Flow Launcher will not fire query if your query is same with existing one.
24+
/// Set this to <see langword="true"/> to force Flow Launcher requerying
2525
/// </param>
2626
void ChangeQuery(string query, bool requery = false);
2727

@@ -233,8 +233,8 @@ public interface IPublicAPI
233233
/// Open directory in an explorer configured by user via Flow's Settings. The default is Windows Explorer
234234
/// </summary>
235235
/// <param name="DirectoryPath">Directory Path to open</param>
236-
/// <param name="FileName">Extra FileName Info</param>
237-
public void OpenDirectory(string DirectoryPath, string FileName = null);
236+
/// <param name="FileNameOrFilePath">Extra FileName Info</param>
237+
public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null);
238238

239239
/// <summary>
240240
/// Opens the URL with the given Uri object.

Flow.Launcher.Plugin/Result.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public override int GetHashCode()
178178
/// <inheritdoc />
179179
public override string ToString()
180180
{
181-
return Title + SubTitle;
181+
return Title + SubTitle + Score;
182182
}
183183

184184
/// <summary>

0 commit comments

Comments
 (0)