JAWMP LYSTS

This commit is contained in:
goyuken 2013-12-13 04:57:14 +00:00
parent c7b582b744
commit 4b9b11c887
4 changed files with 55 additions and 1 deletions

View File

@ -88,7 +88,8 @@ namespace BizHawk.Client.Common
RealFirmwareReader reader = new RealFirmwareReader();
//build a list of files under the global firmwares path, and build a hash for each of them while we're at it
var todo = new Queue<DirectoryInfo>(new[] { new DirectoryInfo(Global.Config.PathEntries.FirmwaresPath) });
var todo = new Queue<DirectoryInfo>();
todo.Enqueue(new DirectoryInfo(PathManager.MakeAbsolutePath(Global.Config.PathEntries.FirmwaresPath, null)));
while (todo.Count != 0)
{

View File

@ -78,12 +78,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
@ -99,6 +101,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\SlimDX.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersionInfo.cs">
@ -350,6 +353,7 @@
<Compile Include="Input\GamePad.cs" Condition=" '$(OS)' == 'Windows_NT' " />
<Compile Include="Input\GamePad360.cs" />
<Compile Include="Input\Input.cs" />
<Compile Include="JumpLists.cs" />
<Compile Include="LogConsole.cs" />
<Compile Include="LogWindow.cs">
<SubType>Form</SubType>

View File

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Shell;
using System.IO;
using System.Reflection;
namespace BizHawk.Client.EmuHawk
{
public class JumpLists
{
static Application _app;
static JumpLists()
{
_app = new Application();
var jmp = new JumpList();
jmp.ShowRecentCategory = true;
JumpList.SetJumpList(_app, jmp);
}
/// <summary>
/// add an item to the W7+ jumplist
/// </summary>
/// <param name="fullpath">fully qualified path, can include '|' character for archives</param>
public static void AddRecentItem(string fullpath)
{
string title;
if (fullpath.Contains('|'))
title = fullpath.Split('|')[1];
else
title = Path.GetFileName(fullpath);
string exepath = Assembly.GetEntryAssembly().Location;
var ji = new JumpTask
{
ApplicationPath = exepath,
Arguments = '"' + fullpath + '"',
Title = title,
// for some reason, this doesn't work
WorkingDirectory = Path.GetDirectoryName(exepath)
};
JumpList.AddToRecentCategory(ji);
}
}
}

View File

@ -3404,6 +3404,7 @@ namespace BizHawk.Client.EmuHawk
}
Global.Config.RecentRoms.Add(file.CanonicalFullPath);
JumpLists.AddRecentItem(file.CanonicalFullPath);
if (File.Exists(PathManager.SaveRamPath(game)))
{
LoadSaveRam();