|
From: <an...@us...> - 2007-05-16 14:01:01
|
Revision: 404
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=404&view=rev
Author: and-81
Date: 2007-05-16 07:00:58 -0700 (Wed, 16 May 2007)
Log Message:
-----------
Fixed STB Command modification through BlasterCommand dialog
Modified Paths:
--------------
trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs
trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs 2007-05-16 07:37:02 UTC (rev 403)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs 2007-05-16 14:00:58 UTC (rev 404)
@@ -29,44 +29,55 @@
#endregion Properties
+ #region Variables
+
+ string _baseFolder;
+
+ #endregion Variables
+
#region Constructors
- public BlastCommand(string file)
+ public BlastCommand(string baseFolder, string file)
{
InitializeComponent();
- labelIRCommandFile.Text = file;
+ SetupPortsAndSpeeds();
- comboBoxPort.Items.AddRange(TV2BlasterPlugin.TransceiverInformation.Ports);
- comboBoxPort.SelectedIndex = 0;
+ _baseFolder = baseFolder;
- comboBoxSpeed.Items.AddRange(TV2BlasterPlugin.TransceiverInformation.Speeds);
- comboBoxSpeed.SelectedIndex = 0;
+ labelIRCommandFile.Text = file;
}
- public BlastCommand(string[] commands)
+ public BlastCommand(string baseFolder, string[] commands)
{
InitializeComponent();
+ SetupPortsAndSpeeds();
+
+ _baseFolder = baseFolder;
+
if (commands == null)
return;
labelIRCommandFile.Text = commands[0];
- comboBoxPort.Items.AddRange(TV2BlasterPlugin.TransceiverInformation.Ports);
if (comboBoxPort.Items.Contains(commands[1]))
comboBoxPort.SelectedItem = commands[1];
- else
- comboBoxPort.SelectedIndex = 0;
- comboBoxSpeed.Items.AddRange(TV2BlasterPlugin.TransceiverInformation.Speeds);
if (comboBoxSpeed.Items.Contains(commands[2]))
comboBoxSpeed.SelectedItem = commands[2];
- else
- comboBoxSpeed.SelectedIndex = 0;
}
#endregion Constructors
+ void SetupPortsAndSpeeds()
+ {
+ comboBoxPort.Items.AddRange(TV2BlasterPlugin.TransceiverInformation.Ports);
+ comboBoxPort.SelectedIndex = 0;
+
+ comboBoxSpeed.Items.AddRange(TV2BlasterPlugin.TransceiverInformation.Speeds);
+ comboBoxSpeed.SelectedIndex = 0;
+ }
+
#region Buttons
private void buttonOK_Click(object sender, EventArgs e)
@@ -90,7 +101,7 @@
try
{
- TV2BlasterPlugin.BlastIR(Common.FolderIRCommands + fileName + Common.FileExtensionIR,
+ TV2BlasterPlugin.BlastIR(_baseFolder + fileName + Common.FileExtensionIR,
comboBoxPort.SelectedItem as string,
comboBoxSpeed.SelectedItem as string);
}
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs 2007-05-16 07:37:02 UTC (rev 403)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs 2007-05-16 14:00:58 UTC (rev 404)
@@ -233,7 +233,7 @@
}
else
{
- BlastCommand blastCommand = new BlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, selected.Substring(Common.CmdPrefixBlast.Length));
if (blastCommand.ShowDialog(this) == DialogResult.Cancel)
return;
@@ -398,7 +398,7 @@
else if (selected.StartsWith(Common.CmdPrefixBlast))
{
string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
- BlastCommand blastCommand = new BlastCommand(commands);
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, commands);
if (blastCommand.ShowDialog(this) == DialogResult.Cancel)
return;
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs 2007-05-16 07:37:02 UTC (rev 403)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs 2007-05-16 14:00:58 UTC (rev 404)
@@ -220,7 +220,7 @@
if (command.StartsWith(Common.CmdPrefixSTB))
{
- blastCommand = new BlastCommand(command.Substring(Common.CmdPrefixSTB.Length));
+ blastCommand = new BlastCommand(Common.FolderSTB, command.Substring(Common.CmdPrefixSTB.Length));
listViewExternalCommands.Items[i].SubItems[1].Text = Common.CmdPrefixSTB + blastCommand.CommandString;
}
else
@@ -280,14 +280,14 @@
if (selected.StartsWith(Common.CmdPrefixBlast))
{
string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
- BlastCommand blastCommand = new BlastCommand(commands);
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, commands);
if (blastCommand.ShowDialog(this) == DialogResult.OK)
listViewExternalCommands.SelectedItems[0].SubItems[1].Text = Common.CmdPrefixBlast + blastCommand.CommandString;
}
else if (selected.StartsWith(Common.CmdPrefixSTB))
{
string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixSTB.Length));
- BlastCommand blastCommand = new BlastCommand(commands);
+ BlastCommand blastCommand = new BlastCommand(Common.FolderSTB, commands);
if (blastCommand.ShowDialog(this) == DialogResult.OK)
listViewExternalCommands.SelectedItems[0].SubItems[1].Text = Common.CmdPrefixSTB + blastCommand.CommandString;
}
@@ -366,7 +366,7 @@
}
else if (selected.StartsWith(Common.CmdPrefixBlast))
{
- BlastCommand blastCommand = new BlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, selected.Substring(Common.CmdPrefixBlast.Length));
if (blastCommand.ShowDialog(this) == DialogResult.Cancel)
return;
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs 2007-05-16 07:37:02 UTC (rev 403)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs 2007-05-16 14:00:58 UTC (rev 404)
@@ -29,44 +29,55 @@
#endregion Properties
+ #region Variables
+
+ string _baseFolder;
+
+ #endregion Variables
+
#region Constructors
- public BlastCommand(string file)
+ public BlastCommand(string baseFolder, string file)
{
InitializeComponent();
- labelIRCommandFile.Text = file;
+ SetupPortsAndSpeeds();
- comboBoxPort.Items.AddRange(TV3BlasterPlugin.TransceiverInformation.Ports);
- comboBoxPort.SelectedIndex = 0;
+ _baseFolder = baseFolder;
- comboBoxSpeed.Items.AddRange(TV3BlasterPlugin.TransceiverInformation.Speeds);
- comboBoxSpeed.SelectedIndex = 0;
+ labelIRCommandFile.Text = file;
}
- public BlastCommand(string[] commands)
+ public BlastCommand(string baseFolder, string[] commands)
{
InitializeComponent();
+ SetupPortsAndSpeeds();
+
+ _baseFolder = baseFolder;
+
if (commands == null)
return;
labelIRCommandFile.Text = commands[0];
- comboBoxPort.Items.AddRange(TV3BlasterPlugin.TransceiverInformation.Ports);
if (comboBoxPort.Items.Contains(commands[1]))
comboBoxPort.SelectedItem = commands[1];
- else
- comboBoxPort.SelectedIndex = 0;
- comboBoxSpeed.Items.AddRange(TV3BlasterPlugin.TransceiverInformation.Speeds);
if (comboBoxSpeed.Items.Contains(commands[2]))
comboBoxSpeed.SelectedItem = commands[2];
- else
- comboBoxSpeed.SelectedIndex = 0;
}
#endregion Constructors
+ void SetupPortsAndSpeeds()
+ {
+ comboBoxPort.Items.AddRange(TV3BlasterPlugin.TransceiverInformation.Ports);
+ comboBoxPort.SelectedIndex = 0;
+
+ comboBoxSpeed.Items.AddRange(TV3BlasterPlugin.TransceiverInformation.Speeds);
+ comboBoxSpeed.SelectedIndex = 0;
+ }
+
#region Buttons
private void buttonOK_Click(object sender, EventArgs e)
@@ -90,7 +101,7 @@
try
{
- TV3BlasterPlugin.BlastIR(Common.FolderIRCommands + fileName + Common.FileExtensionIR,
+ TV3BlasterPlugin.BlastIR(_baseFolder + fileName + Common.FileExtensionIR,
comboBoxPort.SelectedItem as string,
comboBoxSpeed.SelectedItem as string);
}
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs 2007-05-16 07:37:02 UTC (rev 403)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs 2007-05-16 14:00:58 UTC (rev 404)
@@ -213,7 +213,7 @@
}
else
{
- BlastCommand blastCommand = new BlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, selected.Substring(Common.CmdPrefixBlast.Length));
if (blastCommand.ShowDialog(this) == DialogResult.Cancel)
return;
@@ -364,7 +364,7 @@
else if (selected.StartsWith(Common.CmdPrefixBlast))
{
string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
- BlastCommand blastCommand = new BlastCommand(commands);
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, commands);
if (blastCommand.ShowDialog(this) == DialogResult.Cancel)
return;
Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs
===================================================================
--- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs 2007-05-16 07:37:02 UTC (rev 403)
+++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs 2007-05-16 14:00:58 UTC (rev 404)
@@ -244,7 +244,7 @@
if (command.StartsWith(Common.CmdPrefixSTB))
{
- blastCommand = new BlastCommand(command.Substring(Common.CmdPrefixSTB.Length));
+ blastCommand = new BlastCommand(Common.FolderSTB, command.Substring(Common.CmdPrefixSTB.Length));
listViewExternalCommands.Items[i].SubItems[1].Text = Common.CmdPrefixSTB + blastCommand.CommandString;
}
else
@@ -304,14 +304,14 @@
if (selected.StartsWith(Common.CmdPrefixBlast))
{
string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
- BlastCommand blastCommand = new BlastCommand(commands);
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, commands);
if (blastCommand.ShowDialog(this) == DialogResult.OK)
listViewExternalCommands.SelectedItems[0].SubItems[1].Text = Common.CmdPrefixBlast + blastCommand.CommandString;
}
else if (selected.StartsWith(Common.CmdPrefixSTB))
{
string[] commands = Common.SplitBlastCommand(selected.Substring(Common.CmdPrefixSTB.Length));
- BlastCommand blastCommand = new BlastCommand(commands);
+ BlastCommand blastCommand = new BlastCommand(Common.FolderSTB, commands);
if (blastCommand.ShowDialog(this) == DialogResult.OK)
listViewExternalCommands.SelectedItems[0].SubItems[1].Text = Common.CmdPrefixSTB + blastCommand.CommandString;
}
@@ -390,7 +390,7 @@
}
else if (selected.StartsWith(Common.CmdPrefixBlast))
{
- BlastCommand blastCommand = new BlastCommand(selected.Substring(Common.CmdPrefixBlast.Length));
+ BlastCommand blastCommand = new BlastCommand(Common.FolderIRCommands, selected.Substring(Common.CmdPrefixBlast.Length));
if (blastCommand.ShowDialog(this) == DialogResult.Cancel)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|