Skip to content

Commit 39de484

Browse files
committed
Merge branch 'administrator_mode' of https://github.com/Flow-Launcher/Flow.Launcher into administrator_mode
2 parents 4df7264 + 1dfec7f commit 39de484

File tree

11 files changed

+167
-136
lines changed

11 files changed

+167
-136
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public bool HideNotifyIcon
385385

386386
public bool AlwaysRunAsAdministrator { get; set; } = false;
387387

388-
private bool _showAtTopmost = true;
388+
private bool _showAtTopmost = false;
389389
public bool ShowAtTopmost
390390
{
391391
get => _showAtTopmost;

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.5.0</Version>
18-
<PackageVersion>4.5.0</PackageVersion>
19-
<AssemblyVersion>4.5.0</AssemblyVersion>
20-
<FileVersion>4.5.0</FileVersion>
17+
<Version>4.6.0</Version>
18+
<PackageVersion>4.6.0</PackageVersion>
19+
<AssemblyVersion>4.6.0</AssemblyVersion>
20+
<FileVersion>4.6.0</FileVersion>
2121
<PackageId>Flow.Launcher.Plugin</PackageId>
2222
<Authors>Flow-Launcher</Authors>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,28 @@ public interface IPublicAPI
342342
public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null);
343343

344344
/// <summary>
345-
/// Opens the URL with the given Uri object.
345+
/// Opens the URL using the browser with the given Uri object, even if the URL is a local file.
346+
/// The browser and mode used is based on what's configured in Flow's default browser settings.
347+
/// </summary>
348+
public void OpenWebUrl(Uri url, bool? inPrivate = null);
349+
350+
/// <summary>
351+
/// Opens the URL using the browser with the given string, even if the URL is a local file.
352+
/// The browser and mode used is based on what's configured in Flow's default browser settings.
353+
/// Non-C# plugins should use this method.
354+
/// </summary>
355+
public void OpenWebUrl(string url, bool? inPrivate = null);
356+
357+
/// <summary>
358+
/// Opens the URL with the given Uri object in browser if scheme is Http or Https.
359+
/// If the URL is a local file, it will instead be opened with the default application for that file type.
346360
/// The browser and mode used is based on what's configured in Flow's default browser settings.
347361
/// </summary>
348362
public void OpenUrl(Uri url, bool? inPrivate = null);
349363

350364
/// <summary>
351-
/// Opens the URL with the given string.
365+
/// Opens the URL with the given string in browser if scheme is Http or Https.
366+
/// If the URL is a local file, it will instead be opened with the default application for that file type.
352367
/// The browser and mode used is based on what's configured in Flow's default browser settings.
353368
/// Non-C# plugins should use this method.
354369
/// </summary>

Flow.Launcher/ActionKeywords.xaml

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -14,118 +14,118 @@
1414
<WindowChrome.WindowChrome>
1515
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
1616
</WindowChrome.WindowChrome>
17+
1718
<Grid>
1819
<Grid.RowDefinitions>
20+
<RowDefinition />
21+
<RowDefinition />
22+
<RowDefinition />
23+
<RowDefinition />
1924
<RowDefinition />
2025
<RowDefinition Height="80" />
2126
</Grid.RowDefinitions>
22-
<Grid>
23-
<StackPanel Grid.Row="0">
24-
<StackPanel>
25-
<Grid>
26-
<Grid.ColumnDefinitions>
27-
<ColumnDefinition Width="Auto" />
28-
<ColumnDefinition Width="*" />
29-
<ColumnDefinition Width="Auto" />
30-
<ColumnDefinition Width="Auto" />
31-
<ColumnDefinition Width="Auto" />
32-
</Grid.ColumnDefinitions>
33-
<Button
34-
Grid.Column="4"
35-
Click="BtnCancel_OnClick"
36-
Style="{StaticResource TitleBarCloseButtonStyle}">
37-
<Path
38-
Width="46"
39-
Height="32"
40-
Data="M 18,11 27,20 M 18,20 27,11"
41-
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
42-
StrokeThickness="1">
43-
<Path.Style>
44-
<Style TargetType="Path">
45-
<Style.Triggers>
46-
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
47-
<Setter Property="Opacity" Value="0.5" />
48-
</DataTrigger>
49-
</Style.Triggers>
50-
</Style>
51-
</Path.Style>
52-
</Path>
53-
</Button>
54-
</Grid>
55-
</StackPanel>
56-
<StackPanel Margin="26 12 26 0">
57-
<StackPanel Grid.Row="0" Margin="0 0 0 12">
58-
<TextBlock
59-
Grid.Column="0"
60-
Margin="0 0 0 0"
61-
FontSize="20"
62-
FontWeight="SemiBold"
63-
Text="{DynamicResource actionKeywordsTitle}"
64-
TextAlignment="Left" />
65-
</StackPanel>
66-
<StackPanel>
67-
<TextBlock
68-
FontSize="14"
69-
Text="{DynamicResource actionkeyword_tips}"
70-
TextAlignment="Left"
71-
TextWrapping="WrapWithOverflow" />
72-
</StackPanel>
27+
<Grid.ColumnDefinitions>
28+
<ColumnDefinition Width="Auto" />
29+
<ColumnDefinition Width="*" />
30+
</Grid.ColumnDefinitions>
7331

74-
<StackPanel Margin="0 18 0 0" Orientation="Horizontal">
75-
<TextBlock
76-
Grid.Row="0"
77-
Grid.Column="1"
78-
HorizontalAlignment="Left"
79-
VerticalAlignment="Center"
80-
FontSize="14"
81-
Text="{DynamicResource currentActionKeywords}" />
82-
<TextBlock
83-
x:Name="tbOldActionKeyword"
84-
Grid.Row="0"
85-
Grid.Column="1"
86-
Margin="14 10 10 10"
87-
HorizontalAlignment="Left"
88-
VerticalAlignment="Center"
89-
FontSize="14"
90-
FontWeight="SemiBold"
91-
Foreground="{DynamicResource Color05B}" />
92-
</StackPanel>
93-
<StackPanel Margin="0 0 0 10" Orientation="Horizontal">
94-
<TextBlock
95-
Grid.Row="1"
96-
Grid.Column="1"
97-
HorizontalAlignment="Left"
98-
VerticalAlignment="Center"
99-
FontSize="14"
100-
Text="{DynamicResource newActionKeyword}" />
101-
<TextBox
102-
x:Name="tbAction"
103-
Width="105"
104-
Margin="10 10 15 10"
105-
HorizontalAlignment="Left"
106-
VerticalAlignment="Center" />
107-
</StackPanel>
108-
</StackPanel>
109-
</StackPanel>
110-
</Grid>
111-
<Border
32+
<Button
33+
Grid.Row="0"
34+
Grid.Column="1"
35+
HorizontalAlignment="Right"
36+
Click="BtnCancel_OnClick"
37+
Style="{StaticResource TitleBarCloseButtonStyle}">
38+
<Path
39+
Width="46"
40+
Height="32"
41+
Data="M 18,11 27,20 M 18,20 27,11"
42+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
43+
StrokeThickness="1">
44+
<Path.Style>
45+
<Style TargetType="Path">
46+
<Style.Triggers>
47+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
48+
<Setter Property="Opacity" Value="0.5" />
49+
</DataTrigger>
50+
</Style.Triggers>
51+
</Style>
52+
</Path.Style>
53+
</Path>
54+
</Button>
55+
56+
<TextBlock
11257
Grid.Row="1"
58+
Grid.Column="0"
59+
Grid.ColumnSpan="2"
60+
Margin="26 12 26 12"
61+
FontSize="20"
62+
FontWeight="SemiBold"
63+
Text="{DynamicResource actionKeywordsTitle}"
64+
TextAlignment="Left" />
65+
<TextBlock
66+
Grid.Row="2"
67+
Grid.Column="0"
68+
Grid.ColumnSpan="2"
69+
Margin="26 0 26 10"
70+
FontSize="14"
71+
Text="{DynamicResource actionkeyword_tips}"
72+
TextAlignment="Left"
73+
TextWrapping="WrapWithOverflow" />
74+
75+
<TextBlock
76+
Grid.Row="3"
77+
Grid.Column="0"
78+
Margin="26 0 10 0"
79+
VerticalAlignment="Center"
80+
FontSize="14"
81+
Text="{DynamicResource currentActionKeywords}" />
82+
<TextBox
83+
x:Name="tbOldActionKeyword"
84+
Grid.Row="3"
85+
Grid.Column="1"
86+
Margin="10 10 26 6"
87+
VerticalAlignment="Center"
88+
FontSize="14"
89+
FontWeight="SemiBold"
90+
Foreground="{DynamicResource Color05B}"
91+
IsReadOnly="True"
92+
Text="List of old keyword(s)" />
93+
94+
<TextBlock
95+
Grid.Row="4"
96+
Grid.Column="0"
97+
Margin="26 6 10 12"
98+
VerticalAlignment="Center"
99+
FontSize="14"
100+
Text="{DynamicResource newActionKeyword}" />
101+
<TextBox
102+
x:Name="tbAction"
103+
Grid.Row="4"
104+
Grid.Column="1"
105+
Margin="10 6 26 10"
106+
VerticalAlignment="Center" />
107+
108+
<Border
109+
Grid.Row="5"
110+
Grid.Column="0"
111+
Grid.ColumnSpan="2"
112+
Margin="0 10 0 0"
113113
Background="{DynamicResource PopupButtonAreaBGColor}"
114114
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
115115
BorderThickness="0 1 0 0">
116116
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
117117
<Button
118118
x:Name="btnCancel"
119119
Width="145"
120-
Height="30"
121-
Margin="10 0 5 0"
120+
Height="38"
121+
Margin="10 0 10 0"
122122
Click="BtnCancel_OnClick"
123123
Content="{DynamicResource cancel}" />
124124
<Button
125125
x:Name="btnDone"
126126
Width="145"
127-
Height="30"
128-
Margin="5 0 10 0"
127+
Height="38"
128+
Margin="10 0 10 0"
129129
Click="btnDone_OnClick"
130130
Style="{StaticResource AccentButtonStyle}">
131131
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />

Flow.Launcher/ActionKeywords.xaml.cs

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public ActionKeywords(PluginViewModel pluginViewModel)
2020

2121
private void ActionKeyword_OnLoaded(object sender, RoutedEventArgs e)
2222
{
23-
tbOldActionKeyword.Text = string.Join(Query.ActionKeywordSeparator, _plugin.Metadata.ActionKeywords.ToArray());
23+
tbOldActionKeyword.Text = string.Join(Query.ActionKeywordSeparator, _plugin.Metadata.ActionKeywords);
24+
tbAction.Text = tbOldActionKeyword.Text;
25+
tbAction.SelectAll();
2426
tbAction.Focus();
2527
}
2628

@@ -33,38 +35,39 @@ private void btnDone_OnClick(object sender, RoutedEventArgs _)
3335
{
3436
var oldActionKeywords = _plugin.Metadata.ActionKeywords;
3537

36-
var newActionKeywords = tbAction.Text.Split(Query.ActionKeywordSeparator).ToList();
37-
newActionKeywords.RemoveAll(string.IsNullOrEmpty);
38-
newActionKeywords = newActionKeywords.Distinct().ToList();
38+
var newActionKeywords = tbAction.Text.Split(Query.ActionKeywordSeparator)
39+
.Where(s => !string.IsNullOrEmpty(s))
40+
.Distinct()
41+
.ToList();
3942

4043
newActionKeywords = newActionKeywords.Count > 0 ? newActionKeywords : new() { Query.GlobalPluginWildcardSign };
4144

4245
var addedActionKeywords = newActionKeywords.Except(oldActionKeywords).ToList();
4346
var removedActionKeywords = oldActionKeywords.Except(newActionKeywords).ToList();
44-
if (!addedActionKeywords.Any(App.API.ActionKeywordAssigned))
47+
48+
if (addedActionKeywords.Any(App.API.ActionKeywordAssigned))
49+
{
50+
App.API.ShowMsgBox(App.API.GetTranslation("newActionKeywordsHasBeenAssigned"));
51+
return;
52+
}
53+
54+
if (oldActionKeywords.Count != newActionKeywords.Count)
4555
{
46-
if (oldActionKeywords.Count != newActionKeywords.Count)
47-
{
48-
ReplaceActionKeyword(_plugin.Metadata.ID, removedActionKeywords, addedActionKeywords);
49-
return;
50-
}
56+
ReplaceActionKeyword(_plugin.Metadata.ID, removedActionKeywords, addedActionKeywords);
57+
return;
58+
}
5159

52-
var sortedOldActionKeywords = oldActionKeywords.OrderBy(s => s).ToList();
53-
var sortedNewActionKeywords = newActionKeywords.OrderBy(s => s).ToList();
60+
var sortedOldActionKeywords = oldActionKeywords.OrderBy(s => s).ToList();
61+
var sortedNewActionKeywords = newActionKeywords.OrderBy(s => s).ToList();
5462

55-
if (sortedOldActionKeywords.SequenceEqual(sortedNewActionKeywords))
56-
{
57-
// User just changes the sequence of action keywords
58-
App.API.ShowMsgBox(App.API.GetTranslation("newActionKeywordsSameAsOld"));
59-
}
60-
else
61-
{
62-
ReplaceActionKeyword(_plugin.Metadata.ID, removedActionKeywords, addedActionKeywords);
63-
}
63+
if (sortedOldActionKeywords.SequenceEqual(sortedNewActionKeywords))
64+
{
65+
// User just changes the sequence of action keywords
66+
App.API.ShowMsgBox(App.API.GetTranslation("newActionKeywordsSameAsOld"));
6467
}
6568
else
6669
{
67-
App.API.ShowMsgBox(App.API.GetTranslation("newActionKeywordsHasBeenAssigned"));
70+
ReplaceActionKeyword(_plugin.Metadata.ID, removedActionKeywords, addedActionKeywords);
6871
}
6972
}
7073

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@
132132
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
133133
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
134134
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
135-
<system:String x:Key="showAtTopmost">Show Search Window at Topmost</system:String>
136-
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>
135+
<system:String x:Key="showAtTopmost">Show Search Window at Foremost</system:String>
136+
<system:String x:Key="showAtTopmostToolTip">Overrides other programs' 'Always on Top' setting and displays Flow in the foremost position.</system:String>
137137
<system:String x:Key="alwaysRunAsAdministrator">Always run as administrator</system:String>
138138
<system:String x:Key="alwaysRunAsAdministratorToolTip">Run Flow Launcher as administrator on startup</system:String>
139139
<system:String x:Key="runAsAdministratorChange">Administrator Mode Change</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,11 @@ private void OnLoaded(object sender, RoutedEventArgs _)
137137
welcomeWindow.Show();
138138
}
139139

140-
if (_settings.ReleaseNotesVersion != Constant.Version)
140+
if (Constant.Version != "1.0.0" && _settings.ReleaseNotesVersion != Constant.Version) // Skip release notes notification for developer builds (version 1.0.0)
141141
{
142142
// Update release notes version
143143
_settings.ReleaseNotesVersion = Constant.Version;
144-
145-
// Display message box with button
144+
// Show release note popup with button
146145
App.API.ShowMsgWithButton(
147146
string.Format(App.API.GetTranslation("appUpdateTitle"), Constant.Version),
148147
App.API.GetTranslation("appUpdateButtonContent"),

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null
404404
}
405405
}
406406

407-
private void OpenUri(Uri uri, bool? inPrivate = null)
407+
private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrowser = false)
408408
{
409-
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
409+
if (forceBrowser || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
410410
{
411411
var browserInfo = _settings.CustomBrowser;
412412

@@ -441,6 +441,16 @@ private void OpenUri(Uri uri, bool? inPrivate = null)
441441
}
442442
}
443443

444+
public void OpenWebUrl(string url, bool? inPrivate = null)
445+
{
446+
OpenUri(new Uri(url), inPrivate, true);
447+
}
448+
449+
public void OpenWebUrl(Uri url, bool? inPrivate = null)
450+
{
451+
OpenUri(url, inPrivate, true);
452+
}
453+
444454
public void OpenUrl(string url, bool? inPrivate = null)
445455
{
446456
OpenUri(new Uri(url), inPrivate);

0 commit comments

Comments
 (0)