-
-
Notifications
You must be signed in to change notification settings - Fork 455
Add Plugin Priority Settings #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e790e94
Add Plugin Priority Settings
taooceros bcb144e
change autogenerated summary to english
taooceros 6f43d4f
remove extra space
taooceros 3ba1bf6
Use l18n instead of static string
taooceros 012d2d0
Merge remote-tracking branch 'origin/dev' into PluginPriority
jjw24 777b0b9
Merge remote-tracking branch 'origin/dev' into PluginPriority
jjw24 b97834d
update message + window location
jjw24 b1642cc
priority score variable for clarity and seperation from original score
jjw24 b9158e5
update typo
jjw24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,45 @@ | ||
| <Window x:Class="Flow.Launcher.PriorityChangeWindow" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:local="clr-namespace:Flow.Launcher" | ||
| Loaded="PriorityChangeWindow_Loaded" | ||
| mc:Ignorable="d" | ||
| WindowStartupLocation="CenterScreen" | ||
| Title="PriorityChangeWindow" Height="250" Width="300"> | ||
| <Grid> | ||
| <Grid.RowDefinitions> | ||
| <RowDefinition /> | ||
| <RowDefinition Height="60"/> | ||
| <RowDefinition Height="75"/> | ||
| <RowDefinition /> | ||
| </Grid.RowDefinitions> | ||
| <Grid.ColumnDefinitions> | ||
| <ColumnDefinition Width="20" /> | ||
| <ColumnDefinition /> | ||
| </Grid.ColumnDefinitions> | ||
| <TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" | ||
| HorizontalAlignment="Left" Text="{DynamicResource currentPriority}" /> | ||
| <TextBlock x:Name="OldPriority" Grid.Row="0" Grid.Column="1" Margin="170 10 10 10" FontSize="14" | ||
| VerticalAlignment="Center" HorizontalAlignment="Left" /> | ||
|
|
||
| <TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" | ||
| HorizontalAlignment="Left" Text="{DynamicResource newPriority}" /> | ||
| <StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1"> | ||
| <TextBox x:Name="tbAction" Margin="140 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" /> | ||
| </StackPanel> | ||
|
|
||
| <TextBlock Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Foreground="Gray" | ||
| Text="{DynamicResource priority_tips}" TextWrapping="Wrap" | ||
| Margin="0,0,20,0"/> | ||
|
|
||
| <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="3" Grid.Column="1"> | ||
| <Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="30" | ||
| Content="{DynamicResource cancel}" /> | ||
| <Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="30" Click="btnDone_OnClick"> | ||
| <TextBlock x:Name="lblAdd" Text="{DynamicResource done}" /> | ||
| </Button> | ||
| </StackPanel> | ||
| </Grid> | ||
| </Window> |
This file contains hidden or 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,69 @@ | ||
| using Flow.Launcher.Core.Plugin; | ||
| using Flow.Launcher.Core.Resource; | ||
| using Flow.Launcher.Infrastructure.UserSettings; | ||
| using Flow.Launcher.Plugin; | ||
| using Flow.Launcher.ViewModel; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
| using System.Windows; | ||
| using System.Windows.Controls; | ||
| using System.Windows.Data; | ||
| using System.Windows.Documents; | ||
| using System.Windows.Input; | ||
| using System.Windows.Media; | ||
| using System.Windows.Media.Imaging; | ||
| using System.Windows.Shapes; | ||
|
|
||
| namespace Flow.Launcher | ||
| { | ||
| /// <summary> | ||
| /// Interaction Logic of PriorityChangeWindow.xaml | ||
| /// </summary> | ||
| public partial class PriorityChangeWindow : Window | ||
| { | ||
| private readonly PluginPair plugin; | ||
| private Settings settings; | ||
| private readonly Internationalization translater = InternationalizationManager.Instance; | ||
| private readonly PluginViewModel pluginViewModel; | ||
|
|
||
| public PriorityChangeWindow(string pluginId, Settings settings, PluginViewModel pluginViewModel) | ||
| { | ||
| InitializeComponent(); | ||
| plugin = PluginManager.GetPluginForId(pluginId); | ||
| this.settings = settings; | ||
| this.pluginViewModel = pluginViewModel; | ||
| if (plugin == null) | ||
| { | ||
| MessageBox.Show(translater.GetTranslation("cannotFindSpecifiedPlugin")); | ||
| Close(); | ||
| } | ||
| } | ||
|
|
||
| private void BtnCancel_OnClick(object sender, RoutedEventArgs e) | ||
| { | ||
| Close(); | ||
| } | ||
|
|
||
| private void btnDone_OnClick(object sender, RoutedEventArgs e) | ||
| { | ||
| if (int.TryParse(tbAction.Text.Trim(), out var newPriority)) | ||
| { | ||
| pluginViewModel.ChangePriority(newPriority); | ||
| Close(); | ||
| } | ||
| else | ||
| { | ||
| string msg = translater.GetTranslation("invalidPriority"); | ||
| MessageBox.Show(msg); | ||
| } | ||
|
|
||
taooceros marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| private void PriorityChangeWindow_Loaded(object sender, RoutedEventArgs e) | ||
| { | ||
| OldPriority.Text = pluginViewModel.Priority.ToString(); | ||
| tbAction.Focus(); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -91,7 +91,7 @@ public List<Result> Query(Query query) | |
| }; | ||
| } | ||
| } | ||
| catch | ||
| catch (Exception) | ||
| { | ||
| // ignored | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.