Skip to content

Commit

Permalink
Merge pull request #97 from patrickmollohan/qol/open-export-directory
Browse files Browse the repository at this point in the history
Add menu button/keyboard shortcut to open export directory
  • Loading branch information
binary1230 authored Dec 14, 2023
2 parents de3cca3 + 43abbf6 commit 1d0f511
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
29 changes: 28 additions & 1 deletion DiztinGUIsh/window/MainWindow.Actions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using Diz.Controllers.controllers;
using Diz.Controllers.interfaces;
using Diz.Core.commands;
Expand Down Expand Up @@ -45,6 +47,31 @@ private void CreateNewProject()
ProjectController.ImportRomAndCreateNewProject(openFileDialog.FileName);
}

private void OpenExportDirectory()
{
var projectSettings = ProjectController.Project.LogWriterSettings;
var exportDirectory = Path.Combine(projectSettings.BaseOutputPath, projectSettings.FileOrFolderOutPath);

OpenDirectory(exportDirectory);
}

private void OpenDirectory(string path)
{
if (Directory.Exists(path))
{
ProcessStartInfo startInfo = new ProcessStartInfo
{
Arguments = path,
FileName = "explorer.exe",
};
Process.Start(startInfo);
}
else
{
MessageBox.Show(string.Format("{0} does not exist!", path));
}
}

private void Step(int offset)
{
if (!RomDataPresent())
Expand Down
22 changes: 21 additions & 1 deletion DiztinGUIsh/window/MainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions DiztinGUIsh/window/MainWindow.SimpleUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ private void toolStrip_exportDisassemblyUseCurrentSettings_Click(object sender,
private void toolStrip_exportDisassemblyEditSettingsFirst_Click(object sender, EventArgs e) =>
ProjectController?.ConfirmSettingsThenExportAssembly();

private void toolStrip_openExportDirectory_Click(object sender, EventArgs e) =>
OpenExportDirectory();

private void aboutToolStripMenuItem_Click(object sender, EventArgs e) =>
ProjectController.ViewFactory.GetAboutView().Show();

Expand Down
1 change: 1 addition & 0 deletions DiztinGUIsh/window/MainWindow.StateUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public void UpdateSaveOptionStates(bool saveEnabled, bool saveAsEnabled, bool cl

toolStrip_exportDisassemblyUseCurrentSettings.Enabled = true;
toolStrip_exportDisassemblyEditSettingsFirst.Enabled = true;
toolStrip_openExportDirectory.Enabled = true;
}

private void UpdateSomeUI2()
Expand Down

0 comments on commit 1d0f511

Please sign in to comment.