implemented minimum window size #13
main window on startup at center of screen #14 implemented remembering window state #15 implemented adjustable image amount loaded from API #16 fixed message when done #10 handled API connection errors #17 fixed empty replace path #18 added some comments
This commit is contained in:
parent
be9459e78d
commit
814a6e404a
41
Mk0.Software.Bildduplikate/API.Designer.cs
generated
41
Mk0.Software.Bildduplikate/API.Designer.cs
generated
@ -36,6 +36,9 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.textBoxPath2 = new System.Windows.Forms.TextBox();
|
this.textBoxPath2 = new System.Windows.Forms.TextBox();
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
this.buttonSave = new System.Windows.Forms.Button();
|
this.buttonSave = new System.Windows.Forms.Button();
|
||||||
|
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
@ -96,11 +99,44 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.buttonSave.UseVisualStyleBackColor = true;
|
this.buttonSave.UseVisualStyleBackColor = true;
|
||||||
this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click);
|
this.buttonSave.Click += new System.EventHandler(this.ButtonSave_Click);
|
||||||
//
|
//
|
||||||
|
// numericUpDown1
|
||||||
|
//
|
||||||
|
this.numericUpDown1.Location = new System.Drawing.Point(248, 104);
|
||||||
|
this.numericUpDown1.Maximum = new decimal(new int[] {
|
||||||
|
1000,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.numericUpDown1.Minimum = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.numericUpDown1.Name = "numericUpDown1";
|
||||||
|
this.numericUpDown1.Size = new System.Drawing.Size(78, 20);
|
||||||
|
this.numericUpDown1.TabIndex = 7;
|
||||||
|
this.numericUpDown1.Value = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(245, 88);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(228, 13);
|
||||||
|
this.label4.TabIndex = 8;
|
||||||
|
this.label4.Text = "Amount of images loaded per request from API:";
|
||||||
|
//
|
||||||
// API
|
// API
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(476, 180);
|
this.ClientSize = new System.Drawing.Size(476, 180);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.numericUpDown1);
|
||||||
this.Controls.Add(this.buttonSave);
|
this.Controls.Add(this.buttonSave);
|
||||||
this.Controls.Add(this.label3);
|
this.Controls.Add(this.label3);
|
||||||
this.Controls.Add(this.textBoxPath2);
|
this.Controls.Add(this.textBoxPath2);
|
||||||
@ -114,7 +150,8 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.Name = "API";
|
this.Name = "API";
|
||||||
this.ShowIcon = false;
|
this.ShowIcon = false;
|
||||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||||
this.Text = "API";
|
this.Text = "API Settings";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
@ -129,5 +166,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
private System.Windows.Forms.TextBox textBoxPath2;
|
private System.Windows.Forms.TextBox textBoxPath2;
|
||||||
private System.Windows.Forms.Label label3;
|
private System.Windows.Forms.Label label3;
|
||||||
private System.Windows.Forms.Button buttonSave;
|
private System.Windows.Forms.Button buttonSave;
|
||||||
|
private System.Windows.Forms.NumericUpDown numericUpDown1;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,6 +11,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
textBoxApiUrl.Text = Properties.Settings.Default.ApiUrl;
|
textBoxApiUrl.Text = Properties.Settings.Default.ApiUrl;
|
||||||
textBoxPath1.Text = Properties.Settings.Default.ReplacePath;
|
textBoxPath1.Text = Properties.Settings.Default.ReplacePath;
|
||||||
textBoxPath2.Text = Properties.Settings.Default.ReplaceWith;
|
textBoxPath2.Text = Properties.Settings.Default.ReplaceWith;
|
||||||
|
numericUpDown1.Value = Properties.Settings.Default.imagesFromAPI;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonSave_Click(object sender, EventArgs e)
|
private void ButtonSave_Click(object sender, EventArgs e)
|
||||||
@ -18,6 +19,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
Properties.Settings.Default.ApiUrl = textBoxApiUrl.Text.Trim();
|
Properties.Settings.Default.ApiUrl = textBoxApiUrl.Text.Trim();
|
||||||
Properties.Settings.Default.ReplacePath = textBoxPath1.Text.Trim();
|
Properties.Settings.Default.ReplacePath = textBoxPath1.Text.Trim();
|
||||||
Properties.Settings.Default.ReplaceWith = textBoxPath2.Text.Trim();
|
Properties.Settings.Default.ReplaceWith = textBoxPath2.Text.Trim();
|
||||||
|
Properties.Settings.Default.imagesFromAPI = (int)numericUpDown1.Value;
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,24 @@
|
|||||||
<setting name="ReplaceWith" serializeAs="String">
|
<setting name="ReplaceWith" serializeAs="String">
|
||||||
<value />
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="lastWidth" serializeAs="String">
|
||||||
|
<value>0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="lastHeight" serializeAs="String">
|
||||||
|
<value>0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="lastTop" serializeAs="String">
|
||||||
|
<value>0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="lastLeft" serializeAs="String">
|
||||||
|
<value>0</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="fullScreen" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="imagesFromAPI" serializeAs="String">
|
||||||
|
<value>500</value>
|
||||||
|
</setting>
|
||||||
</Mk0.Software.Bildduplikate.Properties.Settings>
|
</Mk0.Software.Bildduplikate.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<runtime>
|
<runtime>
|
||||||
|
73
Mk0.Software.Bildduplikate/Main.Designer.cs
generated
73
Mk0.Software.Bildduplikate/Main.Designer.cs
generated
@ -42,9 +42,10 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.buttonReload = new System.Windows.Forms.Button();
|
this.buttonReload = new System.Windows.Forms.Button();
|
||||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||||
this.textBoxDesc1 = new System.Windows.Forms.TextBox();
|
this.textBoxDesc1 = new System.Windows.Forms.TextBox();
|
||||||
this.textBoxDesc2 = new System.Windows.Forms.TextBox();
|
|
||||||
this.buttonAPISetting = new System.Windows.Forms.Button();
|
this.buttonAPISetting = new System.Windows.Forms.Button();
|
||||||
this.buttonAPILoad = new System.Windows.Forms.Button();
|
this.buttonAPILoad = new System.Windows.Forms.Button();
|
||||||
|
this.richTextBoxDesc1 = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.richTextBoxDesc2 = new System.Windows.Forms.RichTextBox();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
@ -70,7 +71,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
// buttonDel1
|
// buttonDel1
|
||||||
//
|
//
|
||||||
this.buttonDel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
this.buttonDel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.buttonDel1.Location = new System.Drawing.Point(313, 3);
|
this.buttonDel1.Location = new System.Drawing.Point(405, 3);
|
||||||
this.buttonDel1.Name = "buttonDel1";
|
this.buttonDel1.Name = "buttonDel1";
|
||||||
this.buttonDel1.Size = new System.Drawing.Size(75, 23);
|
this.buttonDel1.Size = new System.Drawing.Size(75, 23);
|
||||||
this.buttonDel1.TabIndex = 2;
|
this.buttonDel1.TabIndex = 2;
|
||||||
@ -96,7 +97,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
|
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.pictureBox1.Name = "pictureBox1";
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
this.pictureBox1.Size = new System.Drawing.Size(388, 315);
|
this.pictureBox1.Size = new System.Drawing.Size(480, 362);
|
||||||
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||||
this.pictureBox1.TabIndex = 6;
|
this.pictureBox1.TabIndex = 6;
|
||||||
this.pictureBox1.TabStop = false;
|
this.pictureBox1.TabStop = false;
|
||||||
@ -109,7 +110,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.pictureBox2.Location = new System.Drawing.Point(0, 0);
|
this.pictureBox2.Location = new System.Drawing.Point(0, 0);
|
||||||
this.pictureBox2.Name = "pictureBox2";
|
this.pictureBox2.Name = "pictureBox2";
|
||||||
this.pictureBox2.Size = new System.Drawing.Size(384, 315);
|
this.pictureBox2.Size = new System.Drawing.Size(476, 362);
|
||||||
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||||
this.pictureBox2.TabIndex = 7;
|
this.pictureBox2.TabIndex = 7;
|
||||||
this.pictureBox2.TabStop = false;
|
this.pictureBox2.TabStop = false;
|
||||||
@ -119,7 +120,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
// buttonKeinDuplikat
|
// buttonKeinDuplikat
|
||||||
//
|
//
|
||||||
this.buttonKeinDuplikat.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
this.buttonKeinDuplikat.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
||||||
this.buttonKeinDuplikat.Location = new System.Drawing.Point(280, 12);
|
this.buttonKeinDuplikat.Location = new System.Drawing.Point(372, 12);
|
||||||
this.buttonKeinDuplikat.Name = "buttonKeinDuplikat";
|
this.buttonKeinDuplikat.Name = "buttonKeinDuplikat";
|
||||||
this.buttonKeinDuplikat.Size = new System.Drawing.Size(217, 23);
|
this.buttonKeinDuplikat.Size = new System.Drawing.Size(217, 23);
|
||||||
this.buttonKeinDuplikat.TabIndex = 8;
|
this.buttonKeinDuplikat.TabIndex = 8;
|
||||||
@ -144,15 +145,15 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
// splitContainer1.Panel2
|
// splitContainer1.Panel2
|
||||||
//
|
//
|
||||||
this.splitContainer1.Panel2.Controls.Add(this.pictureBox2);
|
this.splitContainer1.Panel2.Controls.Add(this.pictureBox2);
|
||||||
this.splitContainer1.Size = new System.Drawing.Size(776, 315);
|
this.splitContainer1.Size = new System.Drawing.Size(960, 362);
|
||||||
this.splitContainer1.SplitterDistance = 388;
|
this.splitContainer1.SplitterDistance = 480;
|
||||||
this.splitContainer1.TabIndex = 9;
|
this.splitContainer1.TabIndex = 9;
|
||||||
this.splitContainer1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
this.splitContainer1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
||||||
//
|
//
|
||||||
// label3
|
// label3
|
||||||
//
|
//
|
||||||
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.label3.Location = new System.Drawing.Point(598, 17);
|
this.label3.Location = new System.Drawing.Point(782, 17);
|
||||||
this.label3.Name = "label3";
|
this.label3.Name = "label3";
|
||||||
this.label3.Size = new System.Drawing.Size(190, 23);
|
this.label3.Size = new System.Drawing.Size(190, 23);
|
||||||
this.label3.TabIndex = 10;
|
this.label3.TabIndex = 10;
|
||||||
@ -174,20 +175,21 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
//
|
//
|
||||||
this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.splitContainer2.Location = new System.Drawing.Point(12, 362);
|
this.splitContainer2.Location = new System.Drawing.Point(12, 429);
|
||||||
this.splitContainer2.Name = "splitContainer2";
|
this.splitContainer2.Name = "splitContainer2";
|
||||||
//
|
//
|
||||||
// splitContainer2.Panel1
|
// splitContainer2.Panel1
|
||||||
//
|
//
|
||||||
|
this.splitContainer2.Panel1.Controls.Add(this.richTextBoxDesc1);
|
||||||
this.splitContainer2.Panel1.Controls.Add(this.textBoxDesc1);
|
this.splitContainer2.Panel1.Controls.Add(this.textBoxDesc1);
|
||||||
this.splitContainer2.Panel1.Controls.Add(this.buttonDel1);
|
this.splitContainer2.Panel1.Controls.Add(this.buttonDel1);
|
||||||
//
|
//
|
||||||
// splitContainer2.Panel2
|
// splitContainer2.Panel2
|
||||||
//
|
//
|
||||||
this.splitContainer2.Panel2.Controls.Add(this.textBoxDesc2);
|
this.splitContainer2.Panel2.Controls.Add(this.richTextBoxDesc2);
|
||||||
this.splitContainer2.Panel2.Controls.Add(this.buttonDel2);
|
this.splitContainer2.Panel2.Controls.Add(this.buttonDel2);
|
||||||
this.splitContainer2.Size = new System.Drawing.Size(775, 81);
|
this.splitContainer2.Size = new System.Drawing.Size(959, 115);
|
||||||
this.splitContainer2.SplitterDistance = 388;
|
this.splitContainer2.SplitterDistance = 480;
|
||||||
this.splitContainer2.TabIndex = 12;
|
this.splitContainer2.TabIndex = 12;
|
||||||
this.splitContainer2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
this.splitContainer2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
||||||
//
|
//
|
||||||
@ -195,7 +197,7 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
//
|
//
|
||||||
this.textBoxDesc1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
this.textBoxDesc1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
this.textBoxDesc1.BackColor = System.Drawing.SystemColors.Control;
|
this.textBoxDesc1.BackColor = System.Drawing.SystemColors.Control;
|
||||||
this.textBoxDesc1.Location = new System.Drawing.Point(-139, 32);
|
this.textBoxDesc1.Location = new System.Drawing.Point(-47, 32);
|
||||||
this.textBoxDesc1.Multiline = true;
|
this.textBoxDesc1.Multiline = true;
|
||||||
this.textBoxDesc1.Name = "textBoxDesc1";
|
this.textBoxDesc1.Name = "textBoxDesc1";
|
||||||
this.textBoxDesc1.Size = new System.Drawing.Size(524, 49);
|
this.textBoxDesc1.Size = new System.Drawing.Size(524, 49);
|
||||||
@ -203,17 +205,6 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.textBoxDesc1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
this.textBoxDesc1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||||
this.textBoxDesc1.Visible = false;
|
this.textBoxDesc1.Visible = false;
|
||||||
//
|
//
|
||||||
// textBoxDesc2
|
|
||||||
//
|
|
||||||
this.textBoxDesc2.BackColor = System.Drawing.SystemColors.Control;
|
|
||||||
this.textBoxDesc2.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
|
||||||
this.textBoxDesc2.Location = new System.Drawing.Point(3, 32);
|
|
||||||
this.textBoxDesc2.Multiline = true;
|
|
||||||
this.textBoxDesc2.Name = "textBoxDesc2";
|
|
||||||
this.textBoxDesc2.Size = new System.Drawing.Size(592, 44);
|
|
||||||
this.textBoxDesc2.TabIndex = 4;
|
|
||||||
this.textBoxDesc2.Visible = false;
|
|
||||||
//
|
|
||||||
// buttonAPISetting
|
// buttonAPISetting
|
||||||
//
|
//
|
||||||
this.buttonAPISetting.Location = new System.Drawing.Point(174, 12);
|
this.buttonAPISetting.Location = new System.Drawing.Point(174, 12);
|
||||||
@ -234,11 +225,33 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.buttonAPILoad.UseVisualStyleBackColor = true;
|
this.buttonAPILoad.UseVisualStyleBackColor = true;
|
||||||
this.buttonAPILoad.Click += new System.EventHandler(this.ButtonAPILoad_Click);
|
this.buttonAPILoad.Click += new System.EventHandler(this.ButtonAPILoad_Click);
|
||||||
//
|
//
|
||||||
|
// richTextBoxDesc1
|
||||||
|
//
|
||||||
|
this.richTextBoxDesc1.Location = new System.Drawing.Point(123, 8);
|
||||||
|
this.richTextBoxDesc1.Name = "richTextBoxDesc1";
|
||||||
|
this.richTextBoxDesc1.Size = new System.Drawing.Size(256, 96);
|
||||||
|
this.richTextBoxDesc1.TabIndex = 4;
|
||||||
|
this.richTextBoxDesc1.Text = "";
|
||||||
|
//
|
||||||
|
// richTextBoxDesc2
|
||||||
|
//
|
||||||
|
this.richTextBoxDesc2.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.richTextBoxDesc2.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.richTextBoxDesc2.Location = new System.Drawing.Point(0, 32);
|
||||||
|
this.richTextBoxDesc2.Name = "richTextBoxDesc2";
|
||||||
|
this.richTextBoxDesc2.ReadOnly = true;
|
||||||
|
this.richTextBoxDesc2.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
||||||
|
this.richTextBoxDesc2.Size = new System.Drawing.Size(469, 78);
|
||||||
|
this.richTextBoxDesc2.TabIndex = 5;
|
||||||
|
this.richTextBoxDesc2.Text = "";
|
||||||
|
//
|
||||||
// Main
|
// Main
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
this.ClientSize = new System.Drawing.Size(984, 551);
|
||||||
this.Controls.Add(this.buttonAPILoad);
|
this.Controls.Add(this.buttonAPILoad);
|
||||||
this.Controls.Add(this.buttonAPISetting);
|
this.Controls.Add(this.buttonAPISetting);
|
||||||
this.Controls.Add(this.splitContainer2);
|
this.Controls.Add(this.splitContainer2);
|
||||||
@ -249,8 +262,12 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.Controls.Add(this.buttonCSV);
|
this.Controls.Add(this.buttonCSV);
|
||||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
this.KeyPreview = true;
|
this.KeyPreview = true;
|
||||||
|
this.MinimumSize = new System.Drawing.Size(1000, 590);
|
||||||
this.Name = "Main";
|
this.Name = "Main";
|
||||||
this.Text = "Bildduplikate v1.4 by kmpr.at";
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Bildduplikate v1.5 by kmpr.at";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing);
|
||||||
|
this.Shown += new System.EventHandler(this.Main_Shown);
|
||||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||||
@ -261,7 +278,6 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
this.splitContainer2.Panel1.ResumeLayout(false);
|
this.splitContainer2.Panel1.ResumeLayout(false);
|
||||||
this.splitContainer2.Panel1.PerformLayout();
|
this.splitContainer2.Panel1.PerformLayout();
|
||||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||||
this.splitContainer2.Panel2.PerformLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||||
this.splitContainer2.ResumeLayout(false);
|
this.splitContainer2.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
@ -282,9 +298,10 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
private System.Windows.Forms.Button buttonReload;
|
private System.Windows.Forms.Button buttonReload;
|
||||||
private System.Windows.Forms.SplitContainer splitContainer2;
|
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||||
private System.Windows.Forms.TextBox textBoxDesc1;
|
private System.Windows.Forms.TextBox textBoxDesc1;
|
||||||
private System.Windows.Forms.TextBox textBoxDesc2;
|
|
||||||
private System.Windows.Forms.Button buttonAPISetting;
|
private System.Windows.Forms.Button buttonAPISetting;
|
||||||
private System.Windows.Forms.Button buttonAPILoad;
|
private System.Windows.Forms.Button buttonAPILoad;
|
||||||
|
private System.Windows.Forms.RichTextBox richTextBoxDesc1;
|
||||||
|
private System.Windows.Forms.RichTextBox richTextBoxDesc2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,11 +20,18 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
|
|
||||||
private List<Duplicate> duplicates = new List<Duplicate>();
|
private List<Duplicate> duplicates = new List<Duplicate>();
|
||||||
|
|
||||||
|
internal List<Duplicate> Duplicates { get => duplicates; set => duplicates = value; }
|
||||||
|
|
||||||
public Main()
|
public Main()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Select CSV with possible duplicates
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void ButtonCSV_Click(object sender, EventArgs e)
|
private void ButtonCSV_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
openFileDialog1.Title = "Select CSV";
|
openFileDialog1.Title = "Select CSV";
|
||||||
@ -40,13 +47,17 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Load possible duplicates from CSV
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileName"></param>
|
||||||
private void LoadCSV(string fileName)
|
private void LoadCSV(string fileName)
|
||||||
{
|
{
|
||||||
line = 0;
|
line = 0;
|
||||||
total = 0;
|
total = 0;
|
||||||
file = fileName;
|
file = fileName;
|
||||||
offset = 0;
|
offset = 0;
|
||||||
duplicates.Clear();
|
Duplicates.Clear();
|
||||||
|
|
||||||
using (StreamReader reader = new StreamReader(fileName))
|
using (StreamReader reader = new StreamReader(fileName))
|
||||||
{
|
{
|
||||||
@ -56,28 +67,33 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
var values = line.Split(',');
|
var values = line.Split(',');
|
||||||
|
|
||||||
Duplicate d = new Duplicate(values[0], values[1]);
|
Duplicate d = new Duplicate(values[0], values[1]);
|
||||||
duplicates.Add(d);
|
Duplicates.Add(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
total = duplicates.Count;
|
total = Duplicates.Count;
|
||||||
api = false;
|
api = false;
|
||||||
|
|
||||||
LoadDuplicates(line);
|
LoadDuplicates(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Process for manual duplicate processing
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lineDup"></param>
|
||||||
|
/// <param name="api"></param>
|
||||||
private void LoadDuplicates(int lineDup, bool api=false)
|
private void LoadDuplicates(int lineDup, bool api=false)
|
||||||
{
|
{
|
||||||
if (duplicates.Count > lineDup)
|
if (Duplicates.Count > lineDup)
|
||||||
{
|
{
|
||||||
if (File.Exists(duplicates.ElementAt(lineDup).Path1) && File.Exists(duplicates.ElementAt(lineDup).Path2))
|
if (File.Exists(Duplicates.ElementAt(lineDup).Path1) && File.Exists(Duplicates.ElementAt(lineDup).Path2))
|
||||||
{
|
{
|
||||||
Image img1 = GetCopyImage(duplicates.ElementAt(lineDup).Path1);
|
Image img1 = GetCopyImage(Duplicates.ElementAt(lineDup).Path1);
|
||||||
Image img2 = GetCopyImage(duplicates.ElementAt(lineDup).Path2);
|
Image img2 = GetCopyImage(Duplicates.ElementAt(lineDup).Path2);
|
||||||
pictureBox1.Image = img1;
|
pictureBox1.Image = img1;
|
||||||
pictureBox2.Image = img2;
|
pictureBox2.Image = img2;
|
||||||
FileInfo f1 = new FileInfo(duplicates.ElementAt(lineDup).Path1);
|
FileInfo f1 = new FileInfo(Duplicates.ElementAt(lineDup).Path1);
|
||||||
FileInfo f2 = new FileInfo(duplicates.ElementAt(lineDup).Path2);
|
FileInfo f2 = new FileInfo(Duplicates.ElementAt(lineDup).Path2);
|
||||||
|
|
||||||
string size1, size2;
|
string size1, size2;
|
||||||
if(f1.Length==f2.Length)
|
if(f1.Length==f2.Length)
|
||||||
@ -96,26 +112,32 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
size2 = "<b>" + FormatSize(f2.Length) + "</b>";
|
size2 = "<b>" + FormatSize(f2.Length) + "</b>";
|
||||||
}
|
}
|
||||||
|
|
||||||
textBoxDesc1.Text = Path.GetFileName(duplicates.ElementAt(lineDup).Path1) + Environment.NewLine + size1 + Environment.NewLine + f1.LastWriteTime + Environment.NewLine + img1.Width + "x" + img1.Height;
|
textBoxDesc1.Text = Path.GetFileName(Duplicates.ElementAt(lineDup).Path1) + Environment.NewLine + size1 + Environment.NewLine + f1.LastWriteTime + Environment.NewLine + img1.Width + "x" + img1.Height;
|
||||||
textBoxDesc2.Text = Path.GetFileName(duplicates.ElementAt(lineDup).Path2) + Environment.NewLine + size2 + Environment.NewLine + f2.LastWriteTime + Environment.NewLine + img2.Width + "x" + img2.Height;
|
richTextBoxDesc2.Text = Path.GetFileName(Duplicates.ElementAt(lineDup).Path2) + Environment.NewLine + size2 + Environment.NewLine + f2.LastWriteTime + Environment.NewLine + img2.Width + "x" + img2.Height;
|
||||||
label3.Text = total + " Duplikate";
|
label3.Text = total + " Duplikate";
|
||||||
UIElementsVisible(true);
|
UIElementsVisible(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (api)
|
if (api)
|
||||||
{
|
{
|
||||||
WebClient webClient = new WebClient();
|
try
|
||||||
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
|
||||||
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?isDuplicate", "{\"duplicateId\":" + duplicates.ElementAt(lineDup).ID + "}");
|
|
||||||
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
|
||||||
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
total--;
|
WebClient webClient = new WebClient();
|
||||||
line++;
|
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||||
LoadDuplicates(line, api);
|
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?isDuplicate", "{\"duplicateId\":" + Duplicates.ElementAt(lineDup).ID + "}");
|
||||||
|
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
||||||
|
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
total--;
|
||||||
|
line++;
|
||||||
|
LoadDuplicates(line, api);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler bei der Kommunikation mit der API:" + Environment.NewLine + ex.ToString(), "API Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -129,15 +151,26 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("Alle Duplikate in CSV abgearbeitet", "Fertig!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
||||||
UIElementsVisible(false);
|
UIElementsVisible(false);
|
||||||
|
if (api)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Alle Duplikate von API abgearbeitet", "Fertig!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Alle Duplikate in CSV abgearbeitet", "Fertig!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// UI-Elements shown or not shown
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="vis"></param>
|
||||||
private void UIElementsVisible(bool vis)
|
private void UIElementsVisible(bool vis)
|
||||||
{
|
{
|
||||||
textBoxDesc1.Visible = vis;
|
textBoxDesc1.Visible = vis;
|
||||||
textBoxDesc2.Visible = vis;
|
richTextBoxDesc2.Visible = vis;
|
||||||
label3.Visible = vis;
|
label3.Visible = vis;
|
||||||
buttonDel1.Visible = vis;
|
buttonDel1.Visible = vis;
|
||||||
buttonDel2.Visible = vis;
|
buttonDel2.Visible = vis;
|
||||||
@ -146,6 +179,11 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
pictureBox2.Visible = vis;
|
pictureBox2.Visible = vis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Format string of file size
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="length"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private string FormatSize(long length)
|
private string FormatSize(long length)
|
||||||
{
|
{
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
@ -158,20 +196,32 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
return string.Format("{0:n1}{1}", number, suffixes[counter]);
|
return string.Format("{0:n1}{1}", number, suffixes[counter]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Mark images as non-duplicates
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void ButtonKeinDuplikat_Click(object sender, EventArgs e)
|
private void ButtonKeinDuplikat_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (api)
|
if (api)
|
||||||
{
|
{
|
||||||
WebClient webClient = new WebClient();
|
try
|
||||||
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
|
||||||
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?noDuplicate", "{\"duplicateId\":" + duplicates.ElementAt(line).ID + "}");
|
|
||||||
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
|
||||||
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
total--;
|
WebClient webClient = new WebClient();
|
||||||
line++;
|
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||||
LoadDuplicates(line, api);
|
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?noDuplicate", "{\"duplicateId\":" + Duplicates.ElementAt(line).ID + "}");
|
||||||
|
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
||||||
|
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
total--;
|
||||||
|
line++;
|
||||||
|
LoadDuplicates(line, api);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler bei der Kommunikation mit der API:" + Environment.NewLine + ex.ToString(), "API Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -183,26 +233,38 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete duplicate file1
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void ButtonDel1_Click(object sender, EventArgs e)
|
private void ButtonDel1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (api)
|
if (api)
|
||||||
{
|
{
|
||||||
WebClient webClient = new WebClient();
|
try
|
||||||
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
|
||||||
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?isDuplicate", "{\"duplicateId\":" + duplicates.ElementAt(line).ID + "}");
|
|
||||||
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
|
||||||
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
File.Delete(duplicates.ElementAt(line).Path1);
|
WebClient webClient = new WebClient();
|
||||||
total--;
|
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||||
line++;
|
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?isDuplicate", "{\"duplicateId\":" + Duplicates.ElementAt(line).ID + "}");
|
||||||
LoadDuplicates(line, api);
|
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
||||||
|
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
File.Delete(Duplicates.ElementAt(line).Path1);
|
||||||
|
total--;
|
||||||
|
line++;
|
||||||
|
LoadDuplicates(line, api);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler bei der Kommunikation mit der API:" + Environment.NewLine + ex.ToString(), "API Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
File.Delete(duplicates.ElementAt(line).Path1);
|
File.Delete(Duplicates.ElementAt(line).Path1);
|
||||||
File_DeleteLine(line);
|
File_DeleteLine(line);
|
||||||
line++;
|
line++;
|
||||||
total--;
|
total--;
|
||||||
@ -210,26 +272,38 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete duplicate file2
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void ButtonDel2_Click(object sender, EventArgs e)
|
private void ButtonDel2_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (api)
|
if (api)
|
||||||
{
|
{
|
||||||
WebClient webClient = new WebClient();
|
try
|
||||||
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
|
||||||
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?isDuplicate", "{\"duplicateId\":" + duplicates.ElementAt(line).ID + "}");
|
|
||||||
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
|
||||||
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
File.Delete(duplicates.ElementAt(line).Path2);
|
WebClient webClient = new WebClient();
|
||||||
total--;
|
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||||
line++;
|
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?isDuplicate", "{\"duplicateId\":" + Duplicates.ElementAt(line).ID + "}");
|
||||||
LoadDuplicates(line, api);
|
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
||||||
|
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
File.Delete(Duplicates.ElementAt(line).Path2);
|
||||||
|
total--;
|
||||||
|
line++;
|
||||||
|
LoadDuplicates(line, api);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler bei der Kommunikation mit der API:" + Environment.NewLine + ex.ToString(), "API Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
File.Delete(duplicates.ElementAt(line).Path2);
|
File.Delete(Duplicates.ElementAt(line).Path2);
|
||||||
File_DeleteLine(line);
|
File_DeleteLine(line);
|
||||||
line++;
|
line++;
|
||||||
total--;
|
total--;
|
||||||
@ -237,6 +311,11 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper for showing images and being able to delete them
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private Image GetCopyImage(string path)
|
private Image GetCopyImage(string path)
|
||||||
{
|
{
|
||||||
using (Image image = Image.FromFile(path))
|
using (Image image = Image.FromFile(path))
|
||||||
@ -246,6 +325,11 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Keyboard control handling for duplicate processing
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void Form1_KeyDown(object sender, KeyEventArgs e)
|
private void Form1_KeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.KeyCode == Keys.C)
|
if (e.KeyCode == Keys.C)
|
||||||
@ -276,41 +360,118 @@ namespace Mk0.Software.Bildduplikate
|
|||||||
api.ShowDialog();
|
api.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads possible duplicates from API
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void ButtonAPILoad_Click(object sender, EventArgs e)
|
private void ButtonAPILoad_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
WebClient webClient = new WebClient();
|
try
|
||||||
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
|
||||||
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl+"?getDuplicates", "{\"amount\":500}");
|
|
||||||
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
|
||||||
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
duplicates.Clear();
|
WebClient webClient = new WebClient();
|
||||||
line = 0;
|
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
|
||||||
total = 0;
|
string json = webClient.UploadString(Properties.Settings.Default.ApiUrl + "?getDuplicates", "{\"amount\":" + Properties.Settings.Default.imagesFromAPI + "}");
|
||||||
file = "";
|
var resObj = new JavaScriptSerializer().Deserialize<APIResponse>(json);
|
||||||
api = true;
|
if (resObj.response_code != "200") { MessageBox.Show("Fehler", resObj.response_desc, MessageBoxButtons.OK, MessageBoxIcon.Error); }
|
||||||
offset = 0;
|
else
|
||||||
foreach (APIResponsePayload pl in resObj.payload)
|
|
||||||
{
|
{
|
||||||
Duplicate d = new Duplicate(ReplacePath(pl.file1), ReplacePath(pl.file2), pl.id);
|
Duplicates.Clear();
|
||||||
duplicates.Add(d);
|
line = 0;
|
||||||
|
total = 0;
|
||||||
|
file = "";
|
||||||
|
api = true;
|
||||||
|
offset = 0;
|
||||||
|
foreach (APIResponsePayload pl in resObj.payload)
|
||||||
|
{
|
||||||
|
Duplicate d = new Duplicate(ReplacePath(pl.file1), ReplacePath(pl.file2), pl.id);
|
||||||
|
Duplicates.Add(d);
|
||||||
|
}
|
||||||
|
total = Duplicates.Count;
|
||||||
|
LoadDuplicates(line, true);
|
||||||
}
|
}
|
||||||
total = duplicates.Count;
|
}
|
||||||
LoadDuplicates(line, true);
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Fehler bei der Kommunikation mit der API:" + Environment.NewLine + ex.ToString(), "API Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces API saved path with local (or network) path
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
private string ReplacePath(string file)
|
private string ReplacePath(string file)
|
||||||
{
|
{
|
||||||
|
if (Properties.Settings.Default.ReplacePath == String.Empty)
|
||||||
|
{
|
||||||
|
return file;
|
||||||
|
}
|
||||||
return file.Replace(Properties.Settings.Default.ReplacePath, Properties.Settings.Default.ReplaceWith);
|
return file.Replace(Properties.Settings.Default.ReplacePath, Properties.Settings.Default.ReplaceWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handling when Window is closing
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void Main_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
Properties.Settings.Default.lastWidth = Width;
|
||||||
|
Properties.Settings.Default.lastHeight = Height;
|
||||||
|
Properties.Settings.Default.lastTop = Top;
|
||||||
|
Properties.Settings.Default.lastLeft = Left;
|
||||||
|
Properties.Settings.Default.fullScreen = WindowState == FormWindowState.Maximized;
|
||||||
|
Properties.Settings.Default.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Window handling when Window is Shown Event
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void Main_Shown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (Properties.Settings.Default.fullScreen)
|
||||||
|
{
|
||||||
|
WindowState = FormWindowState.Maximized;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Properties.Settings.Default.lastHeight >= MinimumSize.Height)
|
||||||
|
{
|
||||||
|
Height = Properties.Settings.Default.lastHeight;
|
||||||
|
}
|
||||||
|
if (Properties.Settings.Default.lastWidth >= MinimumSize.Width)
|
||||||
|
{
|
||||||
|
Width = Properties.Settings.Default.lastWidth;
|
||||||
|
}
|
||||||
|
if (Properties.Settings.Default.lastTop <= Screen.PrimaryScreen.Bounds.Height && Properties.Settings.Default.lastTop >= 0)
|
||||||
|
{
|
||||||
|
Top = Properties.Settings.Default.lastTop;
|
||||||
|
}
|
||||||
|
if (Properties.Settings.Default.lastLeft <= Screen.PrimaryScreen.Bounds.Width && Properties.Settings.Default.lastLeft >= 0)
|
||||||
|
{
|
||||||
|
Left = Properties.Settings.Default.lastLeft;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reloads CSV / API
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
private void ButtonReload_Click(object sender, EventArgs e)
|
private void ButtonReload_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
LoadDuplicates(line);
|
LoadDuplicates(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete specified line in CSV file
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lineFile"></param>
|
||||||
private void File_DeleteLine(int lineFile)
|
private void File_DeleteLine(int lineFile)
|
||||||
{
|
{
|
||||||
int linetodelete = lineFile + 1 - offset;
|
int linetodelete = lineFile + 1 - offset;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<UpdateRequired>false</UpdateRequired>
|
<UpdateRequired>false</UpdateRequired>
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>1.4.0.0</ApplicationVersion>
|
<ApplicationVersion>1.5.0.0</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||||
// indem Sie "*" wie unten gezeigt eingeben:
|
// indem Sie "*" wie unten gezeigt eingeben:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.4.0.0")]
|
[assembly: AssemblyVersion("1.5.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.4.0.0")]
|
[assembly: AssemblyFileVersion("1.5.0.0")]
|
||||||
|
@ -58,5 +58,77 @@ namespace Mk0.Software.Bildduplikate.Properties {
|
|||||||
this["ReplaceWith"] = value;
|
this["ReplaceWith"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||||
|
public int lastWidth {
|
||||||
|
get {
|
||||||
|
return ((int)(this["lastWidth"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["lastWidth"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||||
|
public int lastHeight {
|
||||||
|
get {
|
||||||
|
return ((int)(this["lastHeight"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["lastHeight"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||||
|
public int lastTop {
|
||||||
|
get {
|
||||||
|
return ((int)(this["lastTop"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["lastTop"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("0")]
|
||||||
|
public int lastLeft {
|
||||||
|
get {
|
||||||
|
return ((int)(this["lastLeft"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["lastLeft"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||||
|
public bool fullScreen {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["fullScreen"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["fullScreen"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("500")]
|
||||||
|
public int imagesFromAPI {
|
||||||
|
get {
|
||||||
|
return ((int)(this["imagesFromAPI"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["imagesFromAPI"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,23 @@
|
|||||||
<Setting Name="ReplaceWith" Type="System.String" Scope="User">
|
<Setting Name="ReplaceWith" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)" />
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="lastWidth" Type="System.Int32" Scope="User">
|
||||||
|
<Value Profile="(Default)">0</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="lastHeight" Type="System.Int32" Scope="User">
|
||||||
|
<Value Profile="(Default)">0</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="lastTop" Type="System.Int32" Scope="User">
|
||||||
|
<Value Profile="(Default)">0</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="lastLeft" Type="System.Int32" Scope="User">
|
||||||
|
<Value Profile="(Default)">0</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="fullScreen" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">False</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="imagesFromAPI" Type="System.Int32" Scope="User">
|
||||||
|
<Value Profile="(Default)">500</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
Loading…
Reference in New Issue
Block a user