tastudio: global clipboard has preference over internal
This commit is contained in:
parent
a76226fcc2
commit
f52d8a526b
|
@ -390,7 +390,30 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
var wasPaused = Mainform.EmulatorPaused;
|
||||
|
||||
if (_tasClipboard.Any())
|
||||
// copypaste from PasteInsertMenuItem_Click!
|
||||
IDataObject data = Clipboard.GetDataObject();
|
||||
if (data.GetDataPresent(DataFormats.StringFormat))
|
||||
{
|
||||
string input = (string)data.GetData(DataFormats.StringFormat);
|
||||
if (!string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
string[] lines = input.Split('\n');
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
_tasClipboard.Clear();
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
var line = TasClipboardEntry.SetFromMnemonicStr(lines[i]);
|
||||
if (line == null)
|
||||
return;
|
||||
else
|
||||
_tasClipboard.Add(new TasClipboardEntry(i, line));
|
||||
}
|
||||
PasteMenuItem_Click(sender, e); // pseudo recursion
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_tasClipboard.Any())
|
||||
{
|
||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||
|
||||
|
@ -413,38 +436,36 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshDialog();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// copypaste from PasteInsertMenuItem_Click!
|
||||
IDataObject data = Clipboard.GetDataObject();
|
||||
if (data.GetDataPresent(DataFormats.StringFormat))
|
||||
{
|
||||
string input = (string)data.GetData(DataFormats.StringFormat);
|
||||
if (!string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
string[] lines = input.Split('\n');
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
var line = TasClipboardEntry.SetFromMnemonicStr(lines[i]);
|
||||
if (line == null)
|
||||
return;
|
||||
else
|
||||
_tasClipboard.Add(new TasClipboardEntry(i, line));
|
||||
}
|
||||
PasteMenuItem_Click(sender, e); // pseudo recursion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PasteInsertMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var wasPaused = Mainform.EmulatorPaused;
|
||||
|
||||
if (_tasClipboard.Any())
|
||||
// copypaste from PasteMenuItem_Click!
|
||||
IDataObject data = Clipboard.GetDataObject();
|
||||
if (data.GetDataPresent(DataFormats.StringFormat))
|
||||
{
|
||||
string input = (string)data.GetData(DataFormats.StringFormat);
|
||||
if (!string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
string[] lines = input.Split('\n');
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
_tasClipboard.Clear();
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
var line = TasClipboardEntry.SetFromMnemonicStr(lines[i]);
|
||||
if (line == null)
|
||||
return;
|
||||
else
|
||||
_tasClipboard.Add(new TasClipboardEntry(i, line));
|
||||
}
|
||||
PasteInsertMenuItem_Click(sender, e); // pseudo recursion
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_tasClipboard.Any())
|
||||
{
|
||||
var needsToRollback = TasView.FirstSelectedIndex < Emulator.Frame;
|
||||
|
||||
|
@ -467,31 +488,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
RefreshDialog();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// copypaste from PasteMenuItem_Click!
|
||||
IDataObject data = Clipboard.GetDataObject();
|
||||
if (data.GetDataPresent(DataFormats.StringFormat))
|
||||
{
|
||||
string input = (string)data.GetData(DataFormats.StringFormat);
|
||||
if (!string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
string[] lines = input.Split('\n');
|
||||
if (lines.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
{
|
||||
var line = TasClipboardEntry.SetFromMnemonicStr(lines[i]);
|
||||
if (line == null)
|
||||
return;
|
||||
else
|
||||
_tasClipboard.Add(new TasClipboardEntry(i, line));
|
||||
}
|
||||
PasteInsertMenuItem_Click(sender, e); // pseudo recursion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CutMenuItem_Click(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in New Issue