From f49485d933ce31602f74d5dfd3bf5e5f2c03313b Mon Sep 17 00:00:00 2001
From: Solomon Blount <74916907+siblount@users.noreply.github.com>
Date: Sat, 13 Jan 2024 16:20:51 -0500
Subject: [PATCH] add cancellation support
Replaced DPProgressCombo with an actual UserConrtol ProgressCombo.
---
.../ProgressCombo.Designer.cs | 102 +++++
src/DAZ_Installer.UI/ProgressCombo.cs | 104 ++++++
src/DAZ_Installer.UI/ProgressCombo.resx | 120 ++++++
.../DAZ_Installer.Windows.csproj | 1 +
src/DAZ_Installer.Windows/DP/DPExtractJob.cs | 50 +--
.../DP/DPProgressCombo.cs | 144 -------
.../Pages/Extract.Designer.cs | 353 ++++++++----------
src/DAZ_Installer.Windows/Pages/Extract.cs | 88 +----
src/DAZ_Installer.Windows/Pages/Extract.resx | 64 +++-
src/DAZ_Installer.Windows/Pages/Home.cs | 3 +-
10 files changed, 573 insertions(+), 456 deletions(-)
create mode 100644 src/DAZ_Installer.UI/ProgressCombo.Designer.cs
create mode 100644 src/DAZ_Installer.UI/ProgressCombo.cs
create mode 100644 src/DAZ_Installer.UI/ProgressCombo.resx
delete mode 100644 src/DAZ_Installer.Windows/DP/DPProgressCombo.cs
diff --git a/src/DAZ_Installer.UI/ProgressCombo.Designer.cs b/src/DAZ_Installer.UI/ProgressCombo.Designer.cs
new file mode 100644
index 0000000..2cb46fd
--- /dev/null
+++ b/src/DAZ_Installer.UI/ProgressCombo.Designer.cs
@@ -0,0 +1,102 @@
+namespace DAZ_Installer.UI
+{
+ partial class ProgressCombo
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ progressBarLbl = new Label();
+ progressBar = new ProgressBar();
+ cancelBtn = new Button();
+ mainProcLbl = new Label();
+ SuspendLayout();
+ //
+ // progressBarLbl
+ //
+ progressBarLbl.AutoEllipsis = true;
+ progressBarLbl.Font = new Font("Segoe UI", 10.2F, FontStyle.Regular, GraphicsUnit.Point);
+ progressBarLbl.Location = new Point(0, 46);
+ progressBarLbl.Name = "progressBarLbl";
+ progressBarLbl.Size = new Size(667, 31);
+ progressBarLbl.TabIndex = 0;
+ progressBarLbl.Text = "Processing...";
+ progressBarLbl.TextAlign = ContentAlignment.BottomLeft;
+ //
+ // progressBar
+ //
+ progressBar.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ progressBar.Location = new Point(0, 80);
+ progressBar.MarqueeAnimationSpeed = 20;
+ progressBar.Name = "progressBar";
+ progressBar.Size = new Size(667, 293);
+ progressBar.TabIndex = 1;
+ progressBar.Value = 50;
+ //
+ // cancelBtn
+ //
+ cancelBtn.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ cancelBtn.Font = new Font("Segoe UI", 13.8F, FontStyle.Regular, GraphicsUnit.Point);
+ cancelBtn.Location = new Point(612, 3);
+ cancelBtn.Name = "cancelBtn";
+ cancelBtn.Size = new Size(52, 46);
+ cancelBtn.TabIndex = 2;
+ cancelBtn.Text = "X";
+ cancelBtn.UseVisualStyleBackColor = true;
+ cancelBtn.Click += cancelBtn_Click;
+ //
+ // mainProcLbl
+ //
+ mainProcLbl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ mainProcLbl.AutoEllipsis = true;
+ mainProcLbl.Font = new Font("Segoe UI Variable Display Semil", 17.25F, FontStyle.Regular, GraphicsUnit.Point);
+ mainProcLbl.Location = new Point(0, 0);
+ mainProcLbl.Margin = new Padding(4, 0, 4, 0);
+ mainProcLbl.Name = "mainProcLbl";
+ mainProcLbl.Size = new Size(608, 46);
+ mainProcLbl.TabIndex = 3;
+ mainProcLbl.Text = "Nothing to extract.";
+ mainProcLbl.TextAlign = ContentAlignment.MiddleLeft;
+ //
+ // ProgressCombo
+ //
+ AutoScaleMode = AutoScaleMode.Inherit;
+ Controls.Add(cancelBtn);
+ Controls.Add(mainProcLbl);
+ Controls.Add(progressBar);
+ Controls.Add(progressBarLbl);
+ Name = "ProgressCombo";
+ Size = new Size(667, 373);
+ ResumeLayout(false);
+ }
+
+ #endregion
+
+ private Label progressBarLbl;
+ private ProgressBar progressBar;
+ private Button cancelBtn;
+ internal Label mainProcLbl;
+ }
+}
diff --git a/src/DAZ_Installer.UI/ProgressCombo.cs b/src/DAZ_Installer.UI/ProgressCombo.cs
new file mode 100644
index 0000000..9bb54cd
--- /dev/null
+++ b/src/DAZ_Installer.UI/ProgressCombo.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace DAZ_Installer.UI
+{
+ public partial class ProgressCombo : UserControl
+ {
+ [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public CancellationTokenSource CancellationTokenSource { get; set; } = new();
+ public bool IsMarquee => progressBar.Style == ProgressBarStyle.Marquee;
+
+ public ProgressCombo()
+ {
+ InitializeComponent();
+ progressBarLbl.Visible = progressBar.Visible = cancelBtn.Visible = false;
+ }
+
+ public void EndProgress()
+ {
+ if (InvokeRequired)
+ {
+ BeginInvoke(EndProgress);
+ return;
+ }
+ cancelBtn.Visible = false;
+ }
+
+ public void StartProgress()
+ {
+ if (InvokeRequired)
+ {
+ BeginInvoke(StartProgress);
+ return;
+ }
+ progressBarLbl.Visible = progressBar.Visible = cancelBtn.Visible = true;
+ }
+
+ public void SetProgress(int value)
+ {
+ if (InvokeRequired)
+ {
+ BeginInvoke(SetProgress, value);
+ return;
+ }
+ progressBar.Value = value;
+ }
+
+ ///
+ /// Changes the process bar style to either or ".
+ /// It automatically checks if Invoke is required.
+ ///
+ /// Whether to set the progress bar style to Marqueue or not.
+ public void ChangeProgressBarStyle(bool marqueue)
+ {
+ if (InvokeRequired)
+ {
+ BeginInvoke(ChangeProgressBarStyle, marqueue);
+ return;
+ }
+ progressBar.SuspendLayout();
+ if (marqueue)
+ {
+ progressBar.Value = 10;
+ progressBar.Style = ProgressBarStyle.Marquee;
+ }
+ else
+ {
+ progressBar.Value = 50;
+ progressBar.Style = ProgressBarStyle.Blocks;
+ }
+ progressBar.ResumeLayout();
+
+ }
+
+ ///
+ /// Sets the text of the progress bar label and the main process label. Automatically checks if Invoke is required.
+ ///
+ /// The text to set it to.
+ public void SetText(string text)
+ {
+ if (InvokeRequired)
+ {
+ BeginInvoke(SetText, text);
+ return;
+ }
+ SuspendLayout();
+ progressBarLbl.Text = mainProcLbl.Text = text;
+ ResumeLayout();
+ }
+
+ private void cancelBtn_Click(object sender, EventArgs e)
+ {
+ CancellationTokenSource.Cancel();
+ CancellationTokenSource = new();
+ }
+ }
+}
diff --git a/src/DAZ_Installer.UI/ProgressCombo.resx b/src/DAZ_Installer.UI/ProgressCombo.resx
new file mode 100644
index 0000000..af32865
--- /dev/null
+++ b/src/DAZ_Installer.UI/ProgressCombo.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/src/DAZ_Installer.Windows/DAZ_Installer.Windows.csproj b/src/DAZ_Installer.Windows/DAZ_Installer.Windows.csproj
index 4400e37..8691ad3 100644
--- a/src/DAZ_Installer.Windows/DAZ_Installer.Windows.csproj
+++ b/src/DAZ_Installer.Windows/DAZ_Installer.Windows.csproj
@@ -5,6 +5,7 @@
net6.0-windows
enable
true
+ true
disable
diff --git a/src/DAZ_Installer.Windows/DP/DPExtractJob.cs b/src/DAZ_Installer.Windows/DP/DPExtractJob.cs
index c254d31..17255fe 100644
--- a/src/DAZ_Installer.Windows/DP/DPExtractJob.cs
+++ b/src/DAZ_Installer.Windows/DP/DPExtractJob.cs
@@ -5,6 +5,7 @@
using DAZ_Installer.Core.Extraction;
using DAZ_Installer.Database;
using DAZ_Installer.IO;
+using DAZ_Installer.UI;
using DAZ_Installer.Windows.Pages;
using Microsoft.VisualBasic.FileIO;
using Serilog;
@@ -27,9 +28,9 @@ internal class DPExtractJob
public DPProcessor Processor = new();
public Task TaskJob { get; protected set; }
public DPSettings UserSettings { get; protected set; }
- private DPProgressCombo ProgressCombo;
public static DPTaskManager extractJobs = new();
+ private ProgressCombo progressCombo = Extract.ExtractPage.progressCombo;
public static Queue Jobs { get; } = new Queue();
// TODO: Check if a product is already in list.
@@ -78,9 +79,9 @@ private void Processor_StateChanged()
{
Extract.ExtractPage.AddToList(Processor.CurrentArchive);
Extract.ExtractPage.AddToHierachy(Processor.CurrentArchive);
- ProgressCombo.ChangeProgressBarStyle(true);
- ProgressCombo.UpdateText($"Preparing to extract contents in {Processor.CurrentArchive.FileName}...");
- ProgressCombo.SetProgressBarValue(0);
+ progressCombo.ChangeProgressBarStyle(true);
+ progressCombo.SetText($"Preparing to extract contents in {Processor.CurrentArchive.FileName}...");
+ progressCombo.SetProgress(0);
} catch (Exception ex)
{
Logger.Error(ex, "An error occurred while attempting to add archive to list");
@@ -92,24 +93,22 @@ private void Processor_StateChanged()
}
else if (Processor.State == ProcessorState.Analyzing)
{
- ProgressCombo.ChangeProgressBarStyle(true);
- ProgressCombo.UpdateText($"Analyzing file contents in {Processor.CurrentArchive.FileName}...");
+ progressCombo.ChangeProgressBarStyle(true);
+ progressCombo.SetText($"Analyzing file contents in {Processor.CurrentArchive.FileName}...");
}
}
private void Processor_ExtractProgress(object sender, DPExtractProgressArgs e)
{
- if (ProgressCombo.ProgressBar.Style == ProgressBarStyle.Marquee)
- ProgressCombo.ChangeProgressBarStyle(false);
- ProgressCombo.SetProgressBarValue(e.ExtractionPercentage);
- ProgressCombo.UpdateText($"Extracting contents from {e.Archive.FileName}...{e.ExtractionPercentage}%");
+ progressCombo.ChangeProgressBarStyle(false);
+ progressCombo.SetProgress(e.ExtractionPercentage);
+ progressCombo.SetText($"Extracting contents from {e.Archive.FileName}...{e.ExtractionPercentage}%");
}
private void Processor_MoveProgress(DPProcessor sender, DPExtractProgressArgs e)
{
- if (ProgressCombo.ProgressBar.Style != ProgressBarStyle.Marquee)
- ProgressCombo.ChangeProgressBarStyle(true);
- ProgressCombo.UpdateText($"Moving files from {e.Archive.FileName} to destination...%");
+ progressCombo.ChangeProgressBarStyle(true);
+ progressCombo.SetText($"Moving files from {e.Archive.FileName} to destination...%");
}
private void Processor_FileError(object sender, DPErrorArgs e) =>
@@ -129,9 +128,9 @@ private void Processor_ArchiveExit(object sender, DPArchiveExitArgs e)
if (!e.Processed) return;
// Create records if applicable.
// TODO: Only add if successful extraction, and all files from temp were moved, and/or user didn't cancel operation.
- ProgressCombo.ChangeProgressBarStyle(true);
+ progressCombo.ChangeProgressBarStyle(true);
Logger.Information("Creating records for {arc}", e.Archive.FileName);
- ProgressCombo.UpdateText($"Creating records for {e.Archive.FileName}...");
+ progressCombo.SetText($"Creating records for {e.Archive.FileName}...");
CreateRecords(e.Archive, e.Report!);
switch (UserSettings.PermDeleteSource)
@@ -170,7 +169,13 @@ private void ProcessListAsync(CancellationToken t)
{
try
{
- ProgressCombo = new DPProgressCombo();
+ // Tell the progress combo we are beginning by enabling visibility of the progress bar and cancel button.
+ progressCombo.StartProgress();
+
+ // Register the cancellation token so we can cancel the process.
+ var token = progressCombo.CancellationTokenSource.Token;
+ token.Register(Processor.CancelProcessing);
+
// Snapshot the settings and this will be what we use
// throughout the entire extraction process.
UserSettings = DPSettings.GetCopy();
@@ -192,14 +197,11 @@ private void ProcessListAsync(CancellationToken t)
{
var x = FilesToProcess[i];
int percentage = (int)((double)i / c * 100);
- ProgressCombo.SetProgressBarValue(percentage);
- ProgressCombo.UpdateText($"Processing archive {i + 1}/{c}: " +
+ progressCombo.SetProgress(percentage);
+ progressCombo.SetText($"Processing archive {i + 1}/{c}: " +
$"{Path.GetFileName(x)}...({percentage}%)");
Processor.ProcessArchive(x, processSettings);
}
- ProgressCombo.UpdateText($"Finished processing archives");
- ProgressCombo.ChangeProgressBarStyle(false);
- ProgressCombo.SetProgressBarValue(100);
// Update the database after this run.
Program.Database.GetInstalledArchiveNamesQ();
@@ -208,7 +210,11 @@ private void ProcessListAsync(CancellationToken t)
Logger.Error(ex, "An error occurred while attempting to process archive list");
} finally
{
- // We are finished. Remove this job from the queue.
+ progressCombo.SetText($"Finished processing archives");
+ progressCombo.ChangeProgressBarStyle(false);
+ progressCombo.SetProgress(100);
+ progressCombo.EndProgress();
+
Completed = true;
Jobs.Dequeue();
GC.Collect();
diff --git a/src/DAZ_Installer.Windows/DP/DPProgressCombo.cs b/src/DAZ_Installer.Windows/DP/DPProgressCombo.cs
deleted file mode 100644
index e8218dd..0000000
--- a/src/DAZ_Installer.Windows/DP/DPProgressCombo.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-// This code is licensed under the Keep It Free License V1.
-// You may find a full copy of this license at root project directory\LICENSE
-using DAZ_Installer.Windows.Pages;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace DAZ_Installer.Windows.DP
-{
- internal class DPProgressCombo
- {
- internal static Stack ProgressCombos = new(3);
- internal TableLayoutPanel Panel { get; private set; }
- internal Label ProgressBarLbl { get; private set; }
- internal ProgressBar ProgressBar { get; private set; }
-
- internal bool IsMarqueueProgressBar => ProgressBar.Style == ProgressBarStyle.Marquee;
-
- internal DPProgressCombo()
- {
- Extract.ExtractPage.Invoke(CreateProgressCombo);
- Extract.ExtractPage.BeginInvoke(Extract.ExtractPage.AddNewProgressCombo, this);
- ProgressCombos.Push(this);
- }
-
- ///
- /// Creates a new DPProgressCombo.
- ///
- // This function is called once on the UI thread.
- private void CreateProgressCombo()
- {
- // Panel
- Panel = new TableLayoutPanel();
- Panel.Dock = DockStyle.Fill;
- Panel.ColumnCount = 1;
- Panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
- Panel.RowCount = 2;
- Panel.RowStyles.Add(new ColumnStyle(SizeType.AutoSize));
- Panel.RowStyles.Add(new ColumnStyle(SizeType.AutoSize));
-
- ProgressBarLbl = new Label();
- ProgressBarLbl.Text = "Processing ...";
- ProgressBarLbl.Dock = DockStyle.Fill;
- ProgressBarLbl.AutoEllipsis = true;
- ProgressBarLbl.TextAlign = ContentAlignment.BottomLeft;
- ProgressBarLbl.MinimumSize = new Size(0, 25);
- Panel.Controls.Add(ProgressBarLbl, 0, 0);
-
- ProgressBar = new ProgressBar();
- ProgressBar.Value = 50;
- ProgressBar.Dock = DockStyle.Fill;
- ProgressBar.MinimumSize = new Size(0, 18);
- ProgressBar.MarqueeAnimationSpeed /= 5;
- Panel.Controls.Add(ProgressBar, 0, 1);
-
- // ProgressBar.CheckForIllegalCrossThreadCalls = false;
- }
-
- ///
- /// Changes the process bar style to either or ".
- /// It automatically checks if Invoke is required.
- ///
- /// Whether to set the progress bar style to Marqueue or not.
- internal void ChangeProgressBarStyle(bool marqueue)
- {
- // Removed check if marque is already set to marquee due to the fact that it could change later due to async queued' calls.
- if (Extract.ExtractPage.InvokeRequired)
- {
- Extract.ExtractPage.BeginInvoke(ChangeProgressBarStyle, marqueue);
- return;
- }
- try
- {
- ProgressBar.SuspendLayout();
- if (marqueue)
- {
- ProgressBar.Value = 10;
- ProgressBar.Style = ProgressBarStyle.Marquee;
- }
- else
- {
- ProgressBar.Value = 50;
- ProgressBar.Style = ProgressBarStyle.Blocks;
- }
- } finally
- {
- ProgressBar.ResumeLayout();
- }
- }
-
- ///
- /// Removes all DPProgressCombos from the UI. This is a blocking UI call.
- ///
- internal static void RemoveAll()
- {
- Extract.ExtractPage.Invoke(Extract.ExtractPage.ResetExtractPage);
- ProgressCombos.Clear();
- }
-
- ///
- /// Pops the last DPProgressCombo from the stack and removes it from the UI. This is a blocking UI call.
- ///
- internal void Pop()
- {
- if (ProgressCombos.TryPop(out _))
- Extract.ExtractPage.Invoke(Extract.ExtractPage.DeleteProgressionCombo, this);
- }
-
- ///
- /// Sets the value of the progress bar. Automatically checks if Invoke is required.
- ///
- ///
- internal void SetProgressBarValue(int value)
- {
- if (Extract.ExtractPage.InvokeRequired)
- {
- Extract.ExtractPage.BeginInvoke(SetProgressBarValue, value);
- return;
- }
- ProgressBar.Value = value;
- }
-
- ///
- /// Updates the text of the progress bar label and the main process label. Automatically checks if Invoke is required.
- ///
- /// The text to set it to.
- internal void UpdateText(string text)
- {
- if (Extract.ExtractPage.InvokeRequired)
- {
- Extract.ExtractPage.BeginInvoke(UpdateText, text);
- return;
- }
- ProgressBarLbl.Text = Extract.ExtractPage.mainProcLbl.Text = text;
- }
-
- ~DPProgressCombo()
- {
- ProgressBar.Dispose();
- ProgressBarLbl.Dispose();
- Panel.Dispose();
- }
- }
-}
\ No newline at end of file
diff --git a/src/DAZ_Installer.Windows/Pages/Extract.Designer.cs b/src/DAZ_Installer.Windows/Pages/Extract.Designer.cs
index eebbc20..52aaf94 100644
--- a/src/DAZ_Installer.Windows/Pages/Extract.Designer.cs
+++ b/src/DAZ_Installer.Windows/Pages/Extract.Designer.cs
@@ -29,267 +29,217 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Extract));
- this.mainTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.fileListPage = new System.Windows.Forms.TabPage();
- this.fileListView = new System.Windows.Forms.ListView();
- this.filePathColumn = new System.Windows.Forms.ColumnHeader();
- this.fileListContextStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.inspectFileListMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.selectInHierachyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.openInExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.noFilesSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.fileHierachyPage = new System.Windows.Forms.TabPage();
- this.fileHierachyTree = new System.Windows.Forms.TreeView();
- this.archiveFolderIcons = new System.Windows.Forms.ImageList(this.components);
- this.queuePage = new System.Windows.Forms.TabPage();
- this.panel1 = new System.Windows.Forms.Panel();
- this.mainProcLbl = new System.Windows.Forms.Label();
- this.fileHierachyContextStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.inspectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.selectInFileListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.openInExplorerToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
- this.tabControl1.SuspendLayout();
- this.fileListPage.SuspendLayout();
- this.fileListContextStrip.SuspendLayout();
- this.fileHierachyPage.SuspendLayout();
- this.panel1.SuspendLayout();
- this.fileHierachyContextStrip.SuspendLayout();
- this.SuspendLayout();
- //
- // mainTableLayoutPanel
- //
- this.mainTableLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.mainTableLayoutPanel.ColumnCount = 1;
- this.mainTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.mainTableLayoutPanel.Location = new System.Drawing.Point(31, 65);
- this.mainTableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.mainTableLayoutPanel.Name = "mainTableLayoutPanel";
- this.mainTableLayoutPanel.RowCount = 1;
- this.mainTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.mainTableLayoutPanel.Size = new System.Drawing.Size(491, 153);
- this.mainTableLayoutPanel.TabIndex = 0;
+ components = new System.ComponentModel.Container();
+ var resources = new System.ComponentModel.ComponentResourceManager(typeof(Extract));
+ tabControl1 = new System.Windows.Forms.TabControl();
+ fileListPage = new System.Windows.Forms.TabPage();
+ fileListView = new System.Windows.Forms.ListView();
+ filePathColumn = new System.Windows.Forms.ColumnHeader();
+ fileListContextStrip = new System.Windows.Forms.ContextMenuStrip(components);
+ inspectFileListMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ selectInHierachyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ openInExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ noFilesSelectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ fileHierachyPage = new System.Windows.Forms.TabPage();
+ fileHierachyTree = new System.Windows.Forms.TreeView();
+ archiveFolderIcons = new System.Windows.Forms.ImageList(components);
+ queuePage = new System.Windows.Forms.TabPage();
+ fileHierachyContextStrip = new System.Windows.Forms.ContextMenuStrip(components);
+ inspectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ selectInFileListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ openInExplorerToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+ progressCombo = new UI.ProgressCombo();
+ tabControl1.SuspendLayout();
+ fileListPage.SuspendLayout();
+ fileListContextStrip.SuspendLayout();
+ fileHierachyPage.SuspendLayout();
+ fileHierachyContextStrip.SuspendLayout();
+ SuspendLayout();
//
// tabControl1
//
- this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.tabControl1.Controls.Add(this.fileListPage);
- this.tabControl1.Controls.Add(this.fileHierachyPage);
- this.tabControl1.Controls.Add(this.queuePage);
- this.tabControl1.Location = new System.Drawing.Point(31, 222);
- this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(491, 97);
- this.tabControl1.TabIndex = 1;
+ tabControl1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
+ tabControl1.Controls.Add(fileListPage);
+ tabControl1.Controls.Add(fileHierachyPage);
+ tabControl1.Controls.Add(queuePage);
+ tabControl1.Location = new System.Drawing.Point(31, 222);
+ tabControl1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ tabControl1.Name = "tabControl1";
+ tabControl1.SelectedIndex = 0;
+ tabControl1.Size = new System.Drawing.Size(491, 97);
+ tabControl1.TabIndex = 1;
//
// fileListPage
//
- this.fileListPage.Controls.Add(this.fileListView);
- this.fileListPage.Location = new System.Drawing.Point(4, 24);
- this.fileListPage.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.fileListPage.Name = "fileListPage";
- this.fileListPage.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.fileListPage.Size = new System.Drawing.Size(483, 69);
- this.fileListPage.TabIndex = 0;
- this.fileListPage.Text = "File List";
- this.fileListPage.UseVisualStyleBackColor = true;
+ fileListPage.Controls.Add(fileListView);
+ fileListPage.Location = new System.Drawing.Point(4, 24);
+ fileListPage.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ fileListPage.Name = "fileListPage";
+ fileListPage.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ fileListPage.Size = new System.Drawing.Size(483, 69);
+ fileListPage.TabIndex = 0;
+ fileListPage.Text = "File List";
+ fileListPage.UseVisualStyleBackColor = true;
//
// fileListView
//
- this.fileListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.filePathColumn});
- this.fileListView.ContextMenuStrip = this.fileListContextStrip;
- this.fileListView.Dock = System.Windows.Forms.DockStyle.Fill;
- this.fileListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
- this.fileListView.Location = new System.Drawing.Point(4, 2);
- this.fileListView.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.fileListView.MultiSelect = false;
- this.fileListView.Name = "fileListView";
- this.fileListView.Size = new System.Drawing.Size(475, 65);
- this.fileListView.TabIndex = 0;
- this.fileListView.UseCompatibleStateImageBehavior = false;
- this.fileListView.View = System.Windows.Forms.View.Details;
+ fileListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { filePathColumn });
+ fileListView.ContextMenuStrip = fileListContextStrip;
+ fileListView.Dock = System.Windows.Forms.DockStyle.Fill;
+ fileListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
+ fileListView.Location = new System.Drawing.Point(4, 2);
+ fileListView.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ fileListView.MultiSelect = false;
+ fileListView.Name = "fileListView";
+ fileListView.Size = new System.Drawing.Size(475, 65);
+ fileListView.TabIndex = 0;
+ fileListView.UseCompatibleStateImageBehavior = false;
+ fileListView.View = System.Windows.Forms.View.Details;
//
// filePathColumn
//
- this.filePathColumn.Text = "File Path";
- this.filePathColumn.Width = 530;
+ filePathColumn.Text = "File Path";
+ filePathColumn.Width = 530;
//
// fileListContextStrip
//
- this.fileListContextStrip.DropShadowEnabled = false;
- this.fileListContextStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
- this.fileListContextStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.inspectFileListMenuItem,
- this.selectInHierachyToolStripMenuItem,
- this.openInExplorerToolStripMenuItem,
- this.noFilesSelectedToolStripMenuItem});
- this.fileListContextStrip.Name = "contextMenuStrip1";
- this.fileListContextStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
- this.fileListContextStrip.ShowImageMargin = false;
- this.fileListContextStrip.Size = new System.Drawing.Size(144, 92);
- this.fileListContextStrip.Opening += new System.ComponentModel.CancelEventHandler(this.fileListContextStrip_Opening);
+ fileListContextStrip.DropShadowEnabled = false;
+ fileListContextStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
+ fileListContextStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { inspectFileListMenuItem, selectInHierachyToolStripMenuItem, openInExplorerToolStripMenuItem, noFilesSelectedToolStripMenuItem });
+ fileListContextStrip.Name = "contextMenuStrip1";
+ fileListContextStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
+ fileListContextStrip.ShowImageMargin = false;
+ fileListContextStrip.Size = new System.Drawing.Size(144, 92);
+ fileListContextStrip.Opening += fileListContextStrip_Opening;
//
// inspectFileListMenuItem
//
- this.inspectFileListMenuItem.Name = "inspectFileListMenuItem";
- this.inspectFileListMenuItem.Size = new System.Drawing.Size(143, 22);
- this.inspectFileListMenuItem.Text = "Inspect";
- this.inspectFileListMenuItem.Visible = false;
+ inspectFileListMenuItem.Name = "inspectFileListMenuItem";
+ inspectFileListMenuItem.Size = new System.Drawing.Size(143, 22);
+ inspectFileListMenuItem.Text = "Inspect";
+ inspectFileListMenuItem.Visible = false;
//
// selectInHierachyToolStripMenuItem
//
- this.selectInHierachyToolStripMenuItem.Name = "selectInHierachyToolStripMenuItem";
- this.selectInHierachyToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
- this.selectInHierachyToolStripMenuItem.Text = "Select in Hierachy";
- this.selectInHierachyToolStripMenuItem.Visible = false;
- this.selectInHierachyToolStripMenuItem.Click += new System.EventHandler(this.selectInHierachyToolStripMenuItem_Click);
+ selectInHierachyToolStripMenuItem.Name = "selectInHierachyToolStripMenuItem";
+ selectInHierachyToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
+ selectInHierachyToolStripMenuItem.Text = "Select in Hierachy";
+ selectInHierachyToolStripMenuItem.Visible = false;
+ selectInHierachyToolStripMenuItem.Click += selectInHierachyToolStripMenuItem_Click;
//
// openInExplorerToolStripMenuItem
//
- this.openInExplorerToolStripMenuItem.Name = "openInExplorerToolStripMenuItem";
- this.openInExplorerToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
- this.openInExplorerToolStripMenuItem.Text = "Open in Explorer";
- this.openInExplorerToolStripMenuItem.Visible = false;
+ openInExplorerToolStripMenuItem.Name = "openInExplorerToolStripMenuItem";
+ openInExplorerToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
+ openInExplorerToolStripMenuItem.Text = "Open in Explorer";
+ openInExplorerToolStripMenuItem.Visible = false;
//
// noFilesSelectedToolStripMenuItem
//
- this.noFilesSelectedToolStripMenuItem.Enabled = false;
- this.noFilesSelectedToolStripMenuItem.Name = "noFilesSelectedToolStripMenuItem";
- this.noFilesSelectedToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
- this.noFilesSelectedToolStripMenuItem.Text = "No Files Selected";
+ noFilesSelectedToolStripMenuItem.Enabled = false;
+ noFilesSelectedToolStripMenuItem.Name = "noFilesSelectedToolStripMenuItem";
+ noFilesSelectedToolStripMenuItem.Size = new System.Drawing.Size(143, 22);
+ noFilesSelectedToolStripMenuItem.Text = "No Files Selected";
//
// fileHierachyPage
//
- this.fileHierachyPage.Controls.Add(this.fileHierachyTree);
- this.fileHierachyPage.Location = new System.Drawing.Point(4, 24);
- this.fileHierachyPage.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.fileHierachyPage.Name = "fileHierachyPage";
- this.fileHierachyPage.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.fileHierachyPage.Size = new System.Drawing.Size(483, 69);
- this.fileHierachyPage.TabIndex = 1;
- this.fileHierachyPage.Text = "File Hierachy";
- this.fileHierachyPage.UseVisualStyleBackColor = true;
+ fileHierachyPage.Controls.Add(fileHierachyTree);
+ fileHierachyPage.Location = new System.Drawing.Point(4, 24);
+ fileHierachyPage.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ fileHierachyPage.Name = "fileHierachyPage";
+ fileHierachyPage.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ fileHierachyPage.Size = new System.Drawing.Size(483, 69);
+ fileHierachyPage.TabIndex = 1;
+ fileHierachyPage.Text = "File Hierachy";
+ fileHierachyPage.UseVisualStyleBackColor = true;
//
// fileHierachyTree
//
- this.fileHierachyTree.Dock = System.Windows.Forms.DockStyle.Fill;
- this.fileHierachyTree.Indent = 21;
- this.fileHierachyTree.Location = new System.Drawing.Point(4, 2);
- this.fileHierachyTree.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.fileHierachyTree.Name = "fileHierachyTree";
- this.fileHierachyTree.Size = new System.Drawing.Size(475, 65);
- this.fileHierachyTree.StateImageList = this.archiveFolderIcons;
- this.fileHierachyTree.TabIndex = 0;
+ fileHierachyTree.Dock = System.Windows.Forms.DockStyle.Fill;
+ fileHierachyTree.Indent = 21;
+ fileHierachyTree.Location = new System.Drawing.Point(4, 2);
+ fileHierachyTree.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ fileHierachyTree.Name = "fileHierachyTree";
+ fileHierachyTree.Size = new System.Drawing.Size(475, 65);
+ fileHierachyTree.StateImageList = archiveFolderIcons;
+ fileHierachyTree.TabIndex = 0;
//
// archiveFolderIcons
//
- this.archiveFolderIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.archiveFolderIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("archiveFolderIcons.ImageStream")));
- this.archiveFolderIcons.TransparentColor = System.Drawing.SystemColors.Window;
- this.archiveFolderIcons.Images.SetKeyName(0, "FolderIcon.png");
- this.archiveFolderIcons.Images.SetKeyName(1, "RARIcon.png");
- this.archiveFolderIcons.Images.SetKeyName(2, "ZIPIcon.png");
+ archiveFolderIcons.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
+ archiveFolderIcons.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("archiveFolderIcons.ImageStream");
+ archiveFolderIcons.TransparentColor = System.Drawing.SystemColors.Window;
+ archiveFolderIcons.Images.SetKeyName(0, "FolderIcon.png");
+ archiveFolderIcons.Images.SetKeyName(1, "RARIcon.png");
+ archiveFolderIcons.Images.SetKeyName(2, "ZIPIcon.png");
//
// queuePage
//
- this.queuePage.Location = new System.Drawing.Point(4, 24);
- this.queuePage.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.queuePage.Name = "queuePage";
- this.queuePage.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.queuePage.Size = new System.Drawing.Size(483, 69);
- this.queuePage.TabIndex = 2;
- this.queuePage.Text = "Queue";
- this.queuePage.UseVisualStyleBackColor = true;
- //
- // panel1
- //
- this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.panel1.Controls.Add(this.mainProcLbl);
- this.panel1.Location = new System.Drawing.Point(31, 22);
- this.panel1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(486, 40);
- this.panel1.TabIndex = 2;
- //
- // mainProcLbl
- //
- this.mainProcLbl.AutoEllipsis = true;
- this.mainProcLbl.Dock = System.Windows.Forms.DockStyle.Fill;
- this.mainProcLbl.Font = new System.Drawing.Font("Segoe UI Variable Display Semil", 17.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.mainProcLbl.Location = new System.Drawing.Point(0, 0);
- this.mainProcLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
- this.mainProcLbl.Name = "mainProcLbl";
- this.mainProcLbl.Size = new System.Drawing.Size(486, 40);
- this.mainProcLbl.TabIndex = 0;
- this.mainProcLbl.Text = "Nothing to extract.";
- this.mainProcLbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.mainProcLbl.Click += new System.EventHandler(this.mainProcLbl_Click);
+ queuePage.Location = new System.Drawing.Point(4, 24);
+ queuePage.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ queuePage.Name = "queuePage";
+ queuePage.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ queuePage.Size = new System.Drawing.Size(483, 69);
+ queuePage.TabIndex = 2;
+ queuePage.Text = "Queue";
+ queuePage.UseVisualStyleBackColor = true;
//
// fileHierachyContextStrip
//
- this.fileHierachyContextStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
- this.fileHierachyContextStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.inspectToolStripMenuItem,
- this.selectInFileListToolStripMenuItem,
- this.openInExplorerToolStripMenuItem1});
- this.fileHierachyContextStrip.Name = "fileHierachyContextStrip";
- this.fileHierachyContextStrip.Size = new System.Drawing.Size(181, 92);
+ fileHierachyContextStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
+ fileHierachyContextStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { inspectToolStripMenuItem, selectInFileListToolStripMenuItem, openInExplorerToolStripMenuItem1 });
+ fileHierachyContextStrip.Name = "fileHierachyContextStrip";
+ fileHierachyContextStrip.Size = new System.Drawing.Size(163, 70);
//
// inspectToolStripMenuItem
//
- this.inspectToolStripMenuItem.Name = "inspectToolStripMenuItem";
- this.inspectToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
- this.inspectToolStripMenuItem.Text = "Inspect";
+ inspectToolStripMenuItem.Name = "inspectToolStripMenuItem";
+ inspectToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
+ inspectToolStripMenuItem.Text = "Inspect";
//
// selectInFileListToolStripMenuItem
//
- this.selectInFileListToolStripMenuItem.Name = "selectInFileListToolStripMenuItem";
- this.selectInFileListToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
- this.selectInFileListToolStripMenuItem.Text = "Select in File List";
- this.selectInFileListToolStripMenuItem.Click += new System.EventHandler(this.selectInFileListToolStripMenuItem_Click);
+ selectInFileListToolStripMenuItem.Name = "selectInFileListToolStripMenuItem";
+ selectInFileListToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
+ selectInFileListToolStripMenuItem.Text = "Select in File List";
+ selectInFileListToolStripMenuItem.Click += selectInFileListToolStripMenuItem_Click;
//
// openInExplorerToolStripMenuItem1
//
- this.openInExplorerToolStripMenuItem1.Name = "openInExplorerToolStripMenuItem1";
- this.openInExplorerToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
- this.openInExplorerToolStripMenuItem1.Text = "Open in Explorer";
+ openInExplorerToolStripMenuItem1.Name = "openInExplorerToolStripMenuItem1";
+ openInExplorerToolStripMenuItem1.Size = new System.Drawing.Size(162, 22);
+ openInExplorerToolStripMenuItem1.Text = "Open in Explorer";
+ //
+ // progressCombo
+ //
+ progressCombo.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
+ progressCombo.Location = new System.Drawing.Point(29, 22);
+ progressCombo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+ progressCombo.Name = "progressCombo";
+ progressCombo.Size = new System.Drawing.Size(493, 196);
+ progressCombo.TabIndex = 3;
//
// Extract
//
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
- this.BackColor = System.Drawing.Color.White;
- this.Controls.Add(this.tabControl1);
- this.Controls.Add(this.mainTableLayoutPanel);
- this.Controls.Add(this.panel1);
- this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
- this.Name = "Extract";
- this.Size = new System.Drawing.Size(542, 344);
- this.tabControl1.ResumeLayout(false);
- this.fileListPage.ResumeLayout(false);
- this.fileListContextStrip.ResumeLayout(false);
- this.fileHierachyPage.ResumeLayout(false);
- this.panel1.ResumeLayout(false);
- this.fileHierachyContextStrip.ResumeLayout(false);
- this.ResumeLayout(false);
-
+ AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ BackColor = System.Drawing.Color.White;
+ Controls.Add(tabControl1);
+ Controls.Add(progressCombo);
+ Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
+ Name = "Extract";
+ Size = new System.Drawing.Size(542, 344);
+ tabControl1.ResumeLayout(false);
+ fileListPage.ResumeLayout(false);
+ fileListContextStrip.ResumeLayout(false);
+ fileHierachyPage.ResumeLayout(false);
+ fileHierachyContextStrip.ResumeLayout(false);
+ ResumeLayout(false);
}
#endregion
-
- private System.Windows.Forms.TableLayoutPanel mainTableLayoutPanel;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage fileListPage;
private System.Windows.Forms.TabPage fileHierachyPage;
- private System.Windows.Forms.Panel panel1;
- internal System.Windows.Forms.Label mainProcLbl;
private System.Windows.Forms.ListView fileListView;
private System.Windows.Forms.TreeView fileHierachyTree;
private System.Windows.Forms.ColumnHeader filePathColumn;
@@ -305,5 +255,6 @@ private void InitializeComponent()
private System.Windows.Forms.TabPage queuePage;
private Custom_Controls.QueueControl queueControl1;
internal System.Windows.Forms.ImageList archiveFolderIcons;
+ internal UI.ProgressCombo progressCombo;
}
}
diff --git a/src/DAZ_Installer.Windows/Pages/Extract.cs b/src/DAZ_Installer.Windows/Pages/Extract.cs
index 85d1c33..e08288a 100644
--- a/src/DAZ_Installer.Windows/Pages/Extract.cs
+++ b/src/DAZ_Installer.Windows/Pages/Extract.cs
@@ -17,54 +17,10 @@ namespace DAZ_Installer.Windows.Pages
public partial class Extract : UserControl
{
- public static Extract ExtractPage;
+ public static Extract ExtractPage = null!;
internal static Dictionary associatedListItems = new(2048);
internal static Dictionary associatedTreeNodes = new(2048);
- ///
- /// Completely resets the main table layout panel by removing (and disposing) all controls and resetting the row/column count.
- /// Assure that this function is called from the UI thread with either or .
- ///
- public void ResetMainTable()
- {
- mainTableLayoutPanel.SuspendLayout();
- try
- {
- if (mainTableLayoutPanel.Controls.Count != 0)
- {
- foreach (Control control in RecursivelyGetControls(mainTableLayoutPanel))
- control.Dispose();
- }
- }
- catch { }
- mainTableLayoutPanel.Controls.Clear();
- mainTableLayoutPanel.RowStyles.Clear();
- mainTableLayoutPanel.ColumnCount = 1;
- mainTableLayoutPanel.RowStyles.Add(new RowStyle());
- mainTableLayoutPanel.RowCount = 1;
- UpdateMainTableRowSizing();
- mainTableLayoutPanel.ResumeLayout();
- }
-
- ///
- /// Updates the main table row sizing to be equal to the amount of controls in the table.
- /// Set to true to suspend and resume the layout after updating. Default is false.
- ///
- /// Whether to suspend and resume the layout after updating.
- public void UpdateMainTableRowSizing(bool suspend = false)
- {
- if (suspend) mainTableLayoutPanel.SuspendLayout();
- var percentageMultiplied = 1f / mainTableLayoutPanel.Controls.Count * 100f;
- for (var i = 0; i < mainTableLayoutPanel.RowStyles.Count; i++)
- {
- mainTableLayoutPanel.RowStyles[i] = new RowStyle(SizeType.Percent, percentageMultiplied);
- }
-
- if (!suspend) return;
- mainTableLayoutPanel.ResumeLayout();
- mainTableLayoutPanel.Update();
- }
-
public Extract()
{
InitializeComponent();
@@ -170,7 +126,7 @@ private void AddIcon(TreeNode node, string? ext)
public void ResetExtractPage()
{
// Later show nothing to extract panel.
- ResetMainTable();
+ progressCombo.EndProgress();
fileListView.Items.Clear();
fileHierachyTree.Nodes.Clear();
associatedListItems.Clear();
@@ -202,46 +158,6 @@ private void mainProcLbl_Click(object sender, EventArgs e)
}
- #region Handle DPPrecssor Events
-
- ///
- /// Deletes the progression combo from the main table layout panel.
- /// Assure that this function is called from the UI thread with either or .
- ///
- /// The DPProgressCombo to remove.
- internal void DeleteProgressionCombo(DPProgressCombo combo)
- {
- mainTableLayoutPanel.SuspendLayout();
- mainTableLayoutPanel.Controls.Remove(combo.Panel);
- mainTableLayoutPanel.RowCount = Math.Max(1, mainTableLayoutPanel.Controls.Count);
- mainTableLayoutPanel.RowStyles.Clear();
- for (var i = 0; i < mainTableLayoutPanel.RowCount; i++)
- mainTableLayoutPanel.RowStyles.Add(new RowStyle());
- mainTableLayoutPanel.ResumeLayout();
- UpdateMainTableRowSizing(true);
- }
-
- ///
- /// Creates a progress bar and adds it to the table.
- /// Assure that this function is called from the UI thread with either or .
- ///
- /// The DPProgressCombo to add to the main table layout panel.
- // This function is called once on the UI thread.
- internal void AddNewProgressCombo(DPProgressCombo combo)
- {
- mainTableLayoutPanel.SuspendLayout();
- if (mainTableLayoutPanel.Controls.Count != 0)
- {
- mainTableLayoutPanel.RowCount += 1;
- mainTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
- }
- mainTableLayoutPanel.Controls.Add(combo.Panel);
- UpdateMainTableRowSizing();
- mainTableLayoutPanel.ResumeLayout(true);
- }
-
- #endregion
-
#region Context Strip Events
private void selectInHierachyToolStripMenuItem_Click(object sender, EventArgs e)
{
diff --git a/src/DAZ_Installer.Windows/Pages/Extract.resx b/src/DAZ_Installer.Windows/Pages/Extract.resx
index 40bc579..0abce93 100644
--- a/src/DAZ_Installer.Windows/Pages/Extract.resx
+++ b/src/DAZ_Installer.Windows/Pages/Extract.resx
@@ -1,4 +1,64 @@
-
+
+
+
@@ -68,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAlgkAAAJNU0Z0AUkBTAIBAQMB
- AAF4AQABeAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMAAUADAAEQAwABAQEAAQgG
+ AAGIAQABiAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMAAUADAAEQAwABAQEAAQgG
AAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEAAfABygGmAQABMwUAATMB
AAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEAAYABfAH/AQACUAH/AQAB
kwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFmAwABmQMAAcwCAAEzAwAC
diff --git a/src/DAZ_Installer.Windows/Pages/Home.cs b/src/DAZ_Installer.Windows/Pages/Home.cs
index 496394c..c1f34c2 100644
--- a/src/DAZ_Installer.Windows/Pages/Home.cs
+++ b/src/DAZ_Installer.Windows/Pages/Home.cs
@@ -38,7 +38,8 @@ internal void button1_Click(object sender, EventArgs e)
}
// Clear everything from extract page.
- DPProgressCombo.RemoveAll();
+ Extract.ExtractPage.ResetExtractPage();
+
// Goto next page.
MainForm.SwitchPage(Extract.ExtractPage);