diff --git a/src/BloatyNosy/Features/Apps/StoreApps.cs b/src/BloatyNosy/Features/Apps/StoreApps.cs index 884cd30..4c61b24 100644 --- a/src/BloatyNosy/Features/Apps/StoreApps.cs +++ b/src/BloatyNosy/Features/Apps/StoreApps.cs @@ -12,12 +12,12 @@ namespace Features.Feature.Apps public override string ID() { - return "[HIGH] Search and remove pre-installed bloatware apps automatically"; + return "*[HIGH] Search and remove pre-installed bloatware apps automatically (Right-click to remove bloatware manually)"; } public override string Info() { - return "To remove specific apps use the BloatFinder app in the \"More Apps\" section"; + return "To remove specific apps use the BloatFinder app in the \"More Apps\" section or right click on this feature"; } private void RemoveApps(string str) diff --git a/src/BloatyNosy/Helpers/OsHelper.cs b/src/BloatyNosy/Helpers/OsHelper.cs index 14aa6ae..584bd5f 100644 --- a/src/BloatyNosy/Helpers/OsHelper.cs +++ b/src/BloatyNosy/Helpers/OsHelper.cs @@ -1,13 +1,14 @@ using Microsoft.Win32; using System; +using System.Windows.Forms; namespace HelperTool { public static class OsHelper { - public static readonly string thisOS = GetSupportedOS() + "\x20" + GetVersion(); + public static readonly string thisOS = IsWin11() + "\x20" + GetVersion(); - public static string GetSupportedOS() + public static bool IsWin11() { try { @@ -15,11 +16,12 @@ namespace HelperTool int osbuild = Convert.ToInt32(key.GetValue("CurrentBuildNumber")); if (osbuild >= 21996) { - return "Windows 11"; + return true; } } - catch { } - return "Windows 10"; + catch (Exception ex) + { MessageBox.Show(ex.Message); } + return false; } public static string GetVersion() diff --git a/src/BloatyNosy/MainForm.Designer.cs b/src/BloatyNosy/MainForm.Designer.cs index a28eb22..ee85dea 100644 --- a/src/BloatyNosy/MainForm.Designer.cs +++ b/src/BloatyNosy/MainForm.Designer.cs @@ -31,6 +31,8 @@ this.components = new System.ComponentModel.Container(); this.pnlForm = new System.Windows.Forms.Panel(); this.pnlMain = new System.Windows.Forms.Panel(); + this.lnkGitHubRepo = new System.Windows.Forms.LinkLabel(); + this.lblAppOptionsFix = new System.Windows.Forms.Label(); this.lnkRunSetup = new System.Windows.Forms.LinkLabel(); this.btnAppOptions = new System.Windows.Forms.Button(); this.btnSettings = new System.Windows.Forms.Button(); @@ -42,8 +44,8 @@ this.lblTools = new System.Windows.Forms.Label(); this.cmbTools = new System.Windows.Forms.ComboBox(); this.lblHeader = new System.Windows.Forms.Label(); - this.rtbLog = new System.Windows.Forms.RichTextBox(); this.tvwFeatures = new System.Windows.Forms.TreeView(); + this.rtbLog = new System.Windows.Forms.RichTextBox(); this.contextKebapMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.menuAdvanced = new System.Windows.Forms.ToolStripMenuItem(); this.menuIgnoreLowLevelP = new System.Windows.Forms.ToolStripMenuItem(); @@ -54,10 +56,13 @@ this.menuFixInfo = new System.Windows.Forms.ToolStripTextBox(); this.menuRestore = new System.Windows.Forms.ToolStripMenuItem(); this.menuRestoreInfo = new System.Windows.Forms.ToolStripTextBox(); + this.contextAppMenuOptions = new System.Windows.Forms.ContextMenuStrip(this.components); + this.menuAppConfigure = new System.Windows.Forms.ToolStripMenuItem(); this.pnlForm.SuspendLayout(); this.pnlMain.SuspendLayout(); this.contextKebapMenu.SuspendLayout(); this.contextAppMenu.SuspendLayout(); + this.contextAppMenuOptions.SuspendLayout(); this.SuspendLayout(); // // pnlForm @@ -73,6 +78,8 @@ // pnlMain // this.pnlMain.AutoScroll = true; + this.pnlMain.Controls.Add(this.lnkGitHubRepo); + this.pnlMain.Controls.Add(this.lblAppOptionsFix); this.pnlMain.Controls.Add(this.lnkRunSetup); this.pnlMain.Controls.Add(this.btnAppOptions); this.pnlMain.Controls.Add(this.btnSettings); @@ -84,14 +91,41 @@ this.pnlMain.Controls.Add(this.lblTools); this.pnlMain.Controls.Add(this.cmbTools); this.pnlMain.Controls.Add(this.lblHeader); - this.pnlMain.Controls.Add(this.rtbLog); this.pnlMain.Controls.Add(this.tvwFeatures); + this.pnlMain.Controls.Add(this.rtbLog); this.pnlMain.Dock = System.Windows.Forms.DockStyle.Fill; this.pnlMain.Location = new System.Drawing.Point(0, 0); this.pnlMain.Name = "pnlMain"; this.pnlMain.Size = new System.Drawing.Size(1019, 801); this.pnlMain.TabIndex = 0; // + // lnkGitHubRepo + // + this.lnkGitHubRepo.AutoEllipsis = true; + this.lnkGitHubRepo.Font = new System.Drawing.Font("Segoe UI Variable Text Semiligh", 12.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lnkGitHubRepo.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; + this.lnkGitHubRepo.LinkColor = System.Drawing.Color.HotPink; + this.lnkGitHubRepo.Location = new System.Drawing.Point(209, 112); + this.lnkGitHubRepo.Name = "lnkGitHubRepo"; + this.lnkGitHubRepo.Size = new System.Drawing.Size(113, 23); + this.lnkGitHubRepo.TabIndex = 181; + this.lnkGitHubRepo.TabStop = true; + this.lnkGitHubRepo.Text = "Bloaty && Nosy"; + this.lnkGitHubRepo.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkGitHubRepo_LinkClicked); + // + // lblAppOptionsFix + // + this.lblAppOptionsFix.AutoSize = true; + this.lblAppOptionsFix.BackColor = System.Drawing.Color.MediumVioletRed; + this.lblAppOptionsFix.Font = new System.Drawing.Font("Segoe UI Variable Text Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblAppOptionsFix.ForeColor = System.Drawing.Color.White; + this.lblAppOptionsFix.Location = new System.Drawing.Point(360, 225); + this.lblAppOptionsFix.Name = "lblAppOptionsFix"; + this.lblAppOptionsFix.Size = new System.Drawing.Size(25, 17); + this.lblAppOptionsFix.TabIndex = 180; + this.lblAppOptionsFix.Text = "Fix"; + this.lblAppOptionsFix.Click += new System.EventHandler(this.lblAppOptionsFix_Click); + // // lnkRunSetup // this.lnkRunSetup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -114,9 +148,11 @@ this.btnAppOptions.ForeColor = System.Drawing.Color.White; this.btnAppOptions.Location = new System.Drawing.Point(350, 213); this.btnAppOptions.Name = "btnAppOptions"; - this.btnAppOptions.Size = new System.Drawing.Size(54, 42); + this.btnAppOptions.Padding = new System.Windows.Forms.Padding(0, 0, 5, 0); + this.btnAppOptions.Size = new System.Drawing.Size(62, 42); this.btnAppOptions.TabIndex = 178; this.btnAppOptions.Text = "..."; + this.btnAppOptions.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.btnAppOptions.UseVisualStyleBackColor = false; this.btnAppOptions.Click += new System.EventHandler(this.btnAppOptions_Click); // @@ -144,22 +180,25 @@ this.label1.Font = new System.Drawing.Font("Segoe UI Variable Text Semibold", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(47, 49); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(532, 43); + this.label1.Size = new System.Drawing.Size(575, 43); this.label1.TabIndex = 176; - this.label1.Text = "Welcome to the new era of Windows debloating"; + this.label1.Text = "No more draw backs of upgrading to Windows 11 "; + this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter; // // btnKebapMenu // this.btnKebapMenu.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnKebapMenu.FlatAppearance.BorderSize = 0; + this.btnKebapMenu.FlatAppearance.MouseOverBackColor = System.Drawing.Color.WhiteSmoke; this.btnKebapMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnKebapMenu.Font = new System.Drawing.Font("Segoe Fluent Icons", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnKebapMenu.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.btnKebapMenu.Location = new System.Drawing.Point(977, 0); + this.btnKebapMenu.Location = new System.Drawing.Point(970, 0); this.btnKebapMenu.Name = "btnKebapMenu"; this.btnKebapMenu.Size = new System.Drawing.Size(42, 38); this.btnKebapMenu.TabIndex = 175; this.btnKebapMenu.Text = "..."; + this.btnKebapMenu.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.btnKebapMenu.UseVisualStyleBackColor = true; this.btnKebapMenu.Click += new System.EventHandler(this.btnMenu_Click); // @@ -174,7 +213,7 @@ this.btnAnalyze.Name = "btnAnalyze"; this.btnAnalyze.Size = new System.Drawing.Size(286, 42); this.btnAnalyze.TabIndex = 27; - this.btnAnalyze.Text = "Analyze"; + this.btnAnalyze.Text = "Analyze Windows 11 "; this.btnAnalyze.UseVisualStyleBackColor = false; this.btnAnalyze.Click += new System.EventHandler(this.btnAnalyze_Click); // @@ -245,29 +284,9 @@ this.lblHeader.Name = "lblHeader"; this.lblHeader.Size = new System.Drawing.Size(843, 59); this.lblHeader.TabIndex = 16; - this.lblHeader.Text = "Windows 11 is too bloaty && nosey and has some annoying features that just need t" + - "o go.\r\nThis app will scan your system and inform you which features it likes or " + - "dislikes in your configuration."; - // - // rtbLog - // - this.rtbLog.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.rtbLog.BackColor = System.Drawing.Color.White; - this.rtbLog.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.rtbLog.Cursor = System.Windows.Forms.Cursors.IBeam; - this.rtbLog.Font = new System.Drawing.Font("Segoe UI Variable Text Semiligh", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.rtbLog.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.rtbLog.HideSelection = false; - this.rtbLog.Location = new System.Drawing.Point(72, 305); - this.rtbLog.Name = "rtbLog"; - this.rtbLog.ReadOnly = true; - this.rtbLog.Size = new System.Drawing.Size(861, 360); - this.rtbLog.TabIndex = 138; - this.rtbLog.Text = ""; - this.rtbLog.Visible = false; - this.rtbLog.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richLog_LinkClicked); + this.lblHeader.Text = "Windows 11 is too and has some annoying features that just" + + " need to go.\r\nThis app will scan your system and inform you which features it li" + + "kes or dislikes in your configuration."; // // tvwFeatures // @@ -291,6 +310,27 @@ this.tvwFeatures.TabIndex = 168; this.tvwFeatures.Visible = false; this.tvwFeatures.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeFeatures_AfterCheck); + this.tvwFeatures.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tvwFeatures_MouseUp); + // + // rtbLog + // + this.rtbLog.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.rtbLog.BackColor = System.Drawing.Color.White; + this.rtbLog.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.rtbLog.Cursor = System.Windows.Forms.Cursors.IBeam; + this.rtbLog.Font = new System.Drawing.Font("Segoe UI Variable Text Semiligh", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.rtbLog.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.rtbLog.HideSelection = false; + this.rtbLog.Location = new System.Drawing.Point(72, 305); + this.rtbLog.Name = "rtbLog"; + this.rtbLog.ReadOnly = true; + this.rtbLog.Size = new System.Drawing.Size(861, 360); + this.rtbLog.TabIndex = 138; + this.rtbLog.Text = ""; + this.rtbLog.Visible = false; + this.rtbLog.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richLog_LinkClicked); // // contextKebapMenu // @@ -351,7 +391,7 @@ // this.menuFix.Name = "menuFix"; this.menuFix.Size = new System.Drawing.Size(360, 32); - this.menuFix.Text = "Fix problems"; + this.menuFix.Text = "Apply fixes"; this.menuFix.Click += new System.EventHandler(this.menuFix_Click); // // menuFixInfo @@ -369,7 +409,7 @@ // this.menuRestore.Name = "menuRestore"; this.menuRestore.Size = new System.Drawing.Size(360, 32); - this.menuRestore.Text = "Restore settings"; + this.menuRestore.Text = "Restore default state"; this.menuRestore.TextDirection = System.Windows.Forms.ToolStripTextDirection.Horizontal; this.menuRestore.Click += new System.EventHandler(this.menuRestore_Click); // @@ -382,7 +422,24 @@ this.menuRestoreInfo.Margin = new System.Windows.Forms.Padding(5, 1, 1, 1); this.menuRestoreInfo.Name = "menuRestoreInfo"; this.menuRestoreInfo.Size = new System.Drawing.Size(300, 16); - this.menuRestoreInfo.Text = "This will restore the default settings "; + this.menuRestoreInfo.Text = "This will restore the default settings "; + // + // contextAppMenuOptions + // + this.contextAppMenuOptions.BackColor = System.Drawing.SystemColors.Control; + this.contextAppMenuOptions.Font = new System.Drawing.Font("Segoe UI Variable Text Semiligh", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.contextAppMenuOptions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuAppConfigure}); + this.contextAppMenuOptions.Name = "menuMain"; + this.contextAppMenuOptions.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.contextAppMenuOptions.Size = new System.Drawing.Size(208, 30); + // + // menuAppConfigure + // + this.menuAppConfigure.Name = "menuAppConfigure"; + this.menuAppConfigure.Size = new System.Drawing.Size(207, 26); + this.menuAppConfigure.Text = "Configure this app"; + this.menuAppConfigure.Click += new System.EventHandler(this.menuAppConfigure_Click); // // MainForm // @@ -391,6 +448,7 @@ this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(1019, 801); this.Controls.Add(this.pnlForm); + this.MinimumSize = new System.Drawing.Size(700, 700); this.Name = "MainForm"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -402,6 +460,7 @@ this.contextKebapMenu.ResumeLayout(false); this.contextAppMenu.ResumeLayout(false); this.contextAppMenu.PerformLayout(); + this.contextAppMenuOptions.ResumeLayout(false); this.ResumeLayout(false); } @@ -432,6 +491,10 @@ private System.Windows.Forms.ToolStripMenuItem menuImportProfile; private System.Windows.Forms.LinkLabel lnkRunSetup; private System.Windows.Forms.ToolStripMenuItem menuExportProfile; + private System.Windows.Forms.ContextMenuStrip contextAppMenuOptions; + private System.Windows.Forms.ToolStripMenuItem menuAppConfigure; + private System.Windows.Forms.Label lblAppOptionsFix; + private System.Windows.Forms.LinkLabel lnkGitHubRepo; } } diff --git a/src/BloatyNosy/MainForm.cs b/src/BloatyNosy/MainForm.cs index 76e611f..e4e7d25 100644 --- a/src/BloatyNosy/MainForm.cs +++ b/src/BloatyNosy/MainForm.cs @@ -3,6 +3,7 @@ using Features.Feature; using HelperTool; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.IO; using System.Linq; @@ -36,7 +37,7 @@ namespace BloatyNosy btnAppOptions.Text = "\uE70D"; btnKebapMenu.Text = "\u22ee"; btnSettings.Text = "\uE713"; - btnAnalyze.Text += "\x20" + OsHelper.thisOS; + btnAnalyze.Text += OsHelper.GetVersion(); BackColor = tvwFeatures.BackColor = @@ -356,7 +357,7 @@ namespace BloatyNosy } DoProgress(100); - lnkSubHeader.Text = ""; + lnkSubHeader.Text = "Fixing complete (click for details)."; tvwFeatures.Enabled = true; } @@ -377,7 +378,7 @@ namespace BloatyNosy } DoProgress(100); - lnkSubHeader.Text = ""; + lnkSubHeader.Text = "Undo complete (click for details)."; tvwFeatures.Enabled = true; } @@ -386,19 +387,21 @@ namespace BloatyNosy { if (string.IsNullOrWhiteSpace(rtbLog.Text)) { - MessageBox.Show("No analyze has taken place yet."); - return; + btnAnalyze.Text = "Click here to analyze first"; } - Reset(); + if (MessageBox.Show("Do you want to apply selected fixes?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes) + { + Reset(); - List performNodes = CollectFeatureNodes(); - ApplyFeatures(performNodes); + List performNodes = CollectFeatureNodes(); + ApplyFeatures(performNodes); + } } private void menuRestore_Click(object sender, EventArgs e) { - if (MessageBox.Show("Do you want to restore selected features to Windows default state?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes) + if (MessageBox.Show("Do you want to restore selected fixes to Windows default state?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { Reset(); @@ -451,6 +454,11 @@ namespace BloatyNosy private void lnkSubHeader_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => menuAdvanced.PerformClick(); + private void lblAppOptionsFix_Click(object sender, EventArgs e) + => btnAppOptions.PerformClick(); + + private void lnkGitHubRepo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + => Process.Start(Utils.Uri.URL_GITREPO); private void menuImportProfile_Click(object sender, EventArgs e) { OpenFileDialog f = new OpenFileDialog(); @@ -489,7 +497,7 @@ namespace BloatyNosy { SaveFileDialog f = new SaveFileDialog(); f.InitialDirectory = HelperTool.Utils.Data.DataRootDir; - f.FileName = "debloos-profile"; + f.FileName = "BloatyNosy-profile"; f.Filter = "BloatyNosy files *.bloos|*.bloos"; if (f.ShowDialog() == DialogResult.OK) @@ -508,5 +516,34 @@ namespace BloatyNosy MessageBox.Show("Profile has been successfully exported.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } + + private void tvwFeatures_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Right) + { + tvwFeatures.SelectedNode = tvwFeatures.GetNodeAt(e.X, e.Y); + + // Configure .app-entries marked with asterix + if (tvwFeatures.SelectedNode != null && tvwFeatures.SelectedNode.Text.Contains("*")) + { + contextAppMenuOptions.Show(tvwFeatures, e.Location); + } + } + } + + private void menuAppConfigure_Click(object sender, EventArgs e) + { + TreeNode tn = tvwFeatures.SelectedNode; + + switch (tn.Text) + { + case "*[HIGH] Search and remove pre-installed bloatware apps automatically (Right-click to remove bloatware manually)": + this.SetView(new AppsPageView()); // In-box apps > BloatFinder view + break; + + default: + break; + } + } } } \ No newline at end of file diff --git a/src/BloatyNosy/MainForm.resx b/src/BloatyNosy/MainForm.resx index b3096cc..5687fdb 100644 --- a/src/BloatyNosy/MainForm.resx +++ b/src/BloatyNosy/MainForm.resx @@ -123,4 +123,7 @@ 172, 17 + + 318, 17 + \ No newline at end of file diff --git a/src/BloatyNosy/Program.cs b/src/BloatyNosy/Program.cs index d704a09..d2932ce 100644 --- a/src/BloatyNosy/Program.cs +++ b/src/BloatyNosy/Program.cs @@ -15,10 +15,17 @@ namespace BloatyNosy /// [STAThread] private static void Main() - { + { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); + + if (!HelperTool.OsHelper.IsWin11()) + { + MessageBox.Show("You are running Bloaty&Nosy on a system older than Windows 11.\nBloatyNosy is limited to Windows 11 ONLY.", "OS not supported", MessageBoxButtons.OK, MessageBoxIcon.Information); + Application.Exit(); + } + else Application.Run(new MainForm()); + } } } \ No newline at end of file diff --git a/src/BloatyNosy/Properties/AssemblyInfo.cs b/src/BloatyNosy/Properties/AssemblyInfo.cs index c70966a..bd46489 100644 --- a/src/BloatyNosy/Properties/AssemblyInfo.cs +++ b/src/BloatyNosy/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.32.0")] -[assembly: AssemblyFileVersion("0.32.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.40.0")] +[assembly: AssemblyFileVersion("0.40.0")] \ No newline at end of file diff --git a/src/BloatyNosy/Views/IModsPageView.Designer.cs b/src/BloatyNosy/Views/IModsPageView.Designer.cs index b31abe2..a85e2e9 100644 --- a/src/BloatyNosy/Views/IModsPageView.Designer.cs +++ b/src/BloatyNosy/Views/IModsPageView.Designer.cs @@ -31,7 +31,7 @@ this.btnBack = new System.Windows.Forms.Button(); this.lnkNoModsSig = new System.Windows.Forms.LinkLabel(); this.lblHeader = new System.Windows.Forms.Label(); - this.listView = new System.Windows.Forms.ListView(); + this.lvMods = new System.Windows.Forms.ListView(); this.btnInstall = new System.Windows.Forms.Button(); this.progress = new System.Windows.Forms.ProgressBar(); this.label1 = new System.Windows.Forms.Label(); @@ -80,31 +80,32 @@ this.lblHeader.TabIndex = 205; this.lblHeader.Text = "WinModder Marketplace"; // - // listView + // lvMods // - this.listView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.lvMods.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.listView.BackColor = System.Drawing.SystemColors.Control; - this.listView.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.listView.CheckBoxes = true; - this.listView.Font = new System.Drawing.Font("Segoe UI Variable Text Semiligh", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.listView.FullRowSelect = true; - this.listView.HideSelection = false; - this.listView.Location = new System.Drawing.Point(92, 85); - this.listView.Name = "listView"; - this.listView.OwnerDraw = true; - this.listView.Size = new System.Drawing.Size(802, 326); - this.listView.TabIndex = 206; - this.listView.UseCompatibleStateImageBehavior = false; - this.listView.View = System.Windows.Forms.View.Details; - this.listView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.listView_DrawColumnHeader); - this.listView.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(this.listView_DrawItem); + this.lvMods.BackColor = System.Drawing.SystemColors.Control; + this.lvMods.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.lvMods.CheckBoxes = true; + this.lvMods.Font = new System.Drawing.Font("Segoe UI Variable Text Semiligh", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lvMods.FullRowSelect = true; + this.lvMods.HideSelection = false; + this.lvMods.Location = new System.Drawing.Point(92, 85); + this.lvMods.Name = "lvMods"; + this.lvMods.OwnerDraw = true; + this.lvMods.Size = new System.Drawing.Size(802, 326); + this.lvMods.TabIndex = 206; + this.lvMods.UseCompatibleStateImageBehavior = false; + this.lvMods.View = System.Windows.Forms.View.Details; + this.lvMods.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.listView_DrawColumnHeader); + this.lvMods.DrawItem += new System.Windows.Forms.DrawListViewItemEventHandler(this.listView_DrawItem); // // btnInstall // this.btnInstall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnInstall.BackColor = System.Drawing.Color.MediumVioletRed; + this.btnInstall.Enabled = false; this.btnInstall.FlatAppearance.BorderColor = System.Drawing.Color.Orchid; this.btnInstall.FlatAppearance.BorderSize = 0; this.btnInstall.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -164,7 +165,7 @@ this.Controls.Add(this.label1); this.Controls.Add(this.progress); this.Controls.Add(this.btnInstall); - this.Controls.Add(this.listView); + this.Controls.Add(this.lvMods); this.Controls.Add(this.lblHeader); this.Controls.Add(this.lnkNoModsSig); this.Controls.Add(this.btnBack); @@ -179,7 +180,7 @@ private System.Windows.Forms.Button btnBack; private System.Windows.Forms.LinkLabel lnkNoModsSig; private System.Windows.Forms.Label lblHeader; - private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ListView lvMods; private System.Windows.Forms.Button btnInstall; private System.Windows.Forms.ProgressBar progress; private System.Windows.Forms.Label label1; diff --git a/src/BloatyNosy/Views/IModsPageView.cs b/src/BloatyNosy/Views/IModsPageView.cs index 8282637..90a9a7b 100644 --- a/src/BloatyNosy/Views/IModsPageView.cs +++ b/src/BloatyNosy/Views/IModsPageView.cs @@ -19,6 +19,7 @@ namespace BloatyNosy modsForm = ctr as ModsPageView; InitializeComponent(); + InitializeModsSignature(); SetStyle(); @@ -26,17 +27,17 @@ namespace BloatyNosy private void SetStyle() { - listView.BackColor = Color.FromArgb(245, 241, 249); + lvMods.BackColor = Color.FromArgb(245, 241, 249); btnBack.Text = "\uE72B"; } private void InitializeModsSignature() { // Add required columns - listView.Columns.Add("Name"); - listView.Columns.Add("Description"); - listView.Columns.Add("Developer"); - listView.Columns.Add("Link"); + lvMods.Columns.Add("Name"); + lvMods.Columns.Add("Description"); + lvMods.Columns.Add("Developer"); + lvMods.Columns.Add("Link"); try { @@ -52,25 +53,26 @@ namespace BloatyNosy dm.Element("uri").Value, }); - listView.Items.Add(item); + lvMods.Items.Add(item); - listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); - listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); + lvMods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); + lvMods.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent); } isFeatureInstalled(); + btnInstall.Enabled = (lvMods.Items.Count > 0); } catch { MessageBox.Show("Mods signature file not found.\nPlease re-download and install the signatures."); - listView.Visible = false; + lvMods.Visible = false; lnkNoModsSig.Visible = true; } } public void isFeatureInstalled() { - foreach (ListViewItem item in listView.Items) + foreach (ListViewItem item in lvMods.Items) { var feature = item.SubItems[3].Text; if (File.Exists(HelperTool.Utils.Data.DataRootDir + feature.Split('/').Last()) @@ -105,9 +107,10 @@ namespace BloatyNosy progress.Visible = false; - MessageBox.Show("We will restart the app to complete the installation.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); - Application.Restart(); - Environment.Exit(0); + // Update IMods page + btnBack.PerformClick(); + modsForm.lnkExploreMods_LinkClicked(sender, e); + } } catch (Exception ex) @@ -118,7 +121,7 @@ namespace BloatyNosy { bool bNeedRestart = false; - if (listView.CheckedItems.Count == 0) + if (lvMods.CheckedItems.Count == 0) { MessageBox.Show("No feature selected.", "", MessageBoxButtons.OK, MessageBoxIcon.Information); return; @@ -126,7 +129,7 @@ namespace BloatyNosy StringBuilder builder = new StringBuilder(); - foreach (ListViewItem eachItem in listView.CheckedItems) + foreach (ListViewItem eachItem in lvMods.CheckedItems) { List list = new List(eachItem.SubItems[3].Text.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)); @@ -155,7 +158,7 @@ namespace BloatyNosy } catch (Exception ex) { - MessageBox.Show(ex.Message, listView.FocusedItem.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(ex.Message, lvMods.FocusedItem.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } diff --git a/src/BloatyNosy/Views/ModsPageView.cs b/src/BloatyNosy/Views/ModsPageView.cs index 8957911..d8551b4 100644 --- a/src/BloatyNosy/Views/ModsPageView.cs +++ b/src/BloatyNosy/Views/ModsPageView.cs @@ -231,7 +231,7 @@ namespace BloatyNosy private void rtbDesc_LinkClicked(object sender, LinkClickedEventArgs e) => HelperTool.Utils.LaunchUri(e.LinkText); - private void lnkExploreMods_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + public void lnkExploreMods_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) => this.SetView(new IModsPageView(this)); private void lnkDesc_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)