diff --git a/BizHawk.Client.Common/FirmwareManager.cs b/BizHawk.Client.Common/FirmwareManager.cs index afc207b639..f551b6c12b 100644 --- a/BizHawk.Client.Common/FirmwareManager.cs +++ b/BizHawk.Client.Common/FirmwareManager.cs @@ -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(new[] { new DirectoryInfo(Global.Config.PathEntries.FirmwaresPath) }); + var todo = new Queue(); + todo.Enqueue(new DirectoryInfo(PathManager.MakeAbsolutePath(Global.Config.PathEntries.FirmwaresPath, null))); while (todo.Count != 0) { diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index af407ce773..fabfc7b9db 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -78,12 +78,14 @@ False ..\Newtonsoft.Json.dll + 3.5 + 3.5 @@ -99,6 +101,7 @@ False ..\SlimDX.dll + @@ -350,6 +353,7 @@ + Form diff --git a/BizHawk.Client.EmuHawk/JumpLists.cs b/BizHawk.Client.EmuHawk/JumpLists.cs new file mode 100644 index 0000000000..a51e65d238 --- /dev/null +++ b/BizHawk.Client.EmuHawk/JumpLists.cs @@ -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); + } + + /// + /// add an item to the W7+ jumplist + /// + /// fully qualified path, can include '|' character for archives + 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); + } + } +} diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 4d4091bc31..ba3cf83959 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -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();