mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-08-19 08:29:19 +08:00
Drag and drop XML files
This commit is contained in:
parent
458e9d365e
commit
d4085ac37a
@ -2558,7 +2558,8 @@ namespace CodeWalker
|
|||||||
RefreshMainListView();
|
RefreshMainListView();
|
||||||
|
|
||||||
}
|
}
|
||||||
private void ImportXml()
|
|
||||||
|
private void ImportXmlDialog()
|
||||||
{
|
{
|
||||||
if (!EditMode) return;
|
if (!EditMode) return;
|
||||||
if (CurrentFolder?.IsSearchResults ?? false) return;
|
if (CurrentFolder?.IsSearchResults ?? false) return;
|
||||||
@ -2567,14 +2568,13 @@ namespace CodeWalker
|
|||||||
|
|
||||||
if (!EnsureRpfValidEncryption() && (CurrentFolder.RpfFolder != null)) return;
|
if (!EnsureRpfValidEncryption() && (CurrentFolder.RpfFolder != null)) return;
|
||||||
|
|
||||||
|
|
||||||
OpenFileDialog.Filter = "XML Files|*.xml";
|
OpenFileDialog.Filter = "XML Files|*.xml";
|
||||||
if (OpenFileDialog.ShowDialog(this) != DialogResult.OK)
|
if (OpenFileDialog.ShowDialog(this) != DialogResult.OK) return;
|
||||||
{
|
ImportXml(OpenFileDialog.FileNames);
|
||||||
return;//canceled
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var fpaths = OpenFileDialog.FileNames;
|
private void ImportXml(string[] fpaths)
|
||||||
|
{
|
||||||
foreach (var fpath in fpaths)
|
foreach (var fpath in fpaths)
|
||||||
{
|
{
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
@ -3680,7 +3680,7 @@ namespace CodeWalker
|
|||||||
else if (ctrl) ExtractRaw();
|
else if (ctrl) ExtractRaw();
|
||||||
break;
|
break;
|
||||||
case Keys.Insert:
|
case Keys.Insert:
|
||||||
if (shft) ImportXml();
|
if (shft) ImportXmlDialog();
|
||||||
else if (!ctrl) ImportRaw();
|
else if (!ctrl) ImportRaw();
|
||||||
break;
|
break;
|
||||||
case Keys.C:
|
case Keys.C:
|
||||||
@ -3859,7 +3859,19 @@ namespace CodeWalker
|
|||||||
var files = e.Data.GetData(DataFormats.FileDrop) as string[];
|
var files = e.Data.GetData(DataFormats.FileDrop) as string[];
|
||||||
if ((files == null) || (files.Length <= 0)) return;
|
if ((files == null) || (files.Length <= 0)) return;
|
||||||
if (files[0].StartsWith(GetDropFolder(), StringComparison.InvariantCultureIgnoreCase)) return; //don't dry to drop on ourselves...
|
if (files[0].StartsWith(GetDropFolder(), StringComparison.InvariantCultureIgnoreCase)) return; //don't dry to drop on ourselves...
|
||||||
ImportRaw(files);
|
|
||||||
|
//Import as raw regardless of file type while pressing shift
|
||||||
|
if ((e.KeyState & 4) == 4)
|
||||||
|
{
|
||||||
|
ImportRaw(files);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var raw = files.Where(x => !x.EndsWith(".xml"));
|
||||||
|
var xml = files.Except(raw);
|
||||||
|
|
||||||
|
if (raw.Count() > 0) ImportRaw(raw.ToArray());
|
||||||
|
if (xml.Count() > 0) ImportXml(xml.ToArray());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4071,7 +4083,7 @@ namespace CodeWalker
|
|||||||
|
|
||||||
private void ListContextImportXmlMenu_Click(object sender, EventArgs e)
|
private void ListContextImportXmlMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ImportXml();
|
ImportXmlDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ListContextImportRawMenu_Click(object sender, EventArgs e)
|
private void ListContextImportRawMenu_Click(object sender, EventArgs e)
|
||||||
@ -4166,7 +4178,7 @@ namespace CodeWalker
|
|||||||
|
|
||||||
private void EditImportXmlMenu_Click(object sender, EventArgs e)
|
private void EditImportXmlMenu_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ImportXml();
|
ImportXmlDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditImportRawMenu_Click(object sender, EventArgs e)
|
private void EditImportRawMenu_Click(object sender, EventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user