mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
commit
15db87ccc9
7 changed files with 31 additions and 35 deletions
|
|
@ -75,10 +75,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
keyword == Settings.SearchActionKeyword,
|
||||
Settings.ActionKeyword.PathSearchActionKeyword => Settings.PathSearchKeywordEnabled &&
|
||||
keyword == Settings.PathSearchActionKeyword,
|
||||
Settings.ActionKeyword.FileContentSearchActionKeyword => keyword ==
|
||||
Settings.FileContentSearchActionKeyword,
|
||||
Settings.ActionKeyword.IndexSearchActionKeyword => Settings.IndexOnlySearchKeywordEnabled &&
|
||||
keyword == Settings.IndexSearchActionKeyword
|
||||
Settings.ActionKeyword.FileContentSearchActionKeyword => Settings.FileContentSearchKeywordEnabled &&
|
||||
keyword == Settings.FileContentSearchActionKeyword,
|
||||
Settings.ActionKeyword.IndexSearchActionKeyword => Settings.IndexSearchKeywordEnabled &&
|
||||
keyword == Settings.IndexSearchActionKeyword
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
using Flow.Launcher.Plugin.Explorer.Search;
|
||||
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
|
||||
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Flow.Launcher.Plugin.Explorer
|
||||
{
|
||||
|
|
@ -25,13 +23,15 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
|
||||
public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword;
|
||||
|
||||
public bool FileContentSearchKeywordEnabled { get; set; } = true;
|
||||
|
||||
public string PathSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
|
||||
|
||||
public bool PathSearchKeywordEnabled { get; set; }
|
||||
|
||||
public string IndexSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
|
||||
|
||||
public bool IndexOnlySearchKeywordEnabled { get; set; }
|
||||
public bool IndexSearchKeywordEnabled { get; set; }
|
||||
|
||||
public bool WarnWindowsSearchServiceOff { get; set; } = true;
|
||||
|
||||
|
|
@ -48,7 +48,8 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
ActionKeyword.SearchActionKeyword => SearchActionKeyword,
|
||||
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword,
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyWord property not found")
|
||||
};
|
||||
|
||||
internal void SetActionKeyword(ActionKeyword actionKeyword, string keyword) => _ = actionKeyword switch
|
||||
|
|
@ -57,23 +58,25 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword = keyword,
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword = keyword,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword = keyword,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyWord property not found")
|
||||
};
|
||||
|
||||
internal bool? GetActionKeywordEnabled(ActionKeyword actionKeyword) => actionKeyword switch
|
||||
internal bool GetActionKeywordEnabled(ActionKeyword actionKeyword) => actionKeyword switch
|
||||
{
|
||||
ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled,
|
||||
ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled,
|
||||
_ => null
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchKeywordEnabled,
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchKeywordEnabled,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyword enabled status not defined")
|
||||
};
|
||||
|
||||
internal void SetActionKeywordEnabled(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch
|
||||
{
|
||||
ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled = enable,
|
||||
ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled = enable,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled = enable,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchKeywordEnabled = enable,
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchKeywordEnabled = enable,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyword enabled status not defined")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -30,8 +30,7 @@
|
|||
<CheckBox Name="ChkActionKeywordEnabled" ToolTip="{DynamicResource plugin_explorer_actionkeyword_enabled_tooltip}"
|
||||
Margin="10" Grid.Row="0" Grid.Column="2" Content="{DynamicResource plugin_explorer_actionkeyword_enabled}"
|
||||
Width="auto"
|
||||
VerticalAlignment="Center" IsChecked="{Binding Enabled}"
|
||||
Visibility="{Binding Visible}"/>
|
||||
VerticalAlignment="Center" IsChecked="{Binding Enabled}" />
|
||||
<Button Name="DownButton"
|
||||
Click="OnDoneButtonClick" Grid.Row="1" Grid.Column="2"
|
||||
Margin="10 0 10 0" Width="80" Height="35"
|
||||
|
|
|
|||
|
|
@ -19,22 +19,18 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
|
||||
public string ActionKeyword
|
||||
{
|
||||
get => _actionKeyword;
|
||||
get => actionKeyword;
|
||||
set
|
||||
{
|
||||
// Set Enable to be true if user change ActionKeyword
|
||||
if (Enabled is not null)
|
||||
Enabled = true;
|
||||
_actionKeyword = value;
|
||||
Enabled = true;
|
||||
actionKeyword = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool? Enabled { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
private string _actionKeyword;
|
||||
|
||||
public Visibility Visible =>
|
||||
CurrentActionKeyword.Enabled is not null ? Visibility.Visible : Visibility.Collapsed;
|
||||
private string actionKeyword;
|
||||
|
||||
public ActionKeywordSetting(SettingsViewModel settingsViewModel,
|
||||
ActionKeywordView selectedActionKeyword)
|
||||
|
|
@ -74,8 +70,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
|
||||
var oldActionKeyword = CurrentActionKeyword.Keyword;
|
||||
|
||||
// == because of nullable
|
||||
if (Enabled == false || !settingsViewModel.IsActionKeywordAlreadyAssigned(ActionKeyword))
|
||||
if (!Enabled || !settingsViewModel.IsActionKeywordAlreadyAssigned(ActionKeyword))
|
||||
{
|
||||
// Update View Data
|
||||
CurrentActionKeyword.Keyword = Enabled == true ? ActionKeyword : Query.GlobalPluginWildcardSign;
|
||||
|
|
@ -84,7 +79,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
switch (Enabled)
|
||||
{
|
||||
// reset to global so it does not take up an action keyword when disabled
|
||||
// not for null Enable plugin
|
||||
// not for null Enable plugin
|
||||
case false when oldActionKeyword != Query.GlobalPluginWildcardSign:
|
||||
settingsViewModel.UpdateActionKeyword(CurrentActionKeyword.KeywordProperty,
|
||||
Query.GlobalPluginWildcardSign, oldActionKeyword);
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
}
|
||||
|
||||
public string Description { get; private init; }
|
||||
public string Color => Enabled ?? true ? "Black" : "Gray";
|
||||
public string Color => Enabled ? "Black" : "Gray";
|
||||
|
||||
internal Settings.ActionKeyword KeywordProperty { get; }
|
||||
|
||||
|
|
@ -335,11 +335,10 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
set => _settings.SetActionKeyword(KeywordProperty, value);
|
||||
}
|
||||
|
||||
public bool? Enabled
|
||||
public bool Enabled
|
||||
{
|
||||
get => _settings.GetActionKeywordEnabled(KeywordProperty);
|
||||
set => _settings.SetActionKeywordEnabled(KeywordProperty,
|
||||
value ?? throw new ArgumentException("Unexpected null value"));
|
||||
set => _settings.SetActionKeywordEnabled(KeywordProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
"Name": "Explorer",
|
||||
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
|
||||
"Author": "Jeremy Wu",
|
||||
"Version": "1.8.4",
|
||||
"Version": "1.8.5",
|
||||
"Language": "csharp",
|
||||
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
|
||||
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
version: '1.8.2.{build}'
|
||||
version: '1.8.3.{build}'
|
||||
|
||||
init:
|
||||
- ps: |
|
||||
|
|
@ -79,5 +79,5 @@ on_success:
|
|||
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq "true")
|
||||
{
|
||||
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
||||
.\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-v$env:flowVersion.exe -v $env:flowVersion -t $env:winget_token
|
||||
.\wingetcreate.exe update Flow-Launcher.Flow-Launcher -s true -u https://github.com/Flow-Launcher/Flow.Launcher/releases/download/v$env:flowVersion/Flow-Launcher-Setup.exe -v $env:flowVersion -t $env:winget_token
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue