Revision: 116
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=116&view=rev
Author: and-81
Date: 2007-02-13 05:29:30 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/plugins/MCEReplacement/Forms/SetupForm.cs
Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs
===================================================================
--- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-13 09:06:06 UTC (rev 115)
+++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-13 13:29:30 UTC (rev 116)
@@ -99,6 +99,8 @@
comboBoxCommands.Items.Clear();
comboBoxCommands.Items.Add("Run Program");
comboBoxCommands.Items.Add("Serial Command");
+ comboBoxCommands.Items.Add("Message Command");
+ comboBoxCommands.Items.Add("Keystrokes Command");
comboBoxCommands.Items.Add("Go To Screen");
comboBoxCommands.Items.AddRange(MCEReplacement.GetFileList());
@@ -533,6 +535,22 @@
command = MCEReplacement.SerialCommandPrefix + serialCommand.CommandString;
}
+ else if (selected == "Message Command")
+ {
+ MessageCommand messageCommand = new MessageCommand();
+ if (messageCommand.ShowDialog(this) == DialogResult.Cancel)
+ return;
+
+ command = MCEReplacement.MessageCommandPrefix + messageCommand.CommandString;
+ }
+ else if (selected == "Keystrokes Command")
+ {
+ KeysCommand keysCommand = new KeysCommand();
+ if (keysCommand.ShowDialog(this) == DialogResult.Cancel)
+ return;
+
+ command = MCEReplacement.KeyCommandPrefix + keysCommand.CommandString;
+ }
else
{
command = MCEReplacement.BlastCommandPrefix + selected;
@@ -702,8 +720,14 @@
if (command.StartsWith(MCEReplacement.RunCommandPrefix))
{
- ExternalProgram externalProgram = new ExternalProgram(MCEReplacement.SplitRunCommand(command.Substring(MCEReplacement.RunCommandPrefix.Length)));
+ string[] commands = MCEReplacement.SplitRunCommand(command.Substring(MCEReplacement.RunCommandPrefix.Length));
+ if (commands == null)
+ {
+ MessageBox.Show(this, "The current Run command is corrupted, please re-set this command", "Corrupt run command", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+ ExternalProgram externalProgram = new ExternalProgram(commands);
if (externalProgram.ShowDialog(this) == DialogResult.Cancel)
return;
@@ -719,12 +743,42 @@
}
else if (command.StartsWith(MCEReplacement.SerialCommandPrefix))
{
- SerialCommand serialCommand = new SerialCommand(command.Substring(MCEReplacement.SerialCommandPrefix.Length));
+ string[] commands = MCEReplacement.SplitSerialCommand(command.Substring(MCEReplacement.SerialCommandPrefix.Length));
+ if (commands == null)
+ {
+ MessageBox.Show(this, "The current Serial command is corrupted, please re-set this command", "Corrupt serial command", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ SerialCommand serialCommand = new SerialCommand(commands);
if (serialCommand.ShowDialog(this) == DialogResult.Cancel)
return;
command = MCEReplacement.SerialCommandPrefix + serialCommand.CommandString;
}
+ else if (command.StartsWith(MCEReplacement.MessageCommandPrefix))
+ {
+ string[] commands = MCEReplacement.SplitMessageCommand(command.Substring(MCEReplacement.MessageCommandPrefix.Length));
+ if (commands == null)
+ {
+ MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt message command", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ MessageCommand messageCommand = new MessageCommand(commands);
+ if (messageCommand.ShowDialog(this) == DialogResult.Cancel)
+ return;
+
+ command = MCEReplacement.MessageCommandPrefix + messageCommand.CommandString;
+ }
+ else if (command.StartsWith(MCEReplacement.KeyCommandPrefix))
+ {
+ KeysCommand keysCommand = new KeysCommand(command.Substring(MCEReplacement.KeyCommandPrefix.Length));
+ if (keysCommand.ShowDialog(this) == DialogResult.Cancel)
+ return;
+
+ command = MCEReplacement.KeyCommandPrefix + keysCommand.CommandString;
+ }
else
{
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|