From: <an...@us...> - 2007-09-28 18:46:12
|
Revision: 962 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=962&view=rev Author: and-81 Date: 2007-09-28 11:46:10 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-09-28 18:10:48 UTC (rev 961) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-09-28 18:46:10 UTC (rev 962) @@ -69,7 +69,7 @@ comboBoxCopyFrom.SelectedIndex = 0; // Setup quick setup combo box - string[] quickSetupFiles = Directory.GetFiles(MCEReplacement.AppDataFolder + MCEReplacement.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); + string[] quickSetupFiles = Directory.GetFiles(MCEReplacement.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); foreach (string file in quickSetupFiles) comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file)); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-09-28 18:10:48 UTC (rev 961) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-09-28 18:46:10 UTC (rev 962) @@ -169,7 +169,7 @@ } } - void ReceivedRemoteButton(string button) + public void ReceivedRemoteButton(string button) { if (listViewButtons.SelectedIndices.Count == 1 && tabControl.SelectedTab == tabPageDifferentRemote) { @@ -220,7 +220,7 @@ if (listBoxIR.SelectedIndex != -1) { string command = (string)listBoxIR.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + command + Common.FileExtensionIR; + string fileName = MCEReplacement.IRFolder + command + Common.FileExtensionIR; if (File.Exists(fileName)) { @@ -243,7 +243,7 @@ if (listBoxMacro.SelectedIndex != -1) { string command = (string)listBoxMacro.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + command + Common.FileExtensionMacro; + string fileName = MCEReplacement.MacroFolder + command + Common.FileExtensionMacro; if (File.Exists(fileName)) { @@ -383,7 +383,7 @@ if (listBoxIR.SelectedIndex != -1) { string file = (string)listBoxIR.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + file + Common.FileExtensionIR; + string fileName = MCEReplacement.IRFolder + file + Common.FileExtensionIR; if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) @@ -401,7 +401,7 @@ private void buttonNewMacro_Click(object sender, EventArgs e) { - MacroEditor macroEditor = new MacroEditor(true, ""); + MacroEditor macroEditor = new MacroEditor(true, "New"); macroEditor.ShowDialog(this); RefreshMacroList(); @@ -416,7 +416,7 @@ if (listBoxMacro.SelectedIndex != -1) { string file = (string)listBoxMacro.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + file + Common.FileExtensionMacro; + string fileName = MCEReplacement.MacroFolder + file + Common.FileExtensionMacro; if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-09-28 18:10:48 UTC (rev 961) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-09-28 18:46:10 UTC (rev 962) @@ -56,7 +56,6 @@ public static readonly string MacroFolder = AppDataFolder + "Macro\\"; public static readonly string STBFolder = AppDataFolder + "STB\\"; - public static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice) + "\\"; public static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault) + "\\"; @@ -337,6 +336,8 @@ public void ShowPlugin() { + Log.Debug("MCE Replacement: {0}", AppDataFolder); + LoadSettings(); LoadDefaultMapping(); LoadMultiMappings(); @@ -355,9 +356,25 @@ } SetupForm setupForm = new SetupForm(); + + try + { + _mceTransceiver = new MicrosoftMceTransceiver.MicrosoftMceTransceiver(); + _mceTransceiver.RemoteCallback = new IRServerPluginInterface.RemoteHandler(setupForm.ReceivedRemoteButton); + _mceTransceiver.Start(); + } + catch (Exception ex) + { + Log.Error("MCEReplacement: {0}", ex.Message); + _mceTransceiver = null; + } + if (setupForm.ShowDialog() == DialogResult.OK) SaveSettings(); + if (_mceTransceiver != null) + _mceTransceiver.Stop(); + if (LogVerbose) Log.Info("MCEReplacement: ShowPlugin() - End"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |