|
From: <du...@us...> - 2007-04-30 08:01:52
|
Revision: 357
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=357&view=rev
Author: dukus
Date: 2007-04-30 01:01:48 -0700 (Mon, 30 Apr 2007)
Log Message:
-----------
Manual upload support
Modified Paths:
--------------
trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs
Modified: trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs 2007-04-29 17:15:59 UTC (rev 356)
+++ trunk/plugins/mpinstaler/MPInstaler/Build dialog.Designer.cs 2007-04-30 08:01:48 UTC (rev 357)
@@ -28,179 +28,192 @@
/// </summary>
private void InitializeComponent()
{
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Build_dialog));
- 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.button4 = new System.Windows.Forms.Button();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.textBox4 = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- 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(334, 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(354, 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(306, 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.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(369, 134);
- this.listBox1.TabIndex = 5;
- //
- // progressBar1
- //
- this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.progressBar1.Location = new System.Drawing.Point(12, 198);
- this.progressBar1.Name = "progressBar1";
- this.progressBar1.Size = new System.Drawing.Size(369, 16);
- this.progressBar1.TabIndex = 6;
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(147, 220);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(95, 23);
- this.button4.TabIndex = 7;
- this.button4.Text = "Build && Upload";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(403, 54);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(249, 20);
- this.textBox2.TabIndex = 8;
- this.textBox2.Text = "ftp://ftp.extra.hu/wwwroot/upload";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(400, 38);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 13);
- this.label2.TabIndex = 9;
- this.label2.Text = "Server ";
- //
- // textBox3
- //
- this.textBox3.Location = new System.Drawing.Point(403, 97);
- this.textBox3.Name = "textBox3";
- this.textBox3.Size = new System.Drawing.Size(249, 20);
- this.textBox3.TabIndex = 10;
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(400, 81);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(58, 13);
- this.label3.TabIndex = 11;
- this.label3.Text = "User name";
- //
- // textBox4
- //
- this.textBox4.Location = new System.Drawing.Point(403, 138);
- this.textBox4.Name = "textBox4";
- this.textBox4.Size = new System.Drawing.Size(249, 20);
- this.textBox4.TabIndex = 12;
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(400, 122);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(53, 13);
- this.label4.TabIndex = 13;
- this.label4.Text = "Password";
- //
- // Build_dialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(677, 255);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.textBox4);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.textBox3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.textBox2);
- this.Controls.Add(this.button4);
- 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "Build_dialog";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Build";
- this.Load += new System.EventHandler(this.Build_dialog_Load);
- this.ResumeLayout(false);
- this.PerformLayout();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Build_dialog));
+ 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.button4 = new System.Windows.Forms.Button();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.textBox3 = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.textBox4 = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
+ 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(334, 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(354, 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(306, 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.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(369, 134);
+ this.listBox1.TabIndex = 5;
+ //
+ // progressBar1
+ //
+ this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.progressBar1.Location = new System.Drawing.Point(12, 198);
+ this.progressBar1.Name = "progressBar1";
+ this.progressBar1.Size = new System.Drawing.Size(369, 16);
+ this.progressBar1.TabIndex = 6;
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(147, 220);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(95, 23);
+ this.button4.TabIndex = 7;
+ this.button4.Text = "Build && Upload";
+ this.button4.UseVisualStyleBackColor = true;
+ this.button4.Click += new System.EventHandler(this.button4_Click);
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(403, 54);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(249, 20);
+ this.textBox2.TabIndex = 8;
+ this.textBox2.Text = "ftp://ftp.extra.hu/wwwroot/upload";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(400, 38);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(41, 13);
+ this.label2.TabIndex = 9;
+ this.label2.Text = "Server ";
+ //
+ // textBox3
+ //
+ this.textBox3.Location = new System.Drawing.Point(403, 122);
+ this.textBox3.Name = "textBox3";
+ this.textBox3.Size = new System.Drawing.Size(249, 20);
+ this.textBox3.TabIndex = 10;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(400, 106);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(58, 13);
+ this.label3.TabIndex = 11;
+ this.label3.Text = "User name";
+ //
+ // textBox4
+ //
+ this.textBox4.Location = new System.Drawing.Point(403, 163);
+ this.textBox4.Name = "textBox4";
+ this.textBox4.Size = new System.Drawing.Size(249, 20);
+ this.textBox4.TabIndex = 12;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(400, 147);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(53, 13);
+ this.label4.TabIndex = 13;
+ this.label4.Text = "Password";
+ //
+ // checkBox1
+ //
+ this.checkBox1.AutoSize = true;
+ this.checkBox1.Location = new System.Drawing.Point(403, 80);
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.Size = new System.Drawing.Size(74, 17);
+ this.checkBox1.TabIndex = 14;
+ this.checkBox1.Text = "Local disc";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // Build_dialog
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(677, 255);
+ this.Controls.Add(this.checkBox1);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.textBox4);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.textBox3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.button4);
+ 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.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "Build_dialog";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Build";
+ this.Load += new System.EventHandler(this.Build_dialog_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
}
@@ -221,5 +234,6 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.CheckBox checkBox1;
}
}
\ No newline at end of file
Modified: trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs 2007-04-29 17:15:59 UTC (rev 356)
+++ trunk/plugins/mpinstaler/MPInstaler/Build dialog.cs 2007-04-30 08:01:48 UTC (rev 357)
@@ -68,66 +68,103 @@
this.Cursor = Cursors.WaitCursor;
if (!String.IsNullOrEmpty(textBox1.Text))
{
+ if (checkBox1.Checked)
+ {
_struct.BuildFileName = textBox1.Text;
_struct.BuilFile(listBox1, progressBar1);
+ listBox1.SelectedIndex = listBox1.Items.Count - 1;
+ listBox1.Refresh();
+ listBox1.Update();
+ string tempfile = Path.GetDirectoryName(textBox1.Text) + @"\" + Path.GetFileNameWithoutExtension(textBox1.Text) + ".xml";
+ MPInstallHelper temp_mpih = new MPInstallHelper();
+ MPpackageStruct pk = new MPpackageStruct();
+ pk.LoadFromFile(textBox1.Text);
+ temp_mpih.Add(pk);
+ temp_mpih.FileName = tempfile;
+ temp_mpih.SaveToFile();
+ listBox1.Items.Add("Config file created !");
+ listBox1.Refresh();
+ listBox1.Update();
+ }
+ else
+ {
+ _struct.BuildFileName = textBox1.Text;
+ _struct.BuilFile(listBox1, progressBar1);
listBox1.Items.Add("Upload begin...");
listBox1.SelectedIndex = listBox1.Items.Count - 1;
listBox1.Refresh();
listBox1.Update();
if (download_form.FtpUpload(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text))
{
- listBox1.Items.Add("Upload done.");
+ listBox1.Items.Add("Upload done.");
+ listBox1.Refresh();
+ listBox1.Update();
+ if (true)
+ {
+ string tempfile = Path.GetTempPath() + @"\" + Path.GetFileNameWithoutExtension(textBox1.Text) + ".xml";
+ string configfile = textBox2.Text + "/" + Path.GetFileNameWithoutExtension(textBox1.Text) + ".xml";
+ MPInstallHelper temp_mpih = new MPInstallHelper();
+ MPpackageStruct pk = new MPpackageStruct();
+ pk.LoadFromFile(textBox1.Text);
+ temp_mpih.Add(pk);
+ temp_mpih.FileName = tempfile;
+ temp_mpih.SaveToFile();
+ download_form.FtpUpload(tempfile, textBox2.Text, textBox3.Text, textBox4.Text);
+ listBox1.Items.Add("List file uploaded !");
listBox1.Refresh();
listBox1.Update();
- if (true)
+ }
+ else
+ {
+ string tempfile = Path.GetTempPath() + @"\MPExtensionFileList.xml";
+ string configfile = textBox2.Text + "/MPExtensionFileList.xml";
+ if (download_form.FtpDownload(configfile, tempfile, textBox3.Text, textBox4.Text))
{
- string tempfile = Path.GetTempPath() + @"\"+Path.GetFileNameWithoutExtension(textBox1.Text)+".xml";
- string configfile = textBox2.Text + "/" + Path.GetFileNameWithoutExtension(textBox1.Text) + ".xml";
- MPInstallHelper temp_mpih = new MPInstallHelper();
- MPpackageStruct pk = new MPpackageStruct();
- pk.LoadFromFile(textBox1.Text);
- temp_mpih.Add(pk);
- temp_mpih.FileName = tempfile;
- temp_mpih.SaveToFile();
- download_form.FtpUpload(tempfile, textBox2.Text, textBox3.Text, textBox4.Text);
- listBox1.Items.Add("List file uploaded !");
- listBox1.Refresh();
- listBox1.Update();
+ listBox1.Items.Add("List file downloaded !");
+ listBox1.SelectedIndex = listBox1.Items.Count - 1;
+ listBox1.Refresh();
+ listBox1.Update();
+ MPInstallHelper temp_mpih = new MPInstallHelper();
+ temp_mpih.LoadFromFile(tempfile);
+ MPpackageStruct pk = new MPpackageStruct();
+ pk.LoadFromFile(textBox1.Text);
+ temp_mpih.Add(pk);
+ temp_mpih.SaveToFile();
+ download_form.FtpRenam(configfile, "MPExtensionFileList_old.xml", textBox3.Text, textBox4.Text);
+ listBox1.Items.Add("List file renamed !");
+ listBox1.Refresh();
+ listBox1.Update();
+ download_form.FtpUpload(tempfile, textBox2.Text, textBox3.Text, textBox4.Text);
+ listBox1.Items.Add("List file uploaded !");
+ listBox1.Refresh();
+ listBox1.Update();
}
- else
- {
- string tempfile = Path.GetTempPath() + @"\MPExtensionFileList.xml";
- string configfile = textBox2.Text + "/MPExtensionFileList.xml";
- if (download_form.FtpDownload(configfile, tempfile, textBox3.Text, textBox4.Text))
- {
- listBox1.Items.Add("List file downloaded !");
- listBox1.SelectedIndex = listBox1.Items.Count - 1;
- listBox1.Refresh();
- listBox1.Update();
- MPInstallHelper temp_mpih = new MPInstallHelper();
- temp_mpih.LoadFromFile(tempfile);
- MPpackageStruct pk = new MPpackageStruct();
- pk.LoadFromFile(textBox1.Text);
- temp_mpih.Add(pk);
- temp_mpih.SaveToFile();
- download_form.FtpRenam(configfile, "MPExtensionFileList_old.xml", textBox3.Text, textBox4.Text);
- listBox1.Items.Add("List file renamed !");
- listBox1.Refresh();
- listBox1.Update();
- download_form.FtpUpload(tempfile, textBox2.Text, textBox3.Text, textBox4.Text);
- listBox1.Items.Add("List file uploaded !");
- listBox1.Refresh();
- listBox1.Update();
- }
- }
+ }
}
+ }
}
else
{
- MessageBox.Show("File name is mandatory !", "Stop");
- textBox1.Focus();
+ MessageBox.Show("File name is mandatory !", "Stop");
+ textBox1.Focus();
}
this.Cursor = Cursors.Arrow;
}
+
+ private void checkBox1_CheckedChanged(object sender, EventArgs e)
+ {
+ if (checkBox1.Checked)
+ {
+ textBox2.Enabled = false;
+ textBox3.Enabled = false;
+ textBox4.Enabled = false;
+ }
+ else
+ {
+ textBox2.Enabled = true;
+ textBox3.Enabled = true;
+ textBox4.Enabled = true;
+ }
+ }
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|