[Launcher] Remove Win+R checkbox (#2513)

* Remove Win+R

* Comment out all unused options

* Fix PowerLauncherViewModel tests
This commit is contained in:
Tomas Agustin Raies
2020-05-01 15:58:55 -07:00
committed by GitHub
parent f44109abae
commit 1656b4c5b9
3 changed files with 22 additions and 34 deletions

View File

@@ -54,7 +54,7 @@
<TextBlock x:Uid="PowerLauncher_SearchResults"
Style="{StaticResource SettingsGroupTitleStyle}"/>
<ComboBox x:Uid="PowerLauncher_SearchResultPreference"
<!--<ComboBox x:Uid="PowerLauncher_SearchResultPreference"
MinWidth="320"
Margin="{StaticResource SmallTopMargin}"
ItemsSource="{x:Bind searchResultPreferencesOptions}"
@@ -72,7 +72,7 @@
SelectedValuePath="Item2"
DisplayMemberPath="Item1"
IsEnabled="False"
/>
/>-->
<muxc:NumberBox x:Uid="PowerLauncher_MaximumNumberOfResults"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.MaximumNumberOfResults}"
@@ -95,7 +95,7 @@
HotkeySettings="{x:Bind Path=ViewModel.OpenPowerLauncher, Mode=TwoWay}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
/>
<Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenFileLocation"
<!--<Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenFileLocation"
Width="320"
HorizontalAlignment="Left"
Margin="{StaticResource SmallTopMargin}"
@@ -115,19 +115,19 @@
Margin="{StaticResource SmallTopMargin}"
HotkeySettings="{x:Bind Path=ViewModel.OpenConsole, Mode=TwoWay}"
IsEnabled="False"
/>
/>-->
<CheckBox x:Uid="PowerLauncher_OverrideWinRKey"
<!--<CheckBox x:Uid="PowerLauncher_OverrideWinRKey"
Margin="{StaticResource SmallTopMargin}"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideWinRKey}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
/>
IsChecked="False"
IsEnabled="False"
/>-->
<CheckBox x:Uid="PowerLauncher_OverrideWinSKey"
<!--<CheckBox x:Uid="PowerLauncher_OverrideWinSKey"
Margin="{StaticResource SmallTopMargin}"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideWinSKey}"
IsEnabled="False"
/>
/>-->
</StackPanel>
<StackPanel
x:Name="SidePanel"

View File

@@ -13,15 +13,6 @@ namespace ViewModelTests
[TestClass]
public class PowerLauncher
{
class PowerLauncherSettingsMock : PowerLauncherSettings
{
public int TimesSaved { get; set; }
public override void Save()
{
TimesSaved++;
}
}
class SendCallbackMock
{
public int TimesSent { get; set; }
@@ -31,14 +22,14 @@ namespace ViewModelTests
}
}
private PowerLauncherViewModel viewModel;
private PowerLauncherSettingsMock mockSettings;
private PowerLauncherSettings mockSettings;
private SendCallbackMock sendCallbackMock;
[TestInitialize]
public void Initialize()
{
mockSettings = new PowerLauncherSettingsMock();
mockSettings = new PowerLauncherSettings();
sendCallbackMock = new SendCallbackMock();
viewModel = new PowerLauncherViewModel(
@@ -54,19 +45,17 @@ namespace ViewModelTests
viewModel.SearchTypePreference = "SearchOptionsAreNotValidated";
Assert.AreEqual(sendCallbackMock.TimesSent, 2);
Assert.AreEqual(mockSettings.TimesSaved, 2);
Assert.IsTrue(mockSettings.properties.search_result_preference == "SearchOptionsAreNotValidated");
Assert.IsTrue(mockSettings.properties.search_type_preference == "SearchOptionsAreNotValidated");
}
public void AssertHotkeySettings(HotkeySettings setting, bool win, bool ctrl, bool alt, bool shift, int code)
{
Assert.AreEqual(setting.Win, win);
Assert.AreEqual(setting.Ctrl, ctrl);
Assert.AreEqual(setting.Alt, alt);
Assert.AreEqual(setting.Shift, shift);
Assert.AreEqual(setting.Code, code);
Assert.AreEqual(win, setting.Win);
Assert.AreEqual(ctrl, setting.Ctrl);
Assert.AreEqual(alt, setting.Alt);
Assert.AreEqual(shift, setting.Shift);
Assert.AreEqual(code, setting.Code);
}
[TestMethod]
@@ -94,8 +83,7 @@ namespace ViewModelTests
viewModel.OpenConsole = openConsole;
viewModel.CopyPathLocation = copyFileLocation;
Assert.AreEqual(mockSettings.TimesSaved, 4);
Assert.AreEqual(sendCallbackMock.TimesSent, 4);
Assert.AreEqual(4, sendCallbackMock.TimesSent);
AssertHotkeySettings(
mockSettings.properties.open_powerlauncher,
@@ -138,8 +126,7 @@ namespace ViewModelTests
viewModel.OverrideWinSKey = false;
Assert.AreEqual(sendCallbackMock.TimesSent, 1);
Assert.AreEqual(mockSettings.TimesSaved, 1);
Assert.AreEqual(1, sendCallbackMock.TimesSent);
Assert.IsTrue(mockSettings.properties.override_win_r_key);
Assert.IsFalse(mockSettings.properties.override_win_s_key);