Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Commit cc1afd0

Browse files
authored
Merge pull request #20 from blorsten/master
Added double click and closing after opening a project
2 parents 9b01e1d + f431ab9 commit cc1afd0

File tree

5 files changed

+58
-4
lines changed

5 files changed

+58
-4
lines changed

Diff for: UnityLauncher/App.config

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<setting name="closeAfterExplorer" serializeAs="String">
3131
<value>True</value>
3232
</setting>
33+
<setting name="closeAfterProject" serializeAs="String">
34+
<value>True</value>
35+
</setting>
3336
</UnityLauncher.Properties.Settings>
3437
</userSettings>
3538
</configuration>

Diff for: UnityLauncher/Form1.Designer.cs

+19-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: UnityLauncher/Form1.cs

+21
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ void LoadSettings()
9595
// update settings window
9696
chkMinimizeToTaskbar.Checked = Properties.Settings.Default.minimizeToTaskbar;
9797
chkQuitAfterCommandline.Checked = Properties.Settings.Default.closeAfterExplorer;
98+
ChkQuitAfterOpen.Checked = Properties.Settings.Default.closeAfterProject;
9899

99100
// update installations folder listbox
100101
lstRootFolders.Items.AddRange(Properties.Settings.Default.rootFolders.Cast<string>().ToArray());
@@ -328,6 +329,11 @@ void LaunchProject(string projectPath, string version, bool openProject = true)
328329
myProcess.StartInfo.Arguments = pars;
329330
}
330331
myProcess.Start();
332+
333+
if (Properties.Settings.Default.closeAfterProject)
334+
{
335+
Environment.Exit(0);
336+
}
331337
}
332338
catch (Exception ex)
333339
{
@@ -734,6 +740,15 @@ private void gridRecent_KeyDown(object sender, KeyEventArgs e)
734740
}
735741
}
736742

743+
//Checks if you are doubleclicking the current cell
744+
private void GridRecent_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
745+
{
746+
if(e.Button == MouseButtons.Left && e.RowIndex == gridRecent.CurrentCell.RowIndex)
747+
{
748+
LaunchSelectedProject();
749+
}
750+
}
751+
737752
// set basefolder of all unity installations
738753
private void btn_setinstallfolder_Click(object sender, EventArgs e)
739754
{
@@ -812,6 +827,12 @@ private void btnAddRegister_Click(object sender, EventArgs e)
812827
AddContextMenuRegistry();
813828
}
814829

830+
private void ChkQuitAfterOpen_CheckedChanged(object sender, EventArgs e)
831+
{
832+
Properties.Settings.Default.closeAfterProject = ChkQuitAfterOpen.Checked;
833+
Properties.Settings.Default.Save();
834+
}
835+
815836
private void chkQuitAfterCommandline_CheckedChanged(object sender, EventArgs e)
816837
{
817838
Properties.Settings.Default.closeAfterExplorer = chkQuitAfterCommandline.Checked;

Diff for: UnityLauncher/Properties/Settings.Designer.cs

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: UnityLauncher/Properties/Settings.settings

+3
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
<Setting Name="closeAfterExplorer" Type="System.Boolean" Scope="User">
1919
<Value Profile="(Default)">True</Value>
2020
</Setting>
21+
<Setting Name="closeAfterProject" Type="System.Boolean" Scope="User">
22+
<Value Profile="(Default)">True</Value>
23+
</Setting>
2124
</Settings>
2225
</SettingsFile>

0 commit comments

Comments
 (0)