Skip to content

Commit

Permalink
Fixed bugs with the new UI
Browse files Browse the repository at this point in the history
- Raw mode was not checked by default in Build/Rebuild
- Background thread access mistakes in Build/Rebuild
- Mixed up the order of the GDI and Data text boxes and buttons in Rebuild
- Loaded the path of the GDI in rebuild from the button instead of the text box
- Set default column widths for Size & Modified columns in Browse/Extract window
- Set version numbers on Windows build
  • Loading branch information
Sappharad committed Dec 2, 2024
1 parent d290437 commit c5891da
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions GDIBuilderUI/GDIBuilder2.Wpf/GDIBuilder2.Wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<TargetFramework>net8.0-windows</TargetFramework>
<ApplicationIcon>BlankMedia.ico</ApplicationIcon>
<StartupObject>GDIBuilder2.Wpf.Program</StartupObject>
<UseWPF>True</UseWPF>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion GDIBuilderUI/GDIBuilder2/BuildView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private void InitializeComponent()
Spacing = 5
};
btnCancel.Enabled = false;
chkRawMode.Checked = true;
btnPickDataFolder.Click += btnSelectData_Click;
btnPickIpBin.Click += btnSelectIP_Click;
btnAddCdda.Click += btnSelCdda_Click;
Expand Down Expand Up @@ -246,7 +247,9 @@ private void btnMake_Click(object sender, EventArgs e)
ReportProgress = UpdateProgress
};
_cancelTokenSource = new CancellationTokenSource();
_worker = new Thread(() => DoDiscBuild(txtDataFolder.Text, txtOutdir.Text));
string dataFolder = txtDataFolder.Text;
string outDir = txtOutdir.Text;
_worker = new Thread(() => DoDiscBuild(dataFolder, outDir));
_worker.Start();
}
else
Expand Down
2 changes: 2 additions & 0 deletions GDIBuilderUI/GDIBuilder2/ExtractView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private void InitializeComponent()
tgvDisc.Columns.Add(new GridColumn()
{
HeaderText = "Size",
MinWidth = 75,
DataCell = new TextBoxCell(2)
{
Binding = Binding.Property((AdaptedPath p) => p.SizeName)
Expand All @@ -97,6 +98,7 @@ private void InitializeComponent()
tgvDisc.Columns.Add(new GridColumn()
{
HeaderText = "Modified",
MinWidth = 140,
DataCell = new TextBoxCell(3)
{
Binding = Binding.Property((AdaptedPath p) => p.Modified.ToString())
Expand Down
13 changes: 8 additions & 5 deletions GDIBuilderUI/GDIBuilder2/RebuildView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ public RebuildView()
private void InitializeComponent()
{
Title = "Rebuild Patched GD-ROM";
MinimumSize = new Size(540, 220);
MinimumSize = new Size(540, 254);
Padding = new Padding(4, 3, 4, 3);
btnCancel.Enabled = false;
chkRawMode.Checked = true;
btnPickDataFolder.Click += btnSelectData_Click;
btnPickGdi.Click += btnPickGdi_Click;
btnSelOutput.Click += btnSelOutput_Click;
Expand All @@ -71,15 +72,15 @@ private void InitializeComponent()
gdiRight.Add(btnPickGdi);
gdiRight.EndHorizontal();
gdiRight.Spacing = new Size(5, 5);
topTable.Add(gdiRight, 1, 1);
topTable.Add(gdiRight, 1, 0);
topTable.Add(new Label { Text = "Modified files:", TextAlignment = TextAlignment.Right }, 0, 1);
DynamicLayout dataRight = new DynamicLayout();
dataRight.BeginHorizontal();
dataRight.Add(txtDataFolder, true);
dataRight.Add(btnPickDataFolder);
dataRight.EndHorizontal();
dataRight.Spacing = new Size(5, 5);
topTable.Add(dataRight, 1, 0);
topTable.Add(dataRight, 1, 1);
topTable.Add(null, 0, 2);
topTable.SetRowScale(2, true);
topTable.Add(new Label { Text = "Output dir:", TextAlignment = TextAlignment.Right }, 0, 3);
Expand Down Expand Up @@ -170,7 +171,7 @@ private void btnMake_Click(object sender, EventArgs e)
}

List<string> cdTracks = new List<string>();
string[] gdiLines = File.ReadAllText(btnPickGdi.Text).Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
string[] gdiLines = File.ReadAllText(txtGdiPath.Text).Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
if (gdiLines.Length > 3 && int.TryParse(gdiLines[0], out int numTracks) && numTracks > 3)
{
for (int i = 4; i < numTracks && i < gdiLines.Length; i++)
Expand Down Expand Up @@ -208,7 +209,9 @@ private void btnMake_Click(object sender, EventArgs e)
ReportProgress = UpdateProgress
};
_cancelTokenSource = new CancellationTokenSource();
_worker = new Thread(() => DoDiscBuild(gdiLines, gdiDirectory, cdTracks, txtDataFolder.Text, txtOutdir.Text));
string dataFolder = txtDataFolder.Text;
string outDir = txtOutdir.Text;
_worker = new Thread(() => DoDiscBuild(gdiLines, gdiDirectory, cdTracks, dataFolder, outDir));
_worker.Start();
}
else
Expand Down

0 comments on commit c5891da

Please sign in to comment.