Compare commits

..

1 Commits

Author SHA1 Message Date
Gordon Lam (SH)
d868a85b87 Add Version 2025-06-13 18:53:02 +08:00
15 changed files with 18 additions and 86 deletions

View File

@@ -394,7 +394,10 @@ jobs:
testAssemblyVer2: |
**\KeyboardManagerEngineTest.dll
**\KeyboardManagerEditorTest.dll
**\*UnitTest*.dll
**\UnitTests-CommonLib.dll
**\PowerRenameUnitTests.dll
**\UnitTests-FancyZones.dll
**\\WorkspacesLibUnitTests.dll
!**\obj\**
- pwsh: |-

View File

@@ -133,6 +133,11 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<ItemGroup>
<ProjectReference Include="..\version\version.vcxproj">
<Project>{cc6e41ac-8174-4e8a-8d22-85dd7f4851df}</Project>
</ProjectReference>
</ItemGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>

View File

@@ -117,18 +117,16 @@ private:
for (DWORD pid : processIds)
{
HANDLE hProcess = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, FALSE, pid);
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
if (hProcess != NULL)
{
SetEvent(m_hTerminateEvent);
// Wait for 1.5 seconds for the process to end correctly, allowing time for ETW tracer and extensions to stop
if (WaitForSingleObject(hProcess, 1500) == WAIT_TIMEOUT)
{
TerminateProcess(hProcess, 0);
}
// Wait for 1.5 seconds for the process to end correctly and stop etw tracer
WaitForSingleObject(hProcess, 1500);
TerminateProcess(hProcess, 0);
CloseHandle(hProcess);
}
}

View File

@@ -102,8 +102,6 @@ public sealed partial class TopLevelViewModel : ObservableObject, IListItem
}
HandleChangeAlias();
OnPropertyChanged(nameof(AliasText));
OnPropertyChanged(nameof(IsDirectAlias));
}
}
@@ -118,7 +116,6 @@ public sealed partial class TopLevelViewModel : ObservableObject, IListItem
}
HandleChangeAlias();
OnPropertyChanged(nameof(IsDirectAlias));
}
}

View File

@@ -67,7 +67,6 @@ public partial class App : Application
"Local\\PowerToysCmdPal-ExitEvent-eb73f6be-3f22-4b36-aee3-62924ba40bfd", () =>
{
EtwTrace?.Dispose();
AppWindow?.Close();
Environment.Exit(0);
});
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<Page
x:Class="Microsoft.CmdPal.UI.Settings.ExtensionPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
@@ -92,11 +92,12 @@
<controls:SettingsCard x:Uid="Settings_ExtensionPage_Alias_SettingsCard" HeaderIcon="{ui:FontIcon Glyph=&#xE8AC;}">
<StackPanel Orientation="Vertical">
<TextBox Text="{x:Bind AliasText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Text="{x:Bind AliasText, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="Settings_ExtensionPage_Alias_ToggleSwitch"
IsEnabled="{x:Bind AliasText, Converter={StaticResource StringEmptyToBoolConverter}, Mode=OneWay}"
IsOn="{x:Bind IsDirectAlias, Mode=TwoWay}" />
IsOn="{x:Bind IsDirectAlias, Mode=TwoWay}"
OffContent="Indirect"
OnContent="Direct" />
</StackPanel>
</controls:SettingsCard>

View File

@@ -418,10 +418,4 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
<data name="TrayMenu_Exit" xml:space="preserve">
<value>Exit</value>
</data>
<data name="Settings_ExtensionPage_Alias_ToggleSwitch.OnContent" xml:space="preserve">
<value>Direct</value>
</data>
<data name="Settings_ExtensionPage_Alias_ToggleSwitch.OffContent" xml:space="preserve">
<value>Indirect</value>
</data>
</root>

View File

@@ -89,11 +89,6 @@ public:
*cmdState = ECS_HIDDEN;
return S_OK;
}
// Hide MSIX handler to prevent duplicate context menu entries
// The traditional handler provides the context menu functionality
*cmdState = ECS_HIDDEN;
return S_OK;
// Hide if the file is not an image
*cmdState = ECS_HIDDEN;
// Suppressing C26812 warning as the issue is in the shtypes.h library

View File

@@ -63,7 +63,6 @@ CSettings::CSettings()
void CSettings::Save()
{
json::JsonObject jsonData;
jsonData.SetNamedValue(L"extendedContextMenuOnly", json::value(settings.extendedContextMenuOnly));
json::to_file(jsonFilePath, jsonData);
GetSystemTimeAsFileTime(&lastLoadedTime);
@@ -134,7 +133,6 @@ void CSettings::ParseJson()
try
{
// NB: add any new settings here
json::get(jsonSettings, L"extendedContextMenuOnly", settings.extendedContextMenuOnly, false);
}
catch (const winrt::hresult_error&)
{

View File

@@ -19,16 +19,6 @@ public:
return settings.enabled;
}
inline bool GetExtendedContextMenuOnly() const
{
return settings.extendedContextMenuOnly;
}
inline void SetExtendedContextMenuOnly(bool extendedOnly)
{
settings.extendedContextMenuOnly = extendedOnly;
}
void Save();
void Load();
@@ -36,7 +26,6 @@ private:
struct Settings
{
bool enabled{ true };
bool extendedContextMenuOnly{ false }; // Disabled by default.
};
void RefreshEnabledState();

View File

@@ -70,10 +70,6 @@ HRESULT CContextMenuHandler::QueryContextMenu(_In_ HMENU hmenu, UINT indexMenu,
if (!CSettingsInstance().GetEnabled())
return E_FAIL;
// Check if we should only be on the extended context menu
if (CSettingsInstance().GetExtendedContextMenuOnly() && (!(uFlags & CMF_EXTENDEDVERBS)))
return E_FAIL;
// NB: We just check the first item. We could iterate through more if the first one doesn't meet the criteria
HDropIterator i(m_pdtobj);
i.First();

View File

@@ -27,7 +27,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
ImageresizerKeepDateModified = new BoolProperty();
ImageresizerFallbackEncoder = new StringProperty(new System.Guid("19e4a5aa-5662-4fc5-a0c0-1758028e1057").ToString());
ImageresizerCustomSize = new ImageResizerCustomSizeProperty(new ImageSize(4, "custom", ResizeFit.Fit, 1024, 640, ResizeUnit.Pixel));
ImageresizerExtendedContextMenuOnly = new BoolProperty(false);
}
public ImageResizerProperties(Func<string, string> resourceLoader)
@@ -85,9 +84,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[CmdConfigureIgnoreAttribute]
public ImageResizerCustomSizeProperty ImageresizerCustomSize { get; set; }
[JsonPropertyName("imageresizer_extendedContextMenuOnly")]
public BoolProperty ImageresizerExtendedContextMenuOnly { get; set; }
public string ToJsonString()
{
return JsonSerializer.Serialize(this);

View File

@@ -48,21 +48,6 @@
</InfoBar.IconSource>
</InfoBar>
<controls:SettingsGroup x:Uid="ImageResizer_ShellIntegration" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsExpander x:Uid="ImageResizer_Toggle_ContextMenu" IsExpanded="False">
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind ViewModel.ExtendedContextMenuOnly, Mode=TwoWay, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBoxItem x:Uid="ImageResizer_Toggle_StandardContextMenu" />
<ComboBoxItem x:Uid="ImageResizer_Toggle_ExtendedContextMenu" />
</ComboBox>
</tkcontrols:SettingsExpander>
<InfoBar
x:Uid="ExtendedContextMenuInfo"
IsClosable="False"
IsOpen="True"
IsTabStop="False"
Severity="Informational" />
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="ImageResizer_CustomSizes" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsCard x:Uid="ImageResizer_Presets" HeaderIcon="{ui:FontIcon Glyph=&#xE792;}">
<Button

View File

@@ -1406,18 +1406,6 @@
<data name="ImageResizer_UseResizeDate.Content" xml:space="preserve">
<value>Timestamp of resize action</value>
</data>
<data name="ImageResizer_ShellIntegration.Header" xml:space="preserve">
<value>Shell integration</value>
</data>
<data name="ImageResizer_Toggle_ContextMenu.Header" xml:space="preserve">
<value>Show Image Resizer in</value>
</data>
<data name="ImageResizer_Toggle_StandardContextMenu.Content" xml:space="preserve">
<value>Default and extended context menu</value>
</data>
<data name="ImageResizer_Toggle_ExtendedContextMenu.Content" xml:space="preserve">
<value>Extended context menu only</value>
</data>
<data name="Encoding.Header" xml:space="preserve">
<value>Encoding</value>
</data>

View File

@@ -94,7 +94,6 @@ public partial class ImageResizerViewModel : Observable
FileName = Settings.Properties.ImageresizerFileName.Value;
KeepDateModified = Settings.Properties.ImageresizerKeepDateModified.Value;
Encoder = GetEncoderIndex(Settings.Properties.ImageresizerFallbackEncoder.Value);
ExtendedContextMenuOnly = Settings.Properties.ImageresizerExtendedContextMenuOnly.Value;
_customSize = Settings.Properties.ImageresizerCustomSize.Value;
@@ -126,7 +125,6 @@ public partial class ImageResizerViewModel : Observable
private string _fileName;
private bool _keepDateModified;
private int _encoderGuidId;
private bool _extendedContextMenuOnly;
public bool IsListViewFocusRequested { get; set; }
@@ -287,16 +285,6 @@ public partial class ImageResizerViewModel : Observable
}
}
public bool ExtendedContextMenuOnly
{
get => _extendedContextMenuOnly;
set
{
SetProperty(ref _extendedContextMenuOnly, value, v => Settings.Properties.ImageresizerExtendedContextMenuOnly.Value = v);
}
}
public int Encoder
{
get => _encoderGuidId;