From: <du...@us...> - 2007-03-07 21:29:47
|
Revision: 166 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=166&view=rev Author: dukus Date: 2007-03-07 13:29:28 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/mpinstaler/MPInstaler/Form1.cs trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs trunk/plugins/mpinstaler/MPInstaler/Program.cs trunk/plugins/mpinstaler/MPInstaler.suo Added Paths: ----------- trunk/plugins/mpinstaler/MPInstaler/app.config trunk/plugins/mpinstaler/MPInstaler/download_form.resx Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-03-07 20:33:19 UTC (rev 165) +++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-03-07 21:29:28 UTC (rev 166) @@ -222,11 +222,13 @@ proiectt_textBox5.Text = _struct.Description; _loading = false; } + private void languageToolStripMenuItem_Click(object sender, EventArgs e) { Form2 StrForm = new Form2(); - //StrForm.baseDir = "D:\\Program Files\\Team MediaPortal\\MediaPortal\\" ; + StrForm.Language = _struct.Language; StrForm.ShowDialog(); + _struct.Language = StrForm.Language; } private void optionsToolStripMenuItem_Click(object sender, EventArgs e) Modified: trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs 2007-03-07 20:33:19 UTC (rev 165) +++ trunk/plugins/mpinstaler/MPInstaler/Language dialog.Designer.cs 2007-03-07 21:29:28 UTC (rev 166) @@ -38,6 +38,7 @@ this.textBox2 = new System.Windows.Forms.TextBox(); this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); + this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); this.SuspendLayout(); // // button1 @@ -63,21 +64,22 @@ // languageComboBox // this.languageComboBox.FormattingEnabled = true; - this.languageComboBox.Location = new System.Drawing.Point(12, 22); + this.languageComboBox.Location = new System.Drawing.Point(216, 252); this.languageComboBox.Name = "languageComboBox"; - this.languageComboBox.Size = new System.Drawing.Size(372, 21); + this.languageComboBox.Size = new System.Drawing.Size(170, 21); this.languageComboBox.TabIndex = 2; // // listView1 // this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, - this.columnHeader2}); + this.columnHeader2, + this.columnHeader3}); this.listView1.FullRowSelect = true; this.listView1.GridLines = true; - this.listView1.Location = new System.Drawing.Point(12, 68); + this.listView1.Location = new System.Drawing.Point(12, 12); this.listView1.Name = "listView1"; - this.listView1.Size = new System.Drawing.Size(372, 179); + this.listView1.Size = new System.Drawing.Size(372, 235); this.listView1.TabIndex = 3; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = System.Windows.Forms.View.Details; @@ -86,11 +88,12 @@ // columnHeader1 // this.columnHeader1.Text = "Id"; + this.columnHeader1.Width = 68; // // columnHeader2 // this.columnHeader2.Text = "Value"; - this.columnHeader2.Width = 308; + this.columnHeader2.Width = 137; // // textBox1 // @@ -103,7 +106,7 @@ // this.textBox2.Location = new System.Drawing.Point(80, 253); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(304, 20); + this.textBox2.Size = new System.Drawing.Size(130, 20); this.textBox2.TabIndex = 5; // // button3 @@ -114,6 +117,7 @@ this.button3.TabIndex = 6; this.button3.Text = "Save"; this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); // // button4 // @@ -121,9 +125,15 @@ this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(75, 21); this.button4.TabIndex = 7; - this.button4.Text = "Cancel"; + this.button4.Text = "Close"; this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); // + // columnHeader3 + // + this.columnHeader3.Text = "Language"; + this.columnHeader3.Width = 155; + // // Form2 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -157,5 +167,6 @@ private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; + private System.Windows.Forms.ColumnHeader columnHeader3; } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs 2007-03-07 20:33:19 UTC (rev 165) +++ trunk/plugins/mpinstaler/MPInstaler/Language dialog.cs 2007-03-07 21:29:28 UTC (rev 166) @@ -15,6 +15,8 @@ public partial class Form2 : Form { public string baseDir; + public List<LanguageString> Language; + string LanguageDirectory = Config.GetFolder(Config.Dir.Language); public Form2() { @@ -71,6 +73,7 @@ { ListViewItem item1 = new ListViewItem(textBox1.Text, 0); item1.SubItems.Add(textBox2.Text); + item1.SubItems.Add(languageComboBox.Text); listView1.Items.AddRange(new ListViewItem[] { item1 }); } @@ -90,8 +93,28 @@ private void Form2_Load(object sender, EventArgs e) { - LoadLanguages(); + foreach (LanguageString lg in Language) + { + ListViewItem item1 = new ListViewItem(lg.dwCode, 0); + item1.SubItems.Add(lg.mapSting); + item1.SubItems.Add(lg.language); + listView1.Items.AddRange(new ListViewItem[] { item1 }); + } } + + private void button3_Click(object sender, EventArgs e) + { + for(int i=0;i<listView1.Items.Count;i++) + { + Language.Clear(); + Language.Add(new LanguageString(listView1.Items[i].SubItems[2].Text, listView1.Items[i].Text, listView1.Items[i].SubItems[1].Text)); + } + } + + private void button4_Click(object sender, EventArgs e) + { + this.Close(); + } } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-03-07 20:33:19 UTC (rev 165) +++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-03-07 21:29:28 UTC (rev 166) @@ -43,9 +43,11 @@ public ArrayList Uninstall = new ArrayList(); public ArrayList FileList = new ArrayList(); + public List<LanguageString> Language; + public MPinstalerStruct() { - + Language = new List<LanguageString>(); } public string UpdateURL { @@ -147,6 +149,16 @@ //st = st + bossview.Items[i].SubItems[3].Text + @"\" + bossview.Items[i].Text + ";"; } writer.WriteEndElement(); + writer.WriteStartElement("StringList"); + foreach(LanguageString lg in Language) + { + writer.WriteStartElement("string"); + writer.WriteElementString("language", lg.language); + writer.WriteElementString("id", lg.dwCode); + writer.WriteElementString("value", lg.mapSting); + writer.WriteEndElement(); + } + writer.WriteEndElement(); writer.WriteStartElement("Option"); writer.WriteElementString("BuildFileName", this.BuildFileName); writer.WriteElementString("ProiectFileName", Path.GetFullPath(this.ProiectdFileName)); @@ -227,6 +239,7 @@ XmlDocument doc = new XmlDocument(); doc.Load(fil); FileList.Clear(); + Language.Clear(); XmlNode ver = doc.DocumentElement.SelectSingleNode("/MPinstaler"); XmlNodeList fileList = ver.SelectNodes("FileList/File"); foreach (XmlNode nodefile in fileList) @@ -238,6 +251,13 @@ nodefile.SelectSingleNode("Id").InnerText, nodefile.SelectSingleNode("Option").InnerText)); } + XmlNodeList langList = ver.SelectNodes("StringList/string"); + foreach (XmlNode langnode in langList) + { + Language.Add(new LanguageString(langnode.SelectSingleNode("language").InnerText, + langnode.SelectSingleNode("id").InnerText, + langnode.SelectSingleNode("value").InnerText)); + } XmlNode nodeoption = ver.SelectSingleNode("Option"); this.BuildFileName = nodeoption.SelectSingleNode("BuildFileName").InnerText; this.Name = nodeoption.SelectSingleNode("ProiectName").InnerText; @@ -467,4 +487,17 @@ } } + + public class LanguageString + { + public string language; + public string mapSting; + public string dwCode; + public LanguageString(string lang,string dc, string str ) + { + language = lang; + dwCode = dc; + mapSting = str; + } + } } Modified: trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-03-07 20:33:19 UTC (rev 165) +++ trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-03-07 21:29:28 UTC (rev 166) @@ -197,6 +197,10 @@ lst.RemoveAt(i); } lst.Add(pk); + if (!Directory.Exists(InstalDir)) + { + Directory.CreateDirectory(InstalDir); + } if (Path.GetFullPath(pk.FileName) != Path.GetFullPath(InstalDir + @"\" + Path.GetFileName(pk.FileName))) File.Copy(pk.FileName, InstalDir + @"\" + Path.GetFileName(pk.FileName), true); } Modified: trunk/plugins/mpinstaler/MPInstaler/Program.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Program.cs 2007-03-07 20:33:19 UTC (rev 165) +++ trunk/plugins/mpinstaler/MPInstaler/Program.cs 2007-03-07 21:29:28 UTC (rev 166) @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Windows.Forms; using Microsoft.Win32; -using MediaPortal.Configuration; namespace MPInstaler { @@ -20,7 +19,7 @@ fil = args[0]; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - if (File.Exists(Config.GetFolder(Config.Dir.Base) + @"\MediaPortal.exe")) + if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\MediaPortal.exe")) { if (!String.IsNullOrEmpty(fil)) { @@ -46,7 +45,7 @@ } else { - MessageBox.Show(Config.GetFolder(Config.Dir.Base) + @"\MediaPortal.exe not found. Program Exit....."); + MessageBox.Show(AppDomain.CurrentDomain.BaseDirectory + @"\MediaPortal.exe not found. Program Exit....."); } } } Added: trunk/plugins/mpinstaler/MPInstaler/app.config =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/app.config (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/app.config 2007-03-07 21:29:28 UTC (rev 166) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> +</configuration> \ No newline at end of file Added: trunk/plugins/mpinstaler/MPInstaler/download_form.resx =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/download_form.resx (rev 0) +++ trunk/plugins/mpinstaler/MPInstaler/download_form.resx 2007-03-07 21:29:28 UTC (rev 166) @@ -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.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |