diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa26d5..739e648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. + +## [1.3] - 2020-12-20 +- Added: Support for shortcuts +- Added: Optional parameters +- Added: App icons +- Added: You can now auto-update the app + ## [1.2] - 2018-03-10 - Added: Modify an app entry - Added: Check if another instance is running diff --git a/Mint/AboutForm.cs b/Mint/AboutForm.cs index 871db5d..24f1771 100644 --- a/Mint/AboutForm.cs +++ b/Mint/AboutForm.cs @@ -47,8 +47,8 @@ private void t2_Tick(object sender, EventArgs e) string s9 = "deadmoon © "; string s10 = "deadmoon © 2"; string s11 = "deadmoon © 20"; - string s12 = "deadmoon © 201"; - string s13 = "deadmoon © 2018"; + string s12 = "deadmoon © 202"; + string s13 = "deadmoon © 2021"; switch (l2.Text) { @@ -88,12 +88,12 @@ private void t2_Tick(object sender, EventArgs e) case "deadmoon © 20": l2.Text = s12; break; - case "deadmoon © 201": + case "deadmoon © 202": l2.Text = s13; t2.Stop(); //t1.Start(); break; - case "deadmoon © 2018": + case "deadmoon © 2021": l2.Text = s0; break; } diff --git a/Mint/AppsStructure.cs b/Mint/AppsStructure.cs index ff1d879..ced1947 100644 --- a/Mint/AppsStructure.cs +++ b/Mint/AppsStructure.cs @@ -24,5 +24,6 @@ public class App { public string AppTitle { get; set; } public string AppLink { get; set; } + public string AppParams { get; set; } } } diff --git a/Mint/MainForm.Designer.cs b/Mint/MainForm.Designer.cs index 8b7dd2e..0e1d2b9 100644 --- a/Mint/MainForm.Designer.cs +++ b/Mint/MainForm.Designer.cs @@ -46,6 +46,7 @@ private void InitializeComponent() this.radioZerg = new System.Windows.Forms.RadioButton(); this.label6 = new System.Windows.Forms.Label(); this.panelApps = new System.Windows.Forms.Panel(); + this.btnSort = new System.Windows.Forms.Button(); this.btnEdit = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); this.listApps = new System.Windows.Forms.ListBox(); @@ -53,6 +54,8 @@ private void InitializeComponent() this.btnDelete = new System.Windows.Forms.Button(); this.btnClear = new System.Windows.Forms.Button(); this.panelAddApp = new System.Windows.Forms.Panel(); + this.txtParams = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); this.btnLocate = new System.Windows.Forms.Button(); this.btnAdd = new System.Windows.Forms.Button(); this.txtAppTitle = new System.Windows.Forms.TextBox(); @@ -82,7 +85,7 @@ private void InitializeComponent() this.topPanel.Location = new System.Drawing.Point(0, 0); this.topPanel.Margin = new System.Windows.Forms.Padding(2); this.topPanel.Name = "topPanel"; - this.topPanel.Size = new System.Drawing.Size(773, 77); + this.topPanel.Size = new System.Drawing.Size(618, 62); this.topPanel.TabIndex = 8; // // btnUpdate @@ -93,10 +96,10 @@ private void InitializeComponent() this.btnUpdate.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; this.btnUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnUpdate.ForeColor = System.Drawing.Color.White; - this.btnUpdate.Location = new System.Drawing.Point(664, 12); + this.btnUpdate.Location = new System.Drawing.Point(531, 10); this.btnUpdate.Margin = new System.Windows.Forms.Padding(2); this.btnUpdate.Name = "btnUpdate"; - this.btnUpdate.Size = new System.Drawing.Size(94, 39); + this.btnUpdate.Size = new System.Drawing.Size(75, 31); this.btnUpdate.TabIndex = 81; this.btnUpdate.Tag = "themeable"; this.btnUpdate.Text = "Update"; @@ -107,10 +110,10 @@ private void InitializeComponent() // this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand; this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(12, 12); + this.pictureBox1.Location = new System.Drawing.Point(10, 10); this.pictureBox1.Margin = new System.Windows.Forms.Padding(2); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(55, 54); + this.pictureBox1.Size = new System.Drawing.Size(44, 43); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 2; this.pictureBox1.TabStop = false; @@ -120,10 +123,10 @@ private void InitializeComponent() // this.lblversion.AutoSize = true; this.lblversion.ForeColor = System.Drawing.Color.Silver; - this.lblversion.Location = new System.Drawing.Point(90, 46); + this.lblversion.Location = new System.Drawing.Point(72, 37); this.lblversion.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblversion.Name = "lblversion"; - this.lblversion.Size = new System.Drawing.Size(68, 20); + this.lblversion.Size = new System.Drawing.Size(52, 15); this.lblversion.TabIndex = 4; this.lblversion.Text = "Version: "; // @@ -132,10 +135,10 @@ private void InitializeComponent() this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(88, 9); + this.label2.Location = new System.Drawing.Point(70, 7); this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(66, 32); + this.label2.Size = new System.Drawing.Size(53, 25); this.label2.TabIndex = 3; this.label2.Text = "Mint"; // @@ -146,10 +149,10 @@ private void InitializeComponent() this.botPanel.Controls.Add(this.panelApps); this.botPanel.Controls.Add(this.panelAddApp); this.botPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.botPanel.Location = new System.Drawing.Point(0, 77); + this.botPanel.Location = new System.Drawing.Point(0, 62); this.botPanel.Margin = new System.Windows.Forms.Padding(2); this.botPanel.Name = "botPanel"; - this.botPanel.Size = new System.Drawing.Size(773, 589); + this.botPanel.Size = new System.Drawing.Size(618, 523); this.botPanel.TabIndex = 9; // // panelOptions @@ -163,9 +166,10 @@ private void InitializeComponent() this.panelOptions.Controls.Add(this.radioOcean); this.panelOptions.Controls.Add(this.radioZerg); this.panelOptions.Controls.Add(this.label6); - this.panelOptions.Location = new System.Drawing.Point(12, 302); + this.panelOptions.Location = new System.Drawing.Point(10, 312); + this.panelOptions.Margin = new System.Windows.Forms.Padding(2); this.panelOptions.Name = "panelOptions"; - this.panelOptions.Size = new System.Drawing.Size(370, 270); + this.panelOptions.Size = new System.Drawing.Size(296, 200); this.panelOptions.TabIndex = 91; // // checkAutoStart @@ -173,9 +177,10 @@ private void InitializeComponent() this.checkAutoStart.AutoSize = true; this.checkAutoStart.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.checkAutoStart.ForeColor = System.Drawing.Color.Silver; - this.checkAutoStart.Location = new System.Drawing.Point(17, 184); + this.checkAutoStart.Location = new System.Drawing.Point(14, 147); + this.checkAutoStart.Margin = new System.Windows.Forms.Padding(2); this.checkAutoStart.Name = "checkAutoStart"; - this.checkAutoStart.Size = new System.Drawing.Size(211, 32); + this.checkAutoStart.Size = new System.Drawing.Size(170, 25); this.checkAutoStart.TabIndex = 85; this.checkAutoStart.Text = "Start with Windows"; this.checkAutoStart.UseVisualStyleBackColor = true; @@ -186,9 +191,10 @@ private void InitializeComponent() this.radioMinimal.AutoSize = true; this.radioMinimal.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioMinimal.ForeColor = System.Drawing.Color.Gray; - this.radioMinimal.Location = new System.Drawing.Point(124, 137); + this.radioMinimal.Location = new System.Drawing.Point(99, 110); + this.radioMinimal.Margin = new System.Windows.Forms.Padding(2); this.radioMinimal.Name = "radioMinimal"; - this.radioMinimal.Size = new System.Drawing.Size(106, 32); + this.radioMinimal.Size = new System.Drawing.Size(86, 25); this.radioMinimal.TabIndex = 84; this.radioMinimal.Text = "Minimal"; this.radioMinimal.UseVisualStyleBackColor = true; @@ -199,9 +205,10 @@ private void InitializeComponent() this.radioCaramel.AutoSize = true; this.radioCaramel.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioCaramel.ForeColor = System.Drawing.Color.DarkOrange; - this.radioCaramel.Location = new System.Drawing.Point(124, 61); + this.radioCaramel.Location = new System.Drawing.Point(99, 49); + this.radioCaramel.Margin = new System.Windows.Forms.Padding(2); this.radioCaramel.Name = "radioCaramel"; - this.radioCaramel.Size = new System.Drawing.Size(106, 32); + this.radioCaramel.Size = new System.Drawing.Size(87, 25); this.radioCaramel.TabIndex = 83; this.radioCaramel.Text = "Caramel"; this.radioCaramel.UseVisualStyleBackColor = true; @@ -212,9 +219,10 @@ private void InitializeComponent() this.radioLime.AutoSize = true; this.radioLime.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioLime.ForeColor = System.Drawing.Color.LimeGreen; - this.radioLime.Location = new System.Drawing.Point(124, 99); + this.radioLime.Location = new System.Drawing.Point(99, 79); + this.radioLime.Margin = new System.Windows.Forms.Padding(2); this.radioLime.Name = "radioLime"; - this.radioLime.Size = new System.Drawing.Size(77, 32); + this.radioLime.Size = new System.Drawing.Size(63, 25); this.radioLime.TabIndex = 82; this.radioLime.Text = "Lime"; this.radioLime.UseVisualStyleBackColor = true; @@ -225,9 +233,10 @@ private void InitializeComponent() this.radioMagma.AutoSize = true; this.radioMagma.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioMagma.ForeColor = System.Drawing.Color.Tomato; - this.radioMagma.Location = new System.Drawing.Point(17, 99); + this.radioMagma.Location = new System.Drawing.Point(14, 79); + this.radioMagma.Margin = new System.Windows.Forms.Padding(2); this.radioMagma.Name = "radioMagma"; - this.radioMagma.Size = new System.Drawing.Size(101, 32); + this.radioMagma.Size = new System.Drawing.Size(83, 25); this.radioMagma.TabIndex = 81; this.radioMagma.Text = "Magma"; this.radioMagma.UseVisualStyleBackColor = true; @@ -239,9 +248,10 @@ private void InitializeComponent() this.radioOcean.Checked = true; this.radioOcean.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioOcean.ForeColor = System.Drawing.Color.DodgerBlue; - this.radioOcean.Location = new System.Drawing.Point(17, 61); + this.radioOcean.Location = new System.Drawing.Point(14, 49); + this.radioOcean.Margin = new System.Windows.Forms.Padding(2); this.radioOcean.Name = "radioOcean"; - this.radioOcean.Size = new System.Drawing.Size(90, 32); + this.radioOcean.Size = new System.Drawing.Size(74, 25); this.radioOcean.TabIndex = 80; this.radioOcean.TabStop = true; this.radioOcean.Text = "Ocean"; @@ -253,9 +263,10 @@ private void InitializeComponent() this.radioZerg.AutoSize = true; this.radioZerg.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.radioZerg.ForeColor = System.Drawing.Color.MediumOrchid; - this.radioZerg.Location = new System.Drawing.Point(17, 137); + this.radioZerg.Location = new System.Drawing.Point(14, 110); + this.radioZerg.Margin = new System.Windows.Forms.Padding(2); this.radioZerg.Name = "radioZerg"; - this.radioZerg.Size = new System.Drawing.Size(75, 32); + this.radioZerg.Size = new System.Drawing.Size(62, 25); this.radioZerg.TabIndex = 79; this.radioZerg.Text = "Zerg"; this.radioZerg.UseVisualStyleBackColor = true; @@ -266,10 +277,10 @@ private void InitializeComponent() this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.ForeColor = System.Drawing.Color.DodgerBlue; - this.label6.Location = new System.Drawing.Point(11, 10); + this.label6.Location = new System.Drawing.Point(9, 8); this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(112, 35); + this.label6.Size = new System.Drawing.Size(89, 28); this.label6.TabIndex = 78; this.label6.Tag = "themeable"; this.label6.Text = "Options:"; @@ -277,16 +288,36 @@ private void InitializeComponent() // panelApps // this.panelApps.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelApps.Controls.Add(this.btnSort); this.panelApps.Controls.Add(this.btnEdit); this.panelApps.Controls.Add(this.panel2); this.panelApps.Controls.Add(this.label3); this.panelApps.Controls.Add(this.btnDelete); this.panelApps.Controls.Add(this.btnClear); - this.panelApps.Location = new System.Drawing.Point(388, 17); + this.panelApps.Location = new System.Drawing.Point(310, 14); + this.panelApps.Margin = new System.Windows.Forms.Padding(2); this.panelApps.Name = "panelApps"; - this.panelApps.Size = new System.Drawing.Size(370, 555); + this.panelApps.Size = new System.Drawing.Size(296, 498); this.panelApps.TabIndex = 90; // + // btnSort + // + this.btnSort.BackColor = System.Drawing.Color.DodgerBlue; + this.btnSort.FlatAppearance.BorderColor = System.Drawing.Color.DodgerBlue; + this.btnSort.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue; + this.btnSort.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; + this.btnSort.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSort.ForeColor = System.Drawing.Color.White; + this.btnSort.Location = new System.Drawing.Point(205, 11); + this.btnSort.Margin = new System.Windows.Forms.Padding(2); + this.btnSort.Name = "btnSort"; + this.btnSort.Size = new System.Drawing.Size(71, 31); + this.btnSort.TabIndex = 92; + this.btnSort.Tag = "themeable"; + this.btnSort.Text = "Sort"; + this.btnSort.UseVisualStyleBackColor = false; + this.btnSort.Click += new System.EventHandler(this.btnSort_Click); + // // btnEdit // this.btnEdit.BackColor = System.Drawing.Color.DodgerBlue; @@ -295,10 +326,10 @@ private void InitializeComponent() this.btnEdit.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnEdit.ForeColor = System.Drawing.Color.White; - this.btnEdit.Location = new System.Drawing.Point(163, 501); + this.btnEdit.Location = new System.Drawing.Point(130, 445); this.btnEdit.Margin = new System.Windows.Forms.Padding(2); this.btnEdit.Name = "btnEdit"; - this.btnEdit.Size = new System.Drawing.Size(89, 39); + this.btnEdit.Size = new System.Drawing.Size(71, 31); this.btnEdit.TabIndex = 84; this.btnEdit.Tag = "themeable"; this.btnEdit.Text = "Modify"; @@ -309,9 +340,10 @@ private void InitializeComponent() // this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.Controls.Add(this.listApps); - this.panel2.Location = new System.Drawing.Point(20, 58); + this.panel2.Location = new System.Drawing.Point(16, 46); + this.panel2.Margin = new System.Windows.Forms.Padding(2); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(325, 438); + this.panel2.Size = new System.Drawing.Size(260, 395); this.panel2.TabIndex = 83; // // listApps @@ -322,10 +354,11 @@ private void InitializeComponent() this.listApps.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.listApps.ForeColor = System.Drawing.Color.White; this.listApps.FormattingEnabled = true; - this.listApps.ItemHeight = 28; + this.listApps.ItemHeight = 21; this.listApps.Location = new System.Drawing.Point(0, 0); + this.listApps.Margin = new System.Windows.Forms.Padding(2); this.listApps.Name = "listApps"; - this.listApps.Size = new System.Drawing.Size(323, 436); + this.listApps.Size = new System.Drawing.Size(258, 393); this.listApps.TabIndex = 78; // // label3 @@ -333,10 +366,10 @@ private void InitializeComponent() this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3.ForeColor = System.Drawing.Color.DodgerBlue; - this.label3.Location = new System.Drawing.Point(14, 9); + this.label3.Location = new System.Drawing.Point(11, 7); this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(79, 35); + this.label3.Size = new System.Drawing.Size(63, 28); this.label3.TabIndex = 77; this.label3.Tag = "themeable"; this.label3.Text = "Apps:"; @@ -349,10 +382,10 @@ private void InitializeComponent() this.btnDelete.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDelete.ForeColor = System.Drawing.Color.White; - this.btnDelete.Location = new System.Drawing.Point(256, 501); + this.btnDelete.Location = new System.Drawing.Point(205, 445); this.btnDelete.Margin = new System.Windows.Forms.Padding(2); this.btnDelete.Name = "btnDelete"; - this.btnDelete.Size = new System.Drawing.Size(89, 39); + this.btnDelete.Size = new System.Drawing.Size(71, 31); this.btnDelete.TabIndex = 81; this.btnDelete.Tag = "themeable"; this.btnDelete.Text = "Delete"; @@ -367,10 +400,10 @@ private void InitializeComponent() this.btnClear.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClear.ForeColor = System.Drawing.Color.White; - this.btnClear.Location = new System.Drawing.Point(20, 501); + this.btnClear.Location = new System.Drawing.Point(17, 445); this.btnClear.Margin = new System.Windows.Forms.Padding(2); this.btnClear.Name = "btnClear"; - this.btnClear.Size = new System.Drawing.Size(89, 39); + this.btnClear.Size = new System.Drawing.Size(71, 31); this.btnClear.TabIndex = 79; this.btnClear.Tag = "themeable"; this.btnClear.Text = "Clear"; @@ -380,6 +413,8 @@ private void InitializeComponent() // panelAddApp // this.panelAddApp.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panelAddApp.Controls.Add(this.txtParams); + this.panelAddApp.Controls.Add(this.label7); this.panelAddApp.Controls.Add(this.btnLocate); this.panelAddApp.Controls.Add(this.btnAdd); this.panelAddApp.Controls.Add(this.txtAppTitle); @@ -387,11 +422,37 @@ private void InitializeComponent() this.panelAddApp.Controls.Add(this.label5); this.panelAddApp.Controls.Add(this.txtAppLink); this.panelAddApp.Controls.Add(this.label4); - this.panelAddApp.Location = new System.Drawing.Point(12, 17); + this.panelAddApp.Location = new System.Drawing.Point(10, 14); + this.panelAddApp.Margin = new System.Windows.Forms.Padding(2); this.panelAddApp.Name = "panelAddApp"; - this.panelAddApp.Size = new System.Drawing.Size(370, 279); + this.panelAddApp.Size = new System.Drawing.Size(296, 294); this.panelAddApp.TabIndex = 89; // + // txtParams + // + this.txtParams.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); + this.txtParams.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtParams.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtParams.ForeColor = System.Drawing.Color.White; + this.txtParams.Location = new System.Drawing.Point(14, 211); + this.txtParams.Margin = new System.Windows.Forms.Padding(2); + this.txtParams.Name = "txtParams"; + this.txtParams.Size = new System.Drawing.Size(264, 29); + this.txtParams.TabIndex = 91; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.ForeColor = System.Drawing.Color.Silver; + this.label7.Location = new System.Drawing.Point(10, 188); + this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(102, 21); + this.label7.TabIndex = 90; + this.label7.Tag = ""; + this.label7.Text = "(Parameters)"; + // // btnLocate // this.btnLocate.BackColor = System.Drawing.Color.DodgerBlue; @@ -400,10 +461,10 @@ private void InitializeComponent() this.btnLocate.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; this.btnLocate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLocate.ForeColor = System.Drawing.Color.White; - this.btnLocate.Location = new System.Drawing.Point(309, 98); + this.btnLocate.Location = new System.Drawing.Point(247, 78); this.btnLocate.Margin = new System.Windows.Forms.Padding(2); this.btnLocate.Name = "btnLocate"; - this.btnLocate.Size = new System.Drawing.Size(37, 34); + this.btnLocate.Size = new System.Drawing.Size(30, 29); this.btnLocate.TabIndex = 89; this.btnLocate.Tag = "themeable"; this.btnLocate.Text = "..."; @@ -418,10 +479,10 @@ private void InitializeComponent() this.btnAdd.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue; this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnAdd.ForeColor = System.Drawing.Color.White; - this.btnAdd.Location = new System.Drawing.Point(252, 217); + this.btnAdd.Location = new System.Drawing.Point(203, 244); this.btnAdd.Margin = new System.Windows.Forms.Padding(2); this.btnAdd.Name = "btnAdd"; - this.btnAdd.Size = new System.Drawing.Size(94, 39); + this.btnAdd.Size = new System.Drawing.Size(75, 31); this.btnAdd.TabIndex = 80; this.btnAdd.Tag = "themeable"; this.btnAdd.Text = "Add"; @@ -434,9 +495,10 @@ private void InitializeComponent() this.txtAppTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtAppTitle.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtAppTitle.ForeColor = System.Drawing.Color.White; - this.txtAppTitle.Location = new System.Drawing.Point(17, 178); + this.txtAppTitle.Location = new System.Drawing.Point(14, 142); + this.txtAppTitle.Margin = new System.Windows.Forms.Padding(2); this.txtAppTitle.Name = "txtAppTitle"; - this.txtAppTitle.Size = new System.Drawing.Size(329, 34); + this.txtAppTitle.Size = new System.Drawing.Size(264, 29); this.txtAppTitle.TabIndex = 88; // // label1 @@ -444,10 +506,10 @@ private void InitializeComponent() this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.ForeColor = System.Drawing.Color.DodgerBlue; - this.label1.Location = new System.Drawing.Point(11, 9); + this.label1.Location = new System.Drawing.Point(9, 7); this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(192, 35); + this.label1.Size = new System.Drawing.Size(154, 28); this.label1.TabIndex = 84; this.label1.Tag = "themeable"; this.label1.Text = "Add a new app:"; @@ -457,10 +519,10 @@ private void InitializeComponent() this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.ForeColor = System.Drawing.Color.Silver; - this.label5.Location = new System.Drawing.Point(12, 67); + this.label5.Location = new System.Drawing.Point(10, 54); this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(116, 28); + this.label5.Size = new System.Drawing.Size(95, 21); this.label5.TabIndex = 87; this.label5.Tag = ""; this.label5.Text = "Locate app:"; @@ -471,9 +533,10 @@ private void InitializeComponent() this.txtAppLink.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtAppLink.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtAppLink.ForeColor = System.Drawing.Color.White; - this.txtAppLink.Location = new System.Drawing.Point(17, 98); + this.txtAppLink.Location = new System.Drawing.Point(14, 78); + this.txtAppLink.Margin = new System.Windows.Forms.Padding(2); this.txtAppLink.Name = "txtAppLink"; - this.txtAppLink.Size = new System.Drawing.Size(287, 34); + this.txtAppLink.Size = new System.Drawing.Size(230, 29); this.txtAppLink.TabIndex = 85; // // label4 @@ -481,10 +544,10 @@ private void InitializeComponent() this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.ForeColor = System.Drawing.Color.Silver; - this.label4.Location = new System.Drawing.Point(12, 147); + this.label4.Location = new System.Drawing.Point(10, 118); this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(95, 28); + this.label4.Size = new System.Drawing.Size(78, 21); this.label4.TabIndex = 86; this.label4.Tag = ""; this.label4.Text = "App title:"; @@ -500,20 +563,19 @@ private void InitializeComponent() // launcherMenu // this.launcherMenu.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.launcherMenu.Font = new System.Drawing.Font("Segoe UI", 11F); + this.launcherMenu.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.launcherMenu.ImageScalingSize = new System.Drawing.Size(20, 20); this.launcherMenu.Name = "launcherMenu"; this.launcherMenu.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.launcherMenu.ShowImageMargin = false; - this.launcherMenu.Size = new System.Drawing.Size(36, 4); + this.launcherMenu.Size = new System.Drawing.Size(181, 26); this.launcherMenu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.launcherMenu_ItemClicked); // // MainForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(120F, 120F); + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.ClientSize = new System.Drawing.Size(773, 666); + this.ClientSize = new System.Drawing.Size(618, 585); this.Controls.Add(this.botPanel); this.Controls.Add(this.topPanel); this.DoubleBuffered = true; @@ -521,6 +583,7 @@ private void InitializeComponent() this.ForeColor = System.Drawing.Color.White; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(2); this.MaximizeBox = false; this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -576,6 +639,9 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkAutoStart; private System.Windows.Forms.Button btnUpdate; private System.Windows.Forms.Button btnEdit; + private System.Windows.Forms.TextBox txtParams; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Button btnSort; } } diff --git a/Mint/MainForm.cs b/Mint/MainForm.cs index 3c29acc..00c9e8d 100644 --- a/Mint/MainForm.cs +++ b/Mint/MainForm.cs @@ -11,6 +11,8 @@ using System.Net; using System.Diagnostics; using Newtonsoft.Json; +using IWshRuntimeLibrary; +using System.Reflection; namespace Mint { @@ -19,7 +21,6 @@ public partial class MainForm : Form internal AppsStructure AppsStructure; readonly string _latestVersionLink = "https://raw.githubusercontent.com/hellzerg/mint/master/version.txt"; - readonly string _releasesLink = "https://github.com/hellzerg/mint/releases"; readonly string _noNewVersionMessage = "You already have the latest version!"; readonly string _betaVersionMessage = "You are using an experimental version!"; @@ -34,6 +35,8 @@ public MainForm() InitializeComponent(); CheckForIllegalCrossThreadCalls = false; + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + Options.ApplyTheme(this); launcherMenu.Renderer = new ToolStripRendererMaterial(); @@ -51,16 +54,16 @@ private void MainForm_Load(object sender, EventArgs e) private void LoadAppsStructure() { - if (File.Exists(Options.AppsStructureFile)) + if (System.IO.File.Exists(Options.AppsStructureFile)) { - AppsStructure = JsonConvert.DeserializeObject(File.ReadAllText(Options.AppsStructureFile)); + AppsStructure = JsonConvert.DeserializeObject(System.IO.File.ReadAllText(Options.AppsStructureFile)); } else { AppsStructure = new AppsStructure(); AppsStructure.Apps = new List(); - using (FileStream fs = File.Open(Options.AppsStructureFile, FileMode.CreateNew)) + using (FileStream fs = System.IO.File.Open(Options.AppsStructureFile, FileMode.CreateNew)) using (StreamWriter sw = new StreamWriter(fs)) using (JsonWriter jw = new JsonTextWriter(sw)) { @@ -74,9 +77,9 @@ private void LoadAppsStructure() private void SaveAppsStructure() { - File.WriteAllText(Options.AppsStructureFile, string.Empty); + System.IO.File.WriteAllText(Options.AppsStructureFile, string.Empty); - using (FileStream fs = File.Open(Options.AppsStructureFile, FileMode.OpenOrCreate)) + using (FileStream fs = System.IO.File.Open(Options.AppsStructureFile, FileMode.OpenOrCreate)) using (StreamWriter sw = new StreamWriter(fs)) using (JsonWriter jw = new JsonTextWriter(sw)) { @@ -101,6 +104,8 @@ private void LoadAppsList() } } } + + label3.Text = string.Format("Apps ({0})", AppsStructure.Apps.Count); } private void LoadOptions() @@ -138,13 +143,15 @@ private void BuildLauncherMenu() { foreach (App x in AppsStructure.Apps) { - launcherMenu.Items.Add(x.AppTitle); + + ToolStripMenuItem i = new ToolStripMenuItem(x.AppTitle, (Icon.ExtractAssociatedIcon(x.AppLink)).ToBitmap()); + launcherMenu.Items.Add(i); } } launcherMenu.Items.Add("Exit"); - foreach (ToolStripItem y in launcherMenu.Items) + foreach (ToolStripMenuItem y in launcherMenu.Items) { y.ForeColor = Color.White; } @@ -154,7 +161,7 @@ private void AddApp() { if (!string.IsNullOrEmpty(txtAppLink.Text) && !string.IsNullOrEmpty(txtAppTitle.Text)) { - if (File.Exists(txtAppLink.Text)) + if (System.IO.File.Exists(txtAppLink.Text)) { if (AppsStructure.Apps.Find(x => x.AppLink == txtAppLink.Text) != null) { @@ -171,6 +178,7 @@ private void AddApp() App app = new App(); app.AppLink = txtAppLink.Text; app.AppTitle = txtAppTitle.Text; + app.AppParams = txtParams.Text; AppsStructure.Apps.Add(app); SaveAppsStructure(); @@ -181,6 +189,7 @@ private void AddApp() txtAppLink.Clear(); txtAppTitle.Clear(); + txtParams.Clear(); } else { @@ -193,9 +202,14 @@ private void AddApp() } } - private string NewVersionMessage(string latest) + private string NewVersionMessage(string latestVersion) + { + return string.Format("There is a new version available!\n\nLatest version: {0}\nCurrent version: {1}\n\nDo you want to download it now?", latestVersion, Program.GetCurrentVersionToString()); + } + + private string NewDownloadLink(string latestVersion) { - return string.Format("There is a new version available!\n\nLatest version: {0}\nCurrent version: {1}\n\nDo you want to download it now?", latest, Program.GetCurrentVersionToString()); + return string.Format("https://github.com/hellzerg/mint/releases/download/{0}/Mint-{0}.exe", latestVersion); } private void CheckForUpdate() @@ -221,11 +235,48 @@ private void CheckForUpdate() { if (MessageBox.Show(NewVersionMessage(latestVersion), "Update available", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { + // PATCHING PROCESS try { - Process.Start(_releasesLink); + Assembly currentAssembly = Assembly.GetEntryAssembly(); + + if (currentAssembly == null) + { + currentAssembly = Assembly.GetCallingAssembly(); + } + + string appFolder = Path.GetDirectoryName(currentAssembly.Location); + string appName = Path.GetFileNameWithoutExtension(currentAssembly.Location); + string appExtension = Path.GetExtension(currentAssembly.Location); + + string archiveFile = Path.Combine(appFolder, appName + "_old" + appExtension); + string appFile = Path.Combine(appFolder, appName + appExtension); + string tempFile = Path.Combine(appFolder, appName + "_tmp" + appExtension); + + // DOWNLOAD NEW VERSION + client.DownloadFile(NewDownloadLink(latestVersion), tempFile); + + // ALLOW MINT TO EXIT + _allowExit = true; + + // DELETE PREVIOUS BACK-UP + if (System.IO.File.Exists(archiveFile)) + { + System.IO.File.Delete(archiveFile); + } + + // MAKE BACK-UP + System.IO.File.Move(appFile, archiveFile); + + // PATCH + System.IO.File.Move(tempFile, appFile); + + Application.Restart(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); } - catch { } } } else if (float.Parse(latestVersion) == Program.GetCurrentVersion()) @@ -273,12 +324,12 @@ private void LaunchApp(string app) { try { - string fileName = AppsStructure.Apps.Find(x => x.AppTitle == app).AppLink; - string filePath = Path.GetDirectoryName(fileName); + App appX = AppsStructure.Apps.Find(x => x.AppTitle == app); Process p = new Process(); - p.StartInfo.WorkingDirectory = filePath; - p.StartInfo.FileName = fileName; + p.StartInfo.WorkingDirectory = Path.GetDirectoryName(appX.AppLink); + p.StartInfo.Arguments = appX.AppParams; + p.StartInfo.FileName = appX.AppLink; p.Start(); } catch (Exception ex) @@ -380,12 +431,24 @@ private void btnLocate_Click(object sender, EventArgs e) OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Mint | Select an application..."; - dialog.Filter = "Applications | *.exe"; + dialog.Filter = "Applications | *.exe; *.lnk"; if (dialog.ShowDialog() == DialogResult.OK) { - txtAppLink.Text = dialog.FileName; - if (string.IsNullOrEmpty(txtAppTitle.Text)) txtAppTitle.Text = dialog.SafeFileName.Replace(".exe", string.Empty); + if (dialog.FileName.EndsWith(".lnk")) + { + WshShell shell = new WshShell(); + IWshShortcut link = (IWshShortcut)shell.CreateShortcut(dialog.FileName); + + txtAppLink.Text = link.TargetPath; + txtAppTitle.Text = Path.GetFileNameWithoutExtension(dialog.FileName).Replace(".exe", string.Empty); + txtParams.Text = link.Arguments; + } + else + { + txtAppLink.Text = dialog.FileName; + if (string.IsNullOrEmpty(txtAppTitle.Text)) txtAppTitle.Text = dialog.SafeFileName.Replace(".exe", string.Empty); + } } } @@ -437,5 +500,16 @@ private void btnEdit_Click(object sender, EventArgs e) BuildLauncherMenu(); } } + + private void btnSort_Click(object sender, EventArgs e) + { + AppsStructure.Apps = AppsStructure.Apps.OrderBy(x => x.AppTitle).ToList(); + + SaveAppsStructure(); + + LoadAppsStructure(); + LoadAppsList(); + BuildLauncherMenu(); + } } } diff --git a/Mint/Mint.csproj b/Mint/Mint.csproj index b032a3c..d28d9e0 100644 --- a/Mint/Mint.csproj +++ b/Mint/Mint.csproj @@ -117,5 +117,16 @@ + + + {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} + 1 + 0 + 0 + tlbimp + False + True + + \ No newline at end of file diff --git a/Mint/Program.cs b/Mint/Program.cs index f668941..bb8a51c 100644 --- a/Mint/Program.cs +++ b/Mint/Program.cs @@ -14,7 +14,7 @@ static class Program // Enter current version here internal readonly static float Major = 1; - internal readonly static float Minor = 2; + internal readonly static float Minor = 3; /* END OF VERSION PROPERTIES */ diff --git a/Mint/Properties/AssemblyInfo.cs b/Mint/Properties/AssemblyInfo.cs index ef0f511..c8317b2 100644 --- a/Mint/Properties/AssemblyInfo.cs +++ b/Mint/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Mint")] -[assembly: AssemblyCopyright("deadmoon © 2018")] +[assembly: AssemblyCopyright("deadmoon © 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Mint/ToolStripRendererMaterial.cs b/Mint/ToolStripRendererMaterial.cs index 8c5a15e..37d065a 100644 --- a/Mint/ToolStripRendererMaterial.cs +++ b/Mint/ToolStripRendererMaterial.cs @@ -18,6 +18,28 @@ internal ToolStripRendererMaterial() : base(new ColorsMaterial()) internal class ColorsMaterial : ProfessionalColorTable { + public override Color ImageMarginGradientBegin + { + get + { + return Options.BackgroundColor; + } + } + public override Color ImageMarginGradientMiddle + { + get + { + return Options.BackgroundColor; + } + } + public override Color ImageMarginGradientEnd + { + get + { + return Options.BackgroundColor; + } + } + public override Color ToolStripBorder { get diff --git a/README.md b/README.md index 1cecd7c..6730fed 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,6 @@ Compatible with Windows 7, 8.1, 10 ## Details: ## -Latest version: 1.2 +Latest version: 1.3 -Released: March 10, 2018 +Released: December 20, 2020 diff --git a/version.txt b/version.txt index ea710ab..a58941b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.2 \ No newline at end of file +1.3 \ No newline at end of file