mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 12:33:12 +00:00
Option to add new folders to IArchives
This commit is contained in:
parent
38af392160
commit
557fb17232
1 changed files with 27 additions and 1 deletions
|
@ -202,6 +202,9 @@ namespace Toolbox.Library
|
|||
new STToolStripItem("Extract All", ExtractAllAction),
|
||||
new STToolStripSeparator(),
|
||||
new STToolStripItem("Preview Archive", PreviewAction),
|
||||
new STToolStripSeparator(),
|
||||
new STToolStripItem("Add Folder", AddFolderAction) { Enabled = ArchiveFile.CanAddFiles},
|
||||
new STToolStripItem("Add File", AddFileAction) { Enabled = ArchiveFile.CanAddFiles},
|
||||
};
|
||||
|
||||
var toolStripList = ToolStrips.ToList();
|
||||
|
@ -213,6 +216,23 @@ namespace Toolbox.Library
|
|||
return toolStripList.ToArray();
|
||||
}
|
||||
|
||||
private void AddFolderAction(object sender, EventArgs args)
|
||||
{
|
||||
Nodes.Add(new ArchiveFolderNodeWrapper("NewFolder", ArchiveFile));
|
||||
}
|
||||
|
||||
private void AddFileAction(object sender, EventArgs args)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Filter = "Raw Data (*.*)|*.*";
|
||||
ofd.Multiselect = true;
|
||||
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
TreeHelper.AddFiles(this, ArchiveFile, ofd.FileNames);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateFileNames()
|
||||
{
|
||||
if (!ArchiveFile.CanRenameFiles)
|
||||
|
@ -508,10 +528,16 @@ namespace Toolbox.Library
|
|||
new STToolStripItem("Replace Folder", ReplaceAction) { Enabled = ArchiveFile.CanReplaceFiles },
|
||||
new STToolStripItem("Delete Folder", DeleteAction) { Enabled = ArchiveFile.CanDeleteFiles },
|
||||
new STToolStripSeparator(),
|
||||
new STToolStripItem("Add File", AddFileAction) { Enabled = ArchiveFile.CanAddFiles },
|
||||
new STToolStripItem("Add Folder", AddFolderAction) { Enabled = ArchiveFile.CanAddFiles },
|
||||
new STToolStripItem("Add File", AddFileAction) { Enabled = ArchiveFile.CanAddFiles },
|
||||
};
|
||||
}
|
||||
|
||||
private void AddFolderAction(object sender, EventArgs args)
|
||||
{
|
||||
Nodes.Add(new ArchiveFolderNodeWrapper("NewFolder", ArchiveFile));
|
||||
}
|
||||
|
||||
private void AddFileAction(object sender, EventArgs args)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
|
|
Loading…
Reference in a new issue