You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <an...@us...> - 2007-02-18 10:56:39
|
Revision: 122 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=122&view=rev Author: and-81 Date: 2007-02-18 02:56:12 -0800 (Sun, 18 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-18 09:42:47 UTC (rev 121) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-18 10:56:12 UTC (rev 122) @@ -839,7 +839,8 @@ if (LogVerbose) Log.Info("MCEReplacement: Tune External Channel: {0}, Tuner card: {1}", msg.Label, msg.Label2); - if (!ProcessExternalChannel(msg.Label, msg.Label2)) + //if (!ProcessExternalChannel(msg.Label, msg.Label2)) + if (!ProcessExternalChannel(msg.Label, "0")) Log.Error("MCEReplacement: Failed to process external channel request"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <du...@us...> - 2007-02-18 09:42:55
|
Revision: 121 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=121&view=rev Author: dukus Date: 2007-02-18 01:42:47 -0800 (Sun, 18 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Form1.cs trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs trunk/plugins/mpinstaler/MPInstaler.suo Added Paths: ----------- trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs trunk/plugins/mpinstaler/MPInstaler/Language dialog.resx trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs trunk/plugins/mpinstaler/MPInstaler/start_form.cs trunk/plugins/mpinstaler/MPInstaler/start_form.resx trunk/plugins/mpinstaler/MPInstaler/wizard/ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.resx trunk/plugins/mpinstaler/MPInstaler/wizard_background.png Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-17 19:02:54 UTC (rev 120) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -75,12 +75,14 @@ this.label1 = new System.Windows.Forms.Label(); this.tabPage_Language = new System.Windows.Forms.TabPage(); this.tabPage_Proiect = new System.Windows.Forms.TabPage(); + this.proiectt_textBox3 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.proiectt_textBox2 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.proiectt_textBox1 = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); - this.proiectt_textBox1 = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.proiectt_textBox2 = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.proiectt_textBox3 = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.proiectt_textBox4 = new System.Windows.Forms.TextBox(); this.menuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -456,6 +458,8 @@ // // tabPage_Proiect // + this.tabPage_Proiect.Controls.Add(this.proiectt_textBox4); + this.tabPage_Proiect.Controls.Add(this.label5); this.tabPage_Proiect.Controls.Add(this.proiectt_textBox3); this.tabPage_Proiect.Controls.Add(this.label4); this.tabPage_Proiect.Controls.Add(this.proiectt_textBox2); @@ -469,23 +473,31 @@ this.tabPage_Proiect.Text = "Proiect Properties"; this.tabPage_Proiect.UseVisualStyleBackColor = true; // - // label2 + // proiectt_textBox3 // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(3, 12); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(41, 13); - this.label2.TabIndex = 0; - this.label2.Text = "Name :"; + this.proiectt_textBox3.Location = new System.Drawing.Point(94, 59); + this.proiectt_textBox3.Name = "proiectt_textBox3"; + this.proiectt_textBox3.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox3.TabIndex = 5; + this.proiectt_textBox3.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged); // - // proiectt_textBox1 + // label4 // - this.proiectt_textBox1.Location = new System.Drawing.Point(94, 5); - this.proiectt_textBox1.Name = "proiectt_textBox1"; - this.proiectt_textBox1.Size = new System.Drawing.Size(298, 20); - this.proiectt_textBox1.TabIndex = 1; - this.proiectt_textBox1.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged); + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(3, 66); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(73, 13); + this.label4.TabIndex = 4; + this.label4.Text = "Update URL :"; // + // proiectt_textBox2 + // + this.proiectt_textBox2.Location = new System.Drawing.Point(94, 33); + this.proiectt_textBox2.Name = "proiectt_textBox2"; + this.proiectt_textBox2.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox2.TabIndex = 3; + this.proiectt_textBox2.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged); + // // label3 // this.label3.AutoSize = true; @@ -495,29 +507,40 @@ this.label3.TabIndex = 2; this.label3.Text = "Author :"; // - // proiectt_textBox2 + // proiectt_textBox1 // - this.proiectt_textBox2.Location = new System.Drawing.Point(94, 33); - this.proiectt_textBox2.Name = "proiectt_textBox2"; - this.proiectt_textBox2.Size = new System.Drawing.Size(298, 20); - this.proiectt_textBox2.TabIndex = 3; + this.proiectt_textBox1.Location = new System.Drawing.Point(94, 5); + this.proiectt_textBox1.Name = "proiectt_textBox1"; + this.proiectt_textBox1.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox1.TabIndex = 1; + this.proiectt_textBox1.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged); // - // label4 + // label2 // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(3, 66); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(73, 13); - this.label4.TabIndex = 4; - this.label4.Text = "Update URL :"; + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 12); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(41, 13); + this.label2.TabIndex = 0; + this.label2.Text = "Name :"; // - // proiectt_textBox3 + // label5 // - this.proiectt_textBox3.Location = new System.Drawing.Point(94, 59); - this.proiectt_textBox3.Name = "proiectt_textBox3"; - this.proiectt_textBox3.Size = new System.Drawing.Size(298, 20); - this.proiectt_textBox3.TabIndex = 5; + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(5, 92); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(48, 13); + this.label5.TabIndex = 6; + this.label5.Text = "Version :"; // + // proiectt_textBox4 + // + this.proiectt_textBox4.Location = new System.Drawing.Point(94, 85); + this.proiectt_textBox4.Name = "proiectt_textBox4"; + this.proiectt_textBox4.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox4.TabIndex = 7; + this.proiectt_textBox4.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -597,6 +620,8 @@ private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox proiectt_textBox3; private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox proiectt_textBox4; } } Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-17 19:02:54 UTC (rev 120) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -15,6 +15,7 @@ { private MPinstalerStruct _struct = new MPinstalerStruct(); private string proiect_file_name = "Untitled"; + private bool _loading = false; public Form1() { InitializeComponent(); @@ -29,12 +30,13 @@ saveFileDialog1.Filter = "Proiect files (*.xmp)|*.xmp|All files |*.*"; if (Path.GetFileName(proiect_file_name) == "Untitled") { + _struct.AddFileList(bossview); if (saveFileDialog1.ShowDialog(this) == DialogResult.OK) { proiect_file_name = saveFileDialog1.FileName; - save_proiect_file(proiect_file_name); + _struct.SaveToFile(proiect_file_name); } - } else save_proiect_file(proiect_file_name); + } else _struct.SaveToFile(proiect_file_name); } private void windowToolStripMenuItem_Click(object sender, EventArgs e) @@ -131,6 +133,17 @@ addplugin(5); } + private void addrow(MPIFileList list) + { + ListViewItem item1 = new ListViewItem(Path.GetFileName(list.FileName), 0); + item1.SubItems.Add(list.Type); + item1.SubItems.Add(list.SubType); + item1.SubItems.Add(list.FileName); + item1.SubItems.Add(list.ID); + item1.SubItems.Add(list.Option); + bossview.Items.AddRange(new ListViewItem[] { item1 }); + } + private void addrow(string file, string type, string subtype, string path, string id) { ListViewItem item1 = new ListViewItem(file, 0); @@ -151,39 +164,35 @@ item1.SubItems.Add(op); bossview.Items.AddRange(new ListViewItem[] { item1 }); } + private void openProiectToolStripMenuItem_Click(object sender, EventArgs e) { string fil; openFileDialog1.Filter = "Proiect files (*.xmp)|*.xmp|All files |*.*"; if (openFileDialog1.ShowDialog(this) == DialogResult.OK) { + bossview.Items.Clear(); fil = openFileDialog1.FileName; proiect_file_name = fil; - XmlDocument doc = new XmlDocument(); - doc.Load(fil); - XmlNode ver = doc.DocumentElement.SelectSingleNode("/MPinstaler"); - bossview.Items.Clear(); - XmlNodeList fileList = ver.SelectNodes("FileList/File"); - foreach (XmlNode nodefile in fileList) + _struct.LoadFromFile(fil); + _struct.ProiectdFileName = fil; + loadProperties(); + for (int i=0;i<_struct.FileList.Count;i++) { - addrow(nodefile.SelectSingleNode("FileName").InnerText, - nodefile.SelectSingleNode("Type").InnerText, - nodefile.SelectSingleNode("SubType").InnerText, - nodefile.SelectSingleNode("Source").InnerText, - nodefile.SelectSingleNode("Id").InnerText); + addrow((MPIFileList)_struct.FileList[i]); } - _struct.BuildFileName = ver.SelectSingleNode("Option/BuildFileName").InnerText; - _struct.Name = ver.SelectSingleNode("Option/ProiectName").InnerText; - _struct.Author = ver.SelectSingleNode("Option/Author").InnerText; - _struct.UpdateURL = ver.SelectSingleNode("Option/UpdateURL").InnerText; - _struct.ProiectdFileName = fil; } - _struct.AddFileList(bossview); - proiectt_textBox1.Text = _struct.Name; - proiectt_textBox2.Text = _struct.Author; - proiectt_textBox2.Text = _struct.UpdateURL; } + private void loadProperties() + { + _loading = true; + proiectt_textBox1.Text = _struct.Name; + proiectt_textBox2.Text = _struct.Author; + proiectt_textBox3.Text = _struct.UpdateURL; + proiectt_textBox4.Text = _struct.Version; + _loading = false; + } private void languageToolStripMenuItem_Click(object sender, EventArgs e) { Form2 StrForm = new Form2(); @@ -208,6 +217,7 @@ { bossview.Items.Clear(); _struct.Clear(); + loadProperties(); } private void componentToolStripMenuItem_Click(object sender, EventArgs e) @@ -226,66 +236,7 @@ if (bossview.Items[i].Selected) bossview.Items.RemoveAt(i); } - private void save_proiect_file(string fil) - { - Stream myStream; - if ((myStream = File.Open(fil,FileMode.Create, FileAccess.Write, FileShare.None)) != null) - { - // Code to write the stream goes here. - XmlDocument doc = new XmlDocument(); - XmlWriter writer = null; - _struct.AddFileList(bossview); - try - { - // Create an XmlWriterSettings object with the correct options. - XmlWriterSettings settings = new XmlWriterSettings(); - string st = string.Empty; - settings.Indent = true; - settings.IndentChars = ("\t"); - settings.OmitXmlDeclaration = true; - // Create the XmlWriter object and write some content. - writer = XmlWriter.Create(myStream, settings); - writer.WriteStartElement("MPinstaler"); - writer.WriteElementString("ver", "1.00.000"); - writer.WriteStartElement("FileList"); - for (int i = 0; i < _struct.FileList.Count; i++) - { - MPIFileList it = (MPIFileList)_struct.FileList[i]; - writer.WriteStartElement("File"); - writer.WriteElementString("FileName", Path.GetFileName(it.FileName)); - writer.WriteElementString("Type", it.Type); - writer.WriteElementString("SubType", it.SubType); - writer.WriteElementString("Source", Path.GetFullPath(it.FileName)); - writer.WriteElementString("Id", it.ID); - writer.WriteElementString("Option", it.Option); - writer.WriteEndElement(); - st = st + bossview.Items[i].SubItems[3].Text + @"\" + bossview.Items[i].Text + ";"; - } - writer.WriteEndElement(); - writer.WriteStartElement("Option"); - writer.WriteElementString("BuildFileName", _struct.BuildFileName); - writer.WriteElementString("ProiectFileName", Path.GetFullPath(_struct.ProiectdFileName)); - writer.WriteElementString("ProiectName", _struct.Name); - writer.WriteElementString("Author", _struct.Author); - writer.WriteElementString("UpdateURL", _struct.UpdateURL); - writer.WriteEndElement(); - writer.WriteEndElement(); - writer.Flush(); - //------------------------------------- - //------------------------------------- - } - finally - { - if (writer != null) - writer.Close(); - } - myStream.Close(); - - } - - } - private void saveProiectAsToolStripMenuItem_Click(object sender, EventArgs e) { saveFileDialog1.Filter = "Proiect files (*.xmp)|*.xmp|All files |*.*"; @@ -293,7 +244,8 @@ { proiect_file_name = saveFileDialog1.FileName; _struct.ProiectdFileName = proiect_file_name; - save_proiect_file(proiect_file_name); + _struct.AddFileList(bossview); + _struct.SaveToFile(proiect_file_name); } } @@ -361,7 +313,13 @@ private void proiectt_textBox1_TextChanged(object sender, EventArgs e) { - _struct.Name = proiectt_textBox1.Text; + if (!_loading) + { + _struct.Name = proiectt_textBox1.Text; + _struct.Author = proiectt_textBox2.Text; + _struct.UpdateURL = proiectt_textBox3.Text; + _struct.Version = proiectt_textBox4.Text; + } } Added: trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,161 @@ +namespace MPInstaler +{ + partial class Form2 + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.languageComboBox = new System.Windows.Forms.ComboBox(); + this.listView1 = new System.Windows.Forms.ListView(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(15, 279); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(65, 21); + this.button1.TabIndex = 0; + this.button1.Text = "Add"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(311, 279); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 21); + this.button2.TabIndex = 1; + this.button2.Text = "Remove"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // languageComboBox + // + this.languageComboBox.FormattingEnabled = true; + this.languageComboBox.Location = new System.Drawing.Point(12, 22); + this.languageComboBox.Name = "languageComboBox"; + this.languageComboBox.Size = new System.Drawing.Size(372, 21); + this.languageComboBox.TabIndex = 2; + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.listView1.FullRowSelect = true; + this.listView1.GridLines = true; + this.listView1.Location = new System.Drawing.Point(12, 68); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(372, 179); + this.listView1.TabIndex = 3; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); + // + // columnHeader1 + // + this.columnHeader1.Text = "Id"; + // + // columnHeader2 + // + this.columnHeader2.Text = "Value"; + this.columnHeader2.Width = 308; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(12, 253); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(62, 20); + this.textBox1.TabIndex = 4; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(80, 253); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(304, 20); + this.textBox2.TabIndex = 5; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(107, 279); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 21); + this.button3.TabIndex = 6; + this.button3.Text = "Save"; + this.button3.UseVisualStyleBackColor = true; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(209, 279); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 21); + this.button4.TabIndex = 7; + this.button4.Text = "Cancel"; + this.button4.UseVisualStyleBackColor = true; + // + // Form2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(396, 325); + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.listView1); + this.Controls.Add(this.languageComboBox); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "Form2"; + this.Text = "String Editor"; + this.Load += new System.EventHandler(this.Form2_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.ComboBox languageComboBox; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + } +} \ No newline at end of file Added: trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Globalization; +using MediaPortal.Configuration; + + +namespace MPInstaler +{ + public partial class Form2 : Form + { + public string baseDir; + string LanguageDirectory = Config.GetFolder(Config.Dir.Language); + public Form2() + { + InitializeComponent(); + } + private void LoadLanguages() + { + // Get system language + string strLongLanguage = CultureInfo.CurrentCulture.EnglishName; + int iTrimIndex = strLongLanguage.IndexOf(" ", 0, strLongLanguage.Length); + string strShortLanguage = strLongLanguage.Substring(0, iTrimIndex); + + bool bExactLanguageFound = false; + if (Directory.Exists(LanguageDirectory)) + { + string[] folders = Directory.GetDirectories(LanguageDirectory, "*.*"); + + foreach (string folder in folders) + { + string fileName = folder.Substring(folder.LastIndexOf(@"\") + 1); + + // + // Exclude cvs folder + // + if (fileName.ToLower() != "cvs") + { + if (fileName.Length > 0) + { + fileName = fileName.Substring(0, 1).ToUpper() + fileName.Substring(1); + languageComboBox.Items.Add(fileName); + + // Check language file to user region language + if (fileName.ToLower() == strLongLanguage.ToLower()) + { + languageComboBox.Text = fileName; + bExactLanguageFound = true; + } + else if (!bExactLanguageFound && (fileName.ToLower() == strShortLanguage.ToLower())) + { + languageComboBox.Text = fileName; + } + } + } + } + } + + if (languageComboBox.Text == "") + { + languageComboBox.Text = "English"; + } + } + + private void button1_Click(object sender, EventArgs e) + { + ListViewItem item1 = new ListViewItem(textBox1.Text, 0); + item1.SubItems.Add(textBox2.Text); + listView1.Items.AddRange(new ListViewItem[] { item1 }); + + } + + private void listView1_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void button2_Click(object sender, EventArgs e) + { + foreach (int index in listView1.SelectedIndices) + { + listView1.Items.RemoveAt(index); + } + } + + private void Form2_Load(object sender, EventArgs e) + { + + LoadLanguages(); + } + } +} \ No newline at end of file Added: trunk/plugins/mpinstaler/MPInstaler/Language dialog.resx =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Language dialog.resx (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/Language dialog.resx 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-17 19:02:54 UTC (rev 120) +++ trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-18 09:42:47 UTC (rev 121) @@ -55,9 +55,11 @@ <HintPath>D:\Program Files\Team MediaPortal\MediaPortal\ICSharpCode.SharpZipLib.DLL</HintPath> </Reference> <Reference Include="System" /> + <Reference Include="System.Configuration.Install" /> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Management" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> <Reference Include="Utils, Version=1.0.2595.36012, Culture=neutral, processorArchitecture=MSIL"> @@ -85,6 +87,7 @@ <Compile Include="Language dialog.Designer.cs"> <DependentUpon>Language dialog.cs</DependentUpon> </Compile> + <Compile Include="MPpackageStruct.cs" /> <Compile Include="OptionForm.cs"> <SubType>Form</SubType> </Compile> @@ -122,6 +125,10 @@ <SubType>Designer</SubType> <DependentUpon>start_form.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="wizard\wizard_1.resx"> + <SubType>Designer</SubType> + <DependentUpon>wizard_1.cs</DependentUpon> + </EmbeddedResource> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> @@ -149,6 +156,12 @@ <Compile Include="start_form.Designer.cs"> <DependentUpon>start_form.cs</DependentUpon> </Compile> + <Compile Include="wizard\wizard_1.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="wizard\wizard_1.Designer.cs"> + <DependentUpon>wizard_1.cs</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-17 19:02:54 UTC (rev 120) +++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -34,6 +34,8 @@ string _author = string.Empty; string _update = string.Empty; string _name = string.Empty; + string _version = string.Empty; + public ArrayList FileList = new ArrayList(); public MPinstalerStruct() { @@ -47,14 +49,21 @@ if (value == null) _update = ""; else _update = value; } } - public string Author + + public string Version { - get { return _author; } + get { return _version; } set { - if (value ==null) _author = "";else _author = value; + if (value == null) _version = ""; else _version = value; } } + + public string Author + { + get { return _author; } + set {_author = value; } + } public string Name { get { return _name; } @@ -83,8 +92,72 @@ { FileList.Clear(); BuildFileName = string.Empty; + ProiectdFileName = string.Empty; + Author = string.Empty; + Name = string.Empty; + Version = string.Empty; } + public bool SaveToFile(string fil) + { + Stream myStream; + if ((myStream = File.Open(fil, FileMode.Create, FileAccess.Write, FileShare.None)) != null) + { + // Code to write the stream goes here. + XmlDocument doc = new XmlDocument(); + XmlWriter writer = null; + try + { + // Create an XmlWriterSettings object with the correct options. + XmlWriterSettings settings = new XmlWriterSettings(); + string st = string.Empty; + settings.Indent = true; + settings.IndentChars = ("\t"); + settings.OmitXmlDeclaration = true; + // Create the XmlWriter object and write some content. + writer = XmlWriter.Create(myStream, settings); + writer.WriteStartElement("MPinstaler"); + writer.WriteElementString("ver", "1.00.000"); + writer.WriteStartElement("FileList"); + for (int i = 0; i < this.FileList.Count; i++) + { + MPIFileList it = (MPIFileList)this.FileList[i]; + writer.WriteStartElement("File"); + writer.WriteElementString("FileName", Path.GetFileName(it.FileName)); + writer.WriteElementString("Type", it.Type); + writer.WriteElementString("SubType", it.SubType); + writer.WriteElementString("Source", Path.GetFullPath(it.FileName)); + writer.WriteElementString("Id", it.ID); + writer.WriteElementString("Option", it.Option); + writer.WriteEndElement(); + //st = st + bossview.Items[i].SubItems[3].Text + @"\" + bossview.Items[i].Text + ";"; + } + writer.WriteEndElement(); + writer.WriteStartElement("Option"); + writer.WriteElementString("BuildFileName", this.BuildFileName); + writer.WriteElementString("ProiectFileName", Path.GetFullPath(this.ProiectdFileName)); + writer.WriteElementString("ProiectName", this.Name); + writer.WriteElementString("Author", this.Author); + writer.WriteElementString("UpdateURL", this.UpdateURL); + writer.WriteElementString("Version", this.Version); + writer.WriteEndElement(); + writer.WriteEndElement(); + writer.Flush(); + + //------------------------------------- + //------------------------------------- + } + finally + { + if (writer != null) + writer.Close(); + } + myStream.Close(); + + } + return true; + } + public void BuilFile(ListBox ls, ProgressBar pb) { ZipOutputStream s = new ZipOutputStream(File.Create(_builFileName)); @@ -128,10 +201,31 @@ s.Finish(); s.Close(); } + public void LoadFromFile(string fil) { + XmlDocument doc = new XmlDocument(); + doc.Load(fil); + XmlNode ver = doc.DocumentElement.SelectSingleNode("/MPinstaler"); + XmlNodeList fileList = ver.SelectNodes("FileList/File"); + foreach (XmlNode nodefile in fileList) + { + this.FileList.Add(new MPIFileList( + nodefile.SelectSingleNode("Source").InnerText, + nodefile.SelectSingleNode("Type").InnerText, + nodefile.SelectSingleNode("SubType").InnerText, + nodefile.SelectSingleNode("Id").InnerText, + nodefile.SelectSingleNode("Option").InnerText)); + } + XmlNode nodeoption = ver.SelectSingleNode("Option"); + this.BuildFileName = nodeoption.SelectSingleNode("BuildFileName").InnerText; + this.Name = nodeoption.SelectSingleNode("ProiectName").InnerText; + this.Author = nodeoption.SelectSingleNode("Author").InnerText; + this.UpdateURL = nodeoption.SelectSingleNode("UpdateURL").InnerText; + this.Version = nodeoption.SelectSingleNode("Version").InnerText; } + public string GetZipEntry(MPIFileList flst) { string ret = string.Empty; @@ -170,6 +264,11 @@ ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + "Media" + @"\" + Path.GetFileName(flst.FileName); } + if (flst.Type == TEXT_TYPE) + { + ret = "Release" + @"\" + "Text" + @"\" + flst.SubType + @"\" + Path.GetFileName(flst.FileName); + } + return ret; } } @@ -200,6 +299,7 @@ ID = i; Option = o; } + public string FileName { get { return _FileName; } Added: trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using ICSharpCode.SharpZipLib.Zip; + +namespace MPInstaler +{ + public class MPpackageStruct + { + public MPinstalerStruct _intalerStruct= new MPinstalerStruct(); + public bool isValid = false; + public MPpackageStruct() + { + + } + + public void LoadFromFile(string fil) + { + byte[] data = new byte[2048]; + int nb = data.Length; + + ZipEntry entry; + try + { + if (File.Exists(fil)) + { + ZipInputStream s = new ZipInputStream(File.OpenRead(fil)); + while ((entry = s.GetNextEntry()) != null) + { + if (entry.Name == "instaler.xmp") + { + string tpf =Path.GetFullPath(Environment.GetEnvironmentVariable("TEMP"))+@"\" +"instaler.xmp" ; + isValid = true; + FileStream fs = new FileStream(tpf, FileMode.Create); + while ((nb = s.Read(data, 0, data.Length)) > 0) + { + fs.Write(data, 0, nb); + //progressBar.Value = +nb; + } + fs.Close(); + _intalerStruct.LoadFromFile(tpf); + } + } + s.Close(); + } + } + catch (Exception) + { + isValid = false; + } + } + } +} Added: trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,93 @@ +namespace MPInstaler +{ + partial class start_form + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(86, 50); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(121, 32); + this.button1.TabIndex = 0; + this.button1.Text = "Manage package"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(86, 118); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(121, 32); + this.button2.TabIndex = 1; + this.button2.Text = "Install package"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(86, 184); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(121, 32); + this.button3.TabIndex = 2; + this.button3.Text = "Control panel"; + this.button3.UseVisualStyleBackColor = true; + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + this.openFileDialog1.Filter = "MPI files|*.mpi|ZIP files|*.zip|All files|*.*"; + // + // start_form + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(292, 266); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Name = "start_form"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + } +} \ No newline at end of file Added: trunk/plugins/mpinstaler/MPInstaler/start_form.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/start_form.cs (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/start_form.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace MPInstaler +{ + public partial class start_form : Form + { + public start_form() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + Form1 create_dlg = new Form1(); + this.Hide(); + create_dlg.ShowDialog(); + this.Show(); + } + + private void button2_Click(object sender, EventArgs e) + { + if (openFileDialog1.ShowDialog(this) == DialogResult.OK) + { + this.Hide(); + install_Package(openFileDialog1.FileName); + this.Show(); + } + } + + private void install_Package(string fil) + { + wizard_1 wiz = new wizard_1(); + wiz.package.LoadFromFile(fil); + if (wiz.package.isValid) + { + wiz.nextStep(); + } + else + MessageBox.Show("Invalid package !"); + + + } + } +} \ No newline at end of file Added: trunk/plugins/mpinstaler/MPInstaler/start_form.resx =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/start_form.resx (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/start_form.resx 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>39, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs 2007-02-18 09:42:47 UTC (rev 121) @@ -0,0 +1,127 @@ +namespace MPInstaler +{ + partial class wizard_1 + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(wizard_1)); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.button_back = new System.Windows.Forms.Button(); + this.button_next = new System.Windows.Forms.Button(); + this.button_cancel = new System.Windows.Forms.Button(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Location = new System.Drawing.Point(165, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(334, 298); + this.panel1.TabIndex = 0; + // + // panel2 + // + this.panel2.Controls.Add(this.pictureBox1); + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(168, 298); + this.panel2.TabIndex = 1; + // + // pictureBox1 + // + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.Location = new System.Drawing.Point(0, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(168, 298); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 5; + this.pictureBox1.TabStop = false; + // + // button_back + // + this.button_back.Location = new System.Drawing.Point(223, 314); + this.button_back.Name = "button_back"; + this.button_back.Size = new System.Drawing.Size(75, 23); + this.button_... [truncated message content] |
From: <die...@us...> - 2007-02-17 19:02:59
|
Revision: 120 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=120&view=rev Author: diehard2 Date: 2007-02-17 11:02:54 -0800 (Sat, 17 Feb 2007) Log Message: ----------- UI Fixes Modified Paths: -------------- trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/DirecTV.suo trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SerialInterface/SerialInterface.cs trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SetupForm.cs Removed Paths: ------------- trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/obj/ Modified: trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/DirecTV.suo =================================================================== (Binary files differ) Modified: trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SerialInterface/SerialInterface.cs =================================================================== --- trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SerialInterface/SerialInterface.cs 2007-02-15 03:39:19 UTC (rev 119) +++ trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SerialInterface/SerialInterface.cs 2007-02-17 19:02:54 UTC (rev 120) @@ -457,14 +457,14 @@ } else { - Log.WriteFile("DirecTV.SerialInterface.SendCommand(): send data: {0}", ToString(cmd.dataToSend)); + Log.WriteFile("DirecTV.SerialInterface.SendCommand(): trailing zero send data: {0}", ToString(cmd.dataToSend)); _serialPort.Write(cmd.dataToSend, 0, cmd.dataToSend.Length); byte[] temp = new byte [1]; temp[0] = 0x00; _serialPort.Write(temp, 0, 1); receivedData = temp; + } } - } public void SendCommand(Command cmd) { Modified: trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SetupForm.cs =================================================================== --- trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SetupForm.cs 2007-02-15 03:39:19 UTC (rev 119) +++ trunk/plugins/DirectTv/TVE 3 DirecTV Plugin/TunerPlugin/SetupForm.cs 2007-02-17 19:02:54 UTC (rev 120) @@ -29,10 +29,14 @@ //Enable of disable advanced settings if (_settings.Advanced) - EnableAdavancedSettings(); + { EnableAdavancedSettings(); + cbAdvanced.Checked = true ; + } else - cbtwowaydisable.Checked = _settings.TwoWayDisable; + DisableAdavancedSettings(); + + // Build up box types combobox modelComboBox.Items.Clear(); foreach (string box in DirecTVSettings.BoxTypes) @@ -71,8 +75,9 @@ powerOnBox.Checked = _settings.PowerOn; // set loaded debug value debugBox.Checked = _settings.Debug; - cbAdvanced.Checked = _settings.Advanced; + cbHideOSD.Checked = _settings.HideOSD; + cbtwowaydisable.Checked = _settings.TwoWayDisable; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-15 03:40:08
|
Revision: 119 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=119&view=rev Author: and-81 Date: 2007-02-14 19:39:19 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -45,7 +45,7 @@ private void SetupForm_Load(object sender, EventArgs e) { - labelVersion.Text = MCEReplacement.Version; + labelVersion.Text = MCEReplacement.PluginVersion; checkBoxLogVerbose.Checked = MCEReplacement.LogVerbose; checkBoxRequiresFocus.Checked = MCEReplacement.RequireFocus; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -26,7 +26,7 @@ #region Constants - public const string Version = "MCE Replacement Plugin 1.0.2.0 for MediaPortal + SVN"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.2.0 for MediaPortal + SVN"; public const int MessageModeCommand = 0x0018; @@ -262,7 +262,7 @@ public void Start() { - Log.Info("MCEReplacement: Starting ({0})", Version); + Log.Info("MCEReplacement: Starting ({0})", PluginVersion); Log.Debug("MCEReplacement: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); @@ -1311,55 +1311,91 @@ return ProcessSerialCommand(commands); } - static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + #endregion Private Methods + + #region Public Methods + + /// <summary> + /// Loads the default remote button input handler + /// </summary> + public static void LoadDefaultMapping() { - FileStream file = null; + _defaultInputHandler = new InputHandler("MCE Replacement"); - try + if (!_defaultInputHandler.IsLoaded) + Log.Error("MCEReplacement: Error loading default mapping file"); + } + + /// <summary> + /// Loads multi-mappings for input handling + /// </summary> + public static void LoadMultiMappings() + { + FileStream file = new FileStream(MultiMappingFile, FileMode.Open, FileAccess.Read, FileShare.Read); + + XmlDocument doc = new XmlDocument(); + doc.Load(file); + + XmlNodeList mappings = doc.DocumentElement.SelectNodes("map"); + + _multiInputHandlers = new List<InputHandler>(mappings.Count); + _multiMaps = new string[mappings.Count]; + + string map; + for (int index = 0; index < mappings.Count; index++) { - file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + map = mappings.Item(index).Attributes["name"].Value; - if (file.Length == 0) - { - Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); - file.Close(); - return false; - } + _multiMaps[index] = map; + _multiInputHandlers.Add(new InputHandler(map)); - if (!MceIrApi.CheckFile(file.SafeFileHandle)) - { - Log.Error("MCEReplacement: Bad IR file \"{0}\"", fileName); - file.Close(); - return false; - } + if (!_multiInputHandlers[index].IsLoaded) + Log.Error("MCEReplacement: Error loading default mapping file for {0}", map); + } - MceIrApi.SelectBlaster(port); - MceIrApi.SetBlasterSpeed(speed); - MceIrApi.SetBlasterType(BlastType); + file.Close(); + } - if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) - { - if (LogVerbose) - Log.Info("MCEReplacement: Blast successful"); + /// <summary> + /// Call this when entering standby to ensure that the MceIrApi is informed. + /// </summary> + public static void OnSuspend() + { + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Suspend); - file.Close(); - return true; - } - } - catch (Exception ex) + if (MceIrApi.InUse) { - Log.Error("MCEReplacement: BlastIR() {0}", ex.Message); + if (LogVerbose) + Log.Info("MCEReplacement: Suspending MceIrApi"); + + MceIrApi.Suspend(); } + } - Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); + /// <summary> + /// Call this when leaving standby to ensure the MceIrApi is informed. + /// </summary> + public static void OnResume() + { + if (MceIrApi.InUse) + { + if (LogVerbose) + Log.Info("MCEReplacement: Resuming MceIrApi"); - if (file != null) - file.Close(); + MceIrApi.Resume(); + } - return false; + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Resume); } - static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + /// <summary> + /// Process the supplied Macro file. + /// </summary> + /// <param name="fileName">Macro file to process.</param> + /// <returns>Sucess.</returns> + public static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; @@ -1395,7 +1431,7 @@ { if (LogVerbose) Log.Debug("MCEReplacement: Pause {0}", commandProperty); - + int sleep = int.Parse(commandProperty); Thread.Sleep(sleep); break; @@ -1551,83 +1587,59 @@ return true; } - #endregion Private Methods - - #region Public Methods - /// <summary> - /// Loads the default remote button input handler + /// Blast an IR command. /// </summary> - public static void LoadDefaultMapping() + /// <param name="fileName">File to blast.</param> + /// <param name="port">Port to blast to.</param> + /// <param name="speed">Speed to blast at.</param> + /// <returns>Success.</returns> + public static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { - _defaultInputHandler = new InputHandler("MCE Replacement"); + FileStream file = null; - if (!_defaultInputHandler.IsLoaded) - Log.Error("MCEReplacement: Error loading default mapping file"); - } + try + { + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - /// <summary> - /// Loads multi-mappings for input handling - /// </summary> - public static void LoadMultiMappings() - { - FileStream file = new FileStream(MultiMappingFile, FileMode.Open, FileAccess.Read, FileShare.Read); + if (file.Length == 0) + { + Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); + file.Close(); + return false; + } - XmlDocument doc = new XmlDocument(); - doc.Load(file); + if (!MceIrApi.CheckFile(file.SafeFileHandle)) + { + Log.Error("MCEReplacement: Bad IR file \"{0}\"", fileName); + file.Close(); + return false; + } - XmlNodeList mappings = doc.DocumentElement.SelectNodes("map"); + MceIrApi.SelectBlaster(port); + MceIrApi.SetBlasterSpeed(speed); + MceIrApi.SetBlasterType(BlastType); - _multiInputHandlers = new List<InputHandler>(mappings.Count); - _multiMaps = new string[mappings.Count]; + if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) + { + if (LogVerbose) + Log.Info("MCEReplacement: Blast successful"); - string map; - for (int index = 0; index < mappings.Count; index++) - { - map = mappings.Item(index).Attributes["name"].Value; - - _multiMaps[index] = map; - _multiInputHandlers.Add(new InputHandler(map)); - - if (!_multiInputHandlers[index].IsLoaded) - Log.Error("MCEReplacement: Error loading default mapping file for {0}", map); + file.Close(); + return true; + } } - - file.Close(); - } - - /// <summary> - /// Call this when entering standby to ensure that the MceIrApi is informed. - /// </summary> - public static void OnSuspend() - { - if (!InConfiguration && EventMapperEnabled) - MapEvent(MappedEvent.MappingEvent.PC_Suspend); - - if (MceIrApi.InUse) + catch (Exception ex) { - if (LogVerbose) - Log.Info("MCEReplacement: Suspending MceIrApi"); - - MceIrApi.Suspend(); + Log.Error("MCEReplacement: BlastIR() {0}", ex.Message); } - } - /// <summary> - /// Call this when leaving standby to ensure the MceIrApi is informed. - /// </summary> - public static void OnResume() - { - if (MceIrApi.InUse) - { - if (LogVerbose) - Log.Info("MCEReplacement: Resuming MceIrApi"); + Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); - MceIrApi.Resume(); - } + if (file != null) + file.Close(); - if (!InConfiguration && EventMapperEnabled) - MapEvent(MappedEvent.MappingEvent.PC_Resume); + return false; } /// <summary> @@ -2066,20 +2078,22 @@ } /// <summary> - /// Learn an IR code and put it in a file + /// Learn an IR Command and put it in a file /// </summary> - /// <param name="blastCommand">File to learn</param> - /// <returns>bool value shows success</returns> - public static bool LearnIRCommand(string blastCommand) + /// <param name="fileName">File to place learned IR command in.</param> + /// <returns>Success.</returns> + public static bool LearnIRCommand(string fileName) { - string fileName = AppDataFolder + blastCommand + IRExtension; + string filePath = AppDataFolder + fileName + IRExtension; FileStream file = null; bool status = false; try { - file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read); + file = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnTimeout); + if (file.Length == 0) + status = false; } catch (Exception ex) { Modified: trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -16,6 +16,8 @@ string _fileName; + int _cardID = -1; + int _pauseTime = 250; bool _sendSelect = false; bool _doubleChannelSelect = false; @@ -37,6 +39,12 @@ get { return _fileName; } } + public int CardId + { + get { return _cardID; } + set { _cardID = value; } + } + public int PauseTime { get { return _pauseTime; } @@ -93,10 +101,12 @@ #region Constructor - public ExternalChannelConfig(string fileName) + public ExternalChannelConfig(int cardId, string fileName) { _fileName = fileName; + _cardID = cardId; + if (!File.Exists(_fileName)) { for (int i = 0; i < 10; i++) Modified: trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -19,7 +19,6 @@ #region Variables - TabPage[] _tvCardTabs; StbSetup[] _tvCardStbSetups; #endregion Variables @@ -35,31 +34,30 @@ private void ExternalChannels_Load(object sender, EventArgs e) { - int cards = TV3ExtChannelChanger.ExternalChannelConfigs.Length; - string cardName; - string cardNumber; + IList cards = TvDatabase.Card.ListAll(); - _tvCardTabs = new TabPage[cards]; - _tvCardStbSetups = new StbSetup[cards]; + _tvCardStbSetups = new StbSetup[cards.Count]; comboBoxCopyFrom.Items.Clear(); - for (int index = 0; index < cards; index++) + TabPage tempPage; + int index = 0; + + foreach (TvDatabase.Card card in cards) { - cardNumber = (index + 1).ToString(); - cardName = "TV Card " + cardNumber; + comboBoxCopyFrom.Items.Add(card.IdCard); - comboBoxCopyFrom.Items.Add(cardName); - - _tvCardStbSetups[index] = new StbSetup(index); - _tvCardStbSetups[index].Name = "StbSetup" + cardNumber; + _tvCardStbSetups[index] = new StbSetup(card.IdCard); + _tvCardStbSetups[index].Name = string.Format("StbSetup{0}", index); _tvCardStbSetups[index].Dock = DockStyle.Fill; _tvCardStbSetups[index].TabIndex = 0; - _tvCardTabs[index] = new TabPage(cardName); - _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]); + tempPage = new TabPage(string.Format("TV Card {0}", index + 1)); + tempPage.Controls.Add(_tvCardStbSetups[index]); - this.tabControlTVCards.TabPages.Add(_tvCardTabs[index]); + this.tabControlTVCards.TabPages.Add(tempPage); + + index++; } comboBoxCopyFrom.SelectedIndex = 0; @@ -104,11 +102,11 @@ private void buttonOK_Click(object sender, EventArgs e) { foreach (StbSetup setup in _tvCardStbSetups) + { setup.Save(); + TV3ExtChannelChanger.GetExternalChannelConfig(setup.CardId).SaveExternalChannelConfig(); + } - foreach (ExternalChannelConfig config in TV3ExtChannelChanger.ExternalChannelConfigs) - config.SaveExternalChannelConfig(); - this.DialogResult = DialogResult.OK; this.Close(); } @@ -267,7 +265,7 @@ private void buttonCopyFrom_Click(object sender, EventArgs e) { - _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard(comboBoxCopyFrom.SelectedIndex); + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard((int)comboBoxCopyFrom.SelectedItem); } private void buttonCancel_Click(object sender, EventArgs e) Modified: trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -48,7 +48,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(400, 352); + this.buttonOK.Location = new System.Drawing.Point(400, 360); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 5; @@ -62,7 +62,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); - this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 296); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 304); this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); this.groupBoxQuickSetup.TabIndex = 1; @@ -97,7 +97,7 @@ this.groupBoxTest.Controls.Add(this.labelCh); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.numericUpDownTest); - this.groupBoxTest.Location = new System.Drawing.Point(304, 296); + this.groupBoxTest.Location = new System.Drawing.Point(304, 304); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(216, 48); this.groupBoxTest.TabIndex = 2; @@ -144,7 +144,7 @@ // buttonCopyFrom // this.buttonCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonCopyFrom.Location = new System.Drawing.Point(8, 352); + this.buttonCopyFrom.Location = new System.Drawing.Point(8, 360); this.buttonCopyFrom.Name = "buttonCopyFrom"; this.buttonCopyFrom.Size = new System.Drawing.Size(144, 21); this.buttonCopyFrom.TabIndex = 3; @@ -157,7 +157,7 @@ this.comboBoxCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.comboBoxCopyFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCopyFrom.FormattingEnabled = true; - this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 352); + this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 360); this.comboBoxCopyFrom.Name = "comboBoxCopyFrom"; this.comboBoxCopyFrom.Size = new System.Drawing.Size(120, 21); this.comboBoxCopyFrom.TabIndex = 4; @@ -170,14 +170,14 @@ this.tabControlTVCards.Location = new System.Drawing.Point(8, 8); this.tabControlTVCards.Name = "tabControlTVCards"; this.tabControlTVCards.SelectedIndex = 0; - this.tabControlTVCards.Size = new System.Drawing.Size(512, 280); + this.tabControlTVCards.Size = new System.Drawing.Size(512, 288); this.tabControlTVCards.TabIndex = 0; // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(464, 352); + this.buttonCancel.Location = new System.Drawing.Point(464, 360); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 6; @@ -191,7 +191,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(528, 383); + this.ClientSize = new System.Drawing.Size(528, 391); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.tabControlTVCards); this.Controls.Add(this.comboBoxCopyFrom); @@ -200,6 +200,7 @@ this.Controls.Add(this.groupBoxQuickSetup); this.Controls.Add(this.buttonOK); this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(536, 418); this.Name = "ExternalChannels"; this.ShowIcon = false; this.ShowInTaskbar = false; Modified: trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -56,8 +56,7 @@ { Log.Info("TV3ExtChannelChanger: Configuration activated"); - if (TV3ExtChannelChanger.ExternalChannelConfigs == null) - TV3ExtChannelChanger.LoadExternalConfigs(); + TV3ExtChannelChanger.LoadExternalConfigs(); base.OnSectionActivated(); } @@ -66,8 +65,15 @@ private void buttonSTB_Click(object sender, EventArgs e) { - ExternalChannels externalChannels = new ExternalChannels(); - externalChannels.ShowDialog(this); + if (TvDatabase.Card.ListAll().Count == 0) + { + MessageBox.Show(this, "There are no capture cards installed in the TV server", "No TV Cards", MessageBoxButtons.OK, MessageBoxIcon.Stop); + } + else + { + ExternalChannels externalChannels = new ExternalChannels(); + externalChannels.ShowDialog(this); + } } } Modified: trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -46,6 +46,7 @@ this.listViewExternalCommands = new System.Windows.Forms.ListView(); this.columnHeaderExternal = new System.Windows.Forms.ColumnHeader(); this.columnHeaderCommand = new System.Windows.Forms.ColumnHeader(); + this.labelCardName = new System.Windows.Forms.Label(); this.groupBoxOptions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPauseTime)).BeginInit(); @@ -68,7 +69,7 @@ this.groupBoxOptions.Controls.Add(this.checkBoxDoubleSelect); this.groupBoxOptions.Controls.Add(this.labelMS); this.groupBoxOptions.Controls.Add(this.checkBoxSendSelect); - this.groupBoxOptions.Location = new System.Drawing.Point(296, 8); + this.groupBoxOptions.Location = new System.Drawing.Point(296, 16); this.groupBoxOptions.Name = "groupBoxOptions"; this.groupBoxOptions.Size = new System.Drawing.Size(200, 240); this.groupBoxOptions.TabIndex = 1; @@ -221,7 +222,7 @@ this.groupBoxCommands.Controls.Add(this.buttonSet); this.groupBoxCommands.Controls.Add(this.comboBoxCommands); this.groupBoxCommands.Controls.Add(this.listViewExternalCommands); - this.groupBoxCommands.Location = new System.Drawing.Point(8, 8); + this.groupBoxCommands.Location = new System.Drawing.Point(8, 16); this.groupBoxCommands.Name = "groupBoxCommands"; this.groupBoxCommands.Size = new System.Drawing.Size(280, 240); this.groupBoxCommands.TabIndex = 0; @@ -280,14 +281,27 @@ this.columnHeaderCommand.Text = "Command"; this.columnHeaderCommand.Width = 170; // + // labelCardName + // + this.labelCardName.Dock = System.Windows.Forms.DockStyle.Top; + this.labelCardName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelCardName.Location = new System.Drawing.Point(0, 0); + this.labelCardName.Name = "labelCardName"; + this.labelCardName.Size = new System.Drawing.Size(504, 16); + this.labelCardName.TabIndex = 2; + this.labelCardName.Text = "Unknown TV Card"; + this.labelCardName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // StbSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.labelCardName); this.Controls.Add(this.groupBoxOptions); this.Controls.Add(this.groupBoxCommands); + this.MinimumSize = new System.Drawing.Size(504, 262); this.Name = "StbSetup"; - this.Size = new System.Drawing.Size(504, 254); + this.Size = new System.Drawing.Size(504, 262); this.groupBoxOptions.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPauseTime)).EndInit(); @@ -317,5 +331,6 @@ private System.Windows.Forms.ListView listViewExternalCommands; private System.Windows.Forms.ColumnHeader columnHeaderExternal; private System.Windows.Forms.ColumnHeader columnHeaderCommand; + private System.Windows.Forms.Label labelCardName; } } Modified: trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -16,8 +16,27 @@ public partial class StbSetup : UserControl { + #region Constants + + const string parameterInfo = +@"%1 = Current channel number digit (-1 for Select/Pre-Change) +%2 = Full channel number string"; + + #endregion Constants + + #region Variables + + int _cardId; + + #endregion Variables + #region Properties + public int CardId + { + get { return _cardId; } + } + public int PauseTime { get { return Decimal.ToInt32(numericUpDownPauseTime.Value); } @@ -74,25 +93,25 @@ #endregion Properties - #region Variables - - const string parameterInfo = -@"%1 = Current channel number digit (-1 for Select/Pre-Change) -%2 = Full channel number string -%3 = Blaster port (0 = Both, 1 = Port 1, 2 = Port 2)"; - - int _card; - - #endregion Variables - #region Constructor - public StbSetup(int card) + public StbSetup(int cardId) { InitializeComponent(); - _card = card; + _cardId = cardId; + foreach (TvDatabase.Card card in TvDatabase.Card.ListAll()) + { + if (card.IdCard == _cardId) + { + labelCardName.Text = card.Name; + if (!card.Enabled) + labelCardName.Text += " (Disabled)"; + break; + } + } + // Setup commands combo box comboBoxCommands.Items.Add("Run Program"); comboBoxCommands.Items.Add("Serial Command"); @@ -121,17 +140,20 @@ item = new ListViewItem(subItems); listViewExternalCommands.Items.Add(item); - SetToCard(_card); + SetToCard(_cardId); } #endregion Constructor #region Public Methods - public void SetToCard(int card) + public void SetToCard(int cardId) { - ExternalChannelConfig config = TV3ExtChannelChanger.ExternalChannelConfigs[card]; + ExternalChannelConfig config = TV3ExtChannelChanger.GetExternalChannelConfig(cardId); + if (config == null) + return; + // Setup command list. for (int i = 0; i < 10; i++) listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i]; @@ -158,10 +180,12 @@ numericUpDownRepeatDelay.Value = new Decimal(config.RepeatPauseTime); } - public void SetToConfig(int card) + public void SetToConfig(int cardId) { - ExternalChannelConfig config = TV3ExtChannelChanger.ExternalChannelConfigs[card]; + ExternalChannelConfig config = TV3ExtChannelChanger.GetExternalChannelConfig(cardId); + config.CardId = cardId; + config.PauseTime = Decimal.ToInt32(numericUpDownPauseTime.Value); config.SendSelect = checkBoxSendSelect.Checked; config.DoubleChannelSelect = checkBoxDoubleSelect.Checked; @@ -247,7 +271,7 @@ public void Save() { - SetToConfig(_card); + SetToConfig(_cardId); } #endregion Public Methods Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -24,9 +24,7 @@ #region Constants - public static readonly string AppDataFolder = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\MediaPortal TV Server\\"; + public const string PluginVersion = "TV3 Ext Channel Changer Plugin 1.0.2.0"; public const string STBFolder = "STB\\"; @@ -35,6 +33,10 @@ public const string KeyCommandPrefix = "Keys: "; public const string MessageCommandPrefix = "Message: "; + public static readonly string AppDataFolder = + Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + + "\\MediaPortal TV Server\\"; + #endregion Constants #region Variables @@ -85,11 +87,6 @@ set { _logVerbose = value; } } - public static ExternalChannelConfig[] ExternalChannelConfigs - { - get { return _externalChannelConfigs; } - } - #endregion Properties #region Plugin methods @@ -97,8 +94,10 @@ [CLSCompliant(false)] public void Start(IController controller) { - Log.Info("TV3ExtChannelChanger: Version {0}", Version); + Log.Info("TV3ExtChannelChanger: Version {0}", PluginVersion); + Log.Debug("TV3ExtChannelChanger: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); + TvBusinessLayer layer = new TvBusinessLayer(); LogVerbose = Convert.ToBoolean(layer.GetSetting("TV3ExtChannelChangerLogVerbose", "False").Value); @@ -118,12 +117,7 @@ [CLSCompliant(false)] public SetupTv.SectionSettings Setup { - get - { - LoadExternalConfigs(); - - return new SetupTv.Sections.PluginSetup(); - } + get { return new SetupTv.Sections.PluginSetup(); } } #endregion Plugin methods @@ -147,13 +141,13 @@ } } - static bool ProcessExternalChannel(string externalChannel, int card) + static bool ProcessExternalChannel(string externalChannel, int cardId) { bool returnCode = true; try { - ExternalChannelConfig config = ExternalChannelConfigs[card - 1]; + ExternalChannelConfig config = GetExternalChannelConfig(cardId); // Clean up the "externalChannel" string into "channel". StringBuilder channel = new StringBuilder(); @@ -362,18 +356,38 @@ /// </summary> public static void LoadExternalConfigs() { - int cardCount = TvDatabase.Card.ListAll().Count; + IList cards = TvDatabase.Card.ListAll(); - if (cardCount == 0) - cardCount = 1; + if (cards.Count == 0) + return; - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + int index = 0; + foreach (TvDatabase.Card card in cards) + { + _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); + } } /// <summary> + /// Given a card ID returns the configuration for that card. + /// </summary> + /// <param name="cardId">ID of card to retreive configuration for.</param> + /// <returns>Card configuration, null if it doesn't exist.</returns> + public static ExternalChannelConfig GetExternalChannelConfig(int cardId) + { + if (_externalChannelConfigs == null) + return null; + + foreach (ExternalChannelConfig config in _externalChannelConfigs) + if (config.CardId == cardId) + return config; + + return null; + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> Modified: trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -1,5 +1,6 @@ namespace SetupTv.Sections { + partial class PluginSetup { /// <summary> Modified: trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -343,7 +343,7 @@ this.Controls.Add(this.labelCardName); this.Controls.Add(this.groupBoxOptions); this.Controls.Add(this.groupBoxCommands); - this.MinimumSize = new System.Drawing.Size(504, 310); + this.MinimumSize = new System.Drawing.Size(504, 318); this.Name = "StbSetup"; this.Size = new System.Drawing.Size(504, 318); this.groupBoxOptions.ResumeLayout(false); Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -24,8 +24,10 @@ #region Constants - public const int LearnTimeout = 4000; // Milliseconds + public const string PluginVersion = "TV3 MCE Blaster Plugin 1.0.2.0"; + public const int LearnIRTimeout = 4000; // Milliseconds + public const string IRFolder = "IR\\"; public const string MacroFolder = "MACRO\\"; public const string STBFolder = "STB\\"; @@ -118,7 +120,7 @@ [CLSCompliant(false)] public void Start(IController controller) { - Log.Info("TV3MceBlaster: Version {0}", Version); + Log.Info("TV3MceBlaster: Version {0}", PluginVersion); Log.Debug("TV3MceBlaster: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); @@ -337,55 +339,52 @@ return ProcessSerialCommand(commands); } - static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) - { - FileStream file = null; + #endregion Private Methods - try - { - file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + #region Public Methods - if (file.Length == 0) - { - Log.Error("TV3MceBlaster: IR file \"{0}\" has no data, possible IR learn failure", fileName); - file.Close(); - return false; - } + /// <summary> + /// Load external channel configurations. + /// </summary> + public static void LoadExternalConfigs() + { + IList cards = TvDatabase.Card.ListAll(); - if (!MceIrApi.CheckFile(file.SafeFileHandle)) - { - Log.Error("TV3MceBlaster: Bad IR file \"{0}\"", fileName); - file.Close(); - return false; - } + if (cards.Count == 0) + return; - MceIrApi.SelectBlaster(port); - MceIrApi.SetBlasterSpeed(speed); - MceIrApi.SetBlasterType(BlastType); + _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; - if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) - { - if (LogVerbose) - Log.Info("TV3MceBlaster: Blast successful"); - - file.Close(); - return true; - } - } - catch (Exception ex) + int index = 0; + foreach (TvDatabase.Card card in cards) { - Log.Error("TV3MceBlaster: BlastIR() {0}", ex.Message); + _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); } + } - Log.Error("TV3MceBlaster: Failed to blast IR file \"{0}\"", fileName); + /// <summary> + /// Given a card ID returns the configuration for that card. + /// </summary> + /// <param name="cardId">ID of card to retreive configuration for.</param> + /// <returns>Card configuration, null if it doesn't exist.</returns> + public static ExternalChannelConfig GetExternalChannelConfig(int cardId) + { + if (_externalChannelConfigs == null) + return null; - if (file != null) - file.Close(); + foreach (ExternalChannelConfig config in _externalChannelConfigs) + if (config.CardId == cardId) + return config; - return false; + return null; } - static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + /// <summary> + /// Process the supplied Macro file. + /// </summary> + /// <param name="fileName">Macro file to process.</param> + /// <returns>Sucess.</returns> + public static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; @@ -525,44 +524,59 @@ return true; } - #endregion Private Methods - - #region Public Methods - /// <summary> - /// Load external channel configurations. + /// Blast an IR command. /// </summary> - public static void LoadExternalConfigs() + /// <param name="fileName">File to blast.</param> + /// <param name="port">Port to blast to.</param> + /// <param name="speed">Speed to blast at.</param> + /// <returns>Success.</returns> + public static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { - IList cards = TvDatabase.Card.ListAll(); + FileStream file = null; - if (cards.Count == 0) - return; + try + { + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; + if (file.Length == 0) + { + Log.Error("TV3MceBlaster: IR file \"{0}\" has no data, possible IR learn failure", fileName); + file.Close(); + return false; + } - int index = 0; - foreach (TvDatabase.Card card in cards) + if (!MceIrApi.CheckFile(file.SafeFileHandle)) + { + Log.Error("TV3MceBlaster: Bad IR file \"{0}\"", fileName); + file.Close(); + return false; + } + + MceIrApi.SelectBlaster(port); + MceIrApi.SetBlasterSpeed(speed); + MceIrApi.SetBlasterType(BlastType); + + if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) + { + if (LogVerbose) + Log.Info("TV3MceBlaster: Blast successful"); + + file.Close(); + return true; + } + } + catch (Exception ex) { - _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); + Log.Error("TV3MceBlaster: BlastIR() {0}", ex.Message); } - } - /// <summary> - /// Given a card ID returns the configuration for that card. - /// </summary> - /// <param name="cardId">ID of card to retreive configuration for.</param> - /// <returns>Card configuration, null if it doesn't exist.</returns> - public static ExternalChannelConfig GetExternalChannelConfig(int cardId) - { - if (_externalChannelConfigs == null) - return null; + Log.Error("TV3MceBlaster: Failed to blast IR file \"{0}\"", fileName); - foreach (ExternalChannelConfig config in _externalChannelConfigs) - if (config.CardId == cardId) - return config; + if (file != null) + file.Close(); - return null; + return false; } /// <summary> @@ -938,20 +952,22 @@ } /// <summary> - /// Learn an IR code and put it in a file + /// Learn an IR Command and put it in a file /// </summary> - /// <param name="blastCommand">File to learn</param> - /// <returns>bool value shows success</returns> - public static bool LearnIRCommand(string blastCommand) + /// <param name="fileName">File to place learned IR command in.</param> + /// <returns>Success.</returns> + public static bool LearnIRCommand(string fileName) { - string fileName = AppDataFolder + blastCommand + IRExtension; + string filePath = AppDataFolder + fileName + IRExtension; FileStream file = null; bool status = false; try { - file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read); - status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnTimeout); + file = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); + status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnIRTimeout); + if (file.Length == 0) + status = false; } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-14 14:00:58
|
Revision: 118 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=118&view=rev Author: and-81 Date: 2007-02-14 06:00:52 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs Modified: trunk/plugins/MCEReplacement/Forms/LearnIR.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-13 15:50:16 UTC (rev 117) +++ trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-14 14:00:52 UTC (rev 118) @@ -52,6 +52,7 @@ if (command.Length == 0) { MessageBox.Show(this, "You must supply a name for this IR code", "Missing name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + textBoxName.Focus(); return; } Modified: trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-13 15:50:16 UTC (rev 117) +++ trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-14 14:00:52 UTC (rev 118) @@ -52,6 +52,7 @@ if (command.Length == 0) { MessageBox.Show(this, "You must supply a name for this IR code", "Missing name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + textBoxName.Focus(); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-13 15:51:18
|
Revision: 117 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=117&view=rev Author: and-81 Date: 2007-02-13 07:50:16 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/TV3MceBlaster/ExternalChannelConfig.cs trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.cs trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.designer.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/TV3MceBlaster/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/TV3MceBlaster/ExternalChannelConfig.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/ExternalChannelConfig.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -16,6 +16,8 @@ string _fileName; + int _cardID = -1; + int _pauseTime = 250; bool _sendSelect = false; MceIrApi.BlasterPort _extBlastPort = MceIrApi.BlasterPort.Both; @@ -39,6 +41,12 @@ get { return _fileName; } } + public int CardId + { + get { return _cardID; } + set { _cardID = value; } + } + public int PauseTime { get { return _pauseTime; } @@ -105,10 +113,12 @@ #region Constructor - public ExternalChannelConfig(string fileName) + public ExternalChannelConfig(int cardId, string fileName) { _fileName = fileName; + _cardID = cardId; + if (!File.Exists(_fileName)) { for (int i = 0; i < 10; i++) Modified: trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -19,7 +19,6 @@ #region Variables - TabPage[] _tvCardTabs; StbSetup[] _tvCardStbSetups; #endregion Variables @@ -35,31 +34,30 @@ private void ExternalChannels_Load(object sender, EventArgs e) { - int cards = TV3MceBlaster.ExternalChannelConfigs.Length; - string cardName; - string cardNumber; + IList cards = TvDatabase.Card.ListAll(); - _tvCardTabs = new TabPage[cards]; - _tvCardStbSetups = new StbSetup[cards]; + _tvCardStbSetups = new StbSetup[cards.Count]; comboBoxCopyFrom.Items.Clear(); - for (int index = 0; index < cards; index++) + TabPage tempPage; + int index = 0; + + foreach (TvDatabase.Card card in cards) { - cardNumber = (index + 1).ToString(); - cardName = "TV Card " + cardNumber; + comboBoxCopyFrom.Items.Add(card.IdCard); - comboBoxCopyFrom.Items.Add(cardName); - - _tvCardStbSetups[index] = new StbSetup(index); - _tvCardStbSetups[index].Name = "StbSetup" + cardNumber; + _tvCardStbSetups[index] = new StbSetup(card.IdCard); + _tvCardStbSetups[index].Name = string.Format("StbSetup{0}", index); _tvCardStbSetups[index].Dock = DockStyle.Fill; _tvCardStbSetups[index].TabIndex = 0; - _tvCardTabs[index] = new TabPage(cardName); - _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]); + tempPage = new TabPage(string.Format("TV Card {0}", index + 1)); + tempPage.Controls.Add(_tvCardStbSetups[index]); - this.tabControlTVCards.TabPages.Add(_tvCardTabs[index]); + this.tabControlTVCards.TabPages.Add(tempPage); + + index++; } comboBoxCopyFrom.SelectedIndex = 0; @@ -106,11 +104,11 @@ private void buttonOK_Click(object sender, EventArgs e) { foreach (StbSetup setup in _tvCardStbSetups) + { setup.Save(); + TV3MceBlaster.GetExternalChannelConfig(setup.CardId).SaveExternalChannelConfig(); + } - foreach (ExternalChannelConfig config in TV3MceBlaster.ExternalChannelConfigs) - config.SaveExternalChannelConfig(); - this.DialogResult = DialogResult.OK; this.Close(); } @@ -241,7 +239,7 @@ private void buttonCopyFrom_Click(object sender, EventArgs e) { - _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard(comboBoxCopyFrom.SelectedIndex); + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard((int)comboBoxCopyFrom.SelectedItem); } private void buttonCancel_Click(object sender, EventArgs e) Modified: trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.designer.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.designer.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -48,7 +48,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(400, 408); + this.buttonOK.Location = new System.Drawing.Point(400, 416); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 5; @@ -62,7 +62,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); - this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 352); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 360); this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); this.groupBoxQuickSetup.TabIndex = 1; @@ -97,7 +97,7 @@ this.groupBoxTest.Controls.Add(this.labelCh); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.numericUpDownTest); - this.groupBoxTest.Location = new System.Drawing.Point(304, 352); + this.groupBoxTest.Location = new System.Drawing.Point(304, 360); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(216, 48); this.groupBoxTest.TabIndex = 2; @@ -144,7 +144,7 @@ // buttonCopyFrom // this.buttonCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonCopyFrom.Location = new System.Drawing.Point(8, 408); + this.buttonCopyFrom.Location = new System.Drawing.Point(8, 416); this.buttonCopyFrom.Name = "buttonCopyFrom"; this.buttonCopyFrom.Size = new System.Drawing.Size(144, 21); this.buttonCopyFrom.TabIndex = 3; @@ -157,7 +157,7 @@ this.comboBoxCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.comboBoxCopyFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCopyFrom.FormattingEnabled = true; - this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 408); + this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 416); this.comboBoxCopyFrom.Name = "comboBoxCopyFrom"; this.comboBoxCopyFrom.Size = new System.Drawing.Size(120, 21); this.comboBoxCopyFrom.TabIndex = 4; @@ -170,14 +170,14 @@ this.tabControlTVCards.Location = new System.Drawing.Point(8, 8); this.tabControlTVCards.Name = "tabControlTVCards"; this.tabControlTVCards.SelectedIndex = 0; - this.tabControlTVCards.Size = new System.Drawing.Size(512, 336); + this.tabControlTVCards.Size = new System.Drawing.Size(512, 344); this.tabControlTVCards.TabIndex = 0; // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(464, 408); + this.buttonCancel.Location = new System.Drawing.Point(464, 416); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 6; @@ -191,7 +191,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(528, 439); + this.ClientSize = new System.Drawing.Size(528, 447); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.tabControlTVCards); this.Controls.Add(this.comboBoxCopyFrom); @@ -200,7 +200,7 @@ this.Controls.Add(this.groupBoxQuickSetup); this.Controls.Add(this.buttonOK); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(536, 466); + this.MinimumSize = new System.Drawing.Size(536, 474); this.Name = "ExternalChannels"; this.ShowIcon = false; this.ShowInTaskbar = false; Modified: trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -94,8 +94,7 @@ TV3MceBlaster.InConfiguration = true; - if (TV3MceBlaster.ExternalChannelConfigs == null) - TV3MceBlaster.LoadExternalConfigs(); + TV3MceBlaster.LoadExternalConfigs(); base.OnSectionActivated(); } @@ -154,8 +153,15 @@ private void buttonSTB_Click(object sender, EventArgs e) { - ExternalChannels externalChannels = new ExternalChannels(); - externalChannels.ShowDialog(this); + if (TvDatabase.Card.ListAll().Count == 0) + { + MessageBox.Show(this, "There are no capture cards installed in the TV server", "No TV Cards", MessageBoxButtons.OK, MessageBoxIcon.Stop); + } + else + { + ExternalChannels externalChannels = new ExternalChannels(); + externalChannels.ShowDialog(this); + } } private void buttonNewIR_Click(object sender, EventArgs e) Modified: trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -50,6 +50,7 @@ this.listViewExternalCommands = new System.Windows.Forms.ListView(); this.columnHeaderExternal = new System.Windows.Forms.ColumnHeader(); this.columnHeaderCommand = new System.Windows.Forms.ColumnHeader(); + this.labelCardName = new System.Windows.Forms.Label(); this.groupBoxOptions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPauseTime)).BeginInit(); @@ -76,7 +77,7 @@ this.groupBoxOptions.Controls.Add(this.comboBoxBlasterPort); this.groupBoxOptions.Controls.Add(this.labelMS); this.groupBoxOptions.Controls.Add(this.checkBoxSendSelect); - this.groupBoxOptions.Location = new System.Drawing.Point(296, 8); + this.groupBoxOptions.Location = new System.Drawing.Point(296, 16); this.groupBoxOptions.Name = "groupBoxOptions"; this.groupBoxOptions.Size = new System.Drawing.Size(200, 296); this.groupBoxOptions.TabIndex = 1; @@ -265,7 +266,7 @@ this.groupBoxCommands.Controls.Add(this.buttonSet); this.groupBoxCommands.Controls.Add(this.comboBoxCommands); this.groupBoxCommands.Controls.Add(this.listViewExternalCommands); - this.groupBoxCommands.Location = new System.Drawing.Point(8, 8); + this.groupBoxCommands.Location = new System.Drawing.Point(8, 16); this.groupBoxCommands.Name = "groupBoxCommands"; this.groupBoxCommands.Size = new System.Drawing.Size(280, 296); this.groupBoxCommands.TabIndex = 0; @@ -324,15 +325,27 @@ this.columnHeaderCommand.Text = "Command"; this.columnHeaderCommand.Width = 170; // + // labelCardName + // + this.labelCardName.Dock = System.Windows.Forms.DockStyle.Top; + this.labelCardName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelCardName.Location = new System.Drawing.Point(0, 0); + this.labelCardName.Name = "labelCardName"; + this.labelCardName.Size = new System.Drawing.Size(504, 16); + this.labelCardName.TabIndex = 2; + this.labelCardName.Text = "Unknown TV Card"; + this.labelCardName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // StbSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.labelCardName); this.Controls.Add(this.groupBoxOptions); this.Controls.Add(this.groupBoxCommands); this.MinimumSize = new System.Drawing.Size(504, 310); this.Name = "StbSetup"; - this.Size = new System.Drawing.Size(504, 310); + this.Size = new System.Drawing.Size(504, 318); this.groupBoxOptions.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPauseTime)).EndInit(); @@ -366,5 +379,6 @@ private System.Windows.Forms.ColumnHeader columnHeaderCommand; private System.Windows.Forms.Label labelBlasterSpeed; private System.Windows.Forms.ComboBox comboBoxBlasterSpeed; + private System.Windows.Forms.Label labelCardName; } } Modified: trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -16,8 +16,28 @@ public partial class StbSetup : UserControl { + #region Constants + + const string parameterInfo = +@"%1 = Current channel number digit (-1 for Select/Pre-Change) +%2 = Full channel number string +%3 = Blaster port (0 = Both, 1 = Port 1, 2 = Port 2)"; + + #endregion Constants + + #region Variables + + int _cardId; + + #endregion Variables + #region Properties + public int CardId + { + get { return _cardId; } + } + public int PauseTime { get { return Decimal.ToInt32(numericUpDownPauseTime.Value); } @@ -82,25 +102,25 @@ #endregion Properties - #region Variables - - const string parameterInfo = -@"%1 = Current channel number digit (-1 for Select/Pre-Change) -%2 = Full channel number string -%3 = Blaster port (0 = Both, 1 = Port 1, 2 = Port 2)"; - - int _card; - - #endregion Variables - #region Constructor - public StbSetup(int card) + public StbSetup(int cardId) { InitializeComponent(); - _card = card; + _cardId = cardId; + foreach (TvDatabase.Card card in TvDatabase.Card.ListAll()) + { + if (card.IdCard == _cardId) + { + labelCardName.Text = card.Name; + if (!card.Enabled) + labelCardName.Text += " (Disabled)"; + break; + } + } + // Setup commands combo box comboBoxCommands.Items.Add("Run Program"); comboBoxCommands.Items.Add("Serial Command"); @@ -133,17 +153,20 @@ item = new ListViewItem(subItems); listViewExternalCommands.Items.Add(item); - SetToCard(_card); + SetToCard(_cardId); } #endregion Constructor #region Public Methods - public void SetToCard(int card) + public void SetToCard(int cardId) { - ExternalChannelConfig config = TV3MceBlaster.ExternalChannelConfigs[card]; + ExternalChannelConfig config = TV3MceBlaster.GetExternalChannelConfig(cardId); + if (config == null) + return; + // Setup command list. for (int i = 0; i < 10; i++) listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i]; @@ -173,10 +196,12 @@ numericUpDownRepeatDelay.Value = new Decimal(config.RepeatPauseTime); } - public void SetToConfig(int card) + public void SetToConfig(int cardId) { - ExternalChannelConfig config = TV3MceBlaster.ExternalChannelConfigs[card]; + ExternalChannelConfig config = TV3MceBlaster.GetExternalChannelConfig(cardId); + config.CardId = cardId; + config.PauseTime = Decimal.ToInt32(numericUpDownPauseTime.Value); config.SendSelect = checkBoxSendSelect.Checked; config.ExtBlastPort = (MceIrApi.BlasterPort)Enum.Parse(typeof(MceIrApi.BlasterPort), (string)comboBoxBlasterPort.SelectedItem); @@ -273,7 +298,7 @@ public void Save() { - SetToConfig(_card); + SetToConfig(_cardId); } #endregion Public Methods Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-13 13:29:30 UTC (rev 116) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-13 15:50:16 UTC (rev 117) @@ -105,11 +105,6 @@ set { _logVerbose = value; } } - public static ExternalChannelConfig[] ExternalChannelConfigs - { - get { return _externalChannelConfigs; } - } - public static bool InConfiguration { get { return _inConfiguration; } @@ -163,7 +158,7 @@ if (analogChannel == null) return; - + if (tvEvent.EventType == TvServerEventType.StartZapChannel) { if (LogVerbose) @@ -173,13 +168,13 @@ } } - static bool ProcessExternalChannel(string externalChannel, int card) + static bool ProcessExternalChannel(string externalChannel, int cardId) { bool returnCode = true; try { - ExternalChannelConfig config = ExternalChannelConfigs[card - 1]; + ExternalChannelConfig config = GetExternalChannelConfig(cardId); // Clean up the "externalChannel" string into "channel". StringBuilder channel = new StringBuilder(); @@ -539,18 +534,38 @@ /// </summary> public static void LoadExternalConfigs() { - int cardCount = TvDatabase.Card.ListAll().Count; + IList cards = TvDatabase.Card.ListAll(); - if (cardCount == 0) - cardCount = 1; + if (cards.Count == 0) + return; - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + int index = 0; + foreach (TvDatabase.Card card in cards) + { + _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); + } } /// <summary> + /// Given a card ID returns the configuration for that card. + /// </summary> + /// <param name="cardId">ID of card to retreive configuration for.</param> + /// <returns>Card configuration, null if it doesn't exist.</returns> + public static ExternalChannelConfig GetExternalChannelConfig(int cardId) + { + if (_externalChannelConfigs == null) + return null; + + foreach (ExternalChannelConfig config in _externalChannelConfigs) + if (config.CardId == cardId) + return config; + + return null; + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-13 13:29:33
|
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. |
From: <dal...@us...> - 2007-02-13 09:06:08
|
Revision: 115 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=115&view=rev Author: dalanorth Date: 2007-02-13 01:06:06 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/WebBrowser/GUIWebBrowser.cs trunk/plugins/WebBrowser/GUIWebBrowser.csproj trunk/plugins/WebBrowser/GUIWebBrowser.suo trunk/plugins/WebBrowser/WebBrowserControl.Designer.cs trunk/plugins/WebBrowser/WebBrowserControl.cs Modified: trunk/plugins/WebBrowser/GUIWebBrowser.cs =================================================================== --- trunk/plugins/WebBrowser/GUIWebBrowser.cs 2007-02-13 02:16:23 UTC (rev 114) +++ trunk/plugins/WebBrowser/GUIWebBrowser.cs 2007-02-13 09:06:06 UTC (rev 115) @@ -256,7 +256,7 @@ private void GetStringFromKeyboard(ref string strLine) { - VirtualWebKeyboard keyboard = (VirtualWebKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_WEB_KEYBOARD); + DialogWebKeyboard keyboard = (DialogWebKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_WEB_KEYBOARD); if (null == keyboard) return; keyboard.Reset(); keyboard.Text = strLine; Modified: trunk/plugins/WebBrowser/GUIWebBrowser.csproj =================================================================== --- trunk/plugins/WebBrowser/GUIWebBrowser.csproj 2007-02-13 02:16:23 UTC (rev 114) +++ trunk/plugins/WebBrowser/GUIWebBrowser.csproj 2007-02-13 09:06:06 UTC (rev 115) @@ -58,10 +58,13 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> </Reference> + <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> <Reference Include="Utils, Version=1.0.2587.17396, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> @@ -69,6 +72,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Common.cs" /> + <Compile Include="DialogWebKeyboard.cs" /> <Compile Include="GUIFavorites.cs" /> <Compile Include="GUIWebBrowser.cs" /> <Compile Include="INIFile.cs" /> Modified: trunk/plugins/WebBrowser/GUIWebBrowser.suo =================================================================== (Binary files differ) Modified: trunk/plugins/WebBrowser/WebBrowserControl.Designer.cs =================================================================== --- trunk/plugins/WebBrowser/WebBrowserControl.Designer.cs 2007-02-13 02:16:23 UTC (rev 114) +++ trunk/plugins/WebBrowser/WebBrowserControl.Designer.cs 2007-02-13 09:06:06 UTC (rev 115) @@ -53,31 +53,31 @@ /// </summary> private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebBrowserControl)); - this.axMozillaBrowser1 = new AxMOZILLACONTROLLib.AxMozillaBrowser(); - ((System.ComponentModel.ISupportInitialize)(this.axMozillaBrowser1)).BeginInit(); - this.SuspendLayout(); - // - // axMozillaBrowser1 - // - this.axMozillaBrowser1.Enabled = true; - this.axMozillaBrowser1.Location = new System.Drawing.Point(0, 0); - this.axMozillaBrowser1.Margin = new System.Windows.Forms.Padding(0); - this.axMozillaBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMozillaBrowser1.OcxState"))); - this.axMozillaBrowser1.Size = new System.Drawing.Size(720, 473); - this.axMozillaBrowser1.TabIndex = 0; - // - // WebBrowserControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.axMozillaBrowser1); - this.Margin = new System.Windows.Forms.Padding(0); - this.Name = "WebBrowserControl"; - this.Size = new System.Drawing.Size(720, 473); - this.Layout += new System.Windows.Forms.LayoutEventHandler(this.WebBrowserControl_Layout); - ((System.ComponentModel.ISupportInitialize)(this.axMozillaBrowser1)).EndInit(); - this.ResumeLayout(false); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebBrowserControl)); + this.axMozillaBrowser1 = new AxMOZILLACONTROLLib.AxMozillaBrowser(); + ((System.ComponentModel.ISupportInitialize)(this.axMozillaBrowser1)).BeginInit(); + this.SuspendLayout(); + // + // axMozillaBrowser1 + // + this.axMozillaBrowser1.Enabled = true; + this.axMozillaBrowser1.Location = new System.Drawing.Point(0, 0); + this.axMozillaBrowser1.Margin = new System.Windows.Forms.Padding(0); + this.axMozillaBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMozillaBrowser1.OcxState"))); + this.axMozillaBrowser1.Size = new System.Drawing.Size(1366, 665); + this.axMozillaBrowser1.TabIndex = 0; + // + // WebBrowserControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.axMozillaBrowser1); + this.Margin = new System.Windows.Forms.Padding(0); + this.Name = "WebBrowserControl"; + this.Size = new System.Drawing.Size(1366, 665); + this.Layout += new System.Windows.Forms.LayoutEventHandler(this.WebBrowserControl_Layout); + ((System.ComponentModel.ISupportInitialize)(this.axMozillaBrowser1)).EndInit(); + this.ResumeLayout(false); } Modified: trunk/plugins/WebBrowser/WebBrowserControl.cs =================================================================== --- trunk/plugins/WebBrowser/WebBrowserControl.cs 2007-02-13 02:16:23 UTC (rev 114) +++ trunk/plugins/WebBrowser/WebBrowserControl.cs 2007-02-13 09:06:06 UTC (rev 115) @@ -39,7 +39,6 @@ static readonly WebBrowserControl instance = new WebBrowserControl(); private const int TOP = 55; private const int LEFT = 4; - private const int HEIGHT = 493; private Common.MenuState _CurrentMenuState; /// <summary> @@ -122,9 +121,9 @@ { float fSkinHeight = (float)GUIGraphicsContext.SkinSize.Height; ; float fPercentY = ((float)GUIGraphicsContext.Height) / fSkinHeight; - this.Height = (int)Math.Round(((float)HEIGHT) * fPercentY); + this.Height = (int)Math.Round((fSkinHeight - 83) * fPercentY); this.Browser.Height = this.Height; - } + } /// <summary> /// Scale y position for current resolution This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-13 02:16:25
|
Revision: 114 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=114&view=rev Author: and-81 Date: 2007-02-12 18:16:23 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/MCEReplacement/Forms/LearnIR.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -57,7 +57,7 @@ textBoxName.Text = command; - if (!command.StartsWith(MCEReplacement.IRFolder)) + if (!command.StartsWith(MCEReplacement.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = MCEReplacement.IRFolder + command; bool resetTextBoxNameEnabled = textBoxName.Enabled; @@ -109,7 +109,7 @@ if (command.Length == 0) return; - if (!command.StartsWith(MCEReplacement.IRFolder)) + if (!command.StartsWith(MCEReplacement.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = MCEReplacement.IRFolder + command; MCEReplacement.ProcessCommand(command, _blastPort, _blastSpeed); Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -346,8 +346,8 @@ MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - - if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + + if (!fileName.StartsWith(MCEReplacement.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = MCEReplacement.MacroFolder + fileName; WriteToFile(fileName); @@ -372,7 +372,7 @@ return; } - if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + if (!fileName.StartsWith(MCEReplacement.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = MCEReplacement.MacroFolder + fileName; WriteToFile(fileName); @@ -443,7 +443,7 @@ if (commands == null) { - MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt serial command", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt message command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -230,19 +230,19 @@ for (int i = 0; i < 10; i++) { temp = Util.GetXmlString(nodeList, String.Format("Digit{0}", i), ""); - if (temp.EndsWith(MCEReplacement.IRExtension)) + if (temp.EndsWith(MCEReplacement.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = MCEReplacement.STBFolder + temp; listViewExternalCommands.Items[i].SubItems[1].Text = temp; } temp = Util.GetXmlString(nodeList, "SelectCommand", ""); - if (temp.EndsWith(MCEReplacement.IRExtension)) + if (temp.EndsWith(MCEReplacement.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = MCEReplacement.STBFolder + temp; listViewExternalCommands.Items[10].SubItems[1].Text = temp; temp = Util.GetXmlString(nodeList, "PreChangeCommand", ""); - if (temp.EndsWith(MCEReplacement.IRExtension)) + if (temp.EndsWith(MCEReplacement.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = MCEReplacement.STBFolder + temp; listViewExternalCommands.Items[11].SubItems[1].Text = temp; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -1789,7 +1789,7 @@ return false; } - if (command.StartsWith(MacroFolder)) // Macro + if (command.StartsWith(MacroFolder, StringComparison.InvariantCultureIgnoreCase)) // Macro { string fileName = AppDataFolder + command + MacroExtension; if (File.Exists(fileName)) @@ -1802,7 +1802,7 @@ return false; } } - else if (command.StartsWith(IRFolder)) // IR Code + else if (command.StartsWith(IRFolder, StringComparison.InvariantCultureIgnoreCase)) // IR Code { string fileName = AppDataFolder + command + IRExtension; if (File.Exists(fileName)) @@ -1815,14 +1815,14 @@ return false; } } - else if (command.StartsWith(STBFolder)) // STB Command + else if (command.StartsWith(STBFolder, StringComparison.InvariantCultureIgnoreCase)) // STB Command { string fileName = AppDataFolder + command; if (File.Exists(fileName)) { - if (fileName.EndsWith(IRExtension)) // IR Command + if (fileName.EndsWith(IRExtension, StringComparison.InvariantCultureIgnoreCase)) // IR Command return BlastIR(fileName, port, speed); - else if (fileName.EndsWith(MacroExtension)) // Macro + else if (fileName.EndsWith(MacroExtension, StringComparison.InvariantCultureIgnoreCase)) // Macro return ProcessMacro(fileName, port, speed); else { Modified: trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -21,6 +21,8 @@ public partial class PluginSetup : SetupTv.SectionSettings { + #region Constructor + public PluginSetup() { InitializeComponent(); @@ -29,20 +31,39 @@ TV3ExtChannelChanger.LogVerbose = checkBoxLogVerbose.Checked = Convert.ToBoolean(layer.GetSetting("TV3ExtChannelChangerLogVerbose", "False").Value); } + #endregion Constructor + + #region SetupTv.SectionSettings + public override void OnSectionDeActivated() { + Log.Info("TV3ExtChannelChanger: Configuration deactivated"); + TvBusinessLayer layer = new TvBusinessLayer(); - Setting setting = layer.GetSetting("TV3ExtChannelChangerLogVerbose"); - setting.Value = checkBoxLogVerbose.Checked.ToString(); + Setting setting; + + TV3ExtChannelChanger.LogVerbose = checkBoxLogVerbose.Checked; + + setting = layer.GetSetting("TV3ExtChannelChangerLogVerbose"); + setting.Value = TV3ExtChannelChanger.LogVerbose.ToString(); setting.Persist(); + TV3ExtChannelChanger.LoadExternalConfigs(); + base.OnSectionDeActivated(); } public override void OnSectionActivated() { + Log.Info("TV3ExtChannelChanger: Configuration activated"); + + if (TV3ExtChannelChanger.ExternalChannelConfigs == null) + TV3ExtChannelChanger.LoadExternalConfigs(); + base.OnSectionActivated(); } + #endregion SetupTv.SectionSettings + private void buttonSTB_Click(object sender, EventArgs e) { ExternalChannels externalChannels = new ExternalChannels(); Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -147,19 +147,6 @@ } } - static void LoadExternalConfigs() - { - int cardCount = TvDatabase.Card.ListAll().Count; - - if (cardCount == 0) - cardCount = 1; - - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; - - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); - } - static bool ProcessExternalChannel(string externalChannel, int card) { bool returnCode = true; @@ -371,6 +358,22 @@ #region Public Methods /// <summary> + /// Load external channel configurations. + /// </summary> + public static void LoadExternalConfigs() + { + int cardCount = TvDatabase.Card.ListAll().Count; + + if (cardCount == 0) + cardCount = 1; + + _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + + for (int index = 0; index < cardCount; index++) + ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> Modified: trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -57,7 +57,7 @@ textBoxName.Text = command; - if (!command.StartsWith(TV3MceBlaster.IRFolder)) + if (!command.StartsWith(TV3MceBlaster.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = TV3MceBlaster.IRFolder + command; bool resetTextBoxNameEnabled = textBoxName.Enabled; @@ -109,7 +109,7 @@ if (command.Length == 0) return; - if (!command.StartsWith(TV3MceBlaster.IRFolder)) + if (!command.StartsWith(TV3MceBlaster.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = TV3MceBlaster.IRFolder + command; TV3MceBlaster.ProcessCommand(command, _blastPort, _blastSpeed); Modified: trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -309,8 +309,8 @@ MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - - if (!fileName.StartsWith(TV3MceBlaster.MacroFolder)) + + if (!fileName.StartsWith(TV3MceBlaster.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = TV3MceBlaster.MacroFolder + fileName; WriteToFile(fileName); @@ -335,7 +335,7 @@ return; } - if (!fileName.StartsWith(TV3MceBlaster.MacroFolder)) + if (!fileName.StartsWith(TV3MceBlaster.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = TV3MceBlaster.MacroFolder + fileName; WriteToFile(fileName); @@ -406,7 +406,7 @@ if (commands == null) { - MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt serial command", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt message command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Modified: trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -67,21 +67,36 @@ public override void OnSectionDeActivated() { + Log.Info("TV3MceBlaster: Configuration deactivated"); + TvBusinessLayer layer = new TvBusinessLayer(); Setting setting; + TV3MceBlaster.LogVerbose = checkBoxLogVerbose.Checked; + setting = layer.GetSetting("TV3MceBlasterLogVerbose"); - setting.Value = checkBoxLogVerbose.Checked.ToString(); + setting.Value = TV3MceBlaster.LogVerbose.ToString(); setting.Persist(); setting = layer.GetSetting("TV3MceBlasterBlastType"); setting.Value = Enum.GetName(typeof(MceIrApi.BlasterType), TV3MceBlaster.BlastType); setting.Persist(); + TV3MceBlaster.LoadExternalConfigs(); + + TV3MceBlaster.InConfiguration = false; + base.OnSectionDeActivated(); } public override void OnSectionActivated() { + Log.Info("TV3MceBlaster: Configuration activated"); + + TV3MceBlaster.InConfiguration = true; + + if (TV3MceBlaster.ExternalChannelConfigs == null) + TV3MceBlaster.LoadExternalConfigs(); + base.OnSectionActivated(); } Modified: trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -229,19 +229,19 @@ for (int i = 0; i < 10; i++) { temp = Util.GetXmlString(nodeList, String.Format("Digit{0}", i), ""); - if (temp.EndsWith(TV3MceBlaster.IRExtension)) + if (temp.EndsWith(TV3MceBlaster.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = TV3MceBlaster.STBFolder + temp; listViewExternalCommands.Items[i].SubItems[1].Text = temp; } temp = Util.GetXmlString(nodeList, "SelectCommand", ""); - if (temp.EndsWith(TV3MceBlaster.IRExtension)) + if (temp.EndsWith(TV3MceBlaster.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = TV3MceBlaster.STBFolder + temp; listViewExternalCommands.Items[10].SubItems[1].Text = temp; temp = Util.GetXmlString(nodeList, "PreChangeCommand", ""); - if (temp.EndsWith(TV3MceBlaster.IRExtension)) + if (temp.EndsWith(TV3MceBlaster.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = TV3MceBlaster.STBFolder + temp; listViewExternalCommands.Items[11].SubItems[1].Text = temp; Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -110,6 +110,12 @@ get { return _externalChannelConfigs; } } + public static bool InConfiguration + { + get { return _inConfiguration; } + set { _inConfiguration = value; } + } + #endregion Properties #region Plugin methods @@ -143,14 +149,7 @@ [CLSCompliant(false)] public SetupTv.SectionSettings Setup { - get - { - _inConfiguration = true; - - LoadExternalConfigs(); - - return new SetupTv.Sections.PluginSetup(); - } + get { return new SetupTv.Sections.PluginSetup(); } } #endregion Plugin methods @@ -174,19 +173,6 @@ } } - static void LoadExternalConfigs() - { - int cardCount = TvDatabase.Card.ListAll().Count; - - if (cardCount == 0) - cardCount = 1; - - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; - - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); - } - static bool ProcessExternalChannel(string externalChannel, int card) { bool returnCode = true; @@ -549,6 +535,22 @@ #region Public Methods /// <summary> + /// Load external channel configurations. + /// </summary> + public static void LoadExternalConfigs() + { + int cardCount = TvDatabase.Card.ListAll().Count; + + if (cardCount == 0) + cardCount = 1; + + _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + + for (int index = 0; index < cardCount; index++) + ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> @@ -707,7 +709,7 @@ return false; } - if (command.StartsWith(MacroFolder)) // Macro + if (command.StartsWith(MacroFolder, StringComparison.InvariantCultureIgnoreCase)) // Macro { string fileName = AppDataFolder + command + MacroExtension; if (File.Exists(fileName)) @@ -720,7 +722,7 @@ return false; } } - else if (command.StartsWith(IRFolder)) // IR Code + else if (command.StartsWith(IRFolder, StringComparison.InvariantCultureIgnoreCase)) // IR Code { string fileName = AppDataFolder + command + IRExtension; if (File.Exists(fileName)) @@ -733,14 +735,14 @@ return false; } } - else if (command.StartsWith(STBFolder)) // STB Command + else if (command.StartsWith(STBFolder, StringComparison.InvariantCultureIgnoreCase)) // STB Command { string fileName = AppDataFolder + command; if (File.Exists(fileName)) { - if (fileName.EndsWith(IRExtension)) // IR Command + if (fileName.EndsWith(IRExtension, StringComparison.InvariantCultureIgnoreCase)) // IR Command return BlastIR(fileName, port, speed); - else if (fileName.EndsWith(MacroExtension)) // Macro + else if (fileName.EndsWith(MacroExtension, StringComparison.InvariantCultureIgnoreCase)) // Macro return ProcessMacro(fileName, port, speed); else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-02-12 20:12:06
|
Revision: 113 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=113&view=rev Author: zebons Date: 2007-02-12 12:11:45 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs trunk/plugins/MyFilms/AntMovieCatalog.cs trunk/plugins/MyFilms/AntMovieCatalog.xsd trunk/plugins/MyFilms/MesFilms.cs trunk/plugins/MyFilms/MesFilms.csproj trunk/plugins/MyFilms/MesFilms.suo trunk/plugins/MyFilms/MesFilmsDetail.cs trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs trunk/plugins/MyFilms/MesFilmsSetup.cs trunk/plugins/MyFilms/MesFilmsSetup.resx trunk/plugins/MyFilms/Properties/AssemblyInfo.cs trunk/plugins/WebBrowser/GUIWebBrowser.suo Modified: trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs =================================================================== --- trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs 2007-02-12 20:11:45 UTC (rev 113) @@ -1135,7 +1135,7 @@ [System.Diagnostics.DebuggerNonUserCodeAttribute()] public MovieRow AddMovieRow( - int Number, + string Number, string Checked, string MediaLabel, string MediaType, @@ -1266,7 +1266,7 @@ [System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitClass() { - this.columnNumber = new System.Data.DataColumn("Number", typeof(int), null, System.Data.MappingType.Attribute); + this.columnNumber = new System.Data.DataColumn("Number", typeof(string), null, System.Data.MappingType.Attribute); base.Columns.Add(this.columnNumber); this.columnChecked = new System.Data.DataColumn("Checked", typeof(string), null, System.Data.MappingType.Attribute); base.Columns.Add(this.columnChecked); @@ -1609,10 +1609,10 @@ } [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public int Number { + public string Number { get { try { - return ((int)(this[this.tableMovie.NumberColumn])); + return ((string)(this[this.tableMovie.NumberColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("La valeur pour la colonne \'Number\' dans la table \'Movie\' est DBNull.", e); Modified: trunk/plugins/MyFilms/AntMovieCatalog.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyFilms/AntMovieCatalog.xsd =================================================================== --- trunk/plugins/MyFilms/AntMovieCatalog.xsd 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/AntMovieCatalog.xsd 2007-02-12 20:11:45 UTC (rev 113) @@ -18,58 +18,58 @@ <xs:element name="Catalog" msprop:Generator_UserTableName="Catalog" msprop:Generator_RowDeletedName="CatalogRowDeleted" msprop:Generator_RowChangedName="CatalogRowChanged" msprop:Generator_RowClassName="CatalogRow" msprop:Generator_RowChangingName="CatalogRowChanging" msprop:Generator_RowEvArgName="CatalogRowChangeEvent" msprop:Generator_RowEvHandlerName="CatalogRowChangeEventHandler" msprop:Generator_TableClassName="CatalogDataTable" msprop:Generator_TableVarName="tableCatalog" msprop:Generator_RowDeletingName="CatalogRowDeleting" msprop:Generator_TablePropName="Catalog"> <xs:complexType> <xs:sequence> - <xs:element name="Properties" msprop:Generator_UserColumnName="Properties" msprop:Generator_ColumnVarNameInTable="columnProperties" msprop:Generator_ColumnPropNameInRow="Properties" msprop:Generator_ColumnPropNameInTable="PropertiesColumn" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> + <xs:element name="Properties" msprop:Generator_UserColumnName="Properties" msprop:Generator_ColumnPropNameInRow="Properties" msprop:Generator_ColumnVarNameInTable="columnProperties" msprop:Generator_ColumnPropNameInTable="PropertiesColumn" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> <xs:element name="Contents" msprop:Generator_UserTableName="Contents" msprop:Generator_RowDeletedName="ContentsRowDeleted" msprop:Generator_RowChangedName="ContentsRowChanged" msprop:Generator_RowClassName="ContentsRow" msprop:Generator_RowChangingName="ContentsRowChanging" msprop:Generator_RowEvArgName="ContentsRowChangeEvent" msprop:Generator_RowEvHandlerName="ContentsRowChangeEventHandler" msprop:Generator_TableClassName="ContentsDataTable" msprop:Generator_TableVarName="tableContents" msprop:Generator_RowDeletingName="ContentsRowDeleting" msprop:Generator_TablePropName="Contents" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Movie" msprop:Generator_UserTableName="Movie" msprop:Generator_RowDeletedName="MovieRowDeleted" msprop:Generator_RowChangedName="MovieRowChanged" msprop:Generator_RowClassName="MovieRow" msprop:Generator_RowChangingName="MovieRowChanging" msprop:Generator_RowEvArgName="MovieRowChangeEvent" msprop:Generator_RowEvHandlerName="MovieRowChangeEventHandler" msprop:Generator_TableClassName="MovieDataTable" msprop:Generator_TableVarName="tableMovie" msprop:Generator_RowDeletingName="MovieRowDeleting" msprop:Generator_TablePropName="Movie" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> - <xs:element name="DateAdded" msdata:ReadOnly="true" msdata:Expression="Convert(Date,'System.DateTime')" msprop:Generator_UserColumnName="DateAdded" msprop:Generator_ColumnVarNameInTable="columnDateAdded" msprop:Generator_ColumnPropNameInRow="DateAdded" msprop:Generator_ColumnPropNameInTable="DateAddedColumn" type="xs:dateTime" minOccurs="0" msdata:Ordinal="29" /> + <xs:element name="DateAdded" msdata:ReadOnly="true" msdata:Expression="Convert(Date,'System.DateTime')" msprop:Generator_UserColumnName="DateAdded" msprop:Generator_ColumnPropNameInRow="DateAdded" msprop:Generator_ColumnVarNameInTable="columnDateAdded" msprop:Generator_ColumnPropNameInTable="DateAddedColumn" type="xs:dateTime" minOccurs="0" msdata:Ordinal="29" /> </xs:sequence> - <xs:attribute name="Number" msprop:Generator_UserColumnName="Number" msprop:Generator_ColumnVarNameInTable="columnNumber" msprop:Generator_ColumnPropNameInRow="Number" msprop:Generator_ColumnPropNameInTable="NumberColumn" type="xs:int" /> - <xs:attribute name="Checked" msprop:Generator_UserColumnName="Checked" msprop:Generator_ColumnVarNameInTable="columnChecked" msprop:Generator_ColumnPropNameInRow="Checked" msprop:Generator_ColumnPropNameInTable="CheckedColumn" type="xs:string" /> - <xs:attribute name="MediaLabel" msprop:Generator_UserColumnName="MediaLabel" msprop:Generator_ColumnPropNameInRow="MediaLabel" msprop:Generator_ColumnVarNameInTable="columnMediaLabel" msprop:Generator_ColumnPropNameInTable="MediaLabelColumn" type="xs:string" /> - <xs:attribute name="MediaType" msprop:Generator_UserColumnName="MediaType" msprop:Generator_ColumnVarNameInTable="columnMediaType" msprop:Generator_ColumnPropNameInRow="MediaType" msprop:Generator_ColumnPropNameInTable="MediaTypeColumn" type="xs:string" /> - <xs:attribute name="Source" msprop:Generator_UserColumnName="Source" msprop:Generator_ColumnPropNameInRow="Source" msprop:Generator_ColumnVarNameInTable="columnSource" msprop:Generator_ColumnPropNameInTable="SourceColumn" type="xs:string" /> - <xs:attribute name="Date" msprop:Generator_UserColumnName="Date" msprop:Generator_ColumnVarNameInTable="columnDate" msprop:Generator_ColumnPropNameInRow="Date" msprop:Generator_ColumnPropNameInTable="DateColumn" type="xs:string" /> - <xs:attribute name="Borrower" msprop:Generator_UserColumnName="Borrower" msprop:Generator_ColumnVarNameInTable="columnBorrower" msprop:Generator_ColumnPropNameInRow="Borrower" msprop:Generator_ColumnPropNameInTable="BorrowerColumn" type="xs:string" /> - <xs:attribute name="Rating" msprop:Generator_UserColumnName="Rating" msprop:Generator_ColumnVarNameInTable="columnRating" msprop:Generator_ColumnPropNameInRow="Rating" msprop:Generator_ColumnPropNameInTable="RatingColumn" type="xs:decimal" /> - <xs:attribute name="OriginalTitle" msprop:Generator_UserColumnName="OriginalTitle" msprop:Generator_ColumnVarNameInTable="columnOriginalTitle" msprop:Generator_ColumnPropNameInRow="OriginalTitle" msprop:Generator_ColumnPropNameInTable="OriginalTitleColumn" type="xs:string" /> - <xs:attribute name="TranslatedTitle" msprop:Generator_UserColumnName="TranslatedTitle" msprop:Generator_ColumnVarNameInTable="columnTranslatedTitle" msprop:Generator_ColumnPropNameInRow="TranslatedTitle" msprop:Generator_ColumnPropNameInTable="TranslatedTitleColumn" type="xs:string" /> - <xs:attribute name="FormattedTitle" msprop:Generator_UserColumnName="FormattedTitle" msprop:Generator_ColumnVarNameInTable="columnFormattedTitle" msprop:Generator_ColumnPropNameInRow="FormattedTitle" msprop:Generator_ColumnPropNameInTable="FormattedTitleColumn" type="xs:string" /> - <xs:attribute name="Director" msprop:Generator_UserColumnName="Director" msprop:Generator_ColumnVarNameInTable="columnDirector" msprop:Generator_ColumnPropNameInRow="Director" msprop:Generator_ColumnPropNameInTable="DirectorColumn" type="xs:string" /> - <xs:attribute name="Producer" msprop:Generator_UserColumnName="Producer" msprop:Generator_ColumnVarNameInTable="columnProducer" msprop:Generator_ColumnPropNameInRow="Producer" msprop:Generator_ColumnPropNameInTable="ProducerColumn" type="xs:string" /> - <xs:attribute name="Country" msprop:Generator_UserColumnName="Country" msprop:Generator_ColumnVarNameInTable="columnCountry" msprop:Generator_ColumnPropNameInRow="Country" msprop:Generator_ColumnPropNameInTable="CountryColumn" type="xs:string" /> - <xs:attribute name="Category" msprop:Generator_UserColumnName="Category" msprop:Generator_ColumnVarNameInTable="columnCategory" msprop:Generator_ColumnPropNameInRow="Category" msprop:Generator_ColumnPropNameInTable="CategoryColumn" type="xs:string" /> - <xs:attribute name="Year" msprop:Generator_UserColumnName="Year" msprop:Generator_ColumnVarNameInTable="columnYear" msprop:Generator_ColumnPropNameInRow="Year" msprop:Generator_ColumnPropNameInTable="YearColumn" type="xs:string" /> - <xs:attribute name="Length" msprop:Generator_UserColumnName="Length" msprop:Generator_ColumnVarNameInTable="columnLength" msprop:Generator_ColumnPropNameInRow="Length" msprop:Generator_ColumnPropNameInTable="LengthColumn" type="xs:string" /> - <xs:attribute name="Actors" msprop:Generator_UserColumnName="Actors" msprop:Generator_ColumnVarNameInTable="columnActors" msprop:Generator_ColumnPropNameInRow="Actors" msprop:Generator_ColumnPropNameInTable="ActorsColumn" type="xs:string" /> - <xs:attribute name="URL" msprop:Generator_UserColumnName="URL" msprop:Generator_ColumnPropNameInRow="URL" msprop:Generator_ColumnVarNameInTable="columnURL" msprop:Generator_ColumnPropNameInTable="URLColumn" type="xs:string" /> - <xs:attribute name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" type="xs:string" /> - <xs:attribute name="Comments" msprop:Generator_UserColumnName="Comments" msprop:Generator_ColumnVarNameInTable="columnComments" msprop:Generator_ColumnPropNameInRow="Comments" msprop:Generator_ColumnPropNameInTable="CommentsColumn" type="xs:string" /> - <xs:attribute name="VideoFormat" msprop:Generator_UserColumnName="VideoFormat" msprop:Generator_ColumnVarNameInTable="columnVideoFormat" msprop:Generator_ColumnPropNameInRow="VideoFormat" msprop:Generator_ColumnPropNameInTable="VideoFormatColumn" type="xs:string" /> - <xs:attribute name="VideoBitrate" msprop:Generator_UserColumnName="VideoBitrate" msprop:Generator_ColumnVarNameInTable="columnVideoBitrate" msprop:Generator_ColumnPropNameInRow="VideoBitrate" msprop:Generator_ColumnPropNameInTable="VideoBitrateColumn" type="xs:string" /> - <xs:attribute name="AudioFormat" msprop:Generator_UserColumnName="AudioFormat" msprop:Generator_ColumnVarNameInTable="columnAudioFormat" msprop:Generator_ColumnPropNameInRow="AudioFormat" msprop:Generator_ColumnPropNameInTable="AudioFormatColumn" type="xs:string" /> - <xs:attribute name="AudioBitrate" msprop:Generator_UserColumnName="AudioBitrate" msprop:Generator_ColumnVarNameInTable="columnAudioBitrate" msprop:Generator_ColumnPropNameInRow="AudioBitrate" msprop:Generator_ColumnPropNameInTable="AudioBitrateColumn" type="xs:string" /> - <xs:attribute name="Resolution" msprop:Generator_UserColumnName="Resolution" msprop:Generator_ColumnVarNameInTable="columnResolution" msprop:Generator_ColumnPropNameInRow="Resolution" msprop:Generator_ColumnPropNameInTable="ResolutionColumn" type="xs:string" /> - <xs:attribute name="Framerate" msprop:Generator_UserColumnName="Framerate" msprop:Generator_ColumnVarNameInTable="columnFramerate" msprop:Generator_ColumnPropNameInRow="Framerate" msprop:Generator_ColumnPropNameInTable="FramerateColumn" type="xs:string" /> - <xs:attribute name="Languages" msprop:Generator_UserColumnName="Languages" msprop:Generator_ColumnPropNameInRow="Languages" msprop:Generator_ColumnVarNameInTable="columnLanguages" msprop:Generator_ColumnPropNameInTable="LanguagesColumn" type="xs:string" /> - <xs:attribute name="Subtitles" msprop:Generator_UserColumnName="Subtitles" msprop:Generator_ColumnPropNameInRow="Subtitles" msprop:Generator_ColumnVarNameInTable="columnSubtitles" msprop:Generator_ColumnPropNameInTable="SubtitlesColumn" type="xs:string" /> - <xs:attribute name="Size" msprop:Generator_UserColumnName="Size" msprop:Generator_ColumnVarNameInTable="columnSize" msprop:Generator_ColumnPropNameInRow="Size" msprop:Generator_ColumnPropNameInTable="SizeColumn" type="xs:string" /> - <xs:attribute name="Disks" msprop:Generator_UserColumnName="Disks" msprop:Generator_ColumnVarNameInTable="columnDisks" msprop:Generator_ColumnPropNameInRow="Disks" msprop:Generator_ColumnPropNameInTable="DisksColumn" type="xs:string" /> - <xs:attribute name="Picture" msprop:Generator_UserColumnName="Picture" msprop:Generator_ColumnVarNameInTable="columnPicture" msprop:Generator_ColumnPropNameInRow="Picture" msprop:Generator_ColumnPropNameInTable="PictureColumn" type="xs:string" /> - <xs:attribute name="Contents_Id" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" use="prohibited" /> + <xs:attribute name="Number" msprop:Generator_UserColumnName="Number" msprop:Generator_ColumnPropNameInRow="Number" msprop:Generator_ColumnVarNameInTable="columnNumber" msprop:Generator_ColumnPropNameInTable="NumberColumn" type="xs:string" /> + <xs:attribute name="Checked" msprop:Generator_UserColumnName="Checked" msprop:Generator_ColumnPropNameInRow="Checked" msprop:Generator_ColumnVarNameInTable="columnChecked" msprop:Generator_ColumnPropNameInTable="CheckedColumn" type="xs:string" /> + <xs:attribute name="MediaLabel" msprop:Generator_UserColumnName="MediaLabel" msprop:Generator_ColumnVarNameInTable="columnMediaLabel" msprop:Generator_ColumnPropNameInRow="MediaLabel" msprop:Generator_ColumnPropNameInTable="MediaLabelColumn" type="xs:string" /> + <xs:attribute name="MediaType" msprop:Generator_UserColumnName="MediaType" msprop:Generator_ColumnPropNameInRow="MediaType" msprop:Generator_ColumnVarNameInTable="columnMediaType" msprop:Generator_ColumnPropNameInTable="MediaTypeColumn" type="xs:string" /> + <xs:attribute name="Source" msprop:Generator_UserColumnName="Source" msprop:Generator_ColumnVarNameInTable="columnSource" msprop:Generator_ColumnPropNameInRow="Source" msprop:Generator_ColumnPropNameInTable="SourceColumn" type="xs:string" /> + <xs:attribute name="Date" msprop:Generator_UserColumnName="Date" msprop:Generator_ColumnPropNameInRow="Date" msprop:Generator_ColumnVarNameInTable="columnDate" msprop:Generator_ColumnPropNameInTable="DateColumn" type="xs:string" /> + <xs:attribute name="Borrower" msprop:Generator_UserColumnName="Borrower" msprop:Generator_ColumnPropNameInRow="Borrower" msprop:Generator_ColumnVarNameInTable="columnBorrower" msprop:Generator_ColumnPropNameInTable="BorrowerColumn" type="xs:string" /> + <xs:attribute name="Rating" msprop:Generator_UserColumnName="Rating" msprop:Generator_ColumnPropNameInRow="Rating" msprop:Generator_ColumnVarNameInTable="columnRating" msprop:Generator_ColumnPropNameInTable="RatingColumn" type="xs:decimal" /> + <xs:attribute name="OriginalTitle" msprop:Generator_UserColumnName="OriginalTitle" msprop:Generator_ColumnPropNameInRow="OriginalTitle" msprop:Generator_ColumnVarNameInTable="columnOriginalTitle" msprop:Generator_ColumnPropNameInTable="OriginalTitleColumn" type="xs:string" /> + <xs:attribute name="TranslatedTitle" msprop:Generator_UserColumnName="TranslatedTitle" msprop:Generator_ColumnPropNameInRow="TranslatedTitle" msprop:Generator_ColumnVarNameInTable="columnTranslatedTitle" msprop:Generator_ColumnPropNameInTable="TranslatedTitleColumn" type="xs:string" /> + <xs:attribute name="FormattedTitle" msprop:Generator_UserColumnName="FormattedTitle" msprop:Generator_ColumnPropNameInRow="FormattedTitle" msprop:Generator_ColumnVarNameInTable="columnFormattedTitle" msprop:Generator_ColumnPropNameInTable="FormattedTitleColumn" type="xs:string" /> + <xs:attribute name="Director" msprop:Generator_UserColumnName="Director" msprop:Generator_ColumnPropNameInRow="Director" msprop:Generator_ColumnVarNameInTable="columnDirector" msprop:Generator_ColumnPropNameInTable="DirectorColumn" type="xs:string" /> + <xs:attribute name="Producer" msprop:Generator_UserColumnName="Producer" msprop:Generator_ColumnPropNameInRow="Producer" msprop:Generator_ColumnVarNameInTable="columnProducer" msprop:Generator_ColumnPropNameInTable="ProducerColumn" type="xs:string" /> + <xs:attribute name="Country" msprop:Generator_UserColumnName="Country" msprop:Generator_ColumnPropNameInRow="Country" msprop:Generator_ColumnVarNameInTable="columnCountry" msprop:Generator_ColumnPropNameInTable="CountryColumn" type="xs:string" /> + <xs:attribute name="Category" msprop:Generator_UserColumnName="Category" msprop:Generator_ColumnPropNameInRow="Category" msprop:Generator_ColumnVarNameInTable="columnCategory" msprop:Generator_ColumnPropNameInTable="CategoryColumn" type="xs:string" /> + <xs:attribute name="Year" msprop:Generator_UserColumnName="Year" msprop:Generator_ColumnPropNameInRow="Year" msprop:Generator_ColumnVarNameInTable="columnYear" msprop:Generator_ColumnPropNameInTable="YearColumn" type="xs:string" /> + <xs:attribute name="Length" msprop:Generator_UserColumnName="Length" msprop:Generator_ColumnPropNameInRow="Length" msprop:Generator_ColumnVarNameInTable="columnLength" msprop:Generator_ColumnPropNameInTable="LengthColumn" type="xs:string" /> + <xs:attribute name="Actors" msprop:Generator_UserColumnName="Actors" msprop:Generator_ColumnPropNameInRow="Actors" msprop:Generator_ColumnVarNameInTable="columnActors" msprop:Generator_ColumnPropNameInTable="ActorsColumn" type="xs:string" /> + <xs:attribute name="URL" msprop:Generator_UserColumnName="URL" msprop:Generator_ColumnVarNameInTable="columnURL" msprop:Generator_ColumnPropNameInRow="URL" msprop:Generator_ColumnPropNameInTable="URLColumn" type="xs:string" /> + <xs:attribute name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" type="xs:string" /> + <xs:attribute name="Comments" msprop:Generator_UserColumnName="Comments" msprop:Generator_ColumnPropNameInRow="Comments" msprop:Generator_ColumnVarNameInTable="columnComments" msprop:Generator_ColumnPropNameInTable="CommentsColumn" type="xs:string" /> + <xs:attribute name="VideoFormat" msprop:Generator_UserColumnName="VideoFormat" msprop:Generator_ColumnPropNameInRow="VideoFormat" msprop:Generator_ColumnVarNameInTable="columnVideoFormat" msprop:Generator_ColumnPropNameInTable="VideoFormatColumn" type="xs:string" /> + <xs:attribute name="VideoBitrate" msprop:Generator_UserColumnName="VideoBitrate" msprop:Generator_ColumnPropNameInRow="VideoBitrate" msprop:Generator_ColumnVarNameInTable="columnVideoBitrate" msprop:Generator_ColumnPropNameInTable="VideoBitrateColumn" type="xs:string" /> + <xs:attribute name="AudioFormat" msprop:Generator_UserColumnName="AudioFormat" msprop:Generator_ColumnPropNameInRow="AudioFormat" msprop:Generator_ColumnVarNameInTable="columnAudioFormat" msprop:Generator_ColumnPropNameInTable="AudioFormatColumn" type="xs:string" /> + <xs:attribute name="AudioBitrate" msprop:Generator_UserColumnName="AudioBitrate" msprop:Generator_ColumnPropNameInRow="AudioBitrate" msprop:Generator_ColumnVarNameInTable="columnAudioBitrate" msprop:Generator_ColumnPropNameInTable="AudioBitrateColumn" type="xs:string" /> + <xs:attribute name="Resolution" msprop:Generator_UserColumnName="Resolution" msprop:Generator_ColumnPropNameInRow="Resolution" msprop:Generator_ColumnVarNameInTable="columnResolution" msprop:Generator_ColumnPropNameInTable="ResolutionColumn" type="xs:string" /> + <xs:attribute name="Framerate" msprop:Generator_UserColumnName="Framerate" msprop:Generator_ColumnPropNameInRow="Framerate" msprop:Generator_ColumnVarNameInTable="columnFramerate" msprop:Generator_ColumnPropNameInTable="FramerateColumn" type="xs:string" /> + <xs:attribute name="Languages" msprop:Generator_UserColumnName="Languages" msprop:Generator_ColumnVarNameInTable="columnLanguages" msprop:Generator_ColumnPropNameInRow="Languages" msprop:Generator_ColumnPropNameInTable="LanguagesColumn" type="xs:string" /> + <xs:attribute name="Subtitles" msprop:Generator_UserColumnName="Subtitles" msprop:Generator_ColumnVarNameInTable="columnSubtitles" msprop:Generator_ColumnPropNameInRow="Subtitles" msprop:Generator_ColumnPropNameInTable="SubtitlesColumn" type="xs:string" /> + <xs:attribute name="Size" msprop:Generator_UserColumnName="Size" msprop:Generator_ColumnPropNameInRow="Size" msprop:Generator_ColumnVarNameInTable="columnSize" msprop:Generator_ColumnPropNameInTable="SizeColumn" type="xs:string" /> + <xs:attribute name="Disks" msprop:Generator_UserColumnName="Disks" msprop:Generator_ColumnPropNameInRow="Disks" msprop:Generator_ColumnVarNameInTable="columnDisks" msprop:Generator_ColumnPropNameInTable="DisksColumn" type="xs:string" /> + <xs:attribute name="Picture" msprop:Generator_UserColumnName="Picture" msprop:Generator_ColumnPropNameInRow="Picture" msprop:Generator_ColumnVarNameInTable="columnPicture" msprop:Generator_ColumnPropNameInTable="PictureColumn" type="xs:string" /> + <xs:attribute name="Contents_Id" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" use="prohibited" /> </xs:complexType> </xs:element> </xs:sequence> - <xs:attribute name="Contents_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> - <xs:attribute name="Catalog_Id" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" use="prohibited" /> + <xs:attribute name="Contents_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> + <xs:attribute name="Catalog_Id" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" use="prohibited" /> </xs:complexType> </xs:element> </xs:sequence> - <xs:attribute name="AntMovieCatalog_Id" msprop:Generator_UserColumnName="AntMovieCatalog_Id" msprop:Generator_ColumnVarNameInTable="columnAntMovieCatalog_Id" msprop:Generator_ColumnPropNameInRow="AntMovieCatalog_Id" msprop:Generator_ColumnPropNameInTable="AntMovieCatalog_IdColumn" type="xs:int" use="prohibited" /> - <xs:attribute name="Catalog_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> + <xs:attribute name="AntMovieCatalog_Id" msprop:Generator_UserColumnName="AntMovieCatalog_Id" msprop:Generator_ColumnPropNameInRow="AntMovieCatalog_Id" msprop:Generator_ColumnVarNameInTable="columnAntMovieCatalog_Id" msprop:Generator_ColumnPropNameInTable="AntMovieCatalog_IdColumn" type="xs:int" use="prohibited" /> + <xs:attribute name="Catalog_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> </xs:complexType> </xs:element> </xs:choice> Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-02-12 20:11:45 UTC (rev 113) @@ -4,8 +4,8 @@ using System.Text.RegularExpressions; using System.Globalization; using MediaPortal.GUI.Library; +using System.Xml; - using System.IO; using System.Data; using MediaPortal.Dialogs; @@ -87,6 +87,8 @@ string StrViewText1 = null; string StrViewItem2 = null; string StrViewText2 = null; + string StrViewDfltItem = null; + string StrViewDfltText = null; string StrFileXml = null; string StrPathImg = null; string StrSort = null; @@ -103,6 +105,8 @@ string FileImage = "9999"; private AntMovieCatalog mydivx; private string StrPluginName = "Films"; + private string CurrentConfig; + private int NbConfig; #endregion #region events @@ -168,9 +172,9 @@ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { string wPluginName = StrPluginName; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) { - wPluginName = xmlreader.GetValueAsString("MesFilms", "pluginName", "My Films"); + wPluginName = xmlreader.GetValueAsString("MyFilms", "PluginName", "My Films"); } strButtonText = wPluginName; @@ -225,12 +229,7 @@ BtnSrtBy.IsAscending = false; Afficherliste(); return; - // TxtSelect.Label = StrTxtSelect; - // boolselect = false; - // boolreturn = false; - // Afficherliste(); - // return; - } + } if (boolreturn) { boolreturn = false; @@ -295,90 +294,36 @@ base.OnMessage(messageType); g_Player.PlayBackStopped += new MediaPortal.Player.g_Player.StoppedHandler(OnPlayBackStopped); g_Player.PlayBackEnded += new MediaPortal.Player.g_Player.EndedHandler(OnPlayBackEnded); + mydivx = new AntMovieCatalog(); if (g_Player.Playing) affich_overlay(); else supprim_overlay(); - string StrFilterItem1 = null; - string StrFilterText1 = null; - string StrFilterItem2 = null; - string StrFilterText2 = null; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) { - StrStorage = xmlreader.GetValueAsString("MesFilms", "AntStorage", ""); - StrIdentItem = xmlreader.GetValueAsString("MesFilms", "AntIdentItem", ""); - StrTitle1 = xmlreader.GetValueAsString("MesFilms", "AntTitle1", ""); - StrFilterItem1 = xmlreader.GetValueAsString("MesFilms", "AntFilterItem1", ""); - StrTSort1 = xmlreader.GetValueAsString("MesFilms", "AntTSort", ""); - StrSort1 = xmlreader.GetValueAsString("MesFilms", "AntSort", ""); - StrFilterText1 = xmlreader.GetValueAsString("MesFilms", "AntFilterText1", ""); - StrFilterItem2 = xmlreader.GetValueAsString("MesFilms", "AntFilterItem2", ""); - StrFilterText2 = xmlreader.GetValueAsString("MesFilms", "AntFilterText2", ""); - StrViewItem1 = xmlreader.GetValueAsString("MesFilms", "AntViewItem1", ""); - StrViewText1 = xmlreader.GetValueAsString("MesFilms", "AntViewText1", ""); - StrViewItem2 = xmlreader.GetValueAsString("MesFilms", "AntViewItem2", ""); - StrViewText2 = xmlreader.GetValueAsString("MesFilms", "AntViewText2", ""); - StrFileXml = xmlreader.GetValueAsString("MesFilms", "AntCatalog", ""); - StrPathImg = xmlreader.GetValueAsString("MesFilms", "AntPicture", ""); - StrSelect = xmlreader.GetValueAsString("MesFilms", "StrSelect", ""); - StrSort = xmlreader.GetValueAsString("MesFilms", "StrSort", ""); - CurrentSortMethod = xmlreader.GetValueAsString("MesFilms", "CurrentSortMethod", ""); - TxtSelect.Label = xmlreader.GetValueAsString("MesFilms", "Selection", ""); - StrSortSens = xmlreader.GetValueAsString("MesFilms", "StrSortSens", ""); - l_index = xmlreader.GetValueAsInt("MesFilms", "IndexItem", -1); - } - mydivx = new AntMovieCatalog(); - if (!ControlFichierDonn\xE9es()) - base.OnPreviousWindow(); - try - { - mydivx.ReadXml(StrFileXml); - } - catch - { - GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlgOk.SetHeading("Error");//my videos - dlgOk.SetLine(1, "Invalid character in the XML File after enreg : " + mydivx.Movie[mydivx.Movie.Count - 1]["Number"]); - dlgOk.SetLine(2, "Verify the few next enregs with ANT Movie Catalog"); - dlgOk.DoModal(GetID); - } - StrDfltSelect = ""; - if (StrSort1.Length == 0) - StrSort1 = "(none)"; - if (!(StrFilterItem1 == null) && !(StrFilterItem1 == "(none)") && !(StrFilterItem1 == "")) - StrDfltSelect = "(" + StrFilterItem1 + " not like '" + StrFilterText1 + "' or " + StrFilterItem1 + " is null) AND "; - if (!(StrFilterItem2 == null) && !(StrFilterItem2 == "(none)") && !(StrFilterItem2 == "")) - StrDfltSelect = "(" + StrDfltSelect + StrFilterItem2 + " not like '" + StrFilterText2 + "' or " + StrFilterItem2 + " is null) AND "; - if (StrSelect == "") - StrSelect = StrTitle1.ToString() + " not like ''"; - if (StrSort == "") - StrSort = StrTitle1; - if (StrSortSens == "") - StrSortSens = " ASC"; - if (CurrentSortMethod == "") - CurrentSortMethod = GUILocalizeStrings.Get(103); - else - BtnSrtBy.Label = CurrentSortMethod.ToString(); - string BtnSearchT = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(342); - string BtnSearchA = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(344); - GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchT, BtnSearchT); - GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchA, BtnSearchA); - // TxtSelect.HorizontalAlignment = MediaPortal.Drawing.HorizontalAlignment.Right; - BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); - if (PreviousWindowId == 7987) - Afficherliste(); - else - { - StrSelect = StrTitle1.ToString() + " not like ''"; - TxtSelect.Label = StrTxtSelect = " "; - boolselect = false; - l_index = -1; - BtnSrtBy.Label = CurrentSortMethod; - if (StrSortSens == " ASC") - BtnSrtBy.IsAscending = true; + if (PreviousWindowId == 7987) + { + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Current_Config", ""); + Load_Config(CurrentConfig); + Fin_Charge_Init(false); + } else - BtnSrtBy.IsAscending = false; - Afficherliste(); + { + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Default_Config", ""); + NbConfig = xmlreader.GetValueAsInt("MyFilms", "NbConfig", 0); + if ((CurrentConfig == "") && (NbConfig == 0)) + { + StrFileXml = ""; + Fin_Charge_Init(false); + } + else + { + if (CurrentConfig == "") + CurrentConfig = Choice_Config(); + Load_Config(CurrentConfig); + Fin_Charge_Init(true); + } + } } return true; @@ -712,7 +657,7 @@ //---------------------------------------------------------------------------------------- private void affichage_Lstdetail(int w_item) { - DataRow[] r = LectureDonn\xE9es(StrDfltSelect + StrSelect, StrSort, StrSortSens); + DataRow[] r = LectureDonn\xE9es(StrSelect, StrSort, StrSortSens); if (r.Length == 0) { masquage_Lstdetail(); @@ -859,128 +804,51 @@ //-------------------------------------------------------------------------------------------- private void Selection_type_Video() { + ArrayList choice_view = new ArrayList(); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) return; dlg.Reset(); dlg.SetHeading(924); // menu dlg.Add(GUILocalizeStrings.Get(342));//videos + dlg.Add(GUILocalizeStrings.Get(345));//year dlg.Add(GUILocalizeStrings.Get(135));//genre dlg.Add(GUILocalizeStrings.Get(200026));//pays + choice_view.Add("All"); + choice_view.Add("Year"); + choice_view.Add("Category"); + choice_view.Add("Country"); if (!(StrStorage.Length == 0) && !(StrStorage == "(none)")) - dlg.Add(GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951));//pays + { + dlg.Add(GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951));//storage + choice_view.Add("Storage"); + } if (!(StrViewItem1 == null) && !(StrViewItem1 == "(none)")) - if ((StrViewText1 == null) || (StrViewText1 == null)) + { + choice_view.Add("View1"); + if ((StrViewText1 == null) || (StrViewText1.Length == 0)) dlg.Add(StrViewItem1); // specific user View1 else dlg.Add(StrViewText1); // specific Text for View1 + } if (!(StrViewItem2 == null) && !(StrViewItem2 == "(none)")) - if ((StrViewText2 == null) || (StrViewText2 == null)) + { + choice_view.Add("View2"); + if ((StrViewText2 == null) || (StrViewText2.Length == 0)) dlg.Add(StrViewItem2); // specific user View2 else dlg.Add(StrViewText2); // specific Text for View2 + } + if (NbConfig > 1) + { + dlg.Add(GUILocalizeStrings.Get(6029) + " " + GUILocalizeStrings.Get(6022)); // Change Config + choice_view.Add("Config"); + } dlg.DoModal(GetID); if (dlg.SelectedLabel == -1) return; - boolstorage = false; - switch (dlg.SelectedLabel) - { - case 0: - StrSelect = StrTitle1.ToString() + " not like ''"; - TxtSelect.Label = " "; - boolselect = false; - BtnSrtBy.Label = CurrentSortMethod; - if (StrSortSens == " ASC") - BtnSrtBy.IsAscending = true; - else - BtnSrtBy.IsAscending = false; - Afficherliste(); - break; - case 1: - WStrSort = "YEAR"; - WStrSortSens = " DESC"; - BtnSrtBy.IsAscending = false; - boolreturn = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - case 2: - WStrSort = "CATEGORY"; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - case 3: - WStrSort = "COUNTRY"; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - case 4: - if (!(StrStorage.Length == 0) && !(StrStorage == "(none)")) - { - StrSelect = "((" + StrTitle1.ToString() + " not like '') and (" + StrStorage.ToString() + " not like ''))"; - TxtSelect.Label = GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951); - StrTxtSelect = TxtSelect.Label; - boolselect = false; - boolreturn = false; - BtnSrtBy.Label = CurrentSortMethod; - if (StrSortSens == " ASC") - BtnSrtBy.IsAscending = true; - else - BtnSrtBy.IsAscending = false; - Afficherliste(); - break; - } - else - { - if (!(StrViewItem1 == null) && !(StrViewItem1 == "(none)")) - WStrSort = StrViewItem1; // specific user View1 - else - WStrSort = StrViewItem2; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } - case 5: - if (!(StrStorage.Length == 0) && !(StrStorage == "(none)")) - { - if (!(StrViewItem1 == null) && !(StrViewItem1 == "(none)")) - WStrSort = StrViewItem1; // specific user View1 - else - WStrSort = StrViewItem2; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } - else - { - WStrSort = StrViewItem2; // specific user View2 - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } - case 6: - WStrSort = StrViewItem2; // specific user View2 - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } + Change_view(choice_view[dlg.SelectedLabel].ToString()); + return; } //---------------------------------------------------------------------------------------------------- // Search for the selected choice in the ANT Item @@ -1110,21 +978,267 @@ } } //----------------------------------------------------------------------------------------------- - // save Config Parameters in MediaPortal.xml file (section MesFilm) + // save Config Parameters in MyFilms.xml file (section MesFilm) //----------------------------------------------------------------------------------------------- private void save_config_values(bool save_index) { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MyFilms.xml")) { - xmlwriter.SetValue("MesFilms", "StrSelect", StrSelect.ToString()); - xmlwriter.SetValue("MesFilms", "StrSort", StrSort.ToString()); - xmlwriter.SetValue("MesFilms", "CurrentSortMethod", CurrentSortMethod.ToString()); - xmlwriter.SetValue("MesFilms", "StrSortSens", StrSortSens.ToString()); - xmlwriter.SetValue("MesFilms", "Selection", TxtSelect.Label.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrSelect", StrSelect.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrDfltSelect", StrDfltSelect.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrSort", StrSort.ToString()); + xmlwriter.SetValue(CurrentConfig, "CurrentSortMethod", CurrentSortMethod.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrSortSens", StrSortSens.ToString()); + xmlwriter.SetValue(CurrentConfig, "Selection", TxtSelect.Label.ToString()); if (save_index) - xmlwriter.SetValue("MesFilms", "IndexItem", lsCtlFilm.SelectedListItemIndex.ToString()); + xmlwriter.SetValue(CurrentConfig, "IndexItem", lsCtlFilm.SelectedListItemIndex.ToString()); } } + private void Load_Config(string CurrentConfig) + { + //----------------------------------------------------------------------------------------------- + // Load Config Parameters in MyFilms.xml file (section CurrentConfig) + //----------------------------------------------------------------------------------------------- + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + xmlwriter.SetValue("MyFilms", "Current_Config", CurrentConfig); + } + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + StrStorage = xmlreader.GetValueAsString(CurrentConfig, "AntStorage", ""); + StrIdentItem = xmlreader.GetValueAsString(CurrentConfig, "AntIdentItem", ""); + StrTitle1 = xmlreader.GetValueAsString(CurrentConfig, "AntTitle1", ""); + StrTSort1 = xmlreader.GetValueAsString(CurrentConfig, "AntTSort", ""); + StrSort1 = xmlreader.GetValueAsString(CurrentConfig, "AntSort", ""); + StrViewItem1 = xmlreader.GetValueAsString(CurrentConfig, "AntViewItem1", ""); + StrViewText1 = xmlreader.GetValueAsString(CurrentConfig, "AntViewText1", ""); + StrViewItem2 = xmlreader.GetValueAsString(CurrentConfig, "AntViewItem2", ""); + StrViewText2 = xmlreader.GetValueAsString(CurrentConfig, "AntViewText2", ""); + StrFileXml = xmlreader.GetValueAsString(CurrentConfig, "AntCatalog", ""); + StrPathImg = xmlreader.GetValueAsString(CurrentConfig, "AntPicture", ""); + StrSelect = xmlreader.GetValueAsString(CurrentConfig, "StrSelect", ""); + StrDfltSelect = xmlreader.GetValueAsString(CurrentConfig, "StrDfltSelect", ""); + StrSort = xmlreader.GetValueAsString(CurrentConfig, "StrSort", ""); + CurrentSortMethod = xmlreader.GetValueAsString(CurrentConfig, "CurrentSortMethod", ""); + TxtSelect.Label = xmlreader.GetValueAsString(CurrentConfig, "Selection", ""); + StrSortSens = xmlreader.GetValueAsString(CurrentConfig, "StrSortSens", ""); + l_index = xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", -1); + StrViewDfltItem = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltItem", ""); + StrViewDfltText = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltText", ""); + + } + } + //-------------------------------------------------------------------------------------------- + // Change View Response + //-------------------------------------------------------------------------------------------- + private void Change_view(string choice_view) + { + boolstorage = false; + if (choice_view == "All") + { + // Change View All Films + StrSelect = StrTitle1.ToString() + " not like ''"; + TxtSelect.Label = " "; + boolselect = false; + BtnSrtBy.Label = CurrentSortMethod; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + return; + } + if (choice_view == "Year") + { + // Change View by Year + WStrSort = "YEAR"; + WStrSortSens = " DESC"; + BtnSrtBy.IsAscending = false; + boolreturn = true; + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Category") + { + // Change View by "Category": + WStrSort = "CATEGORY"; + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Country") + { + // Change View by "Country": + WStrSort = "COUNTRY"; + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Storage") + { + // Change View by "Storage": + StrSelect = "((" + StrTitle1.ToString() + " not like '') and (" + StrStorage.ToString() + " not like ''))"; + TxtSelect.Label = GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951); + StrTxtSelect = TxtSelect.Label; + boolselect = false; + boolreturn = false; + BtnSrtBy.Label = CurrentSortMethod; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + return; + } + if (choice_view == "View1") + { + // Change View by "View1": + WStrSort = StrViewItem1; // specific user View1 + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + if (WStrSort == "DateAdded") + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); + else + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "View2") + { + // Change View by "View2": + WStrSort = StrViewItem2; + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + if (WStrSort == "DateAdded") + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); + else + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Config") + { + //Change "Config": + mydivx.Clear(); + Load_Config(Choice_Config()); + Fin_Charge_Init(true); + return; + } + } + //-------------------------------------------------------------------------------------------- + // Choice Configuration + //-------------------------------------------------------------------------------------------- + private string Choice_Config() + { + GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (dlg == null) + { + StrFileXml = ""; + return ""; + } + dlg.Reset(); + dlg.SetHeading(924); // menu + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + int MesFilms_nb_config = xmlreader.GetValueAsInt("MyFilms", "NbConfig", -1); + for (int i = 0; i < (int)MesFilms_nb_config; i++) + { + dlg.Add(xmlreader.GetValueAsString("MyFilms", "ConfigName" + i, "")); + } + } + dlg.DoModal(GetID); + if (dlg.SelectedLabel == -1) + { + StrFileXml = ""; + return ""; + } + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "ConfigName" + dlg.SelectedLabel, ""); + } + return CurrentConfig; + } + //-------------------------------------------------------------------------------------------- + // Initial Windows load. If LoadDfltSlct = true => load default select if any + // LoadDfltSlct = false => return from MesFilmsDetail + //-------------------------------------------------------------------------------------------- + private void Fin_Charge_Init(bool LoadDfltSlct) + { + if (!ControlFichierDonn\xE9es()) + base.OnPreviousWindow(); + try + { + mydivx.ReadXml(StrFileXml); + } + catch + { + GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlgOk.SetHeading("Error");//my videos + dlgOk.SetLine(1, "Invalid character in the XML File after enreg : " + mydivx.Movie[mydivx.Movie.Count - 1]["Number"]); + dlgOk.SetLine(2, "Verify your file with the plugin setup"); + dlgOk.DoModal(GetID); + } + if (StrSelect == "") + StrSelect = StrTitle1.ToString() + " not like ''"; + if (StrSort1.Length == 0) + StrSort1 = "(none)"; + if (StrSort == "") + StrSort = StrTitle1; + if (StrSortSens == "") + StrSortSens = " ASC"; + if (CurrentSortMethod == "") + CurrentSortMethod = GUILocalizeStrings.Get(103); + BtnSrtBy.Label = CurrentSortMethod.ToString(); + string BtnSearchT = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(342); + string BtnSearchA = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(344); + GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchT, BtnSearchT); + GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchA, BtnSearchA); + // TxtSelect.HorizontalAlignment = MediaPortal.Drawing.HorizontalAlignment.Right; + BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); + if (!(LoadDfltSlct)) + Afficherliste(); + else + { + if ((StrViewDfltItem.Length == 0) || (StrViewDfltItem == "(none)")) + { + StrSelect = StrTitle1.ToString() + " not like ''"; + TxtSelect.Label = StrTxtSelect = " "; + boolselect = false; + l_index = -1; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + } + else + { + if (StrViewDfltText.Length == 0) + { + Change_view(StrViewDfltItem); + } + else + // View List as selected + { + boolselect = false; + boolreturn = true; + WStrSort = StrViewDfltItem; + if (StrViewDfltItem == "DateAdded") + StrSelect = "Date" + " like '" + DateTime.Parse(StrViewDfltText).ToShortDateString() + "'"; + else + StrSelect = StrViewDfltItem + " like '*" + StrViewDfltText + "*'"; + TxtSelect.Label = "[" + StrViewDfltText + "]"; + BtnSrtBy.Label = CurrentSortMethod; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + } + + } + } + } #endregion } } \ No newline at end of file Modified: trunk/plugins/MyFilms/MesFilms.csproj =================================================================== --- trunk/plugins/MyFilms/MesFilms.csproj 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/MesFilms.csproj 2007-02-12 20:11:45 UTC (rev 113) @@ -30,15 +30,15... [truncated message content] |
From: <du...@us...> - 2007-02-12 18:58:48
|
Revision: 112 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=112&view=rev Author: dukus Date: 2007-02-12 09:42:33 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Text type added Modified Paths: -------------- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Form1.cs trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs trunk/plugins/mpinstaler/MPInstaler.suo Removed Paths: ------------- trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Form2.cs trunk/plugins/mpinstaler/MPInstaler/Form2.resx Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-12 17:42:33 UTC (rev 112) @@ -52,6 +52,10 @@ this.mediaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fullToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.languageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.otherToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.bossview = new System.Windows.Forms.ListView(); this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); @@ -66,13 +70,22 @@ this.tabPage_Skin = new System.Windows.Forms.TabPage(); this.tabPage_Plugin = new System.Windows.Forms.TabPage(); this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage_Other = new System.Windows.Forms.TabPage(); + this.tabPage_Text = new System.Windows.Forms.TabPage(); + this.textt_comboBox1 = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); this.tabPage_Language = new System.Windows.Forms.TabPage(); this.tabPage_Proiect = new System.Windows.Forms.TabPage(); - this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.label2 = new System.Windows.Forms.Label(); + this.proiectt_textBox1 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.proiectt_textBox2 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.proiectt_textBox3 = new System.Windows.Forms.TextBox(); this.menuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); + this.tabPage_Text.SuspendLayout(); + this.tabPage_Proiect.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 @@ -166,7 +179,10 @@ this.windowPluginToolStripMenuItem, this.skinToolStripMenuItem, this.languageToolStripMenuItem, - this.textToolStripMenuItem}); + this.textToolStripMenuItem, + this.otherToolStripMenuItem, + this.settingsToolStripMenuItem, + this.textToolStripMenuItem1}); this.addToolStripMenuItem.Name = "addToolStripMenuItem"; this.addToolStripMenuItem.Size = new System.Drawing.Size(38, 20); this.addToolStripMenuItem.Text = "Add"; @@ -180,7 +196,7 @@ this.tagReadersToolStripMenuItem, this.externalPlayersToolStripMenuItem}); this.windowPluginToolStripMenuItem.Name = "windowPluginToolStripMenuItem"; - this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.windowPluginToolStripMenuItem.Text = "Plugin"; // // windowToolStripMenuItem @@ -225,43 +241,69 @@ this.mediaToolStripMenuItem, this.fullToolStripMenuItem}); this.skinToolStripMenuItem.Name = "skinToolStripMenuItem"; - this.skinToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.skinToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.skinToolStripMenuItem.Text = "Skin"; // // componentToolStripMenuItem // this.componentToolStripMenuItem.Name = "componentToolStripMenuItem"; - this.componentToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.componentToolStripMenuItem.Size = new System.Drawing.Size(140, 22); this.componentToolStripMenuItem.Text = "Component"; this.componentToolStripMenuItem.Click += new System.EventHandler(this.componentToolStripMenuItem_Click); // // mediaToolStripMenuItem // this.mediaToolStripMenuItem.Name = "mediaToolStripMenuItem"; - this.mediaToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.mediaToolStripMenuItem.Size = new System.Drawing.Size(140, 22); this.mediaToolStripMenuItem.Text = "Media"; this.mediaToolStripMenuItem.Click += new System.EventHandler(this.mediaToolStripMenuItem_Click); // // fullToolStripMenuItem // + this.fullToolStripMenuItem.Enabled = false; this.fullToolStripMenuItem.Name = "fullToolStripMenuItem"; - this.fullToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.fullToolStripMenuItem.Size = new System.Drawing.Size(140, 22); this.fullToolStripMenuItem.Text = "Full"; this.fullToolStripMenuItem.Visible = false; // // languageToolStripMenuItem // this.languageToolStripMenuItem.Name = "languageToolStripMenuItem"; - this.languageToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.languageToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.languageToolStripMenuItem.Text = "Language"; this.languageToolStripMenuItem.Click += new System.EventHandler(this.languageToolStripMenuItem_Click); // + // textToolStripMenuItem + // + this.textToolStripMenuItem.Name = "textToolStripMenuItem"; + this.textToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.textToolStripMenuItem.Text = "Text"; + this.textToolStripMenuItem.Click += new System.EventHandler(this.textToolStripMenuItem_Click); + // + // otherToolStripMenuItem + // + this.otherToolStripMenuItem.Name = "otherToolStripMenuItem"; + this.otherToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.otherToolStripMenuItem.Text = "Other"; + // + // settingsToolStripMenuItem + // + this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; + this.settingsToolStripMenuItem.Size = new System.Drawing.Size(132, 22); + this.settingsToolStripMenuItem.Text = "Settings"; + // + // textToolStripMenuItem1 + // + this.textToolStripMenuItem1.Name = "textToolStripMenuItem1"; + this.textToolStripMenuItem1.Size = new System.Drawing.Size(132, 22); + this.textToolStripMenuItem1.Text = "Text"; + this.textToolStripMenuItem1.Click += new System.EventHandler(this.textToolStripMenuItem1_Click); + // // bossview // this.bossview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.bossview.CheckBoxes = true; this.bossview.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, @@ -272,6 +314,7 @@ this.bossview.ContextMenuStrip = this.contextMenuStrip1; this.bossview.FullRowSelect = true; this.bossview.GridLines = true; + this.bossview.HideSelection = false; this.bossview.Location = new System.Drawing.Point(12, 40); this.bossview.Name = "bossview"; this.bossview.Size = new System.Drawing.Size(651, 227); @@ -340,7 +383,7 @@ this.tabPage_Skin.Padding = new System.Windows.Forms.Padding(3); this.tabPage_Skin.Size = new System.Drawing.Size(643, 120); this.tabPage_Skin.TabIndex = 1; - this.tabPage_Skin.Text = "Properties"; + this.tabPage_Skin.Text = "Skin Properties"; this.tabPage_Skin.UseVisualStyleBackColor = true; // // tabPage_Plugin @@ -350,7 +393,7 @@ this.tabPage_Plugin.Padding = new System.Windows.Forms.Padding(3); this.tabPage_Plugin.Size = new System.Drawing.Size(643, 120); this.tabPage_Plugin.TabIndex = 0; - this.tabPage_Plugin.Text = "Properties"; + this.tabPage_Plugin.Text = "Plugin Properties"; this.tabPage_Plugin.UseVisualStyleBackColor = true; // // tabControl1 @@ -359,7 +402,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.tabControl1.Controls.Add(this.tabPage_Plugin); this.tabControl1.Controls.Add(this.tabPage_Skin); - this.tabControl1.Controls.Add(this.tabPage_Other); + this.tabControl1.Controls.Add(this.tabPage_Text); this.tabControl1.Controls.Add(this.tabPage_Language); this.tabControl1.Controls.Add(this.tabPage_Proiect); this.tabControl1.Location = new System.Drawing.Point(12, 273); @@ -368,15 +411,40 @@ this.tabControl1.Size = new System.Drawing.Size(651, 146); this.tabControl1.TabIndex = 3; // - // tabPage_Other + // tabPage_Text // - this.tabPage_Other.Location = new System.Drawing.Point(4, 22); - this.tabPage_Other.Name = "tabPage_Other"; - this.tabPage_Other.Size = new System.Drawing.Size(643, 120); - this.tabPage_Other.TabIndex = 2; - this.tabPage_Other.Text = "Properties"; - this.tabPage_Other.UseVisualStyleBackColor = true; + this.tabPage_Text.Controls.Add(this.textt_comboBox1); + this.tabPage_Text.Controls.Add(this.label1); + this.tabPage_Text.Location = new System.Drawing.Point(4, 22); + this.tabPage_Text.Name = "tabPage_Text"; + this.tabPage_Text.Size = new System.Drawing.Size(643, 120); + this.tabPage_Text.TabIndex = 2; + this.tabPage_Text.Text = "Text Properties"; + this.tabPage_Text.UseVisualStyleBackColor = true; // + // textt_comboBox1 + // + this.textt_comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.textt_comboBox1.FormattingEnabled = true; + this.textt_comboBox1.Items.AddRange(new object[] { + "LOG", + "EULA", + "READ ME"}); + this.textt_comboBox1.Location = new System.Drawing.Point(43, 18); + this.textt_comboBox1.Name = "textt_comboBox1"; + this.textt_comboBox1.Size = new System.Drawing.Size(111, 21); + this.textt_comboBox1.TabIndex = 1; + this.textt_comboBox1.TextChanged += new System.EventHandler(this.tab_text_change); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 21); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(34, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Type:"; + // // tabPage_Language // this.tabPage_Language.Location = new System.Drawing.Point(4, 22); @@ -388,6 +456,12 @@ // // tabPage_Proiect // + this.tabPage_Proiect.Controls.Add(this.proiectt_textBox3); + this.tabPage_Proiect.Controls.Add(this.label4); + this.tabPage_Proiect.Controls.Add(this.proiectt_textBox2); + this.tabPage_Proiect.Controls.Add(this.label3); + this.tabPage_Proiect.Controls.Add(this.proiectt_textBox1); + this.tabPage_Proiect.Controls.Add(this.label2); this.tabPage_Proiect.Location = new System.Drawing.Point(4, 22); this.tabPage_Proiect.Name = "tabPage_Proiect"; this.tabPage_Proiect.Size = new System.Drawing.Size(643, 120); @@ -395,12 +469,55 @@ this.tabPage_Proiect.Text = "Proiect Properties"; this.tabPage_Proiect.UseVisualStyleBackColor = true; // - // textToolStripMenuItem + // label2 // - this.textToolStripMenuItem.Name = "textToolStripMenuItem"; - this.textToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.textToolStripMenuItem.Text = "Text"; + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 12); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(41, 13); + this.label2.TabIndex = 0; + this.label2.Text = "Name :"; // + // proiectt_textBox1 + // + this.proiectt_textBox1.Location = new System.Drawing.Point(94, 5); + this.proiectt_textBox1.Name = "proiectt_textBox1"; + this.proiectt_textBox1.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox1.TabIndex = 1; + this.proiectt_textBox1.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 40); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(44, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Author :"; + // + // proiectt_textBox2 + // + this.proiectt_textBox2.Location = new System.Drawing.Point(94, 33); + this.proiectt_textBox2.Name = "proiectt_textBox2"; + this.proiectt_textBox2.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox2.TabIndex = 3; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(3, 66); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(73, 13); + this.label4.TabIndex = 4; + this.label4.Text = "Update URL :"; + // + // proiectt_textBox3 + // + this.proiectt_textBox3.Location = new System.Drawing.Point(94, 59); + this.proiectt_textBox3.Name = "proiectt_textBox3"; + this.proiectt_textBox3.Size = new System.Drawing.Size(298, 20); + this.proiectt_textBox3.TabIndex = 5; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -417,6 +534,10 @@ this.menuStrip1.PerformLayout(); this.contextMenuStrip1.ResumeLayout(false); this.tabControl1.ResumeLayout(false); + this.tabPage_Text.ResumeLayout(false); + this.tabPage_Text.PerformLayout(); + this.tabPage_Proiect.ResumeLayout(false); + this.tabPage_Proiect.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -460,11 +581,22 @@ private System.Windows.Forms.TabPage tabPage_Skin; private System.Windows.Forms.TabPage tabPage_Plugin; private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage_Other; + private System.Windows.Forms.TabPage tabPage_Text; private System.Windows.Forms.TabPage tabPage_Language; private System.Windows.Forms.TabPage tabPage_Proiect; private System.Windows.Forms.ColumnHeader columnHeader6; private System.Windows.Forms.ToolStripMenuItem textToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem otherToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem textToolStripMenuItem1; + private System.Windows.Forms.ComboBox textt_comboBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox proiectt_textBox1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox proiectt_textBox2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox proiectt_textBox3; + private System.Windows.Forms.Label label4; } } Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-12 17:42:33 UTC (rev 112) @@ -79,7 +79,18 @@ } } } - + private void addtext() + { + openFileDialog1.Filter = "txt files|*.txt|All files|*.*"; + openFileDialog1.Multiselect = true; + if (openFileDialog1.ShowDialog(this) == DialogResult.OK) + { + foreach (string fil in openFileDialog1.FileNames) + { + addrow(Path.GetFileName(fil), MPinstalerStruct.TEXT_TYPE, MPinstalerStruct.TEXT_LOG_TYPE, Path.GetFullPath(fil), "03010", ""); + } + } +} private void addskin(int type) { // string fil; @@ -147,6 +158,7 @@ if (openFileDialog1.ShowDialog(this) == DialogResult.OK) { fil = openFileDialog1.FileName; + proiect_file_name = fil; XmlDocument doc = new XmlDocument(); doc.Load(fil); XmlNode ver = doc.DocumentElement.SelectSingleNode("/MPinstaler"); @@ -161,14 +173,21 @@ nodefile.SelectSingleNode("Id").InnerText); } _struct.BuildFileName = ver.SelectSingleNode("Option/BuildFileName").InnerText; + _struct.Name = ver.SelectSingleNode("Option/ProiectName").InnerText; + _struct.Author = ver.SelectSingleNode("Option/Author").InnerText; + _struct.UpdateURL = ver.SelectSingleNode("Option/UpdateURL").InnerText; _struct.ProiectdFileName = fil; } _struct.AddFileList(bossview); + proiectt_textBox1.Text = _struct.Name; + proiectt_textBox2.Text = _struct.Author; + proiectt_textBox2.Text = _struct.UpdateURL; } private void languageToolStripMenuItem_Click(object sender, EventArgs e) { Form2 StrForm = new Form2(); + //StrForm.baseDir = "D:\\Program Files\\Team MediaPortal\\MediaPortal\\" ; StrForm.ShowDialog(); } @@ -246,6 +265,9 @@ writer.WriteStartElement("Option"); writer.WriteElementString("BuildFileName", _struct.BuildFileName); writer.WriteElementString("ProiectFileName", Path.GetFullPath(_struct.ProiectdFileName)); + writer.WriteElementString("ProiectName", _struct.Name); + writer.WriteElementString("Author", _struct.Author); + writer.WriteElementString("UpdateURL", _struct.UpdateURL); writer.WriteEndElement(); writer.WriteEndElement(); writer.Flush(); @@ -280,6 +302,10 @@ { tabControl1.Controls.Clear(); tabControl1.Controls.Add(tabPage_Proiect); + textt_comboBox1.Items.Clear(); + textt_comboBox1.Items.Add(MPinstalerStruct.TEXT_LOG_TYPE); + textt_comboBox1.Items.Add(MPinstalerStruct.TEXT_README_TYPE); + textt_comboBox1.Items.Add(MPinstalerStruct.TEXT_EULA_TYPE); } private void bossview_SelectedIndexChanged(object sender, EventArgs e) @@ -298,6 +324,14 @@ tabControl1.Controls.Add(tabPage_Skin); tabControl1.Controls.Add(tabPage_Proiect); } + if (bossview.SelectedItems[0].SubItems[1].Text == MPinstalerStruct.TEXT_TYPE) + { + tabControl1.Controls.Clear(); + tabControl1.Controls.Add(tabPage_Text); + tabControl1.Controls.Add(tabPage_Proiect); + textt_comboBox1.Text = bossview.SelectedItems[0].SubItems[2].Text; + } + } else { @@ -307,5 +341,29 @@ } + private void textToolStripMenuItem1_Click(object sender, EventArgs e) + { + + } + + private void textToolStripMenuItem_Click(object sender, EventArgs e) + { + addtext(); + } + + private void tab_text_change(object sender, EventArgs e) + { + if (bossview.SelectedItems.Count > 0) + { + bossview.SelectedItems[0].SubItems[2].Text = textt_comboBox1.Text; + } + } + + private void proiectt_textBox1_TextChanged(object sender, EventArgs e) + { + _struct.Name = proiectt_textBox1.Text; + } + + } } \ No newline at end of file Deleted: trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs 2007-02-12 17:42:33 UTC (rev 112) @@ -1,137 +0,0 @@ -namespace MPInstaler -{ - partial class Form2 - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.languageComboBox = new System.Windows.Forms.ComboBox(); - this.listView1 = new System.Windows.Forms.ListView(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(80, 289); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(65, 23); - this.button1.TabIndex = 0; - this.button1.Text = "Add"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(186, 289); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 1; - this.button2.Text = "Remove"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // languageComboBox - // - this.languageComboBox.FormattingEnabled = true; - this.languageComboBox.Location = new System.Drawing.Point(12, 22); - this.languageComboBox.Name = "languageComboBox"; - this.languageComboBox.Size = new System.Drawing.Size(372, 21); - this.languageComboBox.TabIndex = 2; - // - // listView1 - // - this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2}); - this.listView1.FullRowSelect = true; - this.listView1.GridLines = true; - this.listView1.Location = new System.Drawing.Point(12, 68); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(372, 179); - this.listView1.TabIndex = 3; - this.listView1.UseCompatibleStateImageBehavior = false; - this.listView1.View = System.Windows.Forms.View.Details; - this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); - // - // columnHeader1 - // - this.columnHeader1.Text = "Id"; - // - // columnHeader2 - // - this.columnHeader2.Text = "Value"; - this.columnHeader2.Width = 308; - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(12, 253); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(62, 20); - this.textBox1.TabIndex = 4; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(80, 253); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(304, 20); - this.textBox2.TabIndex = 5; - // - // Form2 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(396, 333); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.listView1); - this.Controls.Add(this.languageComboBox); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Name = "Form2"; - this.Text = "String Editor"; - this.Load += new System.EventHandler(this.Form2_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.ComboBox languageComboBox; - private System.Windows.Forms.ListView listView1; - private System.Windows.Forms.ColumnHeader columnHeader1; - private System.Windows.Forms.ColumnHeader columnHeader2; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - } -} \ No newline at end of file Deleted: trunk/plugins/mpinstaler/MPInstaler/Form2.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form2.cs 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/Form2.cs 2007-02-12 17:42:33 UTC (rev 112) @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.IO; - -namespace MPInstaler -{ - public partial class Form2 : Form - { - string LanguageDirectory = ""; - public Form2() - { - InitializeComponent(); - } - - private void button1_Click(object sender, EventArgs e) - { - ListViewItem item1 = new ListViewItem(textBox1.Text, 0); - item1.SubItems.Add(textBox2.Text); - listView1.Items.AddRange(new ListViewItem[] { item1 }); - - } - - private void listView1_SelectedIndexChanged(object sender, EventArgs e) - { - - } - - private void button2_Click(object sender, EventArgs e) - { - foreach (int index in listView1.SelectedIndices) - { - listView1.Items.RemoveAt(index); - } - } - - private void Form2_Load(object sender, EventArgs e) - { - if (Directory.Exists(LanguageDirectory)) - { - string[] folders = Directory.GetDirectories(LanguageDirectory, "*.*"); - - foreach (string folder in folders) - { - string fileName = folder.Substring(folder.LastIndexOf(@"\") + 1); - - // - // Exclude cvs folder - // - if (fileName.ToLower() != "cvs") - { - if (fileName.Length > 0) - { - fileName = fileName.Substring(0, 1).ToUpper() + fileName.Substring(1); - languageComboBox.Items.Add(fileName); - } - } - } - } - } - } -} \ No newline at end of file Deleted: trunk/plugins/mpinstaler/MPInstaler/Form2.resx =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form2.resx 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/Form2.resx 2007-02-12 17:42:33 UTC (rev 112) @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> -</root> \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-12 17:42:33 UTC (rev 112) @@ -60,6 +60,10 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2595.36012, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>D:\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Build dialog.cs"> @@ -75,11 +79,11 @@ <Compile Include="Form1.Designer.cs"> <DependentUpon>Form1.cs</DependentUpon> </Compile> - <Compile Include="Form2.cs"> + <Compile Include="Language dialog.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Form2.Designer.cs"> - <DependentUpon>Form2.cs</DependentUpon> + <Compile Include="Language dialog.Designer.cs"> + <DependentUpon>Language dialog.cs</DependentUpon> </Compile> <Compile Include="OptionForm.cs"> <SubType>Form</SubType> @@ -97,9 +101,9 @@ <SubType>Designer</SubType> <DependentUpon>Form1.cs</DependentUpon> </EmbeddedResource> - <EmbeddedResource Include="Form2.resx"> + <EmbeddedResource Include="Language dialog.resx"> <SubType>Designer</SubType> - <DependentUpon>Form2.cs</DependentUpon> + <DependentUpon>Language dialog.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="OptionForm.resx"> <SubType>Designer</SubType> Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-11 09:17:50 UTC (rev 111) +++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-12 17:42:33 UTC (rev 112) @@ -24,14 +24,42 @@ public const string SKIN_TYPE = "Skin"; public const string SKIN_MEDIA_TYPE = "Media"; public const string SKIN_XML_SUBTYPE = "Genskin"; + public const string TEXT_TYPE = "Text"; + public const string TEXT_EULA_TYPE = "EULA"; + public const string TEXT_LOG_TYPE = "Log"; + public const string TEXT_README_TYPE = "Ream_me"; string _builFileName = string.Empty; string _proiectFileName = string.Empty; + string _author = string.Empty; + string _update = string.Empty; + string _name = string.Empty; public ArrayList FileList = new ArrayList(); public MPinstalerStruct() { } + public string UpdateURL + { + get { return _update; } + set + { + if (value == null) _update = ""; else _update = value; + } + } + public string Author + { + get { return _author; } + set + { + if (value ==null) _author = "";else _author = value; + } + } + public string Name + { + get { return _name; } + set { _name = value; } + } public string BuildFileName { get { return _builFileName; } Modified: trunk/plugins/mpinstaler/MPInstaler.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-02-11 09:17:52
|
Revision: 111 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=111&view=rev Author: saamand Date: 2007-02-11 01:17:50 -0800 (Sun, 11 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings trunk/plugins/MyLyrics/LyricsEngine/Setup.cs trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.cs trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.resx trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup_LyricsLibrary.cs trunk/plugins/MyLyrics/MyLyric Windows Application/MyLyric Windows Application/LyricsEngine Tester.cs Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricController.cs 2007-02-11 09:17:50 UTC (rev 111) @@ -55,7 +55,6 @@ // Lyric sites private string[] lyricSites; private string[] eastSites; - private string[] googleSites; public LyricController(ILyricForm mainForm, ManualResetEvent eventStopThread, ManualResetEvent eventThreadStopped, @@ -70,25 +69,17 @@ this.lyricSites = lyricSites; - // Sort the sites in easy and google sites ArrayList easySitesArrayList = new ArrayList(); - ArrayList googleArrayList = new ArrayList(); + foreach (string site in lyricSites) { if (Setup.IsMemberOfEasySites(site)) { easySitesArrayList.Add(site); } - if (Setup.IsMemberOfGoogleSites(site)) - { - googleArrayList.Add(site); - } } eastSites = (string[])easySitesArrayList.ToArray(typeof(string)); LyricSearch_EasySites.EasySites = eastSites; - - googleSites = (string[])googleArrayList.ToArray(typeof(string)); - LyricSearch_GoogleSites.GoogleSites = googleSites; // initialize events m_EventStop_LyricController = eventStopThread; @@ -97,7 +88,7 @@ m_EventStop_LyricSearches = new ManualResetEvent(false); m_EventStop_LyricSearches.Set(); - LyricSearch_GoogleSites.Abort = false; + LyricSearch_EasySites.Abort = false; } @@ -168,7 +159,7 @@ this.m_EventStopped_LyricController = eventThreadStopped; } - public void addNewLyricSearch(LyricConfigInfo lyricConfigInfo) + public void addNewLyricSearch(string artist, string title) { if (eastSites.Length > 0) { @@ -177,32 +168,16 @@ { LyricSearch_EasySites lyricSearch_EasySites = new LyricSearch_EasySites(m_EventStop_LyricController, m_EventStopped_LyricController, this); - lyricSearch_EasySites.setLyricInfo(lyricConfigInfo.artist, lyricConfigInfo.track, lyricConfigInfo.extra); + lyricSearch_EasySites.setLyricInfo(artist, title); lyricSearch_EasySites.Run(); }; Thread lyricSearchThread = new Thread(easySitesThreadInstance); - lyricSearchThread.Name = "BasicSearch for " + lyricConfigInfo.artist + " - " + lyricConfigInfo.track; // looks nice in Output window + lyricSearchThread.Name = "BasicSearch for " + artist + " - " + title; // looks nice in Output window lyricSearchThread.IsBackground = true; lyricSearchThread.Start(); threadList.Add(lyricSearchThread); } - - //if (googleSites.Length > 0) - //{ - // ThreadStart googleSitesThreadInstance = delegate - // { - // LyricSearch_GoogleSites lyricSearch_GoogleSites = new LyricSearch_GoogleSites(m_EventStop_LyricController, m_EventStopped_LyricController, this); - // lyricSearch_GoogleSites.setLyricInfo(lyricConfigInfo.artist, lyricConfigInfo.track, lyricConfigInfo.extra); - // lyricSearch_GoogleSites.Run(); - // }; - - // Thread lyricSearchThread = new Thread(googleSitesThreadInstance); - // lyricSearchThread.Name = "GoogleSearch for " + lyricConfigInfo.artist + " - " + lyricConfigInfo.track; // looks nice in Output window - // lyricSearchThread.IsBackground = true; - // lyricSearchThread.Start(); - // threadList.Add(lyricSearchThread); - //} } public void suspendAllSearchThreadsExceptMe(int managedThreadId) @@ -223,27 +198,6 @@ m_EventStop_LyricSearches.Reset(); } - public static object isLicenseKeyWorking(string licenseKey) - { - Google.GoogleSearchService s = new Google.GoogleSearchService(); - Google.GoogleSearchResult searchResults = new Google.GoogleSearchResult(); - - try - { - //MessageBox.Show("licenseKey: " + licenseKey); - searchResults = s.doGoogleSearch(licenseKey, "this is a test", 0, 3, false, "", false, "", "", ""); - return true; - } - catch (System.Net.WebException webExc) - { - return webExc;// true; //todo - } - catch (System.Web.Services.Protocols.SoapException) - { - return false; - } - } - internal void updateString(String message, String site) { m_Form.UpdateString = new Object[] { message, site }; @@ -312,14 +266,14 @@ { m_StopSearches = true; m_EventStop_LyricSearches.Reset(); - LyricSearch_GoogleSites.Abort = true; + LyricSearch_EasySites.Abort = true; //StopTheSearchAndAbort.Invoke(this, EventArgs.Empty); } else { m_StopSearches = false; m_EventStop_LyricSearches.Set(); - LyricSearch_GoogleSites.Abort = false; + LyricSearch_EasySites.Abort = false; } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricUtil.cs 2007-02-11 09:17:50 UTC (rev 111) @@ -8,6 +8,7 @@ { static string[] parenthesesAndAlike = new string[6] { "(album", "(acoustic", "(live", "(radio", "[", "{" }; + static string[] charsToDelete = new string[11] { ".", ",", "&", "'", "!", "\"", "&", "?", "(", ")", "+" }; // capatalize string and make ready for XML @@ -38,7 +39,7 @@ return str; } - public static bool trimForParenthesis(ref string str) + public static void trimForParenthesis(ref string str) { for (int i = 0; i < parenthesesAndAlike.Length; i++) { @@ -46,12 +47,18 @@ if (index != -1) { str = str.Substring(0, index).Trim(); - return true; } } - return false; } + public static void deleteSpecificChars(ref string str) + { + for (int i = 0; i < charsToDelete.Length; i++) + { + str = str.Replace(charsToDelete[i], ""); + } + } + public static string changeAnd_and_and(string str) { string strTemp = str; Modified: trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/LyricsEngine/LyricsEngine.csproj 2007-02-11 09:17:50 UTC (rev 111) @@ -42,11 +42,13 @@ <ItemGroup> <Compile Include="LyricSearch_EasySites.cs" /> <Compile Include="LyricDiagnostics.cs" /> + <Compile Include="LyricSites\EvilLabs.cs" /> + <Compile Include="LyricSites\Lyrics007.cs" /> + <Compile Include="LyricSites\LyricsOnDemand.cs" /> + <Compile Include="LyricSites\SeekLyrics.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="GetGoogleSearchResult.cs" /> <Compile Include="ICommand.cs" /> <Compile Include="ILyricForm.cs" /> - <Compile Include="LyricConfigInfo.cs" /> <Compile Include="LyricController.cs" /> <Compile Include="LyricSiteInfo.cs" /> <EmbeddedResource Include="Properties\Resources.resx"> @@ -54,26 +56,16 @@ <LastGenOutput>Resources.Designer.cs</LastGenOutput> <SubType>Designer</SubType> </EmbeddedResource> - <Compile Include="LyricSearch_GoogleSites.cs" /> <Compile Include="LyricUtil.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> <DesignTime>True</DesignTime> </Compile> - <None Include="app.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> - <None Include="Web References\Google\GoogleSearch.wsdl" /> - <None Include="Web References\Google\GoogleSearchResult.datasource"> - <DependentUpon>Reference.map</DependentUpon> - </None> - <None Include="Web References\Google\Reference.map"> - <Generator>MSDiscoCodeGenerator</Generator> - <LastGenOutput>Reference.cs</LastGenOutput> - </None> <None Include="Web References\org.lyricwiki\LyricsResult.datasource"> <DependentUpon>Reference.map</DependentUpon> </None> @@ -94,33 +86,17 @@ <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> <Compile Include="Setup.cs" /> - <Compile Include="Web References\Google\Reference.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>Reference.map</DependentUpon> - </Compile> <Compile Include="Web References\org.lyricwiki\Reference.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Reference.map</DependentUpon> </Compile> - <Compile Include="Wiki.cs" /> + <Compile Include="LyricSites\Wiki.cs" /> </ItemGroup> <ItemGroup> <WebReferences Include="Web References\" /> </ItemGroup> <ItemGroup> - <WebReferenceUrl Include="http://api.google.com/GoogleSearch.wsdl"> - <UrlBehavior>Dynamic</UrlBehavior> - <RelPath>Web References\Google\</RelPath> - <UpdateFromURL>http://api.google.com/GoogleSearch.wsdl</UpdateFromURL> - <ServiceLocationURL> - </ServiceLocationURL> - <CachedDynamicPropName> - </CachedDynamicPropName> - <CachedAppSettingsObjectName>Settings</CachedAppSettingsObjectName> - <CachedSettingsPropName>MyLyrics_Google_GoogleSearchService</CachedSettingsPropName> - </WebReferenceUrl> <WebReferenceUrl Include="http://lyricwiki.org/server.php%3fwsdl"> <UrlBehavior>Dynamic</UrlBehavior> <RelPath>Web References\org.lyricwiki\</RelPath> Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.Designer.cs 2007-02-11 09:17:50 UTC (rev 111) @@ -26,31 +26,11 @@ [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] - [global::System.Configuration.DefaultSettingValueAttribute("http://api.google.com/search/beta2")] - public string Google_GoogleSearchService { - get { - return ((string)(this["Google_GoogleSearchService"])); - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] [global::System.Configuration.DefaultSettingValueAttribute("http://lyricwiki.org/server.php")] public string LyricsEngine_org_lyricwiki_LyricWiki { get { return ((string)(this["LyricsEngine_org_lyricwiki_LyricWiki"])); } } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] - [global::System.Configuration.DefaultSettingValueAttribute("http://api.google.com/search/beta2")] - public string MyLyrics_Google_GoogleSearchService { - get { - return ((string)(this["MyLyrics_Google_GoogleSearchService"])); - } - } } } Modified: trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/LyricsEngine/Properties/Settings.settings 2007-02-11 09:17:50 UTC (rev 111) @@ -2,14 +2,8 @@ <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="LyricsEngine.Properties" GeneratedClassName="Settings"> <Profiles /> <Settings> - <Setting Name="Google_GoogleSearchService" Type="(Web Service URL)" Scope="Application"> - <Value Profile="(Default)">http://api.google.com/search/beta2</Value> - </Setting> <Setting Name="LyricsEngine_org_lyricwiki_LyricWiki" Type="(Web Service URL)" Scope="Application"> <Value Profile="(Default)">http://lyricwiki.org/server.php</Value> </Setting> - <Setting Name="MyLyrics_Google_GoogleSearchService" Type="(Web Service URL)" Scope="Application"> - <Value Profile="(Default)">http://api.google.com/search/beta2</Value> - </Setting> </Settings> </SettingsFile> \ No newline at end of file Modified: trunk/plugins/MyLyrics/LyricsEngine/Setup.cs =================================================================== --- trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/LyricsEngine/Setup.cs 2007-02-11 09:17:50 UTC (rev 111) @@ -6,37 +6,27 @@ { public static class Setup { - public static string[] EasySites = new string[2] + public static string[] EasySites = new string[4] { "LyricWiki", - "EvilLabs" - }; - - public static string[] GoogleSites = new string[8 - 2] - { - "Sing365", - "LyricsMania", + //"EvilLabs", "Lyrics007", - "LeosLyrics", - "LyricsFreak", - "SongMeanings" - //"LyricsHosting", - //"MusicMadeMe", + "LyricsOnDemand", + "SeekLyrics" }; + public static string[] AllSites() { ArrayList allSites = new ArrayList(); allSites.AddRange(EasySites); - allSites.AddRange(GoogleSites); string[] allSitesArray = (string[])allSites.ToArray(typeof(string)); return allSitesArray; } public static bool IsMember(string value) { - return (System.Array.IndexOf(Setup.EasySites, value) != -1 - || System.Array.IndexOf(Setup.GoogleSites, value) != -1); + return System.Array.IndexOf(Setup.EasySites, value) != -1; } public static bool IsMemberOfEasySites(string value) @@ -44,14 +34,9 @@ return System.Array.IndexOf(Setup.EasySites, value) != -1; } - public static bool IsMemberOfGoogleSites(string value) - { - return System.Array.IndexOf(Setup.GoogleSites, value) != -1; - } - public static int NoOfSites() { - return EasySites.Length + GoogleSites.Length; + return EasySites.Length; } } } Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyrics.cs 2007-02-11 09:17:50 UTC (rev 111) @@ -33,13 +33,13 @@ const int MAX_NO_OF_LICENSE_KEYS = 5; string[] m_GoogleLicenseKeys = new String[5] { "", "", "", "", "" }; int startingScrollSpeedVertical = 2; - bool googlePopUpMessageShown = false; const int SHIFT_WHEN_HIT = 10; #endregion #region Fields related to the skin engine [SkinControlAttribute(20)] - protected GUITextScrollUpControl CONTROL_Lyric = null; + //protected GUITextScrollUpControl CONTROL_Lyric = null; + protected GUITextControl CONTROL_Lyric = null; enum Controls { CONTROL_BACKGROUND = 1, @@ -234,69 +234,37 @@ GUIControl.ClearControl(GetID, (int)Controls.CONTROL_Lyric); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_Lyric, m_LyricText); - bool useSing365, useLyricsHosting, useLyricsMania, useSongMeanings, useLyricsFreak, useMMMD, useLeosLyrics, useLyrics007, useLyricWiki, useEvilLabs; + bool useLyricWiki, useEvilLabs, useLyrics007, useLyricsOnDemand, useSeekLyrics; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { - m_GoogleLicenseKeys[0] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey1", "zhQlW3ZQFHLE2dibwGRcpcDJvThQ/TTU"); - m_GoogleLicenseKeys[1] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey2", ""); - m_GoogleLicenseKeys[2] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey3", ""); - m_GoogleLicenseKeys[3] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey4", ""); - m_GoogleLicenseKeys[4] = xmlreader.GetValueAsString("myLyrics", "googleLicenseKey5", ""); - - useSing365 = ((string)xmlreader.GetValueAsString("myLyrics", "useSing365", "False")).ToString().Equals("True") ? true : false; - useLyricsHosting = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsHosting", "False")).ToString().Equals("True") ? true : false; - useLyricsMania = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsMania", "False")).ToString().Equals("True") ? true : false; - useSongMeanings = ((string)xmlreader.GetValueAsString("myLyrics", "useSongMeaning", "False")).ToString().Equals("True") ? true : false; - useLyricsFreak = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsFreak", "False")).ToString().Equals("True") ? true : false; - useMMMD = ((string)xmlreader.GetValueAsString("myLyrics", "useMMMD", "False")).ToString().Equals("True") ? true : false; - useLeosLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useLeosLyrics", "False")).ToString().Equals("True") ? true : false; - useLyrics007 = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "False")).ToString().Equals("True") ? true : false; useLyricWiki = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricWiki", "True")).ToString().Equals("True") ? true : false; useEvilLabs = ((string)xmlreader.GetValueAsString("myLyrics", "useEvilLabs", "True")).ToString().Equals("True") ? true : false; + useLyrics007 = ((string)xmlreader.GetValueAsString("myLyrics", "useLyrics007", "True")).ToString().Equals("True") ? true : false; + useLyricsOnDemand = ((string)xmlreader.GetValueAsString("myLyrics", "useLyricsOnDemand", "True")).ToString().Equals("True") ? true : false; + useSeekLyrics = ((string)xmlreader.GetValueAsString("myLyrics", "useSeekLyrics", "True")).ToString().Equals("True") ? true : false; } ArrayList sitesToSearch = new ArrayList(); - - if (useSing365 && Setup.IsMember("Sing365")) + if (useLyricWiki && Setup.IsMember("LyricWiki")) { - sitesToSearch.Add("Sing365"); + sitesToSearch.Add("LyricWiki"); } - if (useLyricsHosting && Setup.IsMember("LyricsHosting")) + if (useEvilLabs && Setup.IsMember("EvilLabs")) { - sitesToSearch.Add("LyricsHosting"); + sitesToSearch.Add("EvilLabs"); } - if (useLyricsMania && Setup.IsMember("LyricsMania")) - { - sitesToSearch.Add("LyricsMania"); - } - if (useSongMeanings && Setup.IsMember("SongMeanings")) - { - sitesToSearch.Add("SongMeanings"); - } - if (useLyricsFreak && Setup.IsMember("LyricsFreak")) - { - sitesToSearch.Add("LyricsFreak"); - } - if (useMMMD && Setup.IsMember("MusicMadeMe")) - { - sitesToSearch.Add("MusicMadeMe"); - } - if (useLeosLyrics && Setup.IsMember("LeosLyrics")) - { - sitesToSearch.Add("LeosLyrics"); - } if (useLyrics007 && Setup.IsMember("Lyrics007")) { sitesToSearch.Add("Lyrics007"); } - if (useLyricWiki && Setup.IsMember("LyricWiki")) + if (useLyricsOnDemand && Setup.IsMember("LyricsOnDemand")) { - sitesToSearch.Add("LyricWiki"); + sitesToSearch.Add("LyricsOnDemand"); } - if (useEvilLabs && Setup.IsMember("EvilLabs")) + if (useSeekLyrics && Setup.IsMember("SeekLyrics")) { - sitesToSearch.Add("EvilLabs"); + sitesToSearch.Add("SeekLyrics"); } m_sitesToSearch = (string[])sitesToSearch.ToArray(typeof(string)); @@ -418,8 +386,7 @@ lc.GoogleLicenseKey = m_GoogleLicenseKeys[m_GoogleLicenseKeyIndex]; - LyricConfigInfo lyricConfigInfo = new LyricConfigInfo(lc.GoogleLicenseKey, m_artist, m_title, "lyrics"); - lc.addNewLyricSearch(lyricConfigInfo); + lc.addNewLyricSearch(m_artist, m_title); } } @@ -576,12 +543,6 @@ { ShowLyricOnScreen(lyricText, site); SaveLyricToDatabase(); - - // if not found by LyricWiki, write which license key was used - if (lc != null && !site.Equals("LyricWiki")) - { - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + (lc.GoogleLicenseKey.Equals("") ? "empty key" : lc.GoogleLicenseKey)); - } } } } @@ -616,60 +577,11 @@ set { string message = (string)value; - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Warning, 0, LyricDiagnostics.elapsedTimeString() + "Exception: " + message); - - // GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, message.ToString()); - - string[] entries = message.Split(' '); - string currentKey = entries[entries.Length - 1]; - - bool keyLicensedAlreadyIn = lc.GoogleLicenseKeysUsed.Contains(currentKey); - - // if first time the current licensekey failed - if (!keyLicensedAlreadyIn) - { - lc.addToGoogleLicenseKeysUsed(currentKey); - int nextGoogleLicenseKeyIndex = ++m_GoogleLicenseKeyIndex; - if (nextGoogleLicenseKeyIndex < MAX_NO_OF_LICENSE_KEYS && !m_GoogleLicenseKeys[m_GoogleLicenseKeyIndex].Equals("")) - { - // new license key is used - int nextNextGoogleLicenseKeyIndex = nextGoogleLicenseKeyIndex + 1; - - m_StatusText = "All queries of key license number " + nextGoogleLicenseKeyIndex.ToString() + " has been used, so number " + nextNextGoogleLicenseKeyIndex.ToString() + " is used instead."; - //GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LBStatus, m_StatusText); - lc.GoogleLicenseKey = m_GoogleLicenseKeys[nextGoogleLicenseKeyIndex]; - - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Information, 0, LyricDiagnostics.elapsedTimeString() + "Exception: " + m_StatusText); - } - else - { - string noValidKeysMessage = "The search has ended due to no more valid license keys entries today."; - ThreadFinished = new String[] { m_artist, m_title, message, "" }; - if (googlePopUpMessageShown == false) - { - LyricDiagnostics.TraceSource.TraceEvent(TraceEventType.Warning, 0, LyricDiagnostics.elapsedTimeString() + noValidKeysMessage); - PopUpMessage("LyricWiki only valid source", "Your google license keys don't hold any valid query entries", "Therefore only LyricWiki will be searched.", ""); - googlePopUpMessageShown = true; - lc.NoMoreValidLicenseKeys = true; - } - } - } } } #endregion - - private void PopUpMessage(string header, string line1, string line2, string line3) - { - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading(header); - dlg.SetLine(1, line1); - dlg.SetLine(2, line2); - dlg.SetLine(3, line3); - dlg.DoModal(GUIWindowManager.ActiveWindow); - } - #region ISetup Interface methods /// <summary> Modified: trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs =================================================================== --- trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs 2007-02-10 10:47:10 UTC (rev 110) +++ trunk/plugins/MyLyrics/My Lyrics/MyLyricsSetup.Designer.cs 2007-02-11 09:17:50 UTC (rev 111) @@ -28,23 +28,24 @@ /// </summary> private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MyLyricsSetup)); this.tabControl = new MediaPortal.UserInterface.Controls.MPTabControl(); this.tabPageLyricsDatabase = new MediaPortal.UserInterface.Controls.MPTabPage(); + this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); + this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.cbSeekLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbLyricsOnDemand = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbEvilLabs = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabPageDatabase = new MediaPortal.UserInterface.Controls.MPTabPage(); - this.gbGoogleLicKeyStatuses = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.lbOverallWsStatusa = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbOverallWsStatus = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus4a = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus4 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus3a = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus3 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus2a = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus2 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus1a = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus1 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus5a = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbWsStatus5 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.mpGroupBox1 = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btImportAll = new MediaPortal.UserInterface.Controls.MPButton(); + this.btCancel = new MediaPortal.UserInterface.Controls.MPButton(); + this.mpLabel3 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.gbGenerel = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.lbSongsLimitNote = new MediaPortal.UserInterface.Controls.MPLabel(); + this.lbLimit = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.lbSongsLimit = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbMessages = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.lbMessage = new MediaPortal.UserInterface.Controls.MPLabel(); this.gbProgress = new MediaPortal.UserInterface.Controls.MPGroupBox(); @@ -70,74 +71,34 @@ this.lbTotalSongs = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbLyricsFound2 = new MediaPortal.UserInterface.Controls.MPLabel(); this.lbLyricsFound = new MediaPortal.UserInterface.Controls.MPLabel(); - this.gbMusicDBSearch = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btSave = new MediaPortal.UserInterface.Controls.MPButton(); + this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); + this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); this.cbDisregardSongWithLyricInTag = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.btCancel = new MediaPortal.UserInterface.Controls.MPButton(); this.cbDisregardVariousArtist = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbDisregardSongsWithNoLyric = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbMarkSongsWithNoLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.cbDisconsiderTitlesWithLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.mpLabel1 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.btImportAll = new MediaPortal.UserInterface.Controls.MPButton(); - this.tabPageSetup = new MediaPortal.UserInterface.Controls.MPTabPage(); - this.gbSettings = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.tbLicenseKey5 = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.mpLabel5 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.tbLicenseKey4 = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.mpLabel4 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.tbLicenseKey3 = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.mpLabel3 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.tbLicenseKey2 = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.mpLabel2 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.tbLicenseKey1 = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.lbGoogleLicenceKey = new MediaPortal.UserInterface.Controls.MPLabel(); - this.gbLyricSites = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.cbEvilLabs = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbLyricWiki = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.gbGenerel = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.lbLimit = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.lbSongsLimit = new MediaPortal.UserInterface.Controls.MPLabel(); - this.gbLicenseKeyHelp = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.mpLabel6 = new MediaPortal.UserInterface.Controls.MPLabel(); - this.lbGoogleNotice = new MediaPortal.UserInterface.Controls.MPLabel(); - this.labelPluginBannerHint = new MediaPortal.UserInterface.Controls.MPLabel(); - this.btSave = new MediaPortal.UserInterface.Controls.MPButton(); - this.btClose = new MediaPortal.UserInterface.Controls.MPButton(); - this.bgWorkerTestWebservices = new System.ComponentModel.BackgroundWorker(); - this.bgWorkerSearch = new System.ComponentModel.BackgroundWorker(); - this.mpGroupBox1 = new MediaPortal.UserInterface.Controls.MPGroupBox(); - this.cbLyricsHosting = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbLeosLyrics = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbLyricsMania = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbLyrics007 = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbSing365 = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbSongMeaning = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbLyricsFreak = new MediaPortal.UserInterface.Controls.MPCheckBox(); - this.cbMMMD = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabControl.SuspendLayout(); + this.tabPageSetup.SuspendLayout(); + this.gbLyricSites.SuspendLayout(); this.tabPageDatabase.SuspendLayout(); - this.gbGoogleLicKeyStatuses.SuspendLayout(); + this.mpGroupBox1.SuspendLayout(); + this.gbGenerel.SuspendLayout(); this.gbMessages.SuspendLayout(); this.gbProgress.SuspendLayout(); this.gbMusicDBSearchStats.SuspendLayout(); - this.gbMusicDBSearch.SuspendLayout(); - this.tabPageSetup.SuspendLayout(); - this.gbSettings.SuspendLayout(); - this.gbLyricSites.SuspendLayout(); - this.gbGenerel.SuspendLayout(); - this.gbLicenseKeyHelp.SuspendLayout(); - this.mpGroupBox1.SuspendLayout(); this.SuspendLayout(); // // tabControl // this.tabControl.Controls.Add(this.tabPageLyricsDatabase); - this.tabControl.Controls.Add(this.tabPageDatabase); this.tabControl.Controls.Add(this.tabPageSetup); - this.tabControl.Location = new System.Drawing.Point(5, 4); + this.tabControl.Controls.Add(this.tabPageDatabase); + this.tabControl.Location = new System.Drawing.Point(12, 12); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(528, 528); + this.tabControl.Size = new System.Drawing.Size(528, 476); this.tabControl.TabIndex = 1; // // tabPageLyricsDatabase @@ -145,160 +106,224 @@ this.tabPageLyricsDatabase.Location = new System.Drawing.Point(4, 22); this.tabPageLyricsDatabase.Name = "tabPageLyricsDatabase"; this.tabPageLyricsDatabase.Padding = new System.Windows.Forms.Padding(3); - this.tabPageLyricsDatabase.Size = new System.Drawing.Size(520, 502); + this.tabPageLyricsDatabase.Size = new System.Drawing.Size(520, 450); this.tabPageLyricsDatabase.TabIndex = 1; this.tabPageLyricsDatabase.Text = "Lyrics database"; this.tabPageLyricsDatabase.UseVisualStyleBackColor = true; // - // tabPageDatabase + // tabPageSetup // - this.tabPageDatabase.Controls.Add(this.gbGoogleLicKeyStatuses); - this.tabPageDatabase.Controls.Add(this.gbMessages); - this.tabPageDatabase.Controls.Add(this.gbProgress); - this.tabPageDatabase.Controls.Add(this.gbMusicDBSearchStats); - this.tabPageDatabase.Controls.Add(this.gbMusicDBSearch); - this.tabPageDatabase.Location = new System.Drawing.Point(4, 22); - this.tabPageDatabase.Name = "tabPageDatabase"; - this.tabPageDatabase.Padding = new System.Windows.Forms.Padding(3); - this.tabPageDatabase.Size = new System.Drawing.Size(520, 502); - this.tabPageDatabase.TabIndex = 2; - this.tabPageDatabase.Text = "Music database"; - this.tabPageDatabase.UseVisualStyleBackColor = true; + this.tabPageSetup.Controls.Add(this.gbLyricSites); + this.tabPageSetup.Location = new System.Drawing.Point(4, 22); + this.tabPageSetup.Name = "tabPageSetup"; + this.tabPageSetup.Padding = new System.Windows.Forms.Padding(3); + this.tabPageSetup.Size = new System.Drawing.Size(520, 450); + this.tabPageSetup.TabIndex = 2; + this.tabPageSetup.Text = "General setup"; + this.tabPageSetup.UseVisualStyleBackColor = true; // - // gbGoogleLicKeyStatuses + // gbLyricSites // - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbOverallWsStatusa); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbOverallWsStatus); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus4a); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus4); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus3a); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus3); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus2a); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus2); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus1a); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus1); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus5a); - this.gbGoogleLicKeyStatuses.Controls.Add(this.lbWsStatus5); - this.gbGoogleLicKeyStatuses.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbGoogleLicKeyStatuses.Location = new System.Drawing.Point(254, 276); - this.gbGoogleLicKeyStatuses.Name = "gbGoogleLicKeyStatuses"; - this.gbGoogleLicKeyStatuses.Size = new System.Drawing.Size(263, 126); - this.gbGoogleLicKeyStatuses.TabIndex = 30; - this.gbGoogleLicKeyStatuses.TabStop = false; - this.gbGoogleLicKeyStatuses.Text = "Google license key status"; + this.gbLyricSites.AutoSize = true; + this.gbLyricSites.Controls.Add(this.cbSeekLyrics); + this.gbLyricSites.Controls.Add(this.cbLyricsOnDemand); + this.gbLyricSites.Controls.Add(this.cbLyrics007); + this.gbLyricSites.Controls.Add(this.cbEvilLabs); + this.gbLyricSites.Controls.Add(this.cbLyricWiki); + this.gbLyricSites.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.gbLyricSites.Location = new System.Drawing.Point(4, 6); + this.gbLyricSites.Name = "gbLyricSites"; + this.gbLyricSites.Size = new System.Drawing.Size(510, 102); + this.gbLyricSites.TabIndex = 28; + this.gbLyricSites.TabStop = false; + this.gbLyricSites.Text = "Lyric sites to search"; // - // lbOverallWsStatusa + // cbSeekLyrics // - this.lbOverallWsStatusa.Location = new System.Drawing.Point(94, 95); - this.lbOverallWsStatusa.Name = "lbOverallWsStatusa"; - this.lbOverallWsStatusa.Size = new System.Drawing.Size(160, 15); - this.lbOverallWsStatusa.TabIndex = 31; - this.lbOverallWsStatusa.Text = "-"; + this.cbSeekLyrics.AutoSize = true; + this.cbSeekLyrics.Checked = true; + this.cbSeekLyrics.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbSeekLyrics.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbSeekLyrics.Location = new System.Drawing.Point(148, 21); + this.cbSeekLyrics.Name = "cbSeekLyrics"; + this.cbSeekLyrics.Size = new System.Drawing.Size(79, 17); + this.cbSeekLyrics.TabIndex = 6; + this.cbSeekLyrics.Text = "Seek Lyrics"; + this.cbSeekLyrics.UseVisualStyleBackColor = true; // - // lbOverallWsStatus + // cbLyricsOnDemand // - this.lbOverallWsStatus.Location = new System.Drawing.Point(12, 95); - this.lbOverallWsStatus.Name = "lbOverallWsStatus"; - this.lbOverallWsStatus.Size = new System.Drawing.Size(91, 15); - this.lbOverallWsStatus.TabIndex = 30; - this.lbOverallWsStatus.Text = "Overall status:"; + this.cbLyricsOnDemand.AutoSize = true; + this.cbLyricsOnDemand.Checked = true; + this.cbLyricsOnDemand.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyricsOnDemand.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyricsOnDemand.Location = new System.Drawing.Point(16, 43); + this.cbLyricsOnDemand.Name = "cbLyricsOnDemand"; + this.cbLyricsOnDemand.Size = new System.Drawing.Size(108, 17); + this.cbLyricsOnDemand.TabIndex = 5; + this.cbLyricsOnDemand.Text = "Lyrics OnDemand"; + this.cbLyricsOnDemand.UseVisualStyleBackColor = true; // - // lbWsStatus4a + // cbLyrics007 // - this.lbWsStatus4a.Location = new System.Drawing.Point(94, 63); - this.lbWsStatus4a.Name = "lbWsStatus4a"; - this.lbWsStatus4a.Size = new System.Drawing.Size(160, 15); - this.lbWsStatus4a.TabIndex = 29; - this.lbWsStatus4a.Text = "-"; + this.cbLyrics007.AutoSize = true; + this.cbLyrics007.Checked = true; + this.cbLyrics007.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyrics007.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyrics007.Location = new System.Drawing.Point(16, 66); + this.cbLyrics007.Name = "cbLyrics007"; + this.cbLyrics007.Size = new System.Drawing.Size(72, 17); + this.cbLyrics007.TabIndex = 4; + this.cbLyrics007.Text = "Lyrics 007"; + this.cbLyrics007.UseVisualStyleBackColor = true; // - // lbWsStatus4 + // cbEvilLabs // - this.lbWsStatus4.Location = new System.Drawing.Point(12, 62); - this.lbWsStatus4.Name = "lbWsStatus4"; - this.lbWsStatus4.Size = new System.Drawing.Size(91, 16); - this.lbWsStatus4.TabIndex = 28; - this.lbWsStatus4.Text = "License key 4:"; + this.cbEvilLabs.AutoSize = true; + this.cbEvilLabs.Checked = true; + this.cbEvilLabs.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbEvilLabs.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbEvilLabs.Location = new System.Drawing.Point(148, 44); + this.cbEvilLabs.Name = "cbEvilLabs"; + this.cbEvilLabs.Size = new System.Drawing.Size(67, 17); + this.cbEvilLabs.TabIndex = 3; + this.cbEvilLabs.Text = "Evil Labs"; + this.cbEvilLabs.UseVisualStyleBackColor = true; // - // lbWsStatus3a + // cbLyricWiki // - this.lbWsStatus3a.Location = new System.Drawing.Point(94, 47); - this.lbWsStatus3a.Name = "lbWsStatus3a"; - this.lbWsStatus3a.Size = new System.Drawing.Size(160, 15); - this.lbWsStatus3a.TabIndex = 25; - this.lbWsStatus3a.Text = "-"; + this.cbLyricWiki.AutoSize = true; + this.cbLyricWiki.Checked = true; + this.cbLyricWiki.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbLyricWiki.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.cbLyricWiki.Location = new System.Drawing.Point(16, 21); + this.cbLyricWiki.Name = "cbLyricWiki"; + this.cbLyricWiki.Size = new System.Drawing.Size(67, 17); + this.cbLyricWiki.TabIndex = 2; + this.cbLyricWiki.Text = "LyricWiki"; + this.cbLyricWiki.UseVisualStyleBackColor = true; // - // lbWsStatus3 + // tabPageDatabase // - this.lbWsStatus3.Location = new System.Drawing.Point(12, 46); - this.lbWsStatus3.Name = "lbWsStatus3"; - this.lbWsStatus3.Size = new System.Drawing.Size(91, 16); - this.lbWsStatus3.TabIndex = 24; - this.lbWsStatus3.Text = "License key 3:"; + this.tabPageDatabase.Controls.Add(this.mpGroupBox1); + this.tabPageDatabase.Controls.Add(this.gbGenerel); + this.tabPageDatabase.Controls.Add(this.gbMessages); + this.tabPageDatabase.Controls.Add(this.gbProgress); + this.tabPageDatabase.Controls.Add(this.gbMusicDBSearchStats); + this.tabPageDatabase.Location = new System.Drawing.Point(4, 22); + this.tabPageDatabase.Name = "tabPageDatabase"; + this.tabPageDatabase.Padding = new System.Windows.Forms.Padding(3); + this.tabPageDatabase.Size = new System.Drawing.Size(520, 450); + this.tabPageDatabase.TabIndex = 2; + this.tabPageDatabase.Text = "Search music database"; + this.tabPageDatabase.UseVisualStyleBackColor = true; // - // lbWsStatus2a + // mpGroupBox1 // - this.lbWsStatus2a.Location = new System.Drawing.Point(94, 31); - this.lbWsStatus2a.Name = "lbWsStatus2a"; - this.lbWsStatus2a.Size = new System.Drawing.Size(160, 15); - this.lbWsStatus2a.TabIndex = 23; - this.lbWsStatus2a.Text = "-"; + this.mpGroupBox1.Controls.Add(this.btImportAll); + this.mpGroupBox1.Controls.Add(this.btCancel); + this.mpGroupBox1.Controls.Add(this.mpLabel3); + this.mpGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBox1.Location = new System.Drawing.Point(2, 133); + this.mpGroupBox1.Name = "mpGroupBox1"; + this.mpGroupBox1.Size = new System.Drawing.Size(509, 52); + this.mpGroupBox1.TabIndex = 32; + this.mpGroupBox1.TabStop = false; + this.mpGroupBox1.Text = "Search music database"; // - // lbWsStatus2 + // btImportAll // - this.lbWsStatus2.Location = new System.Drawing.Point(12, 31); - this.lbWsStatus2.Name = "lbWsStatus2"; - this.lbWsStatus2.Size = new System.Drawing.Size(91, 15); - this.lbWsStatus2.TabIndex = 22; - this.lbWsStatus2.Text = "License key 2:"; + this.btImportAll.Location = new System.Drawing.Point(338, 19); + this.btImportAll.Name = "btImportAll"; + this.btImportAll.Size = new System.Drawing.Size(78, 23); + this.btImportAll.TabIndex = 32; + this.btImportAll.Text = "Start"; + this.btImportAll.UseVisualStyleBackColor = true; + this.btImportAll.Click += new System.EventHandler(this.btImportAll_Click); // - // lbWsStatus1a + // btCancel // - this.lbWsStatus1a.Location = new System.Drawing.Point(94, 16); - this.lbWsStatus1a.Name = "lbWsStatus1a"; - this.lbWsStatus1a.Size = new System.Drawing.Size(160, 15); - this.lbWsStatus1a.TabIndex = 21; - this.lbWsStatus1a.Text = "-"; + this.btCancel.Enabled = false; + this.btCancel.Location = new System.Drawing.Point(422, 19); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(78, 23); + this.btCancel.TabIndex = 33; + this.btCancel.Text = "Stop"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); // - // lbWsStatus1 + // mpLabel3 // - this.lbWsStatus1.Location = new System.Drawing.Point(12, 16); - this.lbWsStatus1.Name = "lbWsStatus1"; - this.lbWsStatus1.Size = new System.Drawing.Size(91, 15); - this.lbWsStatus1.TabIndex = 20; - this.lbWsStatus1.Text = "License key 1:"; + this.mpLabel3.AutoSize = true; + this.mpLabel3.Location = new System.Drawing.Point(12, 16); + this.mpLabel3.Name = "mpLabel3"; + this.mpLabel3.Size = new System.Drawing.Size(304, 26); + this.mpLabel3.TabIndex = 12; + this.mpLabel3.Text = "Press \'Start\' to fetch lyrics matching content of music database.\r\nPress \'Stop\' t" + + "o stop an ongoing lyrics search."; // - // lbWsStatus5a + // gbGenerel // - this.lbWsStatus5a.Location = new System.Drawing.Point(94, 78); - this.lbWsStatus5a.Name = "lbWsStatus5a"; - this.lbWsStatus5a.Size = new System.Drawing.Size(160, 15); - this.lbWsStatus5a.TabIndex = 15; - this.lbWsStatus5a.Text = "-"; + this.gbGenerel.Controls.Add(this.cbDisregardSongWithLyricInTag); + this.gbGenerel.Controls.Add(this.cbDisregardVariousArtist); + this.gbGenerel.Controls.Add(this.cbDisregardSongsWithNoLyric); + this.gbGenerel.Controls.Add(this.cbMarkSongsWithNoLyrics); + this.gbGenerel.Controls.Add(this.cbDisconsiderTitlesWithLyrics); + this.gbGenerel.Controls.Add(this.lbSongsLimitNote); + this.gbGenerel.Controls.Add(this.lbLimit); + this.gbGenerel.Controls.Add(this.lbSongsLimit); + this.gbGenerel.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.gbGenerel.Location = new System.Drawing.Point(3, 6); + this.gbGenerel.Name = "gbGenerel"; + this.gbGenerel.Size = new System.Drawing.Size(509, 121); + this.gbGenerel.TabIndex = 32; + this.gbGenerel.TabStop = false; + this.gbGenerel.Text = "Music database search setup"; // - // lbWsStatus5 + // lbSongsLimitNote // - this.lbWsStatus5.Location = new System.Drawing.Point(12, 78); - this.lbWsStatus5.Name = "lbWsStatus5"; - this.lbWsStatus5.Size = new System.Drawing.Size(91, 15); - this.lbWsStatus5.TabIndex = 14; - this.lbWsStatus5.Text = "License key 5:"; + this.lbSongsLimitNote.AutoSize = true; + this.lbSongsLimitNote.Location = new System.Drawing.Point(208, 22); + this.lbSongsLimitNote.Name = "lbSongsLimitNote"; + this.lbSongsLimitNote.Size = new System.Drawing.Size(82, 13); + this.lbSongsLimitNote.TabIndex = 13; + this.lbSongsLimitNote.Text = "(1000 is default)"; // + // lbLimit + // + this.lbLimit.BorderColor = System.Drawing.Color.Empty; + this.lbLimit.Location = new System.Drawing.Point(158, 19); + this.lbLimit.Name = "lbLimit"; + this.lbLimit.Size = new System.Drawing.Size(44, 20); + this.lbLimit.TabIndex = 1; + this.lbLimit.Text = "1000"; + this.lbLimit.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + // + // lbSongsLimit + // + this.lbSongsLimit.AutoSize = true; + this.lbSongsLimit.Location = new System.Drawing.Point(12, 22); + this.lbSongsLimit.Name = "lbSongsLimit"; + this.lbSongsLimit.Size = new System.Drawing.Size(139, 13); + this.lbSongsLimit.TabIndex = 12; + this.lbSongsLimit.Text = "Top limit of songs to search:"; + // // gbMessages // this.gbMessages.Controls.Add(this.lbMessage); this.gbMessages.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbMessages.Location = new System.Drawing.Point(2, 409); + this.gbMessages.Location = new System.Drawing.Point(257, 317); this.gbMessages.Name = "gbMessages"; - this.gbMessages.Size = new System.Drawing.Size(515, 85); + this.gbMessages.Size = new System.Drawing.Size(255, 127); this.gbMessages.TabIndex = 28; this.gbMessages.TabStop = false; this.gbMessages.Text = "Messages"; // // lbMessage // - this.lbMessage.Location = new System.Drawing.Point(6, 16); + this.lbMessage.Location = new System.Drawing.Point(6, 18); this.lbMessage.Name = "lbMessage"; - this.lbMessage.Size = new System.Drawing.Size(504, 65); + this.lbMessage.Size = new System.Drawing.Size(245, 106); this.lbMessage.TabIndex = 28; // // gbProgress @@ -311,24 +336,24 @@ this.gbProgress.Controls.Add(this.progressBar); this.gbProgress.Controls.Add(this.lbStep1); this.gbProgress.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbProgress.Location = new System.Drawing.Point(2, 150); + this.gbProgress.Location = new System.Drawing.Point(2, 191); this.gbProgress.Name = "gbProgress"; - this.gbProgress.Size = new System.Drawing.Size(515, 120); + this.gbProgress.Size = new System.Drawing.Size(509, 120); this.gbProgress.TabIndex = 18; this.gbProgress.TabStop = false; this.gbProgress.Text = "Progress"; // // lbLastActivity2 // - this.lbLastActivity2.Location = new System.Drawing.Point(82, 95); + this.lbLastActivity2.Location = new System.Drawing.Point(82, 92); this.lbLastActivity2.Name = "lbLastActivity2"; - this.lbLastActivity2.Size = new System.Drawing.Size(427, 18); + this.lbLastActivity2.Size = new System.Drawing.Size(427, 25); this.lbLastActivity2.TabIndex = 23; this.lbLastActivity2.Text = "-"; // // lbLastActivity // - this.lbLastActivity.Location = new System.Drawing.Point(12, 95); + this.lbLastActivity.Location = new System.Drawing.Point(12, 92); this.lbLastActivity.Name = "lbLastActivity"; this.lbLastActivity.Size = new System.Drawing.Size(77, 18); this.lbLastActivity.TabIndex = 22; @@ -392,7 +417,7 @@ this.gbMusicDBSearchStats.Controls.Add(this.lbLyricsFound2); this.gbMusicDBSearchStats.Controls.Add(this.lbLyricsFound); this.gbMusicDBSearchStats.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbMusicDBSearchStats.Location = new System.Drawing.Point(2, 276); + this.gbMusicDBSearchStats.Location = new System.Drawing.Point(2, 317); this.gbMusicDBSearchStats.Name = "gbMusicDBSearchStats"; this.gbMusicDBSearchStats.Size = new System.Drawing.Size(249, 127); this.gbMusicDBSearchStats.TabIndex = 12; @@ -511,58 +536,56 @@ this.lbLyricsFound.TabIndex = 14; this.lbLyricsFound.Text = "Lyrics found (during search):"; // - // gbMusicDBSearch + // btSave // - this.gbMusicDBSearch.Controls.Add(this.cbDisregardSongWithLyricInTag); - this.gbMusicDBSearch.Controls.Add(this.btCancel); - this.gbMusicDBSearch.Controls.Add(this.cbDisregardVariousArtist); - this.gbMusicDBSearch.Controls.Add(this.cbDisregardSongsWithNoLyric); - this.gbMusicDBSearch.Controls.Add(this.cbMarkSongsWithNoLyrics); - this.gbMusicDBSearch.Controls.Add(this.cbDisconsiderTitlesWithLyrics); - this.gbMusicDBSearch.Controls.Add(this.mpLabel1); - this.gbMusicDBSearch.Controls.Add(this.btImportAll); - this.gbMusicDBSearch.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gbMusicDBSearch.Location = new System.Drawing.Point(2, 6); - this.gbMusicDBSearch.Name = "gbMusicDBSearch"; - this.gbMusicDBSearch.Size = new System.Drawing.Size(515, 138); - this.gbMusicDBSearch.TabIndex = 11; - this.gbMusicDBSearch.TabStop = false; - this.gbMusicDBSearch.Text = "Search Music database"; + this.btSave.Location = new System.Drawing.Point(356, 494); + this.btSave.Name = "btSave"; + this.btSave.Size = new System.Drawing.Size(78, 23); + this.btSave.TabIndex = 16; + this.btSave.Text = "&Save"; + this.btSave.UseVisualStyleBackColor = true; + this.btSave.Click += new System.EventHandler(this.btSave_Click); // + // btClose + // + this.btClose.Location = new System.Drawing.Point(440, 494); + this.btClose.Name = "btClose"; + this.btClose.Size = new System.Drawing.Size(78, 23); + this.btClose.TabIndex = 99; + this.btClose.Text = "Close"; + this.btClose.UseVisualStyleBackColor = true; + this.btClose.Click += new System.EventHandler(this.button1_Click); + // + // bgWorkerSearch + // + this.bgWorkerSearch.WorkerReportsProgress = true; + this.bgWorkerSearch.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgWorkerSearch_DoWork); + this.bgWorkerSearch.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bgWorkerSearch_RunWorkerCompleted); + this.bgWorkerSearch.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.bgWorkerSearch_ProgressChanged); + // // cbDisregardSongWithLyricInTag // this.cbDisregardSongWithLyricInTag.AutoSize = true; this.cbDisregardSongWithLyricInTag.Checked = true; this.cbDisregardSongWithLyricInTag.CheckState = System.Windows.Forms.CheckState.Checked; thi... [truncated message content] |
From: <an...@us...> - 2007-02-10 10:47:23
|
Revision: 110 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=110&view=rev Author: and-81 Date: 2007-02-10 02:47:10 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:33:25 UTC (rev 109) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:47:10 UTC (rev 110) @@ -260,7 +260,6 @@ #region IPlugin methods - //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Start() { Log.Info("MCEReplacement: Starting ({0})", Version); @@ -364,7 +363,6 @@ Log.Info("MCEReplacement: Started"); } - //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Stop() { if (LogVerbose) @@ -437,7 +435,6 @@ #region IPluginReceiver methods - //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public bool WndProc(ref Message msg) { // Handle Suspend & Resume ... @@ -601,7 +598,7 @@ return false; } - #endregion + #endregion IPluginReceiver methods #region Private Methods Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-10 10:33:25 UTC (rev 109) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-10 10:47:10 UTC (rev 110) @@ -631,16 +631,11 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { - if (input == null) + if (String.IsNullOrEmpty(input)) { - Log.Error("TV3ExtChannelChanger: Null escape code string"); + Log.Error("TV3ExtChannelChanger: Null or empty escape code string"); return ""; } - else if (input.Length == 0) - { - Log.Info("TV3ExtChannelChanger: Empty escape code string"); - return ""; - } bool inEscapeCode = false; bool inHexCode = false; Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-10 10:33:25 UTC (rev 109) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-10 10:47:10 UTC (rev 110) @@ -691,11 +691,14 @@ } /// <summary> - /// Given a command name this method checks if the file exists as an IR code - /// or a macro and then processes the request accordingly. + /// Given a command this method checks if the file exists as an IR + /// command, macro or other command and then processes the request + /// accordingly. /// </summary> - /// <param name="command">The command name stored in the mapping XML</param> - /// <returns>success</returns> + /// <param name="command">Command to process.</param> + /// <param name="port">Blaster port to IR commands to.</param> + /// <param name="speed">Blaster speed to execute IR commands at.</param> + /// <returns>Success.</returns> public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { if (String.IsNullOrEmpty(command)) @@ -950,14 +953,22 @@ /// <returns>string[] of IR Commands</returns> public static string[] GetIRList() { - string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -966,14 +977,22 @@ /// <returns>string[] of Macros</returns> public static string[] GetMacroList() { - string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -1003,16 +1022,11 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { - if (input == null) + if (String.IsNullOrEmpty(input)) { - Log.Error("TV3MceBlaster: Null escape code string"); + Log.Error("TV3MceBlaster: Null or empty escape code string"); return ""; } - else if (input.Length == 0) - { - Log.Info("TV3MceBlaster: Empty escape code string"); - return ""; - } bool inEscapeCode = false; bool inHexCode = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-10 10:33:26
|
Revision: 109 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=109&view=rev Author: and-81 Date: 2007-02-10 02:33:25 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj trunk/plugins/MCEReplacementTray/Setup.cs trunk/plugins/MCEReplacementTray/Tray.cs Added Paths: ----------- trunk/plugins/MCEReplacementTray/Win32.cs Modified: trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj =================================================================== --- trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj 2007-02-10 10:32:57 UTC (rev 108) +++ trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj 2007-02-10 10:33:25 UTC (rev 109) @@ -61,6 +61,7 @@ <Compile Include="Tray.cs"> <SubType>Form</SubType> </Compile> + <Compile Include="Win32.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Properties\Resources.resx"> Modified: trunk/plugins/MCEReplacementTray/Setup.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Setup.cs 2007-02-10 10:32:57 UTC (rev 108) +++ trunk/plugins/MCEReplacementTray/Setup.cs 2007-02-10 10:33:25 UTC (rev 109) @@ -68,23 +68,23 @@ protected override void WndProc(ref Message m) { // Handle Suspend & Resume ... - if (m.Msg == Tray.WM_POWERBROADCAST) + if (m.Msg == Win32.WM_POWERBROADCAST) { switch (m.WParam.ToInt32()) { - case Tray.PBT_APMQUERYSUSPEND: - case Tray.PBT_APMQUERYSTANDBY: + case Win32.PBT_APMQUERYSUSPEND: + case Win32.PBT_APMQUERYSTANDBY: MceIrApi.Suspend(); break; - case Tray.PBT_APMRESUMEAUTOMATIC: + case Win32.PBT_APMRESUMEAUTOMATIC: MceIrApi.Resume(); break; } } // Handle button presses ... - if (m.Msg == Tray.WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) + if (m.Msg == Win32.WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) { int keyCode = m.LParam.ToInt32() & 0xFFFF; Modified: trunk/plugins/MCEReplacementTray/Tray.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Tray.cs 2007-02-10 10:32:57 UTC (rev 108) +++ trunk/plugins/MCEReplacementTray/Tray.cs 2007-02-10 10:33:25 UTC (rev 109) @@ -62,30 +62,6 @@ #endregion Properties - #region Constants - - public const int WM_USER = 0x0400; - - public const int WM_POWERBROADCAST = 0x0218; - - public const int PBT_APMQUERYSUSPEND = 0x0000; - public const int PBT_APMQUERYSTANDBY = 0x0001; - //public const int PBT_APMQUERYSUSPENDFAILED = 0x0002; - //public const int PBT_APMQUERYSTANDBYFAILED = 0x0003; - public const int PBT_APMSUSPEND = 0x0004; - //public const int PBT_APMSTANDBY = 0x0005; - - public const int PBT_APMRESUMECRITICAL = 0x0006; - public const int PBT_APMRESUMESUSPEND = 0x0007; - public const int PBT_APMRESUMESTANDBY = 0x0008; - //public const int PBTF_APMRESUMEFROMFAILURE = 0x00000001; - //public const int PBT_APMBATTERYLOW = 0x0009; - //public const int PBT_APMPOWERSTATUSCHANGE = 0x000A; - //public const int PBT_APMOEMEVENT = 0x000B; - public const int PBT_APMRESUMEAUTOMATIC = 0x0012; - - #endregion Constants - #region Constructor public Tray() @@ -275,18 +251,18 @@ protected override void WndProc(ref Message m) { // Handle Suspend & Resume ... - if (m.Msg == WM_POWERBROADCAST) + if (m.Msg == Win32.WM_POWERBROADCAST) { switch (m.WParam.ToInt32()) { - case PBT_APMQUERYSUSPEND: - case PBT_APMQUERYSTANDBY: + case Win32.PBT_APMQUERYSUSPEND: + case Win32.PBT_APMQUERYSTANDBY: if (MceIrApi.InUse) MceIrApi.Suspend(); TrayIcon.Visible = false; break; - case PBT_APMRESUMEAUTOMATIC: + case Win32.PBT_APMRESUMEAUTOMATIC: if (MceIrApi.InUse) MceIrApi.Resume(); TrayIcon.Visible = true; @@ -295,7 +271,7 @@ } // Handle button presses ... - if (m.Msg == WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) + if (m.Msg == Win32.WM_USER && m.WParam.ToInt32() == MceIrApi.ID_MCEIR_KEYCODE) { int keyCode = m.LParam.ToInt32() & 0xFFFF; if (keyCode == TriggerButton) Added: trunk/plugins/MCEReplacementTray/Win32.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Win32.cs (rev 0) +++ trunk/plugins/MCEReplacementTray/Win32.cs 2007-02-10 10:33:25 UTC (rev 109) @@ -0,0 +1,36 @@ +using System; + +namespace MCEReplacementTray +{ + + public static class Win32 + { + + #region Constants + + public const int WM_USER = 0x0400; + public const int WM_APP = 0x8000; + + public const int WM_POWERBROADCAST = 0x0218; + + public const int PBT_APMQUERYSUSPEND = 0x0000; + public const int PBT_APMQUERYSTANDBY = 0x0001; + //public const int PBT_APMQUERYSUSPENDFAILED = 0x0002; + //public const int PBT_APMQUERYSTANDBYFAILED = 0x0003; + public const int PBT_APMSUSPEND = 0x0004; + //public const int PBT_APMSTANDBY = 0x0005; + + public const int PBT_APMRESUMECRITICAL = 0x0006; + public const int PBT_APMRESUMESUSPEND = 0x0007; + public const int PBT_APMRESUMESTANDBY = 0x0008; + //public const int PBTF_APMRESUMEFROMFAILURE = 0x00000001; + //public const int PBT_APMBATTERYLOW = 0x0009; + //public const int PBT_APMPOWERSTATUSCHANGE = 0x000A; + //public const int PBT_APMOEMEVENT = 0x000B; + public const int PBT_APMRESUMEAUTOMATIC = 0x0012; + + #endregion Constants + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-10 10:33:00
|
Revision: 108 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=108&view=rev Author: and-81 Date: 2007-02-10 02:32:57 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 06:48:49 UTC (rev 107) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:32:57 UTC (rev 108) @@ -1776,11 +1776,14 @@ } /// <summary> - /// Given a command name this method checks if the file exists as an IR code - /// or a macro and then processes the request accordingly. + /// Given a command this method checks if the file exists as an IR + /// command, macro or other command and then processes the request + /// accordingly. /// </summary> - /// <param name="command">The command name stored in the mapping XML</param> - /// <returns>success</returns> + /// <param name="command">Command to process.</param> + /// <param name="port">Blaster port to IR commands to.</param> + /// <param name="speed">Blaster speed to execute IR commands at.</param> + /// <returns>Success.</returns> public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { if (String.IsNullOrEmpty(command)) @@ -1874,15 +1877,15 @@ } else if (command.StartsWith(KeyCommandPrefix)) // Keystroke Command { - string commands = command.Substring(KeyCommandPrefix.Length); + string keyCommand = command.Substring(KeyCommandPrefix.Length); if (InConfiguration) { - MessageBox.Show(commands, "Keystroke Command", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(keyCommand, "Keystroke Command", MessageBoxButtons.OK, MessageBoxIcon.Information); return true; } else { - return ProcessKeyCommand(commands); + return ProcessKeyCommand(keyCommand); } } else if (command.StartsWith(GoToCommandPrefix)) // Go To Screen @@ -2098,14 +2101,22 @@ /// <returns>string[] of IR Commands</returns> public static string[] GetIRList() { - string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -2114,14 +2125,22 @@ /// <returns>string[] of Macros</returns> public static string[] GetMacroList() { - string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -2151,16 +2170,11 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { - if (input == null) + if (String.IsNullOrEmpty(input)) { - Log.Error("MCEReplacement: Null escape code string"); + Log.Error("MCEReplacement: Null or empty escape code string"); return ""; } - else if (input.Length == 0) - { - Log.Warn("MCEReplacement: Empty escape code string"); - return ""; - } bool inEscapeCode = false; bool inHexCode = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-10 06:48:55
|
Revision: 107 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=107&view=rev Author: and-81 Date: 2007-02-09 22:48:49 -0800 (Fri, 09 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/ExternalChannelConfig.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MappedEvent.cs trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacement/Util.cs trunk/plugins/MCEReplacement/Win32.cs trunk/plugins/MCEReplacementTray/MceIrApi.cs trunk/plugins/MCEReplacementTray/Program.cs trunk/plugins/MCEReplacementTray/Properties/AssemblyInfo.cs trunk/plugins/MCEReplacementTray/Setup.Designer.cs trunk/plugins/MCEReplacementTray/Setup.cs trunk/plugins/MCEReplacementTray/Tray.cs trunk/plugins/MessagePlugin/AssemblyInfo.cs trunk/plugins/MessagePlugin/MessagePlugin.cs trunk/plugins/TV3ExtChannelChanger/AssemblyInfo.cs trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalProgram.Designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.Designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/SerialCommand.cs trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3ExtChannelChanger/Util.cs trunk/plugins/TV3ExtChannelChanger/Win32.cs trunk/plugins/TV3MceBlaster/AssemblyInfo.cs trunk/plugins/TV3MceBlaster/ExternalChannelConfig.cs trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.cs trunk/plugins/TV3MceBlaster/Forms/ExternalProgram.Designer.cs trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs trunk/plugins/TV3MceBlaster/Forms/SerialCommand.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs trunk/plugins/TV3MceBlaster/MceIrApi.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs trunk/plugins/TV3MceBlaster/Util.cs trunk/plugins/TV3MceBlaster/Win32.cs trunk/plugins/XBCDRC/AssemblyInfo.cs trunk/plugins/XBCDRC/XBCDRC Plugin.csproj trunk/plugins/XBCDRC/XBCDRCPlugin.cs Added Paths: ----------- trunk/plugins/MCEReplacement/Mouse.cs Modified: trunk/plugins/MCEReplacement/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -1,6 +1,8 @@ +using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -16,6 +18,11 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + // // Version information for an assembly consists of the following four values: // @@ -58,4 +65,7 @@ [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] -[assembly: ComVisibleAttribute(false)] + +[assembly: CLSCompliant(true)] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/MCEReplacement/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/MCEReplacement/ExternalChannelConfig.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/ExternalChannelConfig.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -14,7 +14,7 @@ #region Variables - string _filename; + string _fileName; int _pauseTime = 250; bool _sendSelect = false; @@ -34,9 +34,9 @@ #region Properties - public string Filename + public string FileName { - get { return _filename; } + get { return _fileName; } } public int PauseTime @@ -105,11 +105,11 @@ #region Constructor - public ExternalChannelConfig(string filename) + public ExternalChannelConfig(string fileName) { - _filename = filename; + _fileName = fileName; - if (!File.Exists(_filename)) + if (!File.Exists(_fileName)) { for (int i = 0; i < 10; i++) Digits[i] = ""; @@ -121,7 +121,7 @@ try { - file = new FileStream(_filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(_fileName, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -161,7 +161,7 @@ try { - file = new FileStream(_filename, FileMode.Create, FileAccess.Write, FileShare.Read); + file = new FileStream(_fileName, FileMode.Create, FileAccess.Write, FileShare.Read); XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -11,9 +11,6 @@ using System.Windows.Forms; using System.Xml; -using MediaPortal.GUI.Library; -using MediaPortal.Util; - namespace MediaPortal.Plugins { @@ -192,21 +189,36 @@ ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } } else if (setup.SelectCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) { ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } } else { MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); if (setup.DoubleChannelSelect) - MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + + MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + } } } } @@ -221,7 +233,7 @@ { string quickSetup = comboBoxQuickSetup.Text; - if (quickSetup.Length == 0) + if (String.IsNullOrEmpty(quickSetup)) return; _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToXml(quickSetup); Modified: trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -99,7 +99,7 @@ this.labelStartup.Name = "labelStartup"; this.labelStartup.Size = new System.Drawing.Size(288, 16); this.labelStartup.TabIndex = 3; - this.labelStartup.Text = "Startup Folder:"; + this.labelStartup.Text = "Start in folder:"; this.labelStartup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // textBoxStartup @@ -180,7 +180,7 @@ this.checkBoxShellExecute.Name = "checkBoxShellExecute"; this.checkBoxShellExecute.Size = new System.Drawing.Size(184, 21); this.checkBoxShellExecute.TabIndex = 12; - this.checkBoxShellExecute.Text = "Startup using ShellExecute"; + this.checkBoxShellExecute.Text = "Start using ShellExecute"; this.checkBoxShellExecute.UseVisualStyleBackColor = true; // // buttonTest Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -60,13 +60,13 @@ comboBoxCommands.Items.AddRange(MCEReplacement.GetIRList()); } - void WriteToFile(string filename) + void WriteToFile(string fileName) { FileStream file = null; try { - file = new FileStream(MCEReplacement.AppDataFolder + filename + MCEReplacement.MacroExtension, FileMode.Create, FileAccess.Write, FileShare.Read); + file = new FileStream(MCEReplacement.AppDataFolder + fileName + MCEReplacement.MacroExtension, FileMode.Create, FileAccess.Write, FileShare.Read); XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; @@ -145,13 +145,13 @@ if (file != null) file.Close(); } - void ReadFromFile(string filename) + void ReadFromFile(string fileName) { FileStream file = null; try { - file = new FileStream(MCEReplacement.AppDataFolder + filename + MCEReplacement.MacroExtension, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(MCEReplacement.AppDataFolder + fileName + MCEReplacement.MacroExtension, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -339,20 +339,20 @@ private void buttonTest_Click(object sender, EventArgs e) { - string filename = textBoxName.Text.Trim().ToUpperInvariant(); + string fileName = textBoxName.Text.Trim().ToUpperInvariant(); - if (filename.Length == 0) + if (fileName.Length == 0) { MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - if (!filename.StartsWith(MCEReplacement.MacroFolder)) - filename = MCEReplacement.MacroFolder + filename; + if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + fileName = MCEReplacement.MacroFolder + fileName; - WriteToFile(filename); + WriteToFile(fileName); - if (!MCEReplacement.ProcessCommand(filename, _blastPort, _blastSpeed)) + if (!MCEReplacement.ProcessCommand(fileName, _blastPort, _blastSpeed)) MessageBox.Show(this, "Check the log files for details", "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -364,18 +364,18 @@ private void buttonOK_Click(object sender, EventArgs e) { - string filename = textBoxName.Text.Trim().ToUpperInvariant(); + string fileName = textBoxName.Text.Trim().ToUpperInvariant(); - if (filename.Length == 0) + if (fileName.Length == 0) { MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - if (!filename.StartsWith(MCEReplacement.MacroFolder)) - filename = MCEReplacement.MacroFolder + filename; + if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + fileName = MCEReplacement.MacroFolder + fileName; - WriteToFile(filename); + WriteToFile(fileName); this.DialogResult = DialogResult.OK; this.Close(); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -310,7 +310,7 @@ this.checkBoxMCERemote.Size = new System.Drawing.Size(184, 24); this.checkBoxMCERemote.TabIndex = 3; this.checkBoxMCERemote.Text = "Enable MCE remote"; - this.toolTips.SetToolTip(this.checkBoxMCERemote, "Enable the plugin\'s MCE remote mapping"); + this.toolTips.SetToolTip(this.checkBoxMCERemote, "Enable MCE remote button mapping"); this.checkBoxMCERemote.UseVisualStyleBackColor = true; // // checkBoxMessageMode Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -4,7 +4,7 @@ using System.Data; using System.Drawing; using System.IO; -using System.Security; +using System.Runtime.InteropServices; using System.Security.Permissions; using System.Text; using System.Windows.Forms; @@ -103,7 +103,7 @@ comboBoxCommands.Items.AddRange(MCEReplacement.GetFileList()); comboBoxEvents.Items.Clear(); - foreach (string eventType in Enum.GetNames(typeof(MappedEvent.Events))) + foreach (string eventType in Enum.GetNames(typeof(MappedEvent.MappingEvent))) if (eventType != "None") comboBoxEvents.Items.Add(eventType); @@ -131,9 +131,11 @@ try { + HandleRef handleRef = new HandleRef(this, this.Handle); + do { - registered = MceIrApi.RegisterEvents(this.Handle); + registered = MceIrApi.RegisterEvents(handleRef); if (!registered) { @@ -174,13 +176,14 @@ MessageBox.Show(this, ex.Message, "MCE Replacement Plugin Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + private void SetupForm_FormClosing(object sender, FormClosingEventArgs e) { if (MceIrApi.InUse) MceIrApi.UnregisterEvents(); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] override protected void WndProc(ref Message m) { // Handle Suspend & Resume ... @@ -193,14 +196,14 @@ case Win32.PBT_APMQUERYSUSPEND: case Win32.PBT_APMQUERYSTANDBY: //case Win32.PBT_APMSUSPEND: - MceIrApi.Suspend(); + MCEReplacement.OnSuspend(); break; //case Win32.PBT_APMRESUMECRITICAL: //case Win32.PBT_APMRESUMESUSPEND: //case Win32.PBT_APMRESUMESTANDBY: case Win32.PBT_APMRESUMEAUTOMATIC: - MceIrApi.Resume(); + MCEReplacement.OnResume(); break; } } @@ -244,16 +247,16 @@ if (listBoxIR.SelectedIndex != -1) { string command = (string)listBoxIR.SelectedItem; - string filename = MCEReplacement.AppDataFolder + command + MCEReplacement.IRExtension; + string fileName = MCEReplacement.AppDataFolder + command + MCEReplacement.IRExtension; - if (File.Exists(filename)) + if (File.Exists(fileName)) { LearnIR learnIR = new LearnIR(false, command, BlastPort, BlastSpeed); learnIR.ShowDialog(this); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshIRList(); } } @@ -263,16 +266,16 @@ if (listBoxMacro.SelectedIndex != -1) { string command = (string)listBoxMacro.SelectedItem; - string filename = MCEReplacement.AppDataFolder + command + MCEReplacement.MacroExtension; + string fileName = MCEReplacement.AppDataFolder + command + MCEReplacement.MacroExtension; - if (File.Exists(filename)) + if (File.Exists(fileName)) { MacroEditor macroEditor = new MacroEditor(false, command, BlastPort, BlastSpeed); macroEditor.ShowDialog(this); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshMacroList(); } } @@ -403,15 +406,15 @@ if (listBoxIR.SelectedIndex != -1) { string file = (string)listBoxIR.SelectedItem; - string filename = MCEReplacement.AppDataFolder + file + MCEReplacement.IRExtension; - if (File.Exists(filename)) + string fileName = MCEReplacement.AppDataFolder + file + MCEReplacement.IRExtension; + if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - File.Delete(filename); + File.Delete(fileName); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } RefreshIRList(); @@ -445,15 +448,15 @@ if (listBoxMacro.SelectedIndex != -1) { string file = (string)listBoxMacro.SelectedItem; - string filename = MCEReplacement.AppDataFolder + file + MCEReplacement.MacroExtension; - if (File.Exists(filename)) + string fileName = MCEReplacement.AppDataFolder + file + MCEReplacement.MacroExtension; + if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - File.Delete(filename); + File.Delete(fileName); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } RefreshMacroList(); Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -210,16 +210,16 @@ return; } - string filename = MCEReplacement.AppDataFolder + MCEReplacement.STBFolder + xmlFile + ".xml"; + string fileName = String.Format("{0}{1}{2}.xml", MCEReplacement.AppDataFolder, MCEReplacement.STBFolder, xmlFile); - if (!File.Exists(filename)) + if (!File.Exists(fileName)) return; FileStream file = null; try { - file = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -229,7 +229,7 @@ string temp; for (int i = 0; i < 10; i++) { - temp = Util.GetXmlString(nodeList, "Digit" + i.ToString(), ""); + temp = Util.GetXmlString(nodeList, String.Format("Digit{0}", i), ""); if (temp.EndsWith(MCEReplacement.IRExtension)) temp = MCEReplacement.STBFolder + temp; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -5,6 +5,7 @@ using System.Drawing; using System.IO; using System.IO.Ports; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; @@ -97,10 +98,16 @@ static InputHandler _defaultInputHandler; static List<InputHandler> _multiInputHandlers; + static ExternalChannelConfig[] _externalChannelConfigs; + + static bool _inConfiguration = false; + + static bool _mpBasicHome; + static bool _mpMCERemote; + static string _mpSerialUirPort; + SendMessageHandler _sendMessageHandler; - static ExternalChannelConfig[] _externalChannelConfigs = null; - int[] _mceRemoteMap = null; int[] _differentRemoteMap = null; @@ -108,12 +115,6 @@ bool _mouseModeLeftHeld = false; bool _mouseModeMiddleHeld = false; - static bool _mpBasicHome; - static bool _mpMCERemote; - static string _mpSerialUirPort; - - static bool _inConfiguration = false; - #endregion Variables #region Properties @@ -235,6 +236,12 @@ get { return _externalChannelConfigs; } } + public static bool InConfiguration + { + get { return _inConfiguration; } + set { _inConfiguration = value; } + } + // MediaPortal Settings public static bool MP_BasicHome { @@ -249,19 +256,16 @@ get { return _mpSerialUirPort; } } - public static bool InConfiguration - { - get { return _inConfiguration; } - set { _inConfiguration = value; } - } - #endregion Properties #region IPlugin methods + //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Start() { Log.Info("MCEReplacement: Starting ({0})", Version); + + Log.Debug("MCEReplacement: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); // Load basic settings LoadSettings(); @@ -320,8 +324,10 @@ try { // Register with MceIrApi to receive remote button presses - IntPtr hWnd = Application.OpenForms["D3DApp"].Handle; - if (MceIrApi.RegisterEvents(hWnd)) + Form mpForm = Application.OpenForms["D3DApp"]; + HandleRef handleRef = new HandleRef(mpForm, mpForm.Handle); + + if (MceIrApi.RegisterEvents(handleRef)) { if (LogVerbose) Log.Debug("MCEReplacement: MceIrApi enabled"); @@ -344,7 +350,7 @@ { LoadEventMappings(); - MapEvent(MappedEvent.Events.MediaPortal_Start); + MapEvent(MappedEvent.MappingEvent.MediaPortal_Start); } // Register with MediaPortal to receive GUI Messages ... @@ -357,13 +363,15 @@ if (LogVerbose) Log.Info("MCEReplacement: Started"); } + + //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Stop() { if (LogVerbose) Log.Info("MCEReplacement: Stopping"); if (EventMapperEnabled) - MapEvent(MappedEvent.Events.MediaPortal_Stop); + MapEvent(MappedEvent.MappingEvent.MediaPortal_Stop); if (ControlExternalEnabled || EventMapperEnabled) GUIWindowManager.Receivers -= _sendMessageHandler; @@ -429,6 +437,7 @@ #region IPluginReceiver methods + //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public bool WndProc(ref Message msg) { // Handle Suspend & Resume ... @@ -463,9 +472,9 @@ if (RequireFocus && !GUIGraphicsContext.HasFocus) return true; - int lParam = msg.LParam.ToInt32(); - int keyCode = lParam & 0xFFFF; - int repeatCount = lParam >> 16; + int longParam = msg.LParam.ToInt32(); + int keyCode = longParam & 0xFFFF; + int repeatCount = longParam >> 16; int button = -1; @@ -557,9 +566,9 @@ // The plugin just maps it through the input handler. if (MessageModeEnabled && msg.Msg == Win32.WM_APP && msg.WParam.ToInt32() == MessageModeCommand) { - int lParam = msg.LParam.ToInt32(); - int button = lParam & 0xFFFF; - int repeatCount = lParam >> 16; + int longParam = msg.LParam.ToInt32(); + int button = longParam & 0xFFFF; + int repeatCount = longParam >> 16; if (MultiMappingEnabled && button == MultiMappingButton) { @@ -620,13 +629,13 @@ notifyMessage = "Mouse Mode is now OFF"; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; @@ -642,8 +651,8 @@ } else if (MouseModeActive) { - int x = Cursor.Position.X; - int y = Cursor.Position.Y; + //int x = Cursor.Position.X; + //int y = Cursor.Position.Y; int distance = MouseModeStep; if (MouseModeAcceleration) @@ -652,19 +661,23 @@ switch ((RemoteButton)button) { case RemoteButton.Up: - Cursor.Position = new Point(x, y - distance); + //Cursor.Position = new Point(x, y - distance); + Mouse.Move(0, -distance, false); return true; case RemoteButton.Down: - Cursor.Position = new Point(x, y + distance); + //Cursor.Position = new Point(x, y + distance); + Mouse.Move(0, distance, false); return true; case RemoteButton.Left: - Cursor.Position = new Point(x - distance, y); + //Cursor.Position = new Point(x - distance, y); + Mouse.Move(-distance, 0, false); return true; case RemoteButton.Right: - Cursor.Position = new Point(x + distance, y); + //Cursor.Position = new Point(x + distance, y); + Mouse.Move(distance, 0, false); return true; case RemoteButton.Replay: // Left Single-Click @@ -672,20 +685,20 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); + Mouse.Button(Mouse.MouseEvents.LeftUp); return true; case RemoteButton.Skip: // Right Single-Click @@ -693,20 +706,20 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightDown); + Mouse.Button(Mouse.MouseEvents.RightUp); return true; case RemoteButton.Play: // Middle Single-Click @@ -714,20 +727,20 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleDown); + Mouse.Button(Mouse.MouseEvents.MiddleUp); return true; case RemoteButton.Ok: // Double-Click (Left) @@ -735,36 +748,36 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); + Mouse.Button(Mouse.MouseEvents.LeftUp); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); + Mouse.Button(Mouse.MouseEvents.LeftUp); return true; case RemoteButton.Back: // Left Click & Hold if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); else - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); _mouseModeLeftHeld = !_mouseModeLeftHeld; _mouseModeRightHeld = false; @@ -773,15 +786,15 @@ case RemoteButton.Info: // Right Click & Hold if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); else - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTDOWN, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightDown); _mouseModeRightHeld = !_mouseModeRightHeld; _mouseModeLeftHeld = false; @@ -790,15 +803,15 @@ case RemoteButton.Stop: // Middle Click & Hold if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); else - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEDOWN, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleDown); _mouseModeMiddleHeld = !_mouseModeMiddleHeld; _mouseModeLeftHeld = false; @@ -806,11 +819,11 @@ return true; case RemoteButton.ChannelUp: // Scroll Up - Win32.MouseEvent((uint)Win32.MouseEventFlags.SCROLL, 0, 0, (uint)120, 0); + Mouse.Scroll(Mouse.ScrollDir.Up); return true; case RemoteButton.ChannelDown: // Scroll Down - Win32.MouseEvent((uint)Win32.MouseEventFlags.SCROLL, 0, 0, unchecked((uint)-120), 0); + Mouse.Scroll(Mouse.ScrollDir.Down); return true; } } @@ -1022,7 +1035,7 @@ /// <param name="msg">MediaPortal Message to run through the event mapper</param> static void MapEvent(GUIMessage msg) { - MappedEvent.Events eventType = MappedEvent.GetEventType(msg.Message); + MappedEvent.MappingEvent eventType = MappedEvent.GetEventType(msg.Message); foreach (MappedEvent mappedEvent in EventMappings) { @@ -1086,7 +1099,7 @@ continue; if (LogVerbose) - Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.Events), eventType)); + Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); string command = mappedEvent.Command; @@ -1105,7 +1118,7 @@ /// Run the event mapper over the supplied MappedEvent type /// </summary> /// <param name="msg">MappedEvent to run through the event mapper</param> - static void MapEvent(MappedEvent.Events eventType) + static void MapEvent(MappedEvent.MappingEvent eventType) { foreach (MappedEvent mappedEvent in EventMappings) { @@ -1115,7 +1128,7 @@ continue; if (LogVerbose) - Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.Events), eventType)); + Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); string command = mappedEvent.Command; @@ -1301,26 +1314,24 @@ return ProcessSerialCommand(commands); } - static bool BlastIR(string filename, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; try { - file = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); if (file.Length == 0) { - Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", filename); + Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); file.Close(); return false; } - IntPtr fileHandle = file.SafeFileHandle.DangerousGetHandle(); - - if (!MceIrApi.CheckFile(fileHandle)) + if (!MceIrApi.CheckFile(file.SafeFileHandle)) { - Log.Error("MCEReplacement: Bad IR file \"{0}\"", filename); + Log.Error("MCEReplacement: Bad IR file \"{0}\"", fileName); file.Close(); return false; } @@ -1329,7 +1340,7 @@ MceIrApi.SetBlasterSpeed(speed); MceIrApi.SetBlasterType(BlastType); - if (MceIrApi.PlaybackFromFile(fileHandle)) + if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) { if (LogVerbose) Log.Info("MCEReplacement: Blast successful"); @@ -1343,7 +1354,7 @@ Log.Error("MCEReplacement: BlastIR() {0}", ex.Message); } - Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", filename); + Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); if (file != null) file.Close(); @@ -1351,7 +1362,7 @@ return false; } - static bool ProcessMacro(string filename, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; @@ -1360,7 +1371,7 @@ try { - file = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -1378,7 +1389,7 @@ if (!BlastIR(AppDataFolder + commandProperty + IRExtension, macroPort, macroSpeed)) { file.Close(); - Log.Error("MCEReplacement: Error blasting \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error blasting \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } break; @@ -1400,14 +1411,14 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Run \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Run \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } if (!ProcessRunCommand(commands)) { file.Close(); - Log.Error("MCEReplacement: Error executing Run in \"{0}\"", filename); + Log.Error("MCEReplacement: Error executing Run in \"{0}\"", fileName); return false; } break; @@ -1420,14 +1431,14 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Serial Command \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Serial Command \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } if (!ProcessSerialCommand(commands)) { file.Close(); - Log.Error("MCEReplacement: Error executing Serial Command in \"{0}\"", filename); + Log.Error("MCEReplacement: Error executing Serial Command in \"{0}\"", fileName); return false; } break; @@ -1449,7 +1460,7 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Popup Command \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Popup Command \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } @@ -1479,7 +1490,7 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Message Command \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Message Command \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } @@ -1499,7 +1510,7 @@ else if (!ProcessKeyCommand(commandProperty)) { file.Close(); - Log.Error("MCEReplacement: Error executing Key Command in \"{0}\"", filename); + Log.Error("MCEReplacement: Error executing Key Command in \"{0}\"", fileName); return false; } @@ -1593,8 +1604,8 @@ /// </summary> public static void OnSuspend() { - if (EventMapperEnabled) - MapEvent(MappedEvent.Events.PC_Suspend); + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Suspend); if (MceIrApi.InUse) { @@ -1618,8 +1629,8 @@ MceIrApi.Resume(); } - if (EventMapperEnabled) - MapEvent(MappedEvent.Events.PC_Resume); + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Resume); } /// <summary> @@ -1629,6 +1640,12 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitRunCommand(string runCommand) { + if (String.IsNullOrEmpty(runCommand)) + { + Log.Error("MCEReplacement: Invalid run command"); + return null; + } + string[] commands = runCommand.Split(new char[] { '|' }); if (commands.Length != 7) @@ -1647,24 +1664,30 @@ /// <param name="command">An array of arguments for the method /// (the output of SplitRunCommand)</param> /// <returns>success</returns> - public static bool ProcessRunCommand(string[] command) + public static bool ProcessRunCommand(string[] commands) { + if (commands == null) + { + Log.Error("MCEReplacement: Invalid run command"); + return false; + } + try { Process process = new Process(); - process.StartInfo.FileName = command[0]; - process.StartInfo.WorkingDirectory = command[1]; - process.StartInfo.Arguments = command[2]; - process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), command[3]); - process.StartInfo.CreateNoWindow = bool.Parse(command[4]); - process.StartInfo.UseShellExecute = bool.Parse(command[5]); + process.StartInfo.FileName = commands[0]; + process.StartInfo.WorkingDirectory = commands[1]; + process.StartInfo.Arguments = commands[2]; + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3]); + process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); + process.StartInfo.UseShellExecute = bool.Parse(commands[5]); if (LogVerbose) - Log.Info("MCEReplacement: Launching program {0}", command[0]); + Log.Info("MCEReplacement: Launching program {0}", commands[0]); process.Start(); - if (bool.Parse(command[6])) // Wait for exit + if (bool.Parse(commands[6])) // Wait for exit process.WaitForExit(); } catch (Exception ex) @@ -1683,6 +1706,12 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitSerialCommand(string serialCommand) { + if (String.IsNullOrEmpty(serialCommand)) + { + Log.Error("MCEReplacement: Invalid serial command"); + return null; + } + string[] commands = serialCommand.Split(new char[] { '|' }); if (commands.Length != 6) @@ -1704,6 +1733,12 @@ /// <returns>success</returns> public static bool ProcessSerialCommand(string[] commands) { + if (commands == null) + { + Log.Error("MCEReplacement: Invalid serial command"); + return false; + } + SerialPort serialPort = null; if (LogVerbose) @@ -1748,41 +1783,47 @@ /// <returns>success</returns> public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { + if (String.IsNullOrEmpty(command)) + { + Log.Error("MCEReplacement: Invalid command"); + return false; + } + if (command.StartsWith(MacroFolder)) // Macro { - string filename = AppDataFolder + command + MacroExtension; - if (File.Exists(filename)) + string fileName = AppDataFolder + command + MacroExtension; + if (File.Exists(fileName)) { - return ProcessMacro(filename, port, speed); + return ProcessMacro(fileName, port, speed); } else { - Log.Error("MCEReplacement: Macro file missing \"{0}\"", filename); + Log.Error("MCEReplacement: Macro file missing \"{0}\"", fileName); return false; } } else if (command.StartsWith(IRFolder)) // IR Code { - string filename = AppDataFolder + command + IRExtension; - if (File.Exists(filename)) + string fileName = AppDataFolder + command + IRExtension; + if (File.Exists(fileName)) { - return BlastIR(filename, port, speed); + return BlastIR(fileName, port, speed); } else { - Log.Error("MCEReplacement: IR file missing \"{0}\"", filename); + Log.Error("MCEReplacement: IR file missing \"{0}\"", fileName); return false; } } else if (command.StartsWith(STBFolder)) // STB Command { - string filename = AppDataFolder + command; - if (File.Exists(filename)) + string fileName = AppDataFolder + command; + if (File.Exists(fileName)) { - if (filename.EndsWith(IRExtension)) // IR Command - return BlastIR(filename, port, speed); - else if (filename.EndsWith(MacroExtension)) // Macro - return ProcessMacro(filename, port, speed); + if (fileName.EndsWith(IRExtension)) // IR Command + return BlastIR(fileName, port, speed); + else if (fileName.EndsWith(MacroExtension)) // Macro + return ProcessMacro(fileName, port, speed); else { Log.Error("MCEReplacement: Invalid STB Command \"{0}\"", command); @@ -1791,7 +1832,7 @@ } else { - Log.Error("MCEReplacement: STB file missing \"{0}\"", filename); + Log.Error("MCEReplacement: STB file missing \"{0}\"", fileName); return false; } } @@ -1860,6 +1901,12 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitMessageCommand(string messageCommand) { + if (String.IsNullOrEmpty(messageCommand)) + { + Log.Error("MCEReplacement: Invalid message command"); + return null; + } + string[] commands = messageCommand.Split(new char[] { '|' }); if (commands.Length != 4) @@ -1880,13 +1927,19 @@ /// <returns>success</returns> public static bool ProcessMessageCommand(string[] commands) { + if (commands == null) + { + Log.Error("MCEReplacement: Invalid message command"); + return false; + } + try { - IntPtr hWnd = IntPtr.Zero; + IntPtr windowHandle = IntPtr.Zero; if (commands[0] == "*") { - hWnd = Win32.GetForegroundWindow(); + windowHandle = Win32.GetForegroundWindow(); } else { @@ -1895,7 +1948,7 @@ try { if (proc.MainModule.FileName == commands[0]) - hWnd = proc.MainWindowHandle; + windowHandle = proc.MainWindowHandle; } catch { @@ -1903,19 +1956,20 @@ } } - if (hWnd == IntPtr.Zero) + if (windowHandle == IntPtr.Zero) { Log.Warn("MCEReplacement: No target found for Message Command"); return false; } int msg = int.Parse(commands[1]); - int wParam = int.Parse(commands[2]); - int lParam = int.Parse(commands[3]); + IntPtr wordParam = new IntPtr(int.Parse(commands[2])); + IntPtr longParam = new IntPtr(int.Parse(commands[3])); - Win32.SendMessage(hWnd, msg, wParam, lParam); + Win32.SendMessage(windowHandle, msg, wordParam, longParam); - Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3})", hWnd.ToString(), msg, wParam, lParam); + if (LogVerbose) + Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3})", commands[0], msg, wordParam, longParam); return true; } @@ -1933,11 +1987,17 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitPopupCommand(string popupCommand) { + if (String.IsNullOrEmpty(popupCommand)) + { + Log.Error("MCEReplacement: Invalid popup command"); + return null; + } + string[] commands = popupCommand.Split(new char[] { '|' }); if (commands.Length != 3) { - Log.Error("MCEReplacement: Popup command structure is invalid: {0}", popupCommand); + Log.Error("MCEReplacement: Popup Command structure is invalid: {0}", popupCommand); return null; } @@ -1951,16 +2011,31 @@ /// <returns>Success</returns> public static bool ProcessGoTo(string screen) { - GUIWindow.Window window = (GUIWindow.Window)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + if (String.IsNullOrEmpty(screen)) + { + Log.Error("MCEReplacement: Invalid goto command"); + return false; + } - if (window == GUIWindow.Window.WINDOW_HOME && MP_BasicHome) - window = GUIWindow.Window.WINDOW_SECOND_HOME; + try + { + GUIWindow.Window window = (GUIWindow.Window)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); - if (LogVerbose) - Log.Info("MCEReplacement: Go To Window \"{0}\"", Enum.GetName(typeof(GUIWindow.Window), window)); + if (window == GUIWindow.Window.WINDOW_HOME && MP_BasicHome) + window = GUIWindow.Window.WINDOW_SECOND_HOME; - GUIGraphicsContext.ResetLastActivity(); - GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)window, 0, null)); + if (LogVerbose) + Log.Info("MCEReplacement: Go To Window \"{0}\"", Enum.GetName(typeof(GUIWindow.Window), window)); + + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)window, 0, null)); + } + catch (Exception ex) + { + Log.Error("MCEReplacement: Error processing Goto Command \"{0}\" - {1}", screen, ex.Message); + return false; + } + return true; } @@ -1971,13 +2046,19 @@ /// <returns>Success</returns> public static bool ProcessKeyCommand(string command) { + if (String.IsNullOrEmpty(command)) + { + Log.Error("MCEReplacement: Invalid key command"); + return false; + } + try { SendKeys.SendWait(command); } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.Message); + Log.Error("MCEReplacement: Error processing Key Command \"{0}\"", ex.Message); return false; } @@ -1991,15 +2072,14 @@ /// <returns>bool value shows success</returns> public static bool LearnIRCommand(string blastCommand) { - string filename = AppDataFolder + blastCommand + IRExtension; + string fileName = AppDataFolder + blastCommand + IRExtension; FileStream file = null; bool status = false; try { - file = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.Read); - - status = MceIrApi.RecordToFile(file.SafeFileHandle.DangerousGetHandle(), LearnTimeout); + file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read); + status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnTimeout); } catch (Exception ex) { @@ -2071,6 +2151,17 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { + if (input == null) + { + Log.Error("MCEReplacement: Null escape code string"); + return ""; + } + else if (input.Length == 0) + { + Log.Warn("MCEReplacement: Empty escape code string"); + return ""; + } + bool inEscapeCode = false; bool inHexCode = false; byte hexParsed; @@ -2128,7 +2219,7 @@ if (byte.TryParse(hexCode.ToString(), System.Globalization.NumberStyles.HexNumber, null, out hexParsed)) output.Append((char)hexParsed); else - Log.Error("MCEReplacement: ReplaceEscapeCodes() - Bad Hex Code"); + Log.Error("MCEReplacement: Bad Hex Code \"{0}\"", hexCode.ToString()); inHexCode = false; break; Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-10 06:48:49 UTC (rev 107) @@ -13,6 +13,9 @@ <StartupObject> </StartupObject> <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <SignAssembly>false</SignAssembly> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -150,6 +153,7 @@ <Compile Include="MappedEvent.cs" /> <Compile Include="MceIrApi.cs" /> <Compile Include="MCEReplacement.cs" /> + <Compile Include="Mouse.cs" /> <Compile Include="Util.cs" /> <Compile Include="Win32.cs" /> </ItemGroup> Modified: trunk/plugins/MCEReplacement/MappedEvent.cs =================================================================== --- trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -18,7 +18,7 @@ /// <summary> /// A list of events that can be mapped in the Event Mapper /// </summary> - public enum Events + public enum MappingEvent { None, //Time_Schedule, @@ -114,77 +114,78 @@ /// </summary> /// <param name="messageType">MediaPortal GUIMessage.MessageType</param> /// <returns></returns> - public static Events GetEventType(GUIMessage.MessageType messageType) + [CLSCompliant(false)] + public static MappingEvent GetEventType(GUIMessage.MessageType messageType) { switch (messageType) { case GUIMessage.MessageType.GUI_MSG_CD_INSERTED: - return Events.CD_Inserted; + return MappingEvent.CD_Inserted; case GUIMessage.MessageType.GUI_MSG_CD_REMOVED: - return Events.CD_Ejected; + return MappingEvent.CD_Ejected; case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED: - return Events.File_Downloaded; + return MappingEvent.File_Downloaded; case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING: - return Events.File_Downloading; + return MappingEvent.File_Downloading; case GUIMessage.MessageType.GUI_MSG_LOSTFOCUS: - return Events.Focus_Lost; + return MappingEvent.Focus_Lost; case GUIMessage.MessageType.GUI_MSG_MSN_CLOSECONVERSATION: - return Events.MSN_Close_Conversation; + return MappingEvent.MSN_Close_Conversation; case GUIMessage.MessageType.GUI_MSG_MSN_MESSAGE: - return Events.MSN_Message; + return MappingEvent.MSN_Message; case GUIMessage.MessageType.GUI_MSG_MSN_STATUS_MESSAGE: - return Events.MSN_Status_Message; + return MappingEvent.MSN_Status_Message; case GUIMessage.MessageType.GUI_MSG_PLAY_AUDIO_CD: - return Events.Play_Audio_CD; + return MappingEvent.Play_Audio_CD; case GUIMessage.MessageType.GUI_MSG_PLAY_FILE: - return Events.Play_File; + return MappingEvent.Play_File; case GUIMessage.MessageType.GUI_MSG_PLAY_ITEM: - return Events.Play_Item; + return MappingEvent.Play_Item; case GUIMessage.MessageType.GUI_MSG_PLAY_RADIO_STATION: - return Events.Play_Radio_Station; + return MappingEvent.Play_Radio_Station; case GUIMessage.MessageType.GUI_MSG_PLAYBACK_ENDED: - return Events.Playback_Ended; + return MappingEvent.Playback_Ended; case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: - return Events.Playback_Started; + return MappingEvent.Playback_Started; case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED: - return Events.Playback_Stopped; + return MappingEvent.Playback_Stopped; case GUIMessage.MessageType.GUI_MSG_RECORD: - return Events.Record; + return MappingEvent.Record; case GUIMessage.MessageType.GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING: - return Events.About_To_Record; + return MappingEvent.About_To_Record; case GUIMessage.MessageType.GUI_MSG_RECORDER_START: - return Events.Recorder_Start; + return MappingEvent.Recorder_Start; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP: - return Events.Recorder_Stop; + return MappingEvent.Recorder_Stop; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO: - return Events.Recorder_Stop_Radio; + return MappingEvent.Recorder_Stop_Radio; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TIMESHIFT: - return Events.Recorder_Stop_Timeshift; + return MappingEvent.Recorder_Stop_Timeshift; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TV: - return Events.Recorder_Stop_TV; + return MappingEvent.Recorder_Stop_TV; case GUIMessage.Messag... [truncated message content] |
From: <dal...@us...> - 2007-02-09 15:01:03
|
Revision: 106 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=106&view=rev Author: dalanorth Date: 2007-02-09 07:00:57 -0800 (Fri, 09 Feb 2007) Log Message: ----------- Added functionality to the configuration. Now possible to import IE and Firefox bookmarks, and to automatically get start pages from their settings. Modified Paths: -------------- trunk/plugins/WebBrowser/GUIWebBrowser.csproj trunk/plugins/WebBrowser/WebBrowserSetup.Designer.cs trunk/plugins/WebBrowser/WebBrowserSetup.cs trunk/plugins/WebBrowser/WebBrowserSetup.resx Added Paths: ----------- trunk/plugins/WebBrowser/MozillaFile.cs trunk/plugins/WebBrowser/MozillaNode.cs trunk/plugins/WebBrowser/Node.cs Modified: trunk/plugins/WebBrowser/GUIWebBrowser.csproj =================================================================== --- trunk/plugins/WebBrowser/GUIWebBrowser.csproj 2007-02-07 20:11:58 UTC (rev 105) +++ trunk/plugins/WebBrowser/GUIWebBrowser.csproj 2007-02-09 15:00:57 UTC (rev 106) @@ -72,6 +72,9 @@ <Compile Include="GUIFavorites.cs" /> <Compile Include="GUIWebBrowser.cs" /> <Compile Include="INIFile.cs" /> + <Compile Include="MozillaFile.cs" /> + <Compile Include="MozillaNode.cs" /> + <Compile Include="Node.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="WebBrowserControl.cs"> <SubType>UserControl</SubType> Added: trunk/plugins/WebBrowser/MozillaFile.cs =================================================================== --- trunk/plugins/WebBrowser/MozillaFile.cs (rev 0) +++ trunk/plugins/WebBrowser/MozillaFile.cs 2007-02-09 15:00:57 UTC (rev 106) @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Text; + +public class MozillaFile +{ + int _headerIndex = -1; + private MozillaNode _root = null; + private List<string> _lines; + protected List<string> Lines + { + get { return _lines; } + } + + public MozillaFile(string[] lines) + { + if (lines == null) + { + throw new ArgumentNullException("string[] lines"); + } + if (lines.Length == 0) + { + throw new ArgumentException("string[] lines"); + } + _lines = new List<string>(lines); + _root = MozillaNode.Create("Bookmarks"); + ResolveHeaderIndex(); + ResolveFoldersAndLinks(_root, ref _headerIndex, _lines); + } + + public MozillaNode GetRoot() + { + return _root; + } + + private bool IsBeginFolderHTMLMarkup(string line) + { + return MozillaNode.BeginFolderHTMLMarkup.IsMatch(line); + } + private bool IsEndFolderHTMLMarkup(string line) + { + return MozillaNode.EndFolderHTMLMarkup.IsMatch(line); + } + + private int ResolveHeaderIndex() + { + foreach (string line in _lines) + { + _headerIndex++; + if (IsBeginFolderHTMLMarkup(line)) + return _headerIndex; + } + throw new IndexOutOfRangeException(); + } + + private void ResolveFoldersAndLinks(MozillaNode parentNode, ref int lineNumber, List<string> lines) + { + while (lineNumber < lines.Count) + { + string line = lines[lineNumber++]; + if (IsEndFolderHTMLMarkup(line)) + break; + MozillaNode node = MozillaNode.Create(parentNode, line); + if (node.IsFolder) + ResolveFoldersAndLinks(node, ref lineNumber, lines); + } + } + + public IEnumerable<MozillaNode> FindDuplicateNodes(MozillaNode matchNode) + { + Predicate<MozillaNode> predicate = + delegate(MozillaNode current) { return current.CompareTo(matchNode) == 0; }; + foreach (MozillaNode node in this._root.FindAll(predicate)) + { + yield return node; + } + } + + public int RemoveDuplicateLinks() + { + int removed = 0; + List<MozillaNode> nodes = new List<MozillaNode>(this.GetAllLinkNodes(_root)); + foreach (MozillaNode node in nodes) + { + List<MozillaNode> copies = new List<MozillaNode>(FindDuplicateNodes(node)); + if (copies.Count > 1) + { + for (int i = 1; i < copies.Count; i++) + { + MozillaNode duplicateNode = copies[i]; + MozillaNode.DeleteRelationShip(duplicateNode.Parent, duplicateNode); + removed++; + } + } + } + return removed; + } + + public void Save(string fullyQualifiedFilename) + { + string newMozillaLinks = ""; + foreach (string s in Header) + { + newMozillaLinks += s + Environment.NewLine; + } + newMozillaLinks += "<DL><p>" + Environment.NewLine; + + FormatLines(_root, ref newMozillaLinks); + + + + System.IO.File.WriteAllText(fullyQualifiedFilename, newMozillaLinks); + } + + private IEnumerable<MozillaNode> GetAllLinkNodes(MozillaNode fromNode) + { + Predicate<MozillaNode> predicate = delegate(MozillaNode current) { return current.IsLink; }; + return fromNode.FindAll(predicate); + } + + public MozillaNode Find(MozillaNode matchNode) + { + Predicate<MozillaNode> predicate = + delegate(MozillaNode current) { return current.IsLink && current.CompareTo(matchNode) == 0; }; + foreach (MozillaNode node in _root.FindAll(predicate)) + { + return node; + } + return null; + } + + public IEnumerable<string> Header + { + get + { + foreach (string line in _lines) + { + if (IsBeginFolderHTMLMarkup(line)) + yield break; + else + yield return line; + } + } + } + + private void FormatLines(MozillaNode folder, ref string lines) + { + if (folder.Parent != null) + lines += folder.Line + "\n" + "<DL><p>" + Environment.NewLine; + foreach (MozillaNode node in folder.GetChildren()) + { + if (node.IsFolder) + { + FormatLines(node, ref lines); + } + else + lines += node.Line + Environment.NewLine; + } + lines += "</DL><p>" + Environment.NewLine; + } + + private int _numberOfNewLinksFound = 0; + public int NumberOfNewLinksFound + { + get { return _numberOfNewLinksFound; } + } + + private void FindNewNodes(MozillaNode folder, List<MozillaNode> newNodes) + { + foreach (MozillaNode child in folder.GetChildren()) + { + if (child.IsFolder) + { + FindNewNodes(child, newNodes); + } + else + { + if (Find(child) == null) + { + newNodes.Add(child); + } + } + } + } + + public void Merge(MozillaFile other) + { + List<MozillaNode> newNodes = new List<MozillaNode>(); + _numberOfNewLinksFound = 0; + FindNewNodes(other._root, newNodes); + MoveNodes(_root, newNodes); + _numberOfNewLinksFound = newNodes.Count; + } + + private static void MoveNodes(MozillaNode toNode, List<MozillaNode> nodes) + { + foreach (MozillaNode node in nodes) + { + MozillaNode.DeleteRelationShip(node.Parent, node); + MozillaNode.SetRelationShip(toNode, node); + } + } + + +} Added: trunk/plugins/WebBrowser/MozillaNode.cs =================================================================== --- trunk/plugins/WebBrowser/MozillaNode.cs (rev 0) +++ trunk/plugins/WebBrowser/MozillaNode.cs 2007-02-09 15:00:57 UTC (rev 106) @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +public enum NodeEnum { Unknown, Link, Folder } + +public class MozillaNode : Node +{ + public static void SetUrlComparison() + { + Comparison = delegate(Node x, Node y) { return string.Compare(((MozillaNode)x)._href, ((MozillaNode)y)._href); }; + } + + public static void SetNameComparison() + { + Comparison = delegate(Node x, Node y) { return string.Compare(((MozillaNode)x).Name, ((MozillaNode)y).Name); }; + } + + static MozillaNode() + { + SetNameComparison(); + } + + private NodeEnum _nodeType = NodeEnum.Unknown; + public NodeEnum NodeType { get { return _nodeType; } } + + public static readonly Regex BeginFolderHTMLMarkup = new Regex( + @"\<DL\>", + RegexOptions.IgnoreCase | + RegexOptions.Singleline); + + + public static readonly Regex FolderRegex = new Regex( + @"<DT><H3.*?(ADD_DATE=\""(.*?)\"")* ID=""(.*?)"".*?>(.*?)<\/H3>", + RegexOptions.IgnoreCase | + RegexOptions.Singleline); + + + //match a link + private static readonly Regex LinkRegex = new Regex( + @"<DT><A HREF=""(.+?)"".*?>(.*?)<\/A>", + RegexOptions.IgnoreCase | + RegexOptions.Singleline); + + + public static readonly Regex EndFolderHTMLMarkup = + new Regex(@"\<\/DL\>", + RegexOptions.IgnoreCase | + RegexOptions.Singleline); + + + + private string _name = ""; + private string _href = ""; + private string _line; + + + public static bool IsLinkLine(string line) + { + return LinkRegex.IsMatch(line); + } + + public static bool IsFolderLine(string line) + { + return FolderRegex.IsMatch(line); + } + + public bool IsFolder { get { return _nodeType == NodeEnum.Folder; } } + public bool IsLink { get { return _nodeType == NodeEnum.Link; } } + + public string Line + { + get { return _line; } + } + + public string URL + { + get + { + if (IsLink) + { + return _href; + } + else + { + return string.Empty; + } + } + } + + public static MozillaNode Create(MozillaNode parent, string originalLine) + { + + MozillaNode node = new MozillaNode(); + if (MozillaNode.IsFolderLine(originalLine) || MozillaNode.IsLinkLine(originalLine)) + { + + SetRelationShip(parent, node); + node._line = originalLine; + if (MozillaNode.IsFolderLine(originalLine)) + { + node._nodeType = NodeEnum.Folder; + Match match = FolderRegex.Match(originalLine); + node._name = match.Groups[4].Value; + } + else + { + node._nodeType = NodeEnum.Link; + Match match = LinkRegex.Match(originalLine); + node._href = match.Groups[1].Value; + node._name = match.Groups[2].Value; + if (string.IsNullOrEmpty(node._href) || string.IsNullOrEmpty(node._name)) + { + throw new ArgumentException("_href or _name not set properly"); + } + } + } + return node; + } + + + private MozillaNode() + { + + } + + + public string Name + { + get { return _name; } + } + + + public static MozillaNode Create(string name) + { + MozillaNode node = new MozillaNode(); + node._name = name; + node._href = "root"; + node._line = "root"; + return node; + } + + public override string ToString() + { + const string message = "Href [{0}] Parent [{1}]"; + return string.Format(message, (this._href ?? "<href??>"), (this.Parent == null ? "null" : "Parent")); + } + + public override bool IsValid + { + get + { + bool izNoGood = this.IsLink && string.IsNullOrEmpty(this._href); + return !izNoGood; + } + } +} Added: trunk/plugins/WebBrowser/Node.cs =================================================================== --- trunk/plugins/WebBrowser/Node.cs (rev 0) +++ trunk/plugins/WebBrowser/Node.cs 2007-02-09 15:00:57 UTC (rev 106) @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.Text; + +public abstract class Node : IComparable<Node>, IComparable +{ + protected Node _parent = null; + private List<Node> _children = new List<Node>(); + + private static Comparison<Node> _comparison; + + protected static Comparison<Node> Comparison + { + get { return _comparison; } + set { _comparison = value; } + } + + + public Node() + { + + } + + + public Node Parent + { + get { return _parent; } + } + + private List<Node> Children + { + get { return _children; } + } + + public IEnumerable<Node> GetChildren() + { + foreach (Node node in Children) + { + yield return node; + } + } + + public void Remove(Node node) + { + if (!Children.Contains(node)) + { + const string message = "Node node was not found in child collection. Node {0}."; + throw new ArgumentOutOfRangeException(string.Format(message, ToString())); + } + if (node.HasChildren) + { + throw new ArgumentException("Cannot remove node. Children collection is not empty"); + } + Children.Remove(node); + } + + public void Add(Node node) + { + if (Children.Contains(node)) + { + throw new ArgumentOutOfRangeException("Node node was found in child collection"); + } + Children.Add(node); + } + + public static void SetRelationShip(Node parent, Node child) + { + parent.Add(child); + child._parent = parent; + } + + public static void DeleteRelationShip(Node parent, Node child) + { + parent.Remove(child); + child._parent = null; + } + + #region IComparable<Node> Members + + public int CompareTo(Node other) + { + return Comparison(this, other); + } + + #endregion + + public bool HasChildren { get { return this.Children.Count > 0; } } + + public T Find<T>(Predicate<T> predicate) where T : Node + { + return Find((T)this, predicate); + } + + private T Find<T>(T parent, Predicate<T> predicate) where T : Node + { + foreach (T node in FindAll(parent, predicate)) + { + return node; + } + return null; + } + + public static IEnumerable<T> GetAll<T>(T fromNode) where T : Node + { + foreach (Node child in fromNode.Children) + { + foreach (Node node in GetAll(child)) + { + yield return (T)node; + } + } + yield return fromNode; + } + + private static IEnumerable<T> FindAll<T>(T parent, Predicate<T> predicate) where T : Node + { + foreach (T child in parent.GetChildren()) + { + foreach (T node in FindAll(child, predicate)) + { + yield return node; + } + } + if (predicate(parent)) + { + yield return parent; + } + } + + public IEnumerable<T> FindAll<T>(Predicate<T> predicate) where T : Node + { + return FindAll((T)this, predicate); + } + + + #region IComparable Members + + public int CompareTo(object obj) + { + return this.CompareTo((Node)obj); + } + + public abstract bool IsValid { get; } + + #endregion +} \ No newline at end of file Modified: trunk/plugins/WebBrowser/WebBrowserSetup.Designer.cs =================================================================== --- trunk/plugins/WebBrowser/WebBrowserSetup.Designer.cs 2007-02-07 20:11:58 UTC (rev 105) +++ trunk/plugins/WebBrowser/WebBrowserSetup.Designer.cs 2007-02-09 15:00:57 UTC (rev 106) @@ -62,25 +62,30 @@ this.label1 = new MediaPortal.UserInterface.Controls.MPLabel(); this.HomePage = new MediaPortal.UserInterface.Controls.MPTextBox(); this.label2 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.importFFbtn = new System.Windows.Forms.Button(); + this.importIEbtn = new System.Windows.Forms.Button(); + this.importBookmarkBtn = new System.Windows.Forms.Button(); this.SuspendLayout(); // // Ok // - this.Ok.Location = new System.Drawing.Point(234, 64); + this.Ok.Location = new System.Drawing.Point(315, 67); this.Ok.Name = "Ok"; this.Ok.Size = new System.Drawing.Size(75, 23); this.Ok.TabIndex = 0; this.Ok.Text = "&Ok"; + this.Ok.UseVisualStyleBackColor = true; this.Ok.Click += new System.EventHandler(this.Ok_Click); // // Cancel // this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.Cancel.Location = new System.Drawing.Point(315, 64); + this.Cancel.Location = new System.Drawing.Point(396, 67); this.Cancel.Name = "Cancel"; this.Cancel.Size = new System.Drawing.Size(75, 23); this.Cancel.TabIndex = 1; this.Cancel.Text = "&Cancel"; + this.Cancel.UseVisualStyleBackColor = true; this.Cancel.Click += new System.EventHandler(this.Cancel_Click); // // folderBrowserDialog @@ -94,14 +99,17 @@ this.PickFavoritesFolder.Size = new System.Drawing.Size(75, 23); this.PickFavoritesFolder.TabIndex = 2; this.PickFavoritesFolder.Text = "Browse..."; + this.PickFavoritesFolder.UseVisualStyleBackColor = true; this.PickFavoritesFolder.Click += new System.EventHandler(this.PickFavoritesFolder_Click); // // FavoritesFolder // + this.FavoritesFolder.BorderColor = System.Drawing.Color.Empty; this.FavoritesFolder.Location = new System.Drawing.Point(103, 12); this.FavoritesFolder.Name = "FavoritesFolder"; this.FavoritesFolder.Size = new System.Drawing.Size(206, 20); this.FavoritesFolder.TabIndex = 3; + this.FavoritesFolder.TextChanged += new System.EventHandler(this.FavoritesFolder_TextChanged); // // label1 // @@ -114,6 +122,7 @@ // // HomePage // + this.HomePage.BorderColor = System.Drawing.Color.Empty; this.HomePage.Location = new System.Drawing.Point(103, 38); this.HomePage.Name = "HomePage"; this.HomePage.Size = new System.Drawing.Size(206, 20); @@ -128,10 +137,44 @@ this.label2.TabIndex = 5; this.label2.Text = "Home Page:"; // + // importFFbtn + // + this.importFFbtn.Location = new System.Drawing.Point(315, 38); + this.importFFbtn.Name = "importFFbtn"; + this.importFFbtn.Size = new System.Drawing.Size(75, 23); + this.importFFbtn.TabIndex = 7; + this.importFFbtn.Text = "Use Firefox\'"; + this.importFFbtn.UseVisualStyleBackColor = true; + this.importFFbtn.Click += new System.EventHandler(this.importFFbtn_Click); + // + // importIEbtn + // + this.importIEbtn.Location = new System.Drawing.Point(396, 38); + this.importIEbtn.Name = "importIEbtn"; + this.importIEbtn.Size = new System.Drawing.Size(77, 23); + this.importIEbtn.TabIndex = 8; + this.importIEbtn.Text = "Use IE\'s"; + this.importIEbtn.UseVisualStyleBackColor = true; + this.importIEbtn.Click += new System.EventHandler(this.importIEbtn_Click); + // + // importBookmarkBtn + // + this.importBookmarkBtn.Enabled = false; + this.importBookmarkBtn.Location = new System.Drawing.Point(396, 9); + this.importBookmarkBtn.Name = "importBookmarkBtn"; + this.importBookmarkBtn.Size = new System.Drawing.Size(77, 23); + this.importBookmarkBtn.TabIndex = 9; + this.importBookmarkBtn.Text = "Import..."; + this.importBookmarkBtn.UseVisualStyleBackColor = true; + this.importBookmarkBtn.Click += new System.EventHandler(this.importBookmarkBtn_Click); + // // WebBrowserSetup // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.ClientSize = new System.Drawing.Size(384, 85); + this.ClientSize = new System.Drawing.Size(485, 98); + this.Controls.Add(this.importBookmarkBtn); + this.Controls.Add(this.importIEbtn); + this.Controls.Add(this.importFFbtn); this.Controls.Add(this.HomePage); this.Controls.Add(this.label2); this.Controls.Add(this.label1); @@ -159,5 +202,8 @@ private MediaPortal.UserInterface.Controls.MPLabel label1; private MediaPortal.UserInterface.Controls.MPTextBox HomePage; private MediaPortal.UserInterface.Controls.MPLabel label2; + private System.Windows.Forms.Button importFFbtn; + private System.Windows.Forms.Button importIEbtn; + private System.Windows.Forms.Button importBookmarkBtn; } } \ No newline at end of file Modified: trunk/plugins/WebBrowser/WebBrowserSetup.cs =================================================================== --- trunk/plugins/WebBrowser/WebBrowserSetup.cs 2007-02-07 20:11:58 UTC (rev 105) +++ trunk/plugins/WebBrowser/WebBrowserSetup.cs 2007-02-09 15:00:57 UTC (rev 106) @@ -24,18 +24,26 @@ #endregion using System; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; +using System.Net; +using System.IO; using System.Windows.Forms; using MediaPortal.GUI.Library; +using Microsoft.Win32; namespace MediaPortal.GUI.WebBrowser { public partial class WebBrowserSetup : Form, ISetupForm, IShowPlugin { + private bool doAlwaysAsked = false; + private bool doAlways = false; + private bool alwaysYes = true; + /// <summary> /// Constructor /// </summary> @@ -226,5 +234,377 @@ } } + private void importFFbtn_Click(object sender, EventArgs e) + { + try + { + RegistryKey ffKey = Registry.CurrentUser; + ffKey = ffKey.OpenSubKey(@"Software\Mozilla\Mozilla Firefox\"); + string curVersion = ffKey.GetValue("CurrentVersion").ToString(); + ffKey = ffKey.OpenSubKey(curVersion + @"\Main"); + string installDir = ffKey.GetValue("Install Directory").ToString(); + ffKey.Close(); + + string readLine; + StreamReader streamReader; + streamReader = File.OpenText(installDir + @"browserconfig.properties"); + readLine = streamReader.ReadLine(); + bool found = false; + while (readLine != null) + { + if (readLine.StartsWith("browser.startup.homepage=")) + { + found = true; + break; + } + readLine = streamReader.ReadLine(); + } + streamReader.Close(); + + if (found) + { + HomePage.Text = readLine.Substring(25); + } + else + { + MessageBox.Show("Could not import Firefox homepage"); + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + private void importIEbtn_Click(object sender, EventArgs e) + { + try + { + RegistryKey ffKey = Registry.CurrentUser; + ffKey = ffKey.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main"); + HomePage.Text = ffKey.GetValue("Start Page").ToString(); + ffKey.Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + private void FavoritesFolder_TextChanged(object sender, EventArgs e) + { + importBookmarkBtn.Enabled = (FavoritesFolder.Text != string.Empty); + } + + private void importBookmarkBtn_Click(object sender, EventArgs e) + { + // First of all, verify that the favorites folder is a valid folder + if (Directory.Exists(FavoritesFolder.Text)) + { + // Check if it is Windows Favorites folder + if (FavoritesFolder.Text.Equals(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites), StringComparison.CurrentCultureIgnoreCase)) + { + DialogResult dr = MessageBox.Show(this, "You have selected Windows Favorites folder for bookmarks. Note that bookmark changes made to this directory will affect the list of favorites in your Internet Explorer browser. Continue anyway?", "Are you sure?", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); + if (dr != DialogResult.OK) + { + return; + } + } + + // OK, check if Firefox bookmarks exist + doAlways = false; + doAlwaysAsked = false; + string appData = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + appData += @"\Mozilla\Firefox\Profiles\"; + DirectoryInfo di = new DirectoryInfo(appData); + ArrayList bookmarks = new ArrayList(); + foreach (DirectoryInfo i in di.GetDirectories()) + { + if (File.Exists(i.FullName + @"\bookmarks.html")) + { + bookmarks.Add(i.FullName + @"\bookmarks.html"); + } + } + + bool cancelImport = false; + if (bookmarks.Count > 0) + { + DialogResult dr = MessageBox.Show(this, "Firefox bookmarks found. Import?", "Firefox", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + // Import firefox bookmarks + for (int i = 0; i < bookmarks.Count; i++) + { + importFirefoxBookmarks((string) bookmarks[i]); + } + } + else if (dr == DialogResult.Cancel) + { + cancelImport = true; + } + } + + if (!cancelImport) + { + // Check for explorer bookmarks + if (!FavoritesFolder.Text.Equals(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites), StringComparison.CurrentCultureIgnoreCase)) + { + DialogResult dr = MessageBox.Show(this, "Windows favorites found. Import?", "IE", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + // Import IE bookmarks + doAlways = false; + doAlwaysAsked = false; + importIEBookmarks(System.Environment.GetFolderPath(Environment.SpecialFolder.Favorites)); + } + // No or Cancel means we are done + } + else + { + // No IE bookmarks + if (bookmarks.Count == 0) + { + // No FF bookmarks + MessageBox.Show("Nothing to import!"); + return; + } + } + } + if (cancelImport) + { + MessageBox.Show("Import cancelled!"); + return; + } + MessageBox.Show("Import complete!"); + } + } + + private void importFirefoxBookmarks(string bookmarkFile) + { + string[] masterFileLines = File.ReadAllLines(bookmarkFile); + MozillaFile masterFile = new MozillaFile(masterFileLines); + MozillaNode rootNode = masterFile.GetRoot(); + if (!importFolder(string.Empty, rootNode)) + { + MessageBox.Show("Operation cancelled by user. Some links or folders may have been created already."); + } + } + + /// <summary> + /// Recursive function to import all folders and links that are connected to the input node + /// Exit condition is a node with no subfolders, only links (or no children at all) + /// </summary> + /// <param name="folder"></param> + private bool importFolder(string folderName, MozillaNode folder) + { + if (folder.HasChildren) + { + IEnumerator children = folder.GetChildren().GetEnumerator(); + while (children.MoveNext()) + { + MozillaNode child = (MozillaNode)children.Current; + if (child.IsFolder) + { + if (!importFolder(folderName + "\\" + child.Name, child)) + { + return false; + } + } + else + { + if (!importLink(folderName, child)) + { + return false; + } + } + } + } + return true; + } + + private bool importLink(string folder, MozillaNode link) + { + string bookmarkFolder = FavoritesFolder.Text; + // Create a URL file using the link + if (folder != string.Empty) + { + // Check if the folder exists, else create it + bookmarkFolder += folder; + if (!Directory.Exists(bookmarkFolder)) + { + Directory.CreateDirectory(bookmarkFolder); + } + } + return createURLFile(bookmarkFolder + "\\" + link.Name + ".url", link.Name, link.URL); + } + + private bool createURLFile(string urlFileName, string linkName, string url) + { + bool overwrite = true; + if (File.Exists(urlFileName)) + { + if (!doAlways) + { + DialogResult dr = MessageBox.Show(this, "Link to " + linkName + " already exists, overwrite?", "Already exists", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + overwrite = true; + if (!doAlwaysAsked) + { + DialogResult alwaysRes = MessageBox.Show(this, "Do you always want to overwrite existing links?", "Always", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (alwaysRes == DialogResult.Yes) + { + doAlways = true; + alwaysYes = true; + } + doAlwaysAsked = true; + } + } + else if (dr == DialogResult.No) + { + overwrite = false; + if (!doAlwaysAsked) + { + DialogResult alwaysRes = MessageBox.Show(this, "Do you always want to keep existing links?", "Always", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (alwaysRes == DialogResult.Yes) + { + doAlways = true; + alwaysYes = false; + } + doAlwaysAsked = true; + } + } + else + { + return false; + } + } + else + { + overwrite = alwaysYes; + } + + if (overwrite) + { + try + { + File.Delete(urlFileName); + } + catch (Exception) + { + Log.Info("WebBrowser link import: Could not overwrite link: " + linkName); + return true; + } + } + else + { + return true; + } + } + + try + { + IniFile iniFile = new IniFile(urlFileName); + iniFile.IniWriteValue("InternetShortcut", "URL", url); + } + catch (Exception) + { + Log.Info("WebBrowser link import: Could not create link: " + linkName); + } + return true; + } + + private void importIEBookmarks(string favoritesPath) + { + if (!CopyFolders(favoritesPath, FavoritesFolder.Text)) + { + MessageBox.Show("Operation cancelled by user. Some links or folders may have been created already."); + } + } + + public bool CopyFolders(string source, string destination) + { + DirectoryInfo di = new DirectoryInfo(source); + + if (!CopyFiles(source, destination)) + { + return false; + } + + foreach (DirectoryInfo d in di.GetDirectories()) + { + string newDir = Path.Combine(destination, d.Name); + if (!Directory.Exists(newDir)) + Directory.CreateDirectory(newDir); + + if (!CopyFolders(d.FullName, newDir)) + { + return false; + } + } + return true; + } + + public bool CopyFiles(string source, string destination) + { + DirectoryInfo di = new DirectoryInfo(source); + FileInfo[] files = di.GetFiles(); + + foreach (FileInfo f in files) + { + string sourceFile = f.FullName; + string destFile = Path.Combine(destination, f.Name); + bool overwrite = true; + + if (File.Exists(destFile)) + { + if (!doAlways) + { + DialogResult dr = MessageBox.Show(this, "Link " + f.Name + " already exists, overwrite?", "Already exists", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); + if (dr == DialogResult.Yes) + { + overwrite = true; + if (!doAlwaysAsked) + { + DialogResult alwaysRes = MessageBox.Show(this, "Do you always want to overwrite existing links?", "Always", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (alwaysRes == DialogResult.Yes) + { + doAlways = true; + alwaysYes = true; + } + doAlwaysAsked = true; + } + } + else if (dr == DialogResult.No) + { + overwrite = false; + if (!doAlwaysAsked) + { + DialogResult alwaysRes = MessageBox.Show(this, "Do you always want to keep existing links?", "Always", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (alwaysRes == DialogResult.Yes) + { + doAlways = true; + alwaysYes = false; + } + doAlwaysAsked = true; + } + } + else + { + return false; + } + } + else + { + overwrite = alwaysYes; + } + } + if (overwrite) + { + File.Copy(sourceFile, destFile, overwrite); + } + } + return true; + } } } \ No newline at end of file Modified: trunk/plugins/WebBrowser/WebBrowserSetup.resx =================================================================== --- trunk/plugins/WebBrowser/WebBrowserSetup.resx 2007-02-07 20:11:58 UTC (rev 105) +++ trunk/plugins/WebBrowser/WebBrowserSetup.resx 2007-02-09 15:00:57 UTC (rev 106) @@ -117,33 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="Ok.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="Cancel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="PickFavoritesFolder.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="FavoritesFolder.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="label1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="HomePage.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="label2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <du...@us...> - 2007-02-07 20:12:16
|
Revision: 105 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=105&view=rev Author: dukus Date: 2007-02-07 12:11:58 -0800 (Wed, 07 Feb 2007) Log Message: ----------- Some form changing Modified Paths: -------------- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Form1.cs trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Form2.cs trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj trunk/plugins/mpinstaler/MPInstaler/Program.cs trunk/plugins/mpinstaler/MPInstaler.suo Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-07 19:09:40 UTC (rev 104) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-07 20:11:58 UTC (rev 105) @@ -58,6 +58,7 @@ this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); this.columnHeader4 = new System.Windows.Forms.ColumnHeader(); this.columnHeader5 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader6 = new System.Windows.Forms.ColumnHeader(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripComboBox1 = new System.Windows.Forms.ToolStripMenuItem(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); @@ -68,6 +69,7 @@ this.tabPage_Other = new System.Windows.Forms.TabPage(); this.tabPage_Language = new System.Windows.Forms.TabPage(); this.tabPage_Proiect = new System.Windows.Forms.TabPage(); + this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); @@ -163,7 +165,8 @@ this.addToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.windowPluginToolStripMenuItem, this.skinToolStripMenuItem, - this.languageToolStripMenuItem}); + this.languageToolStripMenuItem, + this.textToolStripMenuItem}); this.addToolStripMenuItem.Name = "addToolStripMenuItem"; this.addToolStripMenuItem.Size = new System.Drawing.Size(38, 20); this.addToolStripMenuItem.Text = "Add"; @@ -228,21 +231,21 @@ // componentToolStripMenuItem // this.componentToolStripMenuItem.Name = "componentToolStripMenuItem"; - this.componentToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.componentToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.componentToolStripMenuItem.Text = "Component"; this.componentToolStripMenuItem.Click += new System.EventHandler(this.componentToolStripMenuItem_Click); // // mediaToolStripMenuItem // this.mediaToolStripMenuItem.Name = "mediaToolStripMenuItem"; - this.mediaToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.mediaToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.mediaToolStripMenuItem.Text = "Media"; this.mediaToolStripMenuItem.Click += new System.EventHandler(this.mediaToolStripMenuItem_Click); // // fullToolStripMenuItem // this.fullToolStripMenuItem.Name = "fullToolStripMenuItem"; - this.fullToolStripMenuItem.Size = new System.Drawing.Size(140, 22); + this.fullToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.fullToolStripMenuItem.Text = "Full"; this.fullToolStripMenuItem.Visible = false; // @@ -264,13 +267,14 @@ this.columnHeader2, this.columnHeader3, this.columnHeader4, - this.columnHeader5}); + this.columnHeader5, + this.columnHeader6}); this.bossview.ContextMenuStrip = this.contextMenuStrip1; this.bossview.FullRowSelect = true; this.bossview.GridLines = true; this.bossview.Location = new System.Drawing.Point(12, 40); this.bossview.Name = "bossview"; - this.bossview.Size = new System.Drawing.Size(663, 227); + this.bossview.Size = new System.Drawing.Size(651, 227); this.bossview.TabIndex = 2; this.bossview.UseCompatibleStateImageBehavior = false; this.bossview.View = System.Windows.Forms.View.Details; @@ -300,6 +304,11 @@ // this.columnHeader5.Text = "Id"; // + // columnHeader6 + // + this.columnHeader6.Text = "Options"; + this.columnHeader6.Width = 89; + // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -386,6 +395,12 @@ this.tabPage_Proiect.Text = "Proiect Properties"; this.tabPage_Proiect.UseVisualStyleBackColor = true; // + // textToolStripMenuItem + // + this.textToolStripMenuItem.Name = "textToolStripMenuItem"; + this.textToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.textToolStripMenuItem.Text = "Text"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -448,6 +463,8 @@ private System.Windows.Forms.TabPage tabPage_Other; private System.Windows.Forms.TabPage tabPage_Language; private System.Windows.Forms.TabPage tabPage_Proiect; + private System.Windows.Forms.ColumnHeader columnHeader6; + private System.Windows.Forms.ToolStripMenuItem textToolStripMenuItem; } } Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-07 19:09:40 UTC (rev 104) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-07 20:11:58 UTC (rev 105) @@ -90,9 +90,9 @@ foreach (string fil in openFileDialog1.FileNames) switch (type) { - case 1: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_TYPE, MPinstalerStruct.SKIN_XML_SUBTYPE, Path.GetFullPath(fil), "02010"); + case 1: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_TYPE, MPinstalerStruct.SKIN_XML_SUBTYPE, Path.GetFullPath(fil), "02010",""); break; - case 2: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_MEDIA_TYPE, MPinstalerStruct.SKIN_XML_SUBTYPE, Path.GetFullPath(fil), "02020"); + case 2: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_MEDIA_TYPE, MPinstalerStruct.SKIN_XML_SUBTYPE, Path.GetFullPath(fil), "02020",""); break; default: break; @@ -127,9 +127,19 @@ item1.SubItems.Add(subtype); item1.SubItems.Add(path); item1.SubItems.Add(id); + item1.SubItems.Add(""); bossview.Items.AddRange(new ListViewItem[] { item1 }); } - + private void addrow(string file, string type, string subtype, string path, string id, string op) + { + ListViewItem item1 = new ListViewItem(file, 0); + item1.SubItems.Add(type); + item1.SubItems.Add(subtype); + item1.SubItems.Add(path); + item1.SubItems.Add(id); + item1.SubItems.Add(op); + bossview.Items.AddRange(new ListViewItem[] { item1 }); + } private void openProiectToolStripMenuItem_Click(object sender, EventArgs e) { string fil; @@ -228,6 +238,7 @@ writer.WriteElementString("SubType", it.SubType); writer.WriteElementString("Source", Path.GetFullPath(it.FileName)); writer.WriteElementString("Id", it.ID); + writer.WriteElementString("Option", it.Option); writer.WriteEndElement(); st = st + bossview.Items[i].SubItems[3].Text + @"\" + bossview.Items[i].Text + ";"; } Modified: trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs 2007-02-07 19:09:40 UTC (rev 104) +++ trunk/plugins/mpinstaler/MPInstaler/Form2.Designer.cs 2007-02-07 20:11:58 UTC (rev 105) @@ -28,97 +28,98 @@ /// </summary> private void InitializeComponent() { - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.listView1 = new System.Windows.Forms.ListView(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(80, 289); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(65, 23); - this.button1.TabIndex = 0; - this.button1.Text = "Add"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(186, 289); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 1; - this.button2.Text = "Remove"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // comboBox1 - // - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Location = new System.Drawing.Point(12, 22); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(372, 21); - this.comboBox1.TabIndex = 2; - // - // listView1 - // - this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.languageComboBox = new System.Windows.Forms.ComboBox(); + this.listView1 = new System.Windows.Forms.ListView(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(80, 289); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(65, 23); + this.button1.TabIndex = 0; + this.button1.Text = "Add"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(186, 289); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 1; + this.button2.Text = "Remove"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // languageComboBox + // + this.languageComboBox.FormattingEnabled = true; + this.languageComboBox.Location = new System.Drawing.Point(12, 22); + this.languageComboBox.Name = "languageComboBox"; + this.languageComboBox.Size = new System.Drawing.Size(372, 21); + this.languageComboBox.TabIndex = 2; + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2}); - this.listView1.FullRowSelect = true; - this.listView1.GridLines = true; - this.listView1.Location = new System.Drawing.Point(12, 68); - this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(372, 179); - this.listView1.TabIndex = 3; - this.listView1.UseCompatibleStateImageBehavior = false; - this.listView1.View = System.Windows.Forms.View.Details; - this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); - // - // columnHeader1 - // - this.columnHeader1.Text = "Id"; - // - // columnHeader2 - // - this.columnHeader2.Text = "Value"; - this.columnHeader2.Width = 308; - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(12, 253); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(62, 20); - this.textBox1.TabIndex = 4; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(80, 253); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(304, 20); - this.textBox2.TabIndex = 5; - // - // Form2 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(396, 333); - this.Controls.Add(this.textBox2); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.listView1); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Name = "Form2"; - this.Text = "String Editor"; - this.ResumeLayout(false); - this.PerformLayout(); + this.listView1.FullRowSelect = true; + this.listView1.GridLines = true; + this.listView1.Location = new System.Drawing.Point(12, 68); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(372, 179); + this.listView1.TabIndex = 3; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); + // + // columnHeader1 + // + this.columnHeader1.Text = "Id"; + // + // columnHeader2 + // + this.columnHeader2.Text = "Value"; + this.columnHeader2.Width = 308; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(12, 253); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(62, 20); + this.textBox1.TabIndex = 4; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(80, 253); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(304, 20); + this.textBox2.TabIndex = 5; + // + // Form2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(396, 333); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.listView1); + this.Controls.Add(this.languageComboBox); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Name = "Form2"; + this.Text = "String Editor"; + this.Load += new System.EventHandler(this.Form2_Load); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -126,7 +127,7 @@ private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; - private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.ComboBox languageComboBox; private System.Windows.Forms.ListView listView1; private System.Windows.Forms.ColumnHeader columnHeader1; private System.Windows.Forms.ColumnHeader columnHeader2; Modified: trunk/plugins/mpinstaler/MPInstaler/Form2.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form2.cs 2007-02-07 19:09:40 UTC (rev 104) +++ trunk/plugins/mpinstaler/MPInstaler/Form2.cs 2007-02-07 20:11:58 UTC (rev 105) @@ -5,12 +5,14 @@ using System.Drawing; using System.Text; using System.Windows.Forms; +using System.IO; namespace MPInstaler { public partial class Form2 : Form { - public Form2() + string LanguageDirectory = ""; + public Form2() { InitializeComponent(); } @@ -35,5 +37,30 @@ listView1.Items.RemoveAt(index); } } + + private void Form2_Load(object sender, EventArgs e) + { + if (Directory.Exists(LanguageDirectory)) + { + string[] folders = Directory.GetDirectories(LanguageDirectory, "*.*"); + + foreach (string folder in folders) + { + string fileName = folder.Substring(folder.LastIndexOf(@"\") + 1); + + // + // Exclude cvs folder + // + if (fileName.ToLower() != "cvs") + { + if (fileName.Length > 0) + { + fileName = fileName.Substring(0, 1).ToUpper() + fileName.Substring(1); + languageComboBox.Items.Add(fileName); + } + } + } + } + } } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-07 19:09:40 UTC (rev 104) +++ trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-07 20:11:58 UTC (rev 105) @@ -46,6 +46,10 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="Core, Version=1.0.2587.35999, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>D:\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + </Reference> <Reference Include="ICSharpCode.SharpZipLib, Version=0.84.0.0, Culture=neutral, PublicKeyToken=1b03e6acf1164f73"> <SpecificVersion>False</SpecificVersion> <HintPath>D:\Program Files\Team MediaPortal\MediaPortal\ICSharpCode.SharpZipLib.DLL</HintPath> @@ -110,6 +114,10 @@ <SubType>Designer</SubType> <DependentUpon>SkinSelect.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="start_form.resx"> + <SubType>Designer</SubType> + <DependentUpon>start_form.cs</DependentUpon> + </EmbeddedResource> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> @@ -131,6 +139,12 @@ <Compile Include="SkinSelect.Designer.cs"> <DependentUpon>SkinSelect.cs</DependentUpon> </Compile> + <Compile Include="start_form.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="start_form.Designer.cs"> + <DependentUpon>start_form.cs</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> Modified: trunk/plugins/mpinstaler/MPInstaler/Program.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Program.cs 2007-02-07 19:09:40 UTC (rev 104) +++ trunk/plugins/mpinstaler/MPInstaler/Program.cs 2007-02-07 20:11:58 UTC (rev 105) @@ -14,7 +14,7 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new start_form()); } } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-07 19:09:47
|
Revision: 104 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=104&view=rev Author: overture Date: 2007-02-07 11:09:40 -0800 (Wed, 07 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/WWMP/Skins/ trunk/plugins/WWMP/Skins/mce/ trunk/plugins/WWMP/Skins/mce/WWMPIPTV.xml trunk/plugins/WWMP/XML/ trunk/plugins/WWMP/XML/MyIPTVsettings.xml Added: trunk/plugins/WWMP/Skins/mce/WWMPIPTV.xml =================================================================== --- trunk/plugins/WWMP/Skins/mce/WWMPIPTV.xml (rev 0) +++ trunk/plugins/WWMP/Skins/mce/WWMPIPTV.xml 2007-02-07 19:09:40 UTC (rev 104) @@ -0,0 +1,56 @@ +<window> + <id>5699</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <control> + <description>BackGround</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>720</width> + <height>576</height> + <texture>background.png</texture> + </control> + <control> + <description>an Image</description> + <type>image</type> + <id>1</id> + <posX>75</posX> + <posY>370</posY> + <texture>hover_my tv.png</texture> + </control> + <control> + <description>text label</description> + <type>label</type> + <id>1</id> + <posX>250</posX> + <posY>70</posY> + <label>WorldWideMediaProject</label> + <font>font16</font> + <align>right</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Categories</description> + <type>listcontrol</type> + <id>10</id> + <posX>300</posX> + <posY>150</posY> + <width>340</width> + <height>300</height> + <textXOff>10</textXOff> + <textYOff>2</textYOff> + <textXOff2>320</textXOff2> + <textYOff2>2</textYOff2> + <spaceBetweenItems>5</spaceBetweenItems> + <textureHeight>25</textureHeight> + <keepaspectratio>no</keepaspectratio> + <font2>font10</font2> + <font3>font10</font3> + <onleft>4</onleft> + <onright>4</onright> + </control> + </controls> +</window> Added: trunk/plugins/WWMP/XML/MyIPTVsettings.xml =================================================================== --- trunk/plugins/WWMP/XML/MyIPTVsettings.xml (rev 0) +++ trunk/plugins/WWMP/XML/MyIPTVsettings.xml 2007-02-07 19:09:40 UTC (rev 104) @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<settings> + <worldwidemediaproject> + <siteuser></siteuser> + <sitepassword></sitepassword> + <playlisturl></playlisturl> + </worldwidemediaproject> + <proxydetails> + <useproxy>True</useproxy> + <usedefaultproxy>True</usedefaultproxy> + <proxyuser> + </proxyuser> + <proxypassword> + </proxypassword> + <proxyipaddress></proxyipaddress> + <proxyport></proxyport> + </proxydetails> +</settings> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-07 19:08:48
|
Revision: 103 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=103&view=rev Author: overture Date: 2007-02-07 11:08:38 -0800 (Wed, 07 Feb 2007) Log Message: ----------- Removed Paths: ------------- trunk/plugins/WWMP/mce/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-07 19:07:14
|
Revision: 102 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=102&view=rev Author: overture Date: 2007-02-07 11:07:11 -0800 (Wed, 07 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/WWMP/MyIPTVsettings.xml Added: trunk/plugins/WWMP/MyIPTVsettings.xml =================================================================== --- trunk/plugins/WWMP/MyIPTVsettings.xml (rev 0) +++ trunk/plugins/WWMP/MyIPTVsettings.xml 2007-02-07 19:07:11 UTC (rev 102) @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<settings> + <worldwidemediaproject> + <siteuser></siteuser> + <sitepassword></sitepassword> + <playlisturl></playlisturl> + </worldwidemediaproject> + <proxydetails> + <useproxy>True</useproxy> + <usedefaultproxy>True</usedefaultproxy> + <proxyuser> + </proxyuser> + <proxypassword> + </proxypassword> + <proxyipaddress></proxyipaddress> + <proxyport></proxyport> + </proxydetails> +</settings> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-07 19:06:33
|
Revision: 101 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=101&view=rev Author: overture Date: 2007-02-07 11:06:31 -0800 (Wed, 07 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/WWMP/mce/ trunk/plugins/WWMP/mce/WWMPIPTV.xml Added: trunk/plugins/WWMP/mce/WWMPIPTV.xml =================================================================== --- trunk/plugins/WWMP/mce/WWMPIPTV.xml (rev 0) +++ trunk/plugins/WWMP/mce/WWMPIPTV.xml 2007-02-07 19:06:31 UTC (rev 101) @@ -0,0 +1,56 @@ +<window> + <id>5699</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <control> + <description>BackGround</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>720</width> + <height>576</height> + <texture>background.png</texture> + </control> + <control> + <description>an Image</description> + <type>image</type> + <id>1</id> + <posX>75</posX> + <posY>370</posY> + <texture>hover_my tv.png</texture> + </control> + <control> + <description>text label</description> + <type>label</type> + <id>1</id> + <posX>250</posX> + <posY>70</posY> + <label>WorldWideMediaProject</label> + <font>font16</font> + <align>right</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Categories</description> + <type>listcontrol</type> + <id>10</id> + <posX>300</posX> + <posY>150</posY> + <width>340</width> + <height>300</height> + <textXOff>10</textXOff> + <textYOff>2</textYOff> + <textXOff2>320</textXOff2> + <textYOff2>2</textYOff2> + <spaceBetweenItems>5</spaceBetweenItems> + <textureHeight>25</textureHeight> + <keepaspectratio>no</keepaspectratio> + <font2>font10</font2> + <font3>font10</font3> + <onleft>4</onleft> + <onright>4</onright> + </control> + </controls> +</window> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-07 18:42:02
|
Revision: 100 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=100&view=rev Author: overture Date: 2007-02-07 10:41:45 -0800 (Wed, 07 Feb 2007) Log Message: ----------- Removed Paths: ------------- trunk/plugins/WWMP/bin/ trunk/plugins/WWMP/obj/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-02-07 11:28:55
|
Revision: 99 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=99&view=rev Author: chef_koch Date: 2007-02-07 03:28:52 -0800 (Wed, 07 Feb 2007) Log Message: ----------- increased version number to 0.2e improved behavior when adding new caller to phone book Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBoxSetupFrom.cs Modified: trunk/plugins/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox.cs 2007-02-06 21:49:35 UTC (rev 98) +++ trunk/plugins/FritzBox/FritzBox.cs 2007-02-07 11:28:52 UTC (rev 99) @@ -75,7 +75,7 @@ #region public Variables - public const string _version = "0.2e"; + public const string _version = "0.2f"; public static bool _extensiveLogging = false; // phonebook settings Modified: trunk/plugins/FritzBox/FritzBoxSetupFrom.cs =================================================================== --- trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-06 21:49:35 UTC (rev 98) +++ trunk/plugins/FritzBox/FritzBoxSetupFrom.cs 2007-02-07 11:28:52 UTC (rev 99) @@ -956,6 +956,12 @@ if (dataGridView.Rows[dataGridView.NewRowIndex].Selected) { dataGridView.Rows.Add(textBoxCallerId.Text, textBoxCallerName.Text, checkBoxCallerShow.Checked); + + textBoxCallerId.Text = ""; + textBoxCallerName.Text = ""; + checkBoxCallerShow.Checked = false; + + textBoxCallerId.Focus(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-06 21:49:44
|
Revision: 98 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=98&view=rev Author: overture Date: 2007-02-06 13:49:35 -0800 (Tue, 06 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/WWMP/ trunk/plugins/WWMP/AssemblyInfo.cs trunk/plugins/WWMP/MyIPTVsetup.cs trunk/plugins/WWMP/MyIPTVsetup.resx trunk/plugins/WWMP/WWMP.csproj trunk/plugins/WWMP/WWMP.sln trunk/plugins/WWMP/WWMPgui.cs trunk/plugins/WWMP/WWMPworker.cs trunk/plugins/WWMP/bin/ trunk/plugins/WWMP/bin/Debug/ trunk/plugins/WWMP/bin/Debug/AxInterop.WMPLib.dll trunk/plugins/WWMP/bin/Debug/Core.DLL trunk/plugins/WWMP/bin/Debug/Dialogs.DLL trunk/plugins/WWMP/bin/Debug/DirectShowLib.dll trunk/plugins/WWMP/bin/Debug/ICSharpCode.SharpZipLib.dll trunk/plugins/WWMP/bin/Debug/Interop.WMPLib.dll trunk/plugins/WWMP/bin/Debug/MediaPortal.Support.dll trunk/plugins/WWMP/bin/Debug/WWMP.dll trunk/plugins/WWMP/bin/Debug/WWMP.pdb trunk/plugins/WWMP/bin/Debug/edtftpnet-1.2.2.dll trunk/plugins/WWMP/bin/Release/ trunk/plugins/WWMP/bin/Release/AxInterop.WMPLib.dll trunk/plugins/WWMP/bin/Release/Core.DLL trunk/plugins/WWMP/bin/Release/Dialogs.DLL trunk/plugins/WWMP/bin/Release/DirectShowLib.dll trunk/plugins/WWMP/bin/Release/ICSharpCode.SharpZipLib.dll trunk/plugins/WWMP/bin/Release/Interop.WMPLib.dll trunk/plugins/WWMP/bin/Release/MediaPortal.Support.dll trunk/plugins/WWMP/bin/Release/WWMP.dll trunk/plugins/WWMP/bin/Release/edtftpnet-1.2.2.dll trunk/plugins/WWMP/obj/ trunk/plugins/WWMP/obj/Debug/ trunk/plugins/WWMP/obj/Debug/MePoTrial.csproj.GenerateResource.Cache trunk/plugins/WWMP/obj/Debug/MePoTrial.dll trunk/plugins/WWMP/obj/Debug/MePoTrial.pdb trunk/plugins/WWMP/obj/Debug/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources trunk/plugins/WWMP/obj/Debug/WWMP.csproj.GenerateResource.Cache trunk/plugins/WWMP/obj/Debug/WWMP.dll trunk/plugins/WWMP/obj/Debug/WWMP.pdb trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt trunk/plugins/WWMP/obj/Release/ trunk/plugins/WWMP/obj/Release/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources trunk/plugins/WWMP/obj/Release/WWMP.csproj.GenerateResource.Cache trunk/plugins/WWMP/obj/Release/WWMP.dll trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt Added: trunk/plugins/WWMP/AssemblyInfo.cs =================================================================== --- trunk/plugins/WWMP/AssemblyInfo.cs (rev 0) +++ trunk/plugins/WWMP/AssemblyInfo.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] + Added: trunk/plugins/WWMP/MyIPTVsetup.cs =================================================================== --- trunk/plugins/WWMP/MyIPTVsetup.cs (rev 0) +++ trunk/plugins/WWMP/MyIPTVsetup.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,397 @@ +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Xml; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.WorldWideMediaProject +{ + /// <summary> + /// Description of MyIPTVsetup. + /// </summary> + public class MyIPTVsetup : System.Windows.Forms.Form + { + private System.ComponentModel.Container components = null; + private string sPath; + + public MyIPTVsetup() + { + InitializeComponent(); + string sFilePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; + sPath = sFilePath.Substring(0,sFilePath.LastIndexOf(@"\")); + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Forms Designer generated code + /// <summary> + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// </summary> + private void InitializeComponent() + { + this.grpBoxUserInfo = new System.Windows.Forms.GroupBox(); + this.txtURL = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.grpBoxConnectInfo = new System.Windows.Forms.GroupBox(); + this.chkBoxUseDefaultProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyPort = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txtProxyIPAddress = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txtProxyPass = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.chkBoxUseProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyUser = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.grpBoxUserInfo.SuspendLayout(); + this.grpBoxConnectInfo.SuspendLayout(); + this.SuspendLayout(); + // + // grpBoxUserInfo + // + this.grpBoxUserInfo.Controls.Add(this.txtURL); + this.grpBoxUserInfo.Controls.Add(this.label3); + this.grpBoxUserInfo.Location = new System.Drawing.Point(12, 12); + this.grpBoxUserInfo.Name = "grpBoxUserInfo"; + this.grpBoxUserInfo.Size = new System.Drawing.Size(660, 55); + this.grpBoxUserInfo.TabIndex = 0; + this.grpBoxUserInfo.TabStop = false; + this.grpBoxUserInfo.Text = "worldwidemediaproject.com User Information"; + this.grpBoxUserInfo.UseCompatibleTextRendering = true; + // + // txtURL + // + this.txtURL.Location = new System.Drawing.Point(139, 19); + this.txtURL.Name = "txtURL"; + this.txtURL.Size = new System.Drawing.Size(473, 20); + this.txtURL.TabIndex = 5; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(33, 16); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 23); + this.label3.TabIndex = 4; + this.label3.Text = "URL Link"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label3.UseCompatibleTextRendering = true; + // + // grpBoxConnectInfo + // + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseDefaultProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPort); + this.grpBoxConnectInfo.Controls.Add(this.label7); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyIPAddress); + this.grpBoxConnectInfo.Controls.Add(this.label6); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPass); + this.grpBoxConnectInfo.Controls.Add(this.label5); + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyUser); + this.grpBoxConnectInfo.Controls.Add(this.label4); + this.grpBoxConnectInfo.Location = new System.Drawing.Point(12, 73); + this.grpBoxConnectInfo.Name = "grpBoxConnectInfo"; + this.grpBoxConnectInfo.Size = new System.Drawing.Size(660, 170); + this.grpBoxConnectInfo.TabIndex = 1; + this.grpBoxConnectInfo.TabStop = false; + this.grpBoxConnectInfo.Text = "Internet Connection Information"; + this.grpBoxConnectInfo.UseCompatibleTextRendering = true; + // + // chkBoxUseDefaultProxy + // + this.chkBoxUseDefaultProxy.Enabled = false; + this.chkBoxUseDefaultProxy.Location = new System.Drawing.Point(69, 64); + this.chkBoxUseDefaultProxy.Name = "chkBoxUseDefaultProxy"; + this.chkBoxUseDefaultProxy.Size = new System.Drawing.Size(242, 24); + this.chkBoxUseDefaultProxy.TabIndex = 9; + this.chkBoxUseDefaultProxy.Text = "Use Default Proxy Authentication?"; + this.chkBoxUseDefaultProxy.UseCompatibleTextRendering = true; + this.chkBoxUseDefaultProxy.UseVisualStyleBackColor = true; + this.chkBoxUseDefaultProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseDefaultProxyCheckedChanged); + // + // txtProxyPort + // + this.txtProxyPort.Enabled = false; + this.txtProxyPort.Location = new System.Drawing.Point(490, 120); + this.txtProxyPort.Name = "txtProxyPort"; + this.txtProxyPort.Size = new System.Drawing.Size(49, 20); + this.txtProxyPort.TabIndex = 8; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(384, 120); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(100, 23); + this.label7.TabIndex = 7; + this.label7.Text = "Port"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label7.UseCompatibleTextRendering = true; + // + // txtProxyIPAddress + // + this.txtProxyIPAddress.Enabled = false; + this.txtProxyIPAddress.Location = new System.Drawing.Point(490, 94); + this.txtProxyIPAddress.Name = "txtProxyIPAddress"; + this.txtProxyIPAddress.Size = new System.Drawing.Size(100, 20); + this.txtProxyIPAddress.TabIndex = 6; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(384, 94); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 23); + this.label6.TabIndex = 5; + this.label6.Text = "IP Address"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label6.UseCompatibleTextRendering = true; + // + // txtProxyPass + // + this.txtProxyPass.Enabled = false; + this.txtProxyPass.Location = new System.Drawing.Point(175, 120); + this.txtProxyPass.Name = "txtProxyPass"; + this.txtProxyPass.Size = new System.Drawing.Size(100, 20); + this.txtProxyPass.TabIndex = 4; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(69, 120); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 23); + this.label5.TabIndex = 3; + this.label5.Text = "Password"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label5.UseCompatibleTextRendering = true; + // + // chkBoxUseProxy + // + this.chkBoxUseProxy.Location = new System.Drawing.Point(33, 28); + this.chkBoxUseProxy.Name = "chkBoxUseProxy"; + this.chkBoxUseProxy.Size = new System.Drawing.Size(136, 24); + this.chkBoxUseProxy.TabIndex = 2; + this.chkBoxUseProxy.Text = "Use a Proxy Server?"; + this.chkBoxUseProxy.UseCompatibleTextRendering = true; + this.chkBoxUseProxy.UseVisualStyleBackColor = true; + this.chkBoxUseProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseProxyCheckedChanged); + // + // txtProxyUser + // + this.txtProxyUser.Enabled = false; + this.txtProxyUser.Location = new System.Drawing.Point(175, 94); + this.txtProxyUser.Name = "txtProxyUser"; + this.txtProxyUser.Size = new System.Drawing.Size(100, 20); + this.txtProxyUser.TabIndex = 1; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(69, 94); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 23); + this.label4.TabIndex = 0; + this.label4.Text = "Username"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label4.UseCompatibleTextRendering = true; + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(518, 249); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 25); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnCancel.UseCompatibleTextRendering = true; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(599, 249); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 25); + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnOK.UseCompatibleTextRendering = true; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.BtnOKClick); + // + // MyIPTVsetup + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(686, 277); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.grpBoxConnectInfo); + this.Controls.Add(this.grpBoxUserInfo); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "MyIPTVsetup"; + this.Text = "MyIPTVsetup"; + this.Load += new System.EventHandler(this.MyIPTVsetupLoad); + this.grpBoxUserInfo.ResumeLayout(false); + this.grpBoxUserInfo.PerformLayout(); + this.grpBoxConnectInfo.ResumeLayout(false); + this.grpBoxConnectInfo.PerformLayout(); + this.ResumeLayout(false); + } + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtProxyUser; + private System.Windows.Forms.CheckBox chkBoxUseProxy; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtProxyPass; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtProxyIPAddress; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txtProxyPort; + private System.Windows.Forms.CheckBox chkBoxUseDefaultProxy; + private System.Windows.Forms.GroupBox grpBoxConnectInfo; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtURL; + private System.Windows.Forms.GroupBox grpBoxUserInfo; + #endregion + + + + void ChkBoxUseProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseProxy.Checked==true) + { + chkBoxUseDefaultProxy.Checked = true; + chkBoxUseDefaultProxy.Enabled = true; + txtProxyIPAddress.Enabled = true; + txtProxyPort.Enabled = true; + } + else + { + chkBoxUseDefaultProxy.Checked = false; + chkBoxUseDefaultProxy.Enabled = false; + txtProxyIPAddress.Enabled = false; + txtProxyPort.Enabled = false; + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + + } + + void ChkBoxUseDefaultProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseDefaultProxy.Checked==false) + { + txtProxyUser.Enabled = true; + txtProxyPass.Enabled = true; + } + else + { + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + } + + void MyIPTVsetupLoad(object sender, System.EventArgs e) + { + XmlDocument xmld = new XmlDocument(); + xmld.Load(this.sPath + @"\myiptvsettings.xml"); + + // Load Proxy Details from XML file + chkBoxUseProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/useproxy").InnerText); + chkBoxUseDefaultProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy").InnerText); + txtProxyUser.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyuser").InnerText; + txtProxyPass.Text = xmld.SelectSingleNode("/settings/proxydetails/proxypassword").InnerText; + txtProxyIPAddress.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress").InnerText; + txtProxyPort.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyport").InnerText; + + // Load worldwidemediaproject.com Details from XML file + txtURL.Text = xmld.SelectSingleNode("/settings/worldwidemediaproject/playlisturl").InnerText; + } + + void BtnOKClick(object sender, System.EventArgs e) + { + XmlNode nchkBoxUseProxyNode; + XmlNode nchkBoxUseDefaultProxyNode; + XmlNode ntxtProxyUserNode; + XmlNode ntxtProxyPassNode; + XmlNode ntxtProxyIPAddressNode; + XmlNode ntxtProxyPortNode; + + XmlNode ntxtSiteUserNode; + XmlNode ntxtSitePassNode; + XmlNode ntxtURLNode; + + XmlDocument xmld = new XmlDocument(); + xmld.Load(sPath + @"\myiptvsettings.xml"); + + nchkBoxUseProxyNode = xmld.SelectSingleNode("/settings/proxydetails/useproxy"); + nchkBoxUseDefaultProxyNode = xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy"); + ntxtProxyUserNode = xmld.SelectSingleNode("/settings/proxydetails/proxyuser"); + ntxtProxyPassNode = xmld.SelectSingleNode("/settings/proxydetails/proxypassword"); + ntxtProxyIPAddressNode = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress"); + ntxtProxyPortNode = xmld.SelectSingleNode("/settings/proxydetails/proxyport"); + + ntxtSiteUserNode = xmld.SelectSingleNode("/settings/worldwidemediaproject/siteuser"); + ntxtSitePassNode = xmld.SelectSingleNode("/settings/worldwidemediaproject/sitepassword"); + ntxtURLNode = xmld.SelectSingleNode("/settings/worldwidemediaproject/playlisturl"); + + nchkBoxUseProxyNode.InnerText = chkBoxUseProxy.Checked.ToString(); + nchkBoxUseDefaultProxyNode.InnerText = chkBoxUseDefaultProxy.Checked.ToString(); + ntxtProxyUserNode.InnerText = txtProxyUser.Text; + ntxtProxyPassNode.InnerText = txtProxyPass.Text; + ntxtProxyIPAddressNode.InnerText = txtProxyIPAddress.Text; + ntxtProxyPortNode.InnerText = txtProxyPort.Text; + + ntxtURLNode.InnerText = txtURL.Text; + + xmld.Save(sPath + @"\myiptvsettings.xml"); + this.Close(); + } + + void BtnCancelClick(object sender, System.EventArgs e) + { + this.Close(); + } + } + +} Added: trunk/plugins/WWMP/MyIPTVsetup.resx =================================================================== --- trunk/plugins/WWMP/MyIPTVsetup.resx (rev 0) +++ trunk/plugins/WWMP/MyIPTVsetup.resx 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/WWMP/WWMP.csproj =================================================================== --- trunk/plugins/WWMP/WWMP.csproj (rev 0) +++ trunk/plugins/WWMP/WWMP.csproj 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,50 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <OutputType>Library</OutputType> + <RootNamespace>MePoTrial</RootNamespace> + <AssemblyName>WWMP</AssemblyName> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{D1A42628-DA12-4AAB-8AD3-408C080F625F}</ProjectGuid> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> + <OutputPath>bin\Debug\</OutputPath> + <Optimize>False</Optimize> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugSymbols>True</DebugSymbols> + <DebugType>Full</DebugType> + <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>True</Optimize> + <DefineConstants>TRACE</DefineConstants> + <DebugSymbols>False</DebugSymbols> + <DebugType>None</DebugType> + <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core"> + <HintPath>..\..\PROGRAM FILES\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="Dialogs"> + <HintPath>..\..\PROGRAM FILES\Team MediaPortal\MediaPortal\plugins\windows\Dialogs.DLL</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + </ItemGroup> + <ItemGroup> + <Compile Include="WWMPgui.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="WWMPworker.cs" /> + <Compile Include="MyIPTVsetup.cs" /> + <EmbeddedResource Include="MyIPTVsetup.resx"> + <DependentUpon>MyIPTVsetup.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> +</Project> \ No newline at end of file Added: trunk/plugins/WWMP/WWMP.sln =================================================================== --- trunk/plugins/WWMP/WWMP.sln (rev 0) +++ trunk/plugins/WWMP/WWMP.sln 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,16 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# SharpDevelop 2.0.0.922 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WWMP", "WWMP.csproj", "{D1A42628-DA12-4AAB-8AD3-408C080F625F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Release|Any CPU.Build.0 = Release|Any CPU + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal Added: trunk/plugins/WWMP/WWMPgui.cs =================================================================== --- trunk/plugins/WWMP/WWMPgui.cs (rev 0) +++ trunk/plugins/WWMP/WWMPgui.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,162 @@ +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Windows.Forms; +using System.Text.RegularExpressions; +using System.IO; +using System.Drawing; +using System.Collections; +using System.Collections.Specialized; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; + +namespace MediaPortal.GUI.WorldWideMediaProject +{ + /// <summary> + /// Summary description for Class1. + /// </summary> + public class WWMPgui : GUIWindow, ISetupForm + { + [SkinControlAttribute(10)] + protected GUIListControl listBox = null; + private StringCollection Categories = new StringCollection(); + private StringCollection Channels = new StringCollection(); + private WWMPworker wwmpWorker; + + public WWMPgui() + { + this.wwmpWorker = new WWMPworker(); + } + + public override int GetID + { + get { return 5699; } + set + { + base.GetID = value; + } + } + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin+@"\WWMPIPTV.xml"); + } + + protected override void OnPageLoad() + { + this.wwmpWorker.InitialLoad(); + this.Categories = this.wwmpWorker.GetCategoryList(listBox); + this.listBox.Focus = true; + base.OnPageLoad(); + } + + protected override void OnClicked(int controlId, GUIControl control,Action.ActionType actionType) + { + if (control == listBox) + { + if(wwmpWorker.ShowCategories==true) + { + string sSelectedCategroyName = this.Categories[listBox.SelectedListItemIndex]; + this.Channels = wwmpWorker.GetChannelList(sSelectedCategroyName,listBox); + } + else if(wwmpWorker.ShowChannels==true) + { + string sSelectedChannelName = this.Channels[listBox.SelectedListItemIndex]; + wwmpWorker.PlayChannel(sSelectedChannelName); + } + } + base.OnClicked(controlId, control, actionType); + } + + public override void OnAction(Action action) + { + switch (action.wID) + { + case Action.ActionType.ACTION_PREVIOUS_MENU: + { + GUIWindowManager.ShowPreviousWindow(); + return; + } + } + base.OnAction(action); + } + + #region ISetupForm Members + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Plugin for viewing Internet TV"; + } + + public bool DefaultEnabled() + { + return true; + } + + public int GetWindowId() + { + return 5699; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText=PluginName(); + strButtonImage=String.Empty; + strButtonImageFocus=String.Empty; + strPictureImage=String.Empty; + return true; + } + + public string Author() + { + return "overture"; + } + + public string PluginName() + { + return "WWMP IPTV"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + MyIPTVsetup myiptvSetup = new MyIPTVsetup(); + myiptvSetup.ShowDialog(); + myiptvSetup.Dispose(); + } + + #endregion + } +} Added: trunk/plugins/WWMP/WWMPworker.cs =================================================================== --- trunk/plugins/WWMP/WWMPworker.cs (rev 0) +++ trunk/plugins/WWMP/WWMPworker.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,241 @@ +using System; +using System.Windows.Forms; +using System.Text.RegularExpressions; +using System.IO; +using System.Drawing; +using System.Net; +using System.Collections; +using System.Collections.Specialized; +using System.Text; +using System.Xml; +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Player; + +namespace MediaPortal.GUI.WorldWideMediaProject +{ + /// <summary> + /// Description of MyIPTVworker. + /// </summary> + public class WWMPworker : StreamBufferPlayer9 + { + private MatchCollection mc; + private string sPath; + private bool bShowCategories = false; + private bool bShowChannels = false; + + public WWMPworker() + { + string sFilePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; + sPath = sFilePath.Substring(0,sFilePath.LastIndexOf(@"\")); + } + + internal bool ShowCategories + { + get + { + return bShowCategories; + } + set + { + bShowCategories = value; + } + } + + internal bool ShowChannels + { + get + { + return bShowChannels; + } + set + { + bShowChannels = value; + } + } + + + internal void InitialLoad() + { + XmlDocument xmld = new XmlDocument(); + xmld.Load(sPath + @"\myiptvsettings.xml"); + bool bUseProxy = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/useproxy").InnerText); + bool bUseDefault = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy").InnerText); + string sPlaylistURL = xmld.SelectSingleNode("/settings/worldwidemediaproject/playlisturl").InnerText; + string sProxyUser = xmld.SelectSingleNode("/settings/proxydetails/proxyuser").InnerText; + string sProxyPass = xmld.SelectSingleNode("/settings/proxydetails/proxypassword").InnerText; + string sProxyIPAdd = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress").InnerText; + string sProxyPort = xmld.SelectSingleNode("/settings/proxydetails/proxyport").InnerText; + + // Http Get + string result = HttpGet(sPlaylistURL + "&ubu=1",sProxyIPAdd,sProxyPort,bUseProxy,bUseDefault,sProxyUser,sProxyPass); + + // Replace special character "\n" with nothing. + result = result.Replace("\n",""); + + // Regular Expression for extracting the relevant data from the Http Response + mc = Regex.Matches(result, @"file\t?..?=(?<streamurl>.*?)Title\t?..?=\[(?<country>.*?)]\[(?<language>.*?)]\[(?<player>.*?)]\[(?<mediatype>.*?)]\[(?<category>.*?)](?<channel>.*?)\t?Length=-1"); + } + + internal StringCollection GetChannelList(string sSelectedCategoryName,GUIListControl listBox) + { + StringCollection Channels = new StringCollection(); + + listBox.Clear(); + + foreach (Match m in this.mc) + { + if(m.Groups["category"].Value==sSelectedCategoryName) + { + Channels.Add(m.Groups["channel"].Value.Replace("-","-")); + GUIListItem item = new GUIListItem(); + item.Label = m.Groups["channel"].Value.Replace("-","-"); + item.Label2 = m.Groups["language"].Value; + listBox.Add(item); + } + } + this.bShowChannels = true; + this.bShowCategories = false; + return Channels; + } + + internal void PlayChannel(string sSelectedChannelName) + { + string streamURL = null; + + foreach (Match m in this.mc) + { + if(m.Groups["channel"].Value.Replace("-","-")==sSelectedChannelName) + { + GUIListItem item = new GUIListItem(); + streamURL = m.Groups["streamurl"].Value; + } + } + if(streamURL!=null) + { + GUIGraphicsContext.IsFullScreenVideo = true; + GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + g_Player.FullScreen = true; + g_Player.Play(streamURL); + } + else + { + MessageBox.Show("ERROR: Stream url not found"); + } + } + + internal StringCollection GetCategoryList(GUIListControl listBox) + { + StringCollection Categories = new StringCollection(); + string[] sCategory = new string[500]; + string[] sRes = new string[100]; + Categories.Clear(); + listBox.Clear(); + + int i = 0; + foreach (Match m in this.mc) + { + sCategory[i] = m.Groups["category"].Value; + i++; + } + + sRes = removeDuplicates(sCategory); + + foreach(string s in sRes) + { + if(s!=null) + { + Categories.Add(s); + GUIListItem item = new GUIListItem(); + item.Label = s; + listBox.Add(item); + } + } + + this.bShowChannels = false; + this.bShowCategories = true; + return Categories; + } + + private string[] removeDuplicates(string[] inputList) + { + string[] finalList = new string[100]; + int i = 0; + foreach (string currValue in inputList) + { + if (!Contains(finalList, currValue)) + { + finalList[i] = currValue; + i++; + } + } + return finalList; + } + + private bool Contains(string[] list, string comparedValue) + { + foreach(string listValue in list) + { + if (listValue == comparedValue) + { + return true; + } + } + return false; + } + + private string HttpGet(string sURL, string sProxyIPAddress, string sProxyPort, bool bUseProxy, bool bUseDefaults, string sProxyUser, string sProxyPass) + { + string sResponse = null; + + HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(sURL); + httpRequest.Method = "POST"; + + if(bUseProxy) + { + System.Net.WebProxy proxy = new System.Net.WebProxy(sProxyIPAddress.Trim() + ":" + sProxyPort.Trim(),true); + if(bUseDefaults) + { + proxy.Credentials = CredentialCache.DefaultCredentials; + GlobalProxySelection.Select = proxy; + } + else + { + proxy.Credentials = new NetworkCredential(sProxyUser, sProxyPass); + } + } + + // Get Response + HttpWebResponse resp = (HttpWebResponse)httpRequest.GetResponse(); + StreamReader responseReader = new StreamReader(resp.GetResponseStream(),Encoding.ASCII); + sResponse = responseReader.ReadToEnd(); + + return sResponse; + } + } +} Added: trunk/plugins/WWMP/bin/Debug/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/Dialogs.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/Dialogs.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/WWMP.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/WWMP.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/Dialogs.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/Dialogs.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MePoTrial.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MePoTrial.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MePoTrial.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MePoTrial.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MePoTrial.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MePoTrial.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/WWMP.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/WWMP.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/WWMP.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/WWMP.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt =================================================================== --- trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt (rev 0) +++ trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,15 @@ +bin\Debug\MePoTrial.pdb +bin\Debug\Core.dll +bin\Debug\Microsoft.DirectX.Direct3DX.dll +bin\Debug\Microsoft.DirectX.Direct3D.dll +bin\Debug\Microsoft.DirectX.dll +bin\Debug\edtftpnet-1.1.8.dll +bin\Debug\AxInterop.WMPLib.dll +bin\Debug\Interop.TunerLib.dll +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\MePoTrial.pdb +bin\Debug\Dialogs.dll +obj\Debug\MePoTrial.csproj.GenerateResource.Cache +bin\Debug\MePoTrial.dll +obj\Debug\MePoTrial.dll +obj\Debug\MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources Added: trunk/plugins/WWMP/obj/Release/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Release/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Release/WWMP.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Release/WWMP.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Release/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Release/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt =================================================================== --- trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt (rev 0) +++ trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,28 @@ +bin\Debug\WWMP.dll +bin\Debug\WWMP.pdb +bin\Debug\Core.dll +bin\Debug\Dialogs.dll +bin\Debug\AxInterop.WMPLib.dll +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources +obj\Debug\WWMP.csproj.GenerateResource.Cache +obj\Debug\WWMP.dll +obj\Debug\WWMP.pdb +bin\Release\WWMP.dll +bin\Release\AxInterop.WMPLib.dll +obj\Release\ResolveAssemblyReference.cache +obj\Release\MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources +obj\Release\WWMP.csproj.GenerateResource.Cache +obj\Release\WWMP.dll +bin\Debug\DirectShowLib.dll +bin\Debug\edtftpnet-1.2.2.dll +bin\Debug\Interop.WMPLib.dll +bin\Debug\MediaPortal.Support.dll +bin\Debug\ICSharpCode.SharpZipLib.dll +bin\Release\Core.DLL +bin\Release\Dialogs.DLL +bin\Release\DirectShowLib.dll +bin\Release\edtftpnet-1.2.2.dll +bin\Release\Interop.WMPLib.dll +bin\Release\MediaPortal.Support.dll +bin\Release\ICSharpCode.SharpZipLib.dll This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |