Make the file picker only show valid files (#28)

* Make the file picker only show valid files

* Fix file wildcard patterns
This commit is contained in:
Josh 2022-11-02 14:26:30 -05:00 committed by GitHub
commit 58d9dd3a67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,7 @@ public class FilePatchForm : Form {
Rows = { Rows = {
new TableRow( new TableRow(
new TableCell(new Label { Text = "EBOOT.elf: ", VerticalAlignment = VerticalAlignment.Center }), new TableCell(new Label { Text = "EBOOT.elf: ", VerticalAlignment = VerticalAlignment.Center }),
new TableCell(this.filePicker = new FilePicker { TabIndex = 0 }) new TableCell(this.filePicker = new FilePicker { TabIndex = 0 , FileAction = FileAction.OpenFile, Filters = { new FileFilter("ELF files", "*.elf", "*.ELF"), new FileFilter("All Files", "*.*") }})
), ),
new TableRow( new TableRow(
new TableCell(new Label { Text = "Server URL: ", VerticalAlignment = VerticalAlignment.Center }), new TableCell(new Label { Text = "Server URL: ", VerticalAlignment = VerticalAlignment.Center }),
@ -58,7 +58,7 @@ public class FilePatchForm : Form {
), ),
new TableRow( new TableRow(
new TableCell(new Label { Text = "Output filename: ", VerticalAlignment = VerticalAlignment.Center }), new TableCell(new Label { Text = "Output filename: ", VerticalAlignment = VerticalAlignment.Center }),
new TableCell(this.outputFileName = new FilePicker { TabIndex = 2, FileAction = FileAction.SaveFile }) new TableCell(this.outputFileName = new FilePicker { TabIndex = 2, FileAction = FileAction.SaveFile, Filters = { new FileFilter("ELF files", "*.elf", "*.ELF"), new FileFilter("All Files", "*.*") }})
), ),
new TableRow( new TableRow(
new TableCell(this.CreateHelpButton(4)), new TableCell(this.CreateHelpButton(4)),
@ -135,4 +135,4 @@ public class FilePatchForm : Form {
Gui.CreateOkDialog("Success!", "The Server URL has been patched to " + this.serverUrl.Text); Gui.CreateOkDialog("Success!", "The Server URL has been patched to " + this.serverUrl.Text);
} }
} }