mirror of
https://github.com/FroggMaster/CreamInstaller.git
synced 2026-07-28 14:47:04 -07:00
Rename SelectForm to MainForm and SelectDialogForm to ScanDialog.
- MainForm is the primary application window that displays the list of installed games and DLC unlockers, and is where DLC unlockers are configured and installed. - ScanDialog performs a library scan and allows the user to select which games to begin configuring DLC unlockers for.
This commit is contained in:
@@ -199,7 +199,7 @@ internal sealed class CustomTreeView : TreeView
|
||||
Rectangle bounds = node.Bounds;
|
||||
Rectangle selectionBounds = bounds;
|
||||
|
||||
if (form is not SelectForm and not SelectDialogForm)
|
||||
if (form is not MainForm and not ScanDialog)
|
||||
return;
|
||||
|
||||
string id = node.Name;
|
||||
@@ -255,7 +255,7 @@ internal sealed class CustomTreeView : TreeView
|
||||
TextRenderer.DrawText(graphics, text, font, point, color, TextFormatFlags.Default);
|
||||
}
|
||||
|
||||
if (form is SelectForm)
|
||||
if (form is MainForm)
|
||||
{
|
||||
Selection selection = Selection.FromId(platform, id);
|
||||
if (selection is not null)
|
||||
@@ -448,7 +448,7 @@ internal sealed class CustomTreeView : TreeView
|
||||
base.OnMouseDown(e);
|
||||
Refresh();
|
||||
Point clickPoint = PointToClient(e.Location);
|
||||
SelectForm selectForm = (form ??= FindForm()) as SelectForm;
|
||||
MainForm selectForm = (form ??= FindForm()) as MainForm;
|
||||
foreach (KeyValuePair<TreeNode, Rectangle> pair in selectionBounds)
|
||||
if (pair.Key.TreeView is null)
|
||||
_ = selectionBounds.Remove(pair.Key);
|
||||
|
||||
@@ -169,10 +169,10 @@
|
||||
<Compile Update="Forms\InstallForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\SelectDialogForm.cs">
|
||||
<Compile Update="Forms\ScanDialog.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\SelectForm.cs">
|
||||
<Compile Update="Forms\MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\UpdateForm.cs">
|
||||
@@ -194,10 +194,10 @@
|
||||
<EmbeddedResource Update="Forms\InstallForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Forms\SelectDialogForm.resx">
|
||||
<EmbeddedResource Update="Forms\ScanDialog.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Forms\SelectForm.resx">
|
||||
<EmbeddedResource Update="Forms\MainForm.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="Forms\UpdateForm.resx">
|
||||
|
||||
@@ -395,7 +395,7 @@ internal sealed partial class InstallForm : CustomForm
|
||||
ProgramData.Log.Info($"[InstallForm] No unlocker detected after install | Game: {selection.Name} ({selection.Id})", LogDestination.Unlocker);
|
||||
}
|
||||
}
|
||||
SelectForm.Current?.Invoke(() => SelectForm.Current?.InvalidateGameList());
|
||||
MainForm.Current?.Invoke(() => MainForm.Current?.InvalidateGameList());
|
||||
|
||||
Program.Cleanup();
|
||||
int activeCount = activeSelections.Count;
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@ using System.Windows.Forms;
|
||||
|
||||
namespace CreamInstaller.Forms
|
||||
{
|
||||
partial class SelectForm
|
||||
partial class MainForm
|
||||
{
|
||||
private IContainer components = null;
|
||||
protected override void Dispose(bool disposing)
|
||||
@@ -293,7 +293,7 @@ namespace CreamInstaller.Forms
|
||||
topOptionsTable.Controls.Add(settingsButton, 2, 0);
|
||||
topOptionsTable.Controls.Add(allCheckBoxLayoutPanel, 3, 0);
|
||||
//
|
||||
// SelectForm
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
AutoScaleMode = AutoScaleMode.Dpi;
|
||||
@@ -317,9 +317,9 @@ namespace CreamInstaller.Forms
|
||||
Margin = new Padding(4, 3, 4, 3);
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Name = "SelectForm";
|
||||
Name = "MainForm";
|
||||
StartPosition = FormStartPosition.Manual;
|
||||
Text = "SelectForm";
|
||||
Text = "MainForm";
|
||||
Load += OnLoad;
|
||||
programsGroupBox.ResumeLayout(false);
|
||||
useSmokeAPILayoutPanel.ResumeLayout(false);
|
||||
@@ -21,11 +21,11 @@ using static CreamInstaller.Resources.Resources;
|
||||
|
||||
namespace CreamInstaller.Forms;
|
||||
|
||||
internal sealed partial class SelectForm : CustomForm
|
||||
internal sealed partial class MainForm : CustomForm
|
||||
{
|
||||
private const string HelpButtonListPrefix = "\n • ";
|
||||
|
||||
private static SelectForm current;
|
||||
private static MainForm current;
|
||||
private static readonly object currentLock = new();
|
||||
|
||||
private readonly ConcurrentDictionary<string, string> remainingDLCs = new();
|
||||
@@ -36,14 +36,14 @@ internal sealed partial class SelectForm : CustomForm
|
||||
|
||||
private List<(Platform platform, string id, string name)> programsToScan;
|
||||
|
||||
private SelectForm()
|
||||
private MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
selectionTreeView.TreeViewNodeSorter = Program.SortByName ? PlatformIdComparer.NodeText : PlatformIdComparer.NodeName;
|
||||
Text = Program.ApplicationName;
|
||||
}
|
||||
|
||||
internal static SelectForm Current
|
||||
internal static MainForm Current
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -51,7 +51,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
{
|
||||
if (current is null || current.Disposing || current.IsDisposed)
|
||||
{
|
||||
current = new SelectForm();
|
||||
current = new MainForm();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
@@ -733,7 +733,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
ProgramData.Log.Info($"[Total] Total time spent detecting games and libraries: {(selectionTimer.Elapsed.TotalSeconds >= 60 ? $"{selectionTimer.Elapsed.TotalSeconds / 60:F1} minutes" : $"{selectionTimer.Elapsed.TotalSeconds:F3}s")}", LogDestination.Scan);
|
||||
if (gameChoices.Count > 0)
|
||||
{
|
||||
using SelectDialogForm form = new(this);
|
||||
using ScanDialog form = new(this);
|
||||
DialogResult selectResult = form.QueryUser("Choose which programs and/or games to scan:", gameChoices,
|
||||
out List<(Platform platform, string id, string name)> choices);
|
||||
scan = selectResult == DialogResult.OK && choices is not null && choices.Count > 0;
|
||||
@@ -810,7 +810,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ProgramData.Log.Error("SelectForm OnLoad failed", ex);
|
||||
ProgramData.Log.Error("MainForm OnLoad failed", ex);
|
||||
// Show error and clean up
|
||||
ex.HandleException(this);
|
||||
HideProgressBar();
|
||||
@@ -1246,7 +1246,7 @@ internal sealed partial class SelectForm : CustomForm
|
||||
|
||||
if (newDlcList.Count > 0)
|
||||
{
|
||||
SelectForm form = SelectForm.Current;
|
||||
MainForm form = MainForm.Current;
|
||||
if (form is null || form.Disposing || form.IsDisposed)
|
||||
return;
|
||||
form.Invoke(delegate
|
||||
Generated
+4
-4
@@ -5,7 +5,7 @@ using CreamInstaller.Components;
|
||||
|
||||
namespace CreamInstaller.Forms
|
||||
{
|
||||
partial class SelectDialogForm
|
||||
partial class ScanDialog
|
||||
{
|
||||
private IContainer components = null;
|
||||
protected override void Dispose(bool disposing)
|
||||
@@ -169,7 +169,7 @@ namespace CreamInstaller.Forms
|
||||
saveButton.UseVisualStyleBackColor = true;
|
||||
saveButton.Click += OnSave;
|
||||
//
|
||||
// SelectDialogForm
|
||||
// ScanDialog
|
||||
//
|
||||
AcceptButton = acceptButton;
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
@@ -187,10 +187,10 @@ namespace CreamInstaller.Forms
|
||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Name = "SelectDialogForm";
|
||||
Name = "ScanDialog";
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = FormStartPosition.Manual;
|
||||
Text = "SelectDialogForm";
|
||||
Text = "ScanDialog";
|
||||
groupBox.ResumeLayout(false);
|
||||
groupBox.PerformLayout();
|
||||
allCheckBoxFlowPanel.ResumeLayout(false);
|
||||
@@ -7,12 +7,12 @@ using CreamInstaller.Utility;
|
||||
|
||||
namespace CreamInstaller.Forms;
|
||||
|
||||
internal sealed partial class SelectDialogForm : CustomForm
|
||||
internal sealed partial class ScanDialog : CustomForm
|
||||
{
|
||||
private readonly List<(Platform platform, string id, string name)> selected = new();
|
||||
private readonly List<(Platform platform, string id, string name, bool alreadySelected)> allChoices = new();
|
||||
|
||||
internal SelectDialogForm(IWin32Window owner) : base(owner)
|
||||
internal ScanDialog(IWin32Window owner) : base(owner)
|
||||
{
|
||||
InitializeComponent();
|
||||
selectionTreeView.TreeViewNodeSorter = sortCheckBox.Checked ? PlatformIdComparer.NodeText : PlatformIdComparer.NodeName;
|
||||
@@ -32,7 +32,7 @@ internal sealed partial class UpdateForm : CustomForm
|
||||
|
||||
private void StartProgram()
|
||||
{
|
||||
SelectForm form = SelectForm.Current;
|
||||
MainForm form = MainForm.Current;
|
||||
form.InheritLocation(this);
|
||||
form.FormClosing += (_, _) => Close();
|
||||
form.Show();
|
||||
|
||||
@@ -71,7 +71,7 @@ internal sealed class Selection : IEquatable<Selection>
|
||||
ExecutableDirectories = executableDirectories;
|
||||
_ = All.TryAdd(this, default);
|
||||
TreeNode = new() { Tag = Platform, Name = Id, Text = Name };
|
||||
SelectForm selectForm = SelectForm.Current;
|
||||
MainForm selectForm = MainForm.Current;
|
||||
if (selectForm is null)
|
||||
return;
|
||||
Enabled = selectForm.allCheckBox.Checked;
|
||||
|
||||
Reference in New Issue
Block a user