Skip to content

Commit 5a754c8

Browse files
committed
Finish Remove tab
1 parent 8d80090 commit 5a754c8

12 files changed

Lines changed: 285 additions & 85 deletions

FlashpointManager.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,14 @@
265265
</ItemGroup>
266266
<ItemGroup>
267267
<Compile Include="src\Common.cs" />
268-
<Compile Include="src\Forms\FinishDownload.cs">
268+
<Compile Include="src\Forms\FinishOperation.cs">
269269
<SubType>Form</SubType>
270270
</Compile>
271-
<Compile Include="src\Forms\FinishDownload.Designer.cs">
272-
<DependentUpon>FinishDownload.cs</DependentUpon>
271+
<Compile Include="src\Forms\FinishOperation.Designer.cs">
272+
<DependentUpon>FinishOperation.cs</DependentUpon>
273+
</Compile>
274+
<Compile Include="src\Forms\MainRemove.cs">
275+
<SubType>Form</SubType>
273276
</Compile>
274277
<Compile Include="src\Forms\Operation.cs">
275278
<SubType>Form</SubType>
@@ -297,8 +300,8 @@
297300
<Compile Include="src\Forms\UpdateCheck.Designer.cs">
298301
<DependentUpon>UpdateCheck.cs</DependentUpon>
299302
</Compile>
300-
<EmbeddedResource Include="src\Forms\FinishDownload.resx">
301-
<DependentUpon>FinishDownload.cs</DependentUpon>
303+
<EmbeddedResource Include="src\Forms\FinishOperation.resx">
304+
<DependentUpon>FinishOperation.cs</DependentUpon>
302305
</EmbeddedResource>
303306
<EmbeddedResource Include="src\Forms\Operation.resx">
304307
<DependentUpon>Operation.cs</DependentUpon>

src/Common.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,18 @@ public static string DestinationPath
141141
get { return Main.DestinationPath.Text; }
142142
set { Main.DestinationPath.Text = value; }
143143
}
144-
// Pointer to source path textbox
144+
// Pointer to source path textbox in Manage tab
145145
public static string SourcePath
146146
{
147147
get { return Main.SourcePath.Text; }
148148
set { Main.SourcePath.Text = value; }
149149
}
150+
// Pointer to source path textbox in Remove tab
151+
public static string SourcePath2
152+
{
153+
get { return Main.SourcePath2.Text; }
154+
set { Main.SourcePath2.Text = value; }
155+
}
150156

151157
// Flag to control how operation window will function
152158
// 0 is for downloading Flashpoint
@@ -331,12 +337,12 @@ public static bool VerifyDestinationPath(string path, bool updateText)
331337
return false;
332338
}
333339

334-
// Checks if specified Flashpoint source path is valid, and optionally updates its respective textbox
335-
public static bool VerifySourcePath(string path, bool updateText)
340+
// Checks if specified Flashpoint source path is valid, and optionally updates one of the textboxes
341+
public static bool VerifySourcePath(string path, int textBox = 0)
336342
{
337343
bool isFlashpoint = false;
338344

339-
Iterate(Main.ComponentList2.Nodes, node =>
345+
Iterate(Main.ComponentList.Nodes, node =>
340346
{
341347
if (node.Tag.GetType().ToString().EndsWith("Component"))
342348
{
@@ -354,7 +360,8 @@ public static bool VerifySourcePath(string path, bool updateText)
354360

355361
if (isFlashpoint)
356362
{
357-
if (updateText) SourcePath = path;
363+
if (textBox == 1) SourcePath = path;
364+
if (textBox == 2) SourcePath2 = path;
358365

359366
return true;
360367
}

src/Forms/FinishDownload.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Forms/FinishOperation.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.IO;
4+
using System.Windows.Forms;
5+
6+
using FlashpointInstaller.Common;
7+
8+
namespace FlashpointInstaller
9+
{
10+
public partial class FinishOperation : Form
11+
{
12+
public FinishOperation() => InitializeComponent();
13+
14+
private void FinishOperation_Load(object sender, EventArgs e)
15+
{
16+
if (FPM.OperateMode == 3)
17+
{
18+
Text = "Removal Complete";
19+
Message.Text = "Flashpoint has been successfully removed.";
20+
RunOnClose.Visible = false;
21+
}
22+
}
23+
24+
private void FinishDownload_Exit(object sender, EventArgs e)
25+
{
26+
if (FPM.OperateMode != 3)
27+
{
28+
if (RunOnClose.Checked)
29+
{
30+
var flashpointProcess = new Process();
31+
flashpointProcess.StartInfo.UseShellExecute = true;
32+
flashpointProcess.StartInfo.FileName = "Flashpoint.exe";
33+
flashpointProcess.StartInfo.WorkingDirectory = Path.Combine(FPM.DestinationPath, @"Launcher");
34+
flashpointProcess.Start();
35+
}
36+
}
37+
38+
Environment.Exit(0);
39+
}
40+
}
41+
}

src/Forms/MainDownload.Designer.cs

Lines changed: 111 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Forms/MainDownload.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ private void DownloadButton_Click(object sender, EventArgs e)
8585
{
8686
FPM.OperateMode = 0;
8787

88-
var downloadWindow = new Operation();
89-
downloadWindow.ShowDialog();
88+
var operationWindow = new Operation();
89+
operationWindow.ShowDialog();
9090
}
9191
}
9292
}

0 commit comments

Comments
 (0)