From: <du...@us...> - 2007-02-03 17:49:21
|
Revision: 85 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=85&view=rev Author: dukus Date: 2007-02-03 09:49:17 -0800 (Sat, 03 Feb 2007) Log Message: ----------- Build form remaked Modified Paths: -------------- trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs trunk/plugins/mpinstaler/MPInstaler.suo Modified: trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs 2007-02-03 07:03:39 UTC (rev 84) +++ trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs 2007-02-03 17:49:17 UTC (rev 85) @@ -28,81 +28,106 @@ /// </summary> private void InitializeComponent() { - this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // saveFileDialog1 - // - this.saveFileDialog1.DefaultExt = "mpi"; - this.saveFileDialog1.Filter = "MPI files|*.mpi|ZIP files|*.zip|All files|*.*"; - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(12, 23); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(484, 20); - this.textBox1.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(9, 7); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(58, 13); - this.label1.TabIndex = 1; - this.label1.Text = "File name :"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(502, 23); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(27, 23); - this.button1.TabIndex = 2; - this.button1.Text = "..."; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(12, 136); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 3; - this.button2.Text = "Build"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button3 - // - this.button3.Location = new System.Drawing.Point(421, 136); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(75, 23); - this.button3.TabIndex = 4; - this.button3.Text = "OK"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); - // - // Build_dialog - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(537, 171); - this.Controls.Add(this.button3); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.label1); - this.Controls.Add(this.textBox1); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "Build_dialog"; - this.Text = "Build"; - this.ResumeLayout(false); - this.PerformLayout(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.listBox1 = new System.Windows.Forms.ListBox(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.SuspendLayout(); + // + // saveFileDialog1 + // + this.saveFileDialog1.DefaultExt = "mpi"; + this.saveFileDialog1.Filter = "MPI files|*.mpi|ZIP files|*.zip|All files|*.*"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(12, 23); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(452, 20); + this.textBox1.TabIndex = 0; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 7); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(58, 13); + this.label1.TabIndex = 1; + this.label1.Text = "File name :"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(469, 20); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(27, 23); + this.button1.TabIndex = 2; + this.button1.Text = "..."; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(12, 220); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 3; + this.button2.Text = "Build"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(421, 220); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 4; + this.button3.Text = "Close"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // listBox1 + // + this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listBox1.FormattingEnabled = true; + this.listBox1.HorizontalScrollbar = true; + this.listBox1.Location = new System.Drawing.Point(12, 54); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(484, 134); + this.listBox1.TabIndex = 5; + // + // progressBar1 + // + this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.progressBar1.Location = new System.Drawing.Point(12, 198); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(484, 16); + this.progressBar1.TabIndex = 6; + // + // Build_dialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(502, 255); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.listBox1); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBox1); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Build_dialog"; + this.Text = "Build"; + this.Load += new System.EventHandler(this.Build_dialog_Load); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -114,5 +139,7 @@ private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.ProgressBar progressBar1; } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs 2007-02-03 07:03:39 UTC (rev 84) +++ trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs 2007-02-03 17:49:17 UTC (rev 85) @@ -40,11 +40,16 @@ private void button2_Click(object sender, EventArgs e) { _struct.BuildFileName = textBox1.Text; - _struct.BuilFile(); + _struct.BuilFile(listBox1,progressBar1); } public void onbuild() { } + + private void Build_dialog_Load(object sender, EventArgs e) + { + listBox1.Items.Clear(); + } } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-03 07:03:39 UTC (rev 84) +++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-03 17:49:17 UTC (rev 85) @@ -12,169 +12,193 @@ namespace MPInstaler { - public class MPinstalerStruct - { - - public const string PLUGIN_TYPE = "Plugin"; - public const string PLUGIN_WINDOW_SUBTYPE = "Window"; - public const string PLUGIN_PROCESS_SUBTYPE = "Process"; - public const string PLUGIN_SUBTITLE_SUBTYPE = "Subtitle"; - public const string PLUGIN_TAGREADER_SUBTYPE = "TagReader"; - public const string PLUGIN_PLAYER_SUBTYPE = "External Player"; - public const string SKIN_TYPE = "Skin"; - public const string SKIN_MEDIA_TYPE = "Media"; - public const string SKIN_XML_SUBTYPE = "Genskin"; - - string _builFileName = string.Empty; - string _proiectFileName = string.Empty; - public ArrayList FileList = new ArrayList(); - public MPinstalerStruct() - { - - } - public string BuildFileName + public class MPinstalerStruct { - get { return _builFileName; } - set { _builFileName = value; } - } - public string ProiectdFileName - { - get { return _proiectFileName; } - set { _proiectFileName = value; } - } - - public void AddFileList(ListView lst) - { - FileList.Clear(); - for (int i = 0; i < lst.Items.Count; i++) - { - FileList.Add(new MPIFileList(lst.Items[i].SubItems[3].Text, lst.Items[i].SubItems[1].Text, lst.Items[i].SubItems[2].Text, lst.Items[i].SubItems[4].Text)); - } - } - public void Clear() - { - FileList.Clear(); - BuildFileName = string.Empty; - } - public void BuilFile() - { - ZipOutputStream s = new ZipOutputStream(File.Create(_builFileName)); + public const string PLUGIN_TYPE = "Plugin"; + public const string PLUGIN_WINDOW_SUBTYPE = "Window"; + public const string PLUGIN_PROCESS_SUBTYPE = "Process"; + public const string PLUGIN_SUBTITLE_SUBTYPE = "Subtitle"; + public const string PLUGIN_TAGREADER_SUBTYPE = "TagReader"; + public const string PLUGIN_PLAYER_SUBTYPE = "External Player"; + public const string SKIN_TYPE = "Skin"; + public const string SKIN_MEDIA_TYPE = "Media"; + public const string SKIN_XML_SUBTYPE = "Genskin"; - s.SetLevel(5); // 0 - store only to 9 - means best compression + string _builFileName = string.Empty; + string _proiectFileName = string.Empty; + public ArrayList FileList = new ArrayList(); + public MPinstalerStruct() + { - foreach (MPIFileList file in FileList) - { - MessageBox.Show(file.FileName); - if (!string.IsNullOrEmpty(file.FileName)&&File.Exists(file.FileName)) + } + public string BuildFileName { - FileStream fs = File.OpenRead(Path.GetFullPath(file.FileName)); - byte[] buffer = new byte[fs.Length]; - fs.Read(buffer, 0, buffer.Length); + get { return _builFileName; } + set { _builFileName = value; } + } + public string ProiectdFileName + { + get { return _proiectFileName; } + set { _proiectFileName = value; } + } - ZipEntry entry = new ZipEntry(GetZipEntry(file)); + public void AddFileList(ListView lst) + { + FileList.Clear(); + for (int i = 0; i < lst.Items.Count; i++) + { + FileList.Add(new MPIFileList(lst.Items[i].SubItems[3].Text, lst.Items[i].SubItems[1].Text, lst.Items[i].SubItems[2].Text, lst.Items[i].SubItems[4].Text)); + } + } + public void Clear() + { + FileList.Clear(); + BuildFileName = string.Empty; + } - s.PutNextEntry(entry); + public void BuilFile(ListBox ls, ProgressBar pb) + { + ZipOutputStream s = new ZipOutputStream(File.Create(_builFileName)); + ls.Items.Clear(); + s.SetLevel(5); // 0 - store only to 9 - means best compression + pb.Value = 0; + pb.Maximum = FileList.Count; + ls.Items.Add("Build file :" + _builFileName); + foreach (MPIFileList file in FileList) + { + ls.Items.Add("Adding file :" + file.FileName); + pb.Value++; + ls.Refresh(); + ls.Update(); + if (!string.IsNullOrEmpty(file.FileName) && File.Exists(file.FileName)) + { + FileStream fs = File.OpenRead(Path.GetFullPath(file.FileName)); + byte[] buffer = new byte[fs.Length]; + fs.Read(buffer, 0, buffer.Length); - s.Write(buffer, 0, buffer.Length); - } + ZipEntry entry = new ZipEntry(GetZipEntry(file)); - } - if (File.Exists(ProiectdFileName)) - { - FileStream fs = File.OpenRead(Path.GetFullPath(ProiectdFileName)); - byte[] buffer = new byte[fs.Length]; - fs.Read(buffer, 0, buffer.Length); + s.PutNextEntry(entry); - ZipEntry entry = new ZipEntry("instaler.xmp"); + s.Write(buffer, 0, buffer.Length); + } - s.PutNextEntry(entry); + } + if (File.Exists(ProiectdFileName)) + { + FileStream fs = File.OpenRead(Path.GetFullPath(ProiectdFileName)); + byte[] buffer = new byte[fs.Length]; + fs.Read(buffer, 0, buffer.Length); - s.Write(buffer, 0, buffer.Length); - } - s.Finish(); - s.Close(); - } + ZipEntry entry = new ZipEntry("instaler.xmp"); - public string GetZipEntry(MPIFileList flst) - { - string ret = string.Empty; - if (flst.Type == PLUGIN_TYPE) - { - ret="Release"+@"\"+"Plugins"+@"\"; - switch (flst.SubType) + s.PutNextEntry(entry); + + s.Write(buffer, 0, buffer.Length); + } + s.Finish(); + s.Close(); + } + public void LoadFromFile(string fil) { - case PLUGIN_WINDOW_SUBTYPE: - ret += "Windows"; - break; - case PLUGIN_PLAYER_SUBTYPE: - ret += "ExternalPlayers"; - break; - case PLUGIN_PROCESS_SUBTYPE: - ret += "Process"; - break; - case PLUGIN_SUBTITLE_SUBTYPE: - ret += "Subtitle"; - break; - case PLUGIN_TAGREADER_SUBTYPE: - ret += "TagReaders"; - break; } - ret += @"\" + Path.GetFileName(flst.FileName); - } + public string GetZipEntry(MPIFileList flst) + { + string ret = string.Empty; + if (flst.Type == PLUGIN_TYPE) + { + ret = "Release" + @"\" + "Plugins" + @"\"; + switch (flst.SubType) + { + case PLUGIN_WINDOW_SUBTYPE: + ret += "Windows"; + break; + case PLUGIN_PLAYER_SUBTYPE: + ret += "ExternalPlayers"; + break; + case PLUGIN_PROCESS_SUBTYPE: + ret += "Process"; + break; + case PLUGIN_SUBTITLE_SUBTYPE: + ret += "Subtitle"; + break; + case PLUGIN_TAGREADER_SUBTYPE: + ret += "TagReaders"; + break; - if (flst.Type == SKIN_TYPE) - { - ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + Path.GetFileName(flst.FileName); - } + } + ret += @"\" + Path.GetFileName(flst.FileName); + } - if (flst.Type == SKIN_MEDIA_TYPE) - { - ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType +@"\"+"Media"+ @"\" + Path.GetFileName(flst.FileName); - } + if (flst.Type == SKIN_TYPE) + { + ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + Path.GetFileName(flst.FileName); + } - return ret; + if (flst.Type == SKIN_MEDIA_TYPE) + { + ret = "Release" + @"\" + "Skin" + @"\" + flst.SubType + @"\" + "Media" + @"\" + Path.GetFileName(flst.FileName); + } + + return ret; + } } - } - public class MPIFileList - { - string _FileName = string.Empty; - string _Type = string.Empty; - string _SubType = string.Empty; - string _Id = string.Empty; - - public MPIFileList(string fn,string ty, string sty,string i) + public class MPIFileList { - FileName = fn; - Type = ty; - SubType = sty; - ID = i; - } - public string FileName - { - get { return _FileName; } - set { _FileName = value; } - } + string _FileName = string.Empty; + string _Type = string.Empty; + string _SubType = string.Empty; + string _Id = string.Empty; + string _Op = string.Empty; + + public MPIFileList(string fn, string ty, string sty, string i) + { + FileName = fn; + Type = ty; + SubType = sty; + ID = i; + Option = String.Empty; + } - public string Type - { - get { return _Type; } - set { _Type = value; } - } + public MPIFileList(string fn, string ty, string sty, string i,string o) + { + FileName = fn; + Type = ty; + SubType = sty; + ID = i; + Option = o; + } + public string FileName + { + get { return _FileName; } + set { _FileName = value; } + } - public string SubType - { - get { return _SubType; } - set { _SubType = value; } + public string Type + { + get { return _Type; } + set { _Type = value; } + } + + public string SubType + { + get { return _SubType; } + set { _SubType = value; } + } + public string ID + { + get { return _Id; } + set { _Id = value; } + } + public string Option + { + get { return _Op; } + set { _Op = value; } + } + } - public string ID - { - get { return _Id; } - set { _Id = value; } - } - - } } 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. |