Skip to content

Commit

Permalink
some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Dec 12, 2023
1 parent 8e45cdb commit 0ee8318
Show file tree
Hide file tree
Showing 16 changed files with 177 additions and 46 deletions.
8 changes: 8 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

# v7.0.0.2 Beta (2023-12-??)

- Fix dynamic menu items missing in context menu.
- Fix certain binding setups shown poorly or incorrect in the main menu.
- Fix conf editor not remembering the search text.
- Fix quit-watch-later not working.
- New zhongfly libmpv build.

# v7.0.0.1 Beta (2023-12-11)

- [.NET 6 is a new requirement](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
Expand Down
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<EntryPointProjectUniqueName>..\mpv.net.csproj</EntryPointProjectUniqueName>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<EntryPointProjectUniqueName>..\MpvNet.Windows\MpvNet.Windows.csproj</EntryPointProjectUniqueName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AppxBundle>Always</AppxBundle>
Expand All @@ -43,20 +43,16 @@
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="..\bin\MediaInfo.dll">
<Link>mpv.net\MediaInfo.dll</Link>
<Content Include="..\MpvNet.Windows\bin\Debug\libmpv-2.dll">
<Link>libmpv-2.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\bin\Microsoft.Management.Infrastructure.dll">
<Link>mpv.net\Microsoft.Management.Infrastructure.dll</Link>
<Content Include="..\MpvNet.Windows\bin\Debug\MediaInfo.dll">
<Link>MediaInfo.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\bin\libmpv-2.dll">
<Link>mpv.net\libmpv-2.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\bin\mpvnet.com">
<Link>mpv.net\mpvnet.com</Link>
<Content Include="..\MpvNet.Windows\bin\Debug\mpvnet.com">
<Link>mpvnet.com</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Images\SplashScreen.scale-200.png" />
Expand All @@ -66,13 +62,12 @@
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Images\StoreLogo.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
<None Include="Package.StoreAssociation.xml" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.19041.8" PrivateAssets="all" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mpv.net.csproj" />
<ProjectReference Include="..\MpvNet.Windows\MpvNet.Windows.csproj" />
</ItemGroup>
</Project>
File renamed without changes.
14 changes: 9 additions & 5 deletions src/MpvNet.Windows/MpvNet.Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>mpv-icon.ico</ApplicationIcon>
<Product>mpv.net</Product>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<FileVersion>7.0.0.1</FileVersion>
<AssemblyVersion>7.0.0.1</AssemblyVersion>
<InformationalVersion>7.0.0.1</InformationalVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Misc\**" />
<EmbeddedResource Remove="Misc\**" />
<None Remove="Misc\**" />
<Page Remove="Misc\**" />
</ItemGroup>

<ItemGroup>
<Content Include="mpv-icon.ico" />
</ItemGroup>
Expand All @@ -38,8 +46,4 @@
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
</ItemGroup>

<ItemGroup>
<Folder Include="Misc\" />
</ItemGroup>

</Project>
13 changes: 5 additions & 8 deletions src/MpvNet.Windows/WPF/ConfWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public ConfWindow()
InitialContent = GetCompareString();

if (string.IsNullOrEmpty(App.Settings.ConfigEditorSearch))
SearchControl.Text = "General:";
SearchText = "General:";
else
SearchControl.Text = App.Settings.ConfigEditorSearch;
SearchText = App.Settings.ConfigEditorSearch;

foreach (var node in Nodes)
SelectNodeFromSearchText(node);
Expand Down Expand Up @@ -155,7 +155,7 @@ void LoadSettings()
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
App.Settings.ConfigEditorSearch = SearchControl.Text;
App.Settings.ConfigEditorSearch = SearchText;

if (InitialContent == GetCompareString())
return;
Expand Down Expand Up @@ -319,9 +319,6 @@ string GetContent(string filename)
}
}

if (!sb.ToString().Contains("# Editor"))
sb.AppendLine("# Editor");

foreach (Setting setting in Settings)
{
if (filename != setting.File || namesWritten.Contains(setting.Name!))
Expand Down Expand Up @@ -443,7 +440,7 @@ void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<

void SelectNodeFromSearchText(NodeViewModel node)
{
if (node.Path + ":" == SearchControl.Text)
if (node.Path + ":" == SearchText)
{
node.IsSelected = true;
return;
Expand All @@ -470,7 +467,7 @@ void ExpandNode(NodeViewModel node)
ExpandNode(it);
}

[RelayCommand] void ShowMpvNetSpecificSettings() => SearchControl.Text = "mpv.net";
[RelayCommand] void ShowMpvNetSpecificSettings() => SearchText = "mpv.net";

[RelayCommand] void PreviewMpvConfFile() => Msg.ShowInfo(GetContent("mpv"));

Expand Down
34 changes: 16 additions & 18 deletions src/MpvNet.Windows/WinForms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public partial class MainForm : Form
public SnapManager SnapManager = new SnapManager();
public IntPtr MpvWindowHandle { get; set; }
public ElementHost? CommandPaletteHost { get; set; }
public Dictionary<string, WpfControls.MenuItem> MenuItemDuplicate = new Dictionary<string, WpfControls.MenuItem>();
public bool WasShown { get; set; }
public static MainForm? Instance { get; set; }
WpfControls.ContextMenu ContextMenu { get; } = new WpfControls.ContextMenu();
Expand Down Expand Up @@ -286,7 +285,7 @@ void UpdateMenu()

lock (Player.MediaTracksLock)
{
var trackMenuItem = FindMenuItem(_("Track"));
var trackMenuItem = FindMenuItem(_("Track"), "Track");

if (trackMenuItem != null)
{
Expand Down Expand Up @@ -348,7 +347,7 @@ void UpdateMenu()
}
}

var chaptersMenuItem = FindMenuItem(_("Chapter"));
var chaptersMenuItem = FindMenuItem(_("Chapter"), "Chapters");

if (chaptersMenuItem != null)
{
Expand All @@ -369,7 +368,7 @@ void UpdateMenu()
}
}

var recentMenuItem = FindMenuItem(_("Recent Files"));
var recentMenuItem = FindMenuItem(_("Recent Files"), "Recent");

if (recentMenuItem != null)
{
Expand All @@ -391,7 +390,7 @@ void UpdateMenu()
recentMenuItem.Items.Add(clearMenuItem);
}

var titlesMenuItem = FindMenuItem(_("Title"));
var titlesMenuItem = FindMenuItem(_("Title"), "Titles");

if (titlesMenuItem != null)
{
Expand Down Expand Up @@ -424,7 +423,7 @@ void UpdateMenu()
}
}

var profilesMenuItem = FindMenuItem(_("Profile"));
var profilesMenuItem = FindMenuItem(_("Profile"), "Profile");

if (profilesMenuItem != null && !profilesMenuItem.HasItems)
{
Expand All @@ -446,7 +445,7 @@ void UpdateMenu()
}
}

var customMenuItem = FindMenuItem(_("Custom"));
var customMenuItem = FindMenuItem(_("Custom"), "Custom");

if (customMenuItem != null)
{
Expand Down Expand Up @@ -476,7 +475,14 @@ void UpdateMenu()
}
}

public WpfControls.MenuItem? FindMenuItem(string text) => FindMenuItem(text, ContextMenu.Items);
public WpfControls.MenuItem? FindMenuItem(string text, string text2 = "") {
var ret = FindMenuItem(text, ContextMenu.Items);

if (ret == null && text2 != "")
return FindMenuItem(text2, ContextMenu.Items);

return ret;
}

WpfControls.MenuItem? FindMenuItem(string text, WpfControls.ItemCollection? items)
{
Expand Down Expand Up @@ -767,27 +773,19 @@ public void InitAndBuildContextMenu()

var (menuBindings, confBindings) = App.InputConf.GetBindings();
_confBindings = confBindings;
var activeBindings = InputHelp.GetActiveBindings(menuBindings);

foreach (Binding binding in menuBindings)
{
Binding tempBinding = binding;

if (MenuItemDuplicate.ContainsKey(tempBinding.Command) && tempBinding.Input != "")
{
var mi = MenuItemDuplicate[tempBinding.Command];
mi.InputGestureText = mi.InputGestureText + ", " + tempBinding.Input;
}

if (!binding.IsMenu)
continue;

var menuItem = MenuHelp.Add(ContextMenu.Items, tempBinding.Comment);

if (menuItem != null)
{
if (tempBinding.Input != "")
MenuItemDuplicate[tempBinding.Command] = menuItem;

menuItem.Click += (sender, args) => {
try {
TaskHelp.Run(() => {
Expand All @@ -803,7 +801,7 @@ public void InitAndBuildContextMenu()
}
};

menuItem.InputGestureText = tempBinding.Input;
menuItem.InputGestureText = InputHelp.GetBindingsForCommand(activeBindings, tempBinding.Command);
}
}

Expand Down
88 changes: 88 additions & 0 deletions src/MpvNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,112 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NGettext.Wpf", "NGettext.Wpf\NGettext.Wpf.csproj", "{0B7958FD-2138-482A-A21B-481AE7A0F851}"
EndProject
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "MSIX", "MSIX\MSIX.wapproj", "{81DAEE3A-76FF-4494-9384-D28A651D70BB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM.ActiveCfg = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM.Build.0 = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|ARM64.Build.0 = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x64.ActiveCfg = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x64.Build.0 = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x86.ActiveCfg = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Debug|x86.Build.0 = Debug|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|Any CPU.Build.0 = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM.ActiveCfg = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM.Build.0 = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM64.ActiveCfg = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|ARM64.Build.0 = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x64.ActiveCfg = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x64.Build.0 = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x86.ActiveCfg = Release|Any CPU
{ADC341B5-863A-4DFB-9352-475518FABE91}.Release|x86.Build.0 = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM.ActiveCfg = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM.Build.0 = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|ARM64.Build.0 = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x64.ActiveCfg = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x64.Build.0 = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x86.ActiveCfg = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Debug|x86.Build.0 = Debug|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|Any CPU.Build.0 = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM.ActiveCfg = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM.Build.0 = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM64.ActiveCfg = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|ARM64.Build.0 = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x64.ActiveCfg = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x64.Build.0 = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x86.ActiveCfg = Release|Any CPU
{0B524801-DA28-433F-808D-3F74EF81EB53}.Release|x86.Build.0 = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM.ActiveCfg = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM.Build.0 = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|ARM64.Build.0 = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x64.ActiveCfg = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x64.Build.0 = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x86.ActiveCfg = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Debug|x86.Build.0 = Debug|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|Any CPU.Build.0 = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM.ActiveCfg = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM.Build.0 = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM64.ActiveCfg = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|ARM64.Build.0 = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x64.ActiveCfg = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x64.Build.0 = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x86.ActiveCfg = Release|Any CPU
{0B7958FD-2138-482A-A21B-481AE7A0F851}.Release|x86.Build.0 = Release|Any CPU
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.ActiveCfg = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.Build.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|Any CPU.Deploy.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM.ActiveCfg = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM.Build.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM.Deploy.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM64.ActiveCfg = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM64.Build.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|ARM64.Deploy.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.ActiveCfg = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.Build.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x64.Deploy.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x86.ActiveCfg = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x86.Build.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Debug|x86.Deploy.0 = Debug|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.ActiveCfg = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.Build.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|Any CPU.Deploy.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM.ActiveCfg = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM.Build.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM.Deploy.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM64.ActiveCfg = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM64.Build.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|ARM64.Deploy.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.ActiveCfg = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.Build.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x64.Deploy.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x86.ActiveCfg = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x86.Build.0 = Release|x64
{81DAEE3A-76FF-4494-9384-D28A651D70BB}.Release|x86.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 0ee8318

Please sign in to comment.