From c90a34904deb6129aea549ef10d98146f799e5a0 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 21 Jul 2024 18:44:05 +0100 Subject: [PATCH] Fixed folder paths when saving Fixed update-icon close button --- BookmarkManager.csproj | 4 ++-- EditBookmarkForm.cs | 27 +++++---------------------- MainForm.cs | 9 +++++++++ UpdateIconsForm.cs | 24 ++++-------------------- Windows/Forms/BookmarkTreeView.cs | 4 ++-- 5 files changed, 22 insertions(+), 46 deletions(-) diff --git a/BookmarkManager.csproj b/BookmarkManager.csproj index bba7952..239fa3e 100644 --- a/BookmarkManager.csproj +++ b/BookmarkManager.csproj @@ -120,8 +120,8 @@ - - + + \ No newline at end of file diff --git a/EditBookmarkForm.cs b/EditBookmarkForm.cs index b2becff..f90c8c5 100644 --- a/EditBookmarkForm.cs +++ b/EditBookmarkForm.cs @@ -20,7 +20,6 @@ namespace FizzyLauncher private Label label4; private ThHiButtonTextBox textBox2; private PictureBox pictureBox1; - private PictureBox pictureBox2; private ToolTip toolTip1; private System.ComponentModel.IContainer components; private ThClearableTextBox textBox3; @@ -68,7 +67,7 @@ namespace FizzyLauncher private void InitializeComponent() { - components = new System.ComponentModel.Container(); + components = new Container(); label1 = new Label(); textBox1 = new ThClearableTextBox(); label2 = new Label(); @@ -78,13 +77,11 @@ namespace FizzyLauncher textBox2 = new ThHiButtonTextBox(); pictureBox1 = new PictureBox(); toolTip1 = new ToolTip(components); - pictureBox2 = new PictureBox(); textBox3 = new ThClearableTextBox(); thUserControl1 = new ThUserControl(); label5 = new Label(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); - ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); - ((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit(); + ((ISupportInitialize)pictureBox1).BeginInit(); SuspendLayout(); // // label1 @@ -205,19 +202,6 @@ namespace FizzyLauncher pictureBox1.TabStop = false; pictureBox1.MouseDoubleClick += pictureBox1_MouseDoubleClick; // - // pictureBox2 - // - pictureBox2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; - pictureBox2.BackColor = Color.Transparent; - pictureBox2.ErrorImage = null; - pictureBox2.InitialImage = null; - pictureBox2.Location = new Point(10, 396); - pictureBox2.Name = "pictureBox2"; - pictureBox2.Size = new Size(32, 32); - pictureBox2.SizeMode = PictureBoxSizeMode.CenterImage; - pictureBox2.TabIndex = 202; - pictureBox2.TabStop = false; - // // textBox3 // textBox3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; @@ -264,6 +248,7 @@ namespace FizzyLauncher dialogFooter1.Button1Text = "&OK"; dialogFooter1.Dialog = this; dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.IsBusy = false; dialogFooter1.Location = new Point(0, 437); dialogFooter1.Name = "dialogFooter1"; dialogFooter1.Size = new Size(384, 84); @@ -276,7 +261,6 @@ namespace FizzyLauncher ClientSize = new Size(384, 521); Controls.Add(dialogFooter1); Controls.Add(textBox3); - Controls.Add(pictureBox2); Controls.Add(pictureBox1); Controls.Add(textBox2); Controls.Add(memoBox1); @@ -291,8 +275,7 @@ namespace FizzyLauncher MinimumSize = new Size(400, 560); Name = "EditBookmarkForm"; Text = "Edit Bookmark"; - ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); - ((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit(); + ((ISupportInitialize)pictureBox1).EndInit(); ResumeLayout(false); PerformLayout(); } @@ -352,7 +335,7 @@ namespace FizzyLauncher UIControl.SetEnable(textBox1, !this.IsBusy); UIControl.SetEnable(textBox2, !this.IsBusy); UIControl.SetEnable(textBox3, !this.IsBusy); - UIControl.SetValue(pictureBox2, (this.IsBusy ? RyzStudio.Windows.ThemedForms.Resource2.loading_block : null)); + dialogFooter1.IsBusy = _isBusy; UIControl.SetEnable(memoBox1, !this.IsBusy); } } diff --git a/MainForm.cs b/MainForm.cs index 6bbcc14..88affdd 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -750,6 +750,15 @@ namespace FizzyLauncher this.CurrentSession.Height = this.Height; var nodeList = treeView1.ToNodeList() ?? new List>(); + foreach (var node in nodeList) + { + node.Value.Path = treeView1.GetNodePath(node.Key); + + if (node.Value.Path.Contains('\n')) + { + node.Value.Path = node.Value.Path.Substring(0, node.Value.Path.LastIndexOf('\n')); + } + } this.CurrentSession.Items = nodeList.Select(x => x.Value).ToList(); diff --git a/UpdateIconsForm.cs b/UpdateIconsForm.cs index 606fd69..8f5ca55 100644 --- a/UpdateIconsForm.cs +++ b/UpdateIconsForm.cs @@ -17,7 +17,6 @@ namespace FizzyLauncher private System.Windows.Forms.Label label1; private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2; private Label label2; - private PictureBox pictureBox2; private ThYesNoPickerBox pickerBox1; private ThButton button2; private RyzStudio.Windows.ThemedForms.ThProgressBar progressBar1; @@ -51,7 +50,6 @@ namespace FizzyLauncher label1 = new Label(); tHorizontalSeparator2 = new THorizontalSeparator(); label2 = new Label(); - pictureBox2 = new PictureBox(); pickerBox1 = new ThYesNoPickerBox(); button2 = new ThButton(); progressBar1 = new ThProgressBar(); @@ -60,7 +58,6 @@ namespace FizzyLauncher button3 = new ThButton(); progressBar2 = new ThProgressBar(); dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter(); - ((ISupportInitialize)pictureBox2).BeginInit(); SuspendLayout(); // // label1 @@ -106,19 +103,6 @@ namespace FizzyLauncher label2.Text = "Retrieve supported icons from bookmarks."; label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // pictureBox2 - // - pictureBox2.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; - pictureBox2.BackColor = System.Drawing.Color.Transparent; - pictureBox2.ErrorImage = null; - pictureBox2.InitialImage = null; - pictureBox2.Location = new System.Drawing.Point(402, 294); - pictureBox2.Name = "pictureBox2"; - pictureBox2.Size = new System.Drawing.Size(32, 32); - pictureBox2.SizeMode = PictureBoxSizeMode.CenterImage; - pictureBox2.TabIndex = 202; - pictureBox2.TabStop = false; - // // pickerBox1 // pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right; @@ -237,8 +221,9 @@ namespace FizzyLauncher // dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); dialogFooter1.Button1Text = "&Close"; - dialogFooter1.Dialog = null; + dialogFooter1.Dialog = this; dialogFooter1.Dock = DockStyle.Bottom; + dialogFooter1.IsBusy = false; dialogFooter1.Location = new System.Drawing.Point(0, 437); dialogFooter1.Name = "dialogFooter1"; dialogFooter1.Size = new System.Drawing.Size(444, 84); @@ -257,7 +242,6 @@ namespace FizzyLauncher Controls.Add(progressBar1); Controls.Add(button2); Controls.Add(pickerBox1); - Controls.Add(pictureBox2); Controls.Add(label2); Controls.Add(tHorizontalSeparator2); Controls.Add(label1); @@ -265,7 +249,6 @@ namespace FizzyLauncher MinimumSize = new System.Drawing.Size(460, 560); Name = "UpdateIconsForm"; Text = "Update Icons"; - ((ISupportInitialize)pictureBox2).EndInit(); ResumeLayout(false); PerformLayout(); } @@ -319,7 +302,8 @@ namespace FizzyLauncher { button3.LabelText = (this.IsBusy ? "&Stop" : "Clear &All"); }); - UIControl.SetValue(pictureBox2, (this.IsBusy ? RyzStudio.Windows.ThemedForms.Resource2.loading_block : null)); + + dialogFooter1.IsBusy = _isBusy; } } diff --git a/Windows/Forms/BookmarkTreeView.cs b/Windows/Forms/BookmarkTreeView.cs index b9073e3..12d5ce4 100644 --- a/Windows/Forms/BookmarkTreeView.cs +++ b/Windows/Forms/BookmarkTreeView.cs @@ -281,7 +281,7 @@ namespace RyzStudio.Windows.Forms public TreeNode AddNode(BookmarkModel model) { - var parentNode = this.CreateNodePath(model.Path, (int)NodeIcon.Folder1, (int)NodeIcon.Folder2); + var parentNode = this.CreateNodePath(model?.Path?.Trim() ?? string.Empty, (int)NodeIcon.Folder1, (int)NodeIcon.Folder2); int iconIndex = (int)NodeIcon.Default; // Add custom favicon @@ -304,7 +304,7 @@ namespace RyzStudio.Windows.Forms } } - TreeNode newNode = new TreeNode(model.Title, iconIndex, iconIndex); + TreeNode newNode = new TreeNode(model?.Title?.Trim() ?? string.Empty, iconIndex, iconIndex); newNode.Tag = model; newNode.ToolTipText = model.ToString();