-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from axel7083/feature/start-from-editor
feat: allowing to config emulator executable to start rom
- Loading branch information
Showing
9 changed files
with
272 additions
and
34 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Windows.Forms; | ||
|
||
namespace SM64DSe.ui.dialogs | ||
{ | ||
public partial class RunningDialog : Form | ||
{ | ||
private string executable; | ||
public RunningDialog(string executable) | ||
{ | ||
this.executable = executable; | ||
InitializeComponent(); | ||
} | ||
|
||
protected override void OnShown(EventArgs e) | ||
{ | ||
base.OnShown(e); | ||
RunProcessAsync(); | ||
} | ||
|
||
private void RunProcessAsync() | ||
{ | ||
Process process = new Process(); | ||
process.StartInfo.FileName = this.executable; | ||
process.StartInfo.Arguments = Program.m_ROMPath; | ||
process.EnableRaisingEvents = true; | ||
|
||
process.Exited += (sender, e) => | ||
{ | ||
this.Close(); | ||
process.Dispose(); | ||
}; | ||
|
||
process.Start(); | ||
} | ||
} | ||
} |