From 6e8b4f0a9ddbc5d7cc37b7ec0a086eb9f802b5a9 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Sun, 29 Jun 2025 14:19:58 +0200 Subject: [PATCH] manager: tree view & action set infos editor panel --- .../Ui/MainForm.Designer.cs | 226 +++++++++++------- ModpackUpdater.Apps.Manager/Ui/MainForm.cs | 148 ++++++++---- .../UpdatePropertiesEditorFlyout.Designer.cs | 114 --------- .../Ui/UpdatePropertiesEditorFlyout.cs | 32 --- .../Ui/UpdatePropertiesEditorFlyout.resx | 120 ---------- 5 files changed, 240 insertions(+), 400 deletions(-) delete mode 100644 ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.Designer.cs delete mode 100644 ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.cs delete mode 100644 ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.resx diff --git a/ModpackUpdater.Apps.Manager/Ui/MainForm.Designer.cs b/ModpackUpdater.Apps.Manager/Ui/MainForm.Designer.cs index 86fa83e..7a35795 100644 --- a/ModpackUpdater.Apps.Manager/Ui/MainForm.Designer.cs +++ b/ModpackUpdater.Apps.Manager/Ui/MainForm.Designer.cs @@ -29,48 +29,54 @@ partial class MainForm /// private void InitializeComponent() { - var tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition(); + var tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition(); var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer(); splitPanel1 = new Telerik.WinControls.UI.SplitPanel(); tableLayoutPanel2 = new TableLayoutPanel(); - radListControl_Updates = new Telerik.WinControls.UI.RadListControl(); + radTreeView_Sets = new Telerik.WinControls.UI.RadTreeView(); splitPanel2 = new Telerik.WinControls.UI.SplitPanel(); - tableLayoutPanel1 = new TableLayoutPanel(); + tableLayoutPanel_ActionSet = new TableLayoutPanel(); radGridView_Actions = new Telerik.WinControls.UI.RadGridView(); + tableLayoutPanel_ActionSetInfo = new TableLayoutPanel(); + radLabel1 = new Telerik.WinControls.UI.RadLabel(); + radTextBoxControl_Version = new Telerik.WinControls.UI.RadTextBoxControl(); + radCheckBox_IsPublic = new Telerik.WinControls.UI.RadCheckBox(); radMenuItem_Workspace = new Telerik.WinControls.UI.RadMenuItem(); radMenuItem_WorkspacePreferences = new Telerik.WinControls.UI.RadMenuItem(); radMenuItem_SaveWorkspace = new Telerik.WinControls.UI.RadMenuItem(); radMenuSeparatorItem1 = new Telerik.WinControls.UI.RadMenuSeparatorItem(); + radMenuHeaderItem_NewWorkspace = new Telerik.WinControls.UI.RadMenuHeaderItem(); + radMenuSeparatorItem3 = new Telerik.WinControls.UI.RadMenuSeparatorItem(); + radMenuHeaderItem_RecentWorkspaces = new Telerik.WinControls.UI.RadMenuHeaderItem(); radMenuItem_Tools = new Telerik.WinControls.UI.RadMenuItem(); radMenuItem_Updates = new Telerik.WinControls.UI.RadMenuItem(); - radMenuItem_EditUpdate = new Telerik.WinControls.UI.RadMenuItem(); - radMenuSeparatorItem2 = new Telerik.WinControls.UI.RadMenuSeparatorItem(); radMenuItem_CreateUpdate = new Telerik.WinControls.UI.RadMenuItem(); radMenuItem_RemoveUpdate = new Telerik.WinControls.UI.RadMenuItem(); radWaitingBar_Updates = new Telerik.WinControls.UI.RadWaitingBar(); dotsRingWaitingBarIndicatorElement1 = new Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement(); radWaitingBar_Actions = new Telerik.WinControls.UI.RadWaitingBar(); dotsRingWaitingBarIndicatorElement2 = new Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement(); - radMenuHeaderItem_NewWorkspace = new Telerik.WinControls.UI.RadMenuHeaderItem(); - radMenuHeaderItem_RecentWorkspaces = new Telerik.WinControls.UI.RadMenuHeaderItem(); - radMenuSeparatorItem3 = new Telerik.WinControls.UI.RadMenuSeparatorItem(); radMenu1 = new Telerik.WinControls.UI.RadMenu(); ((System.ComponentModel.ISupportInitialize)radSplitContainer1).BeginInit(); radSplitContainer1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)splitPanel1).BeginInit(); splitPanel1.SuspendLayout(); tableLayoutPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)radListControl_Updates).BeginInit(); + ((System.ComponentModel.ISupportInitialize)radTreeView_Sets).BeginInit(); ((System.ComponentModel.ISupportInitialize)splitPanel2).BeginInit(); splitPanel2.SuspendLayout(); - tableLayoutPanel1.SuspendLayout(); + tableLayoutPanel_ActionSet.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)radGridView_Actions).BeginInit(); ((System.ComponentModel.ISupportInitialize)radGridView_Actions.MasterTemplate).BeginInit(); + tableLayoutPanel_ActionSetInfo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)radLabel1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)radTextBoxControl_Version).BeginInit(); + ((System.ComponentModel.ISupportInitialize)radCheckBox_IsPublic).BeginInit(); ((System.ComponentModel.ISupportInitialize)radWaitingBar_Updates).BeginInit(); ((System.ComponentModel.ISupportInitialize)radWaitingBar_Actions).BeginInit(); - ((System.ComponentModel.ISupportInitialize)this).BeginInit(); ((System.ComponentModel.ISupportInitialize)radMenu1).BeginInit(); + ((System.ComponentModel.ISupportInitialize)this).BeginInit(); SuspendLayout(); // // radSplitContainer1 @@ -89,10 +95,11 @@ partial class MainForm splitPanel1.Controls.Add(tableLayoutPanel2); splitPanel1.Location = new Point(0, 0); splitPanel1.Name = "splitPanel1"; - splitPanel1.Size = new Size(200, 422); + splitPanel1.Size = new Size(232, 422); + splitPanel1.SizeInfo.AbsoluteSize = new Size(232, 200); splitPanel1.SizeInfo.AutoSizeScale = new SizeF(-0.190954775F, 0F); splitPanel1.SizeInfo.SizeMode = Telerik.WinControls.UI.Docking.SplitPanelSizeMode.Absolute; - splitPanel1.SizeInfo.SplitterCorrection = new Size(-152, 0); + splitPanel1.SizeInfo.SplitterCorrection = new Size(-120, 0); splitPanel1.TabIndex = 0; splitPanel1.TabStop = false; // @@ -100,53 +107,57 @@ partial class MainForm // tableLayoutPanel2.ColumnCount = 1; tableLayoutPanel2.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); - tableLayoutPanel2.Controls.Add(radListControl_Updates, 0, 0); + tableLayoutPanel2.Controls.Add(radTreeView_Sets, 0, 0); tableLayoutPanel2.Dock = DockStyle.Fill; tableLayoutPanel2.Location = new Point(0, 0); tableLayoutPanel2.Name = "tableLayoutPanel2"; tableLayoutPanel2.RowCount = 1; tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); - tableLayoutPanel2.Size = new Size(200, 422); + tableLayoutPanel2.Size = new Size(232, 422); tableLayoutPanel2.TabIndex = 1; // - // radListControl_Updates + // radTreeView_Sets // - radListControl_Updates.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; - radListControl_Updates.ItemHeight = 24; - radListControl_Updates.Location = new Point(3, 3); - radListControl_Updates.Name = "radListControl_Updates"; - radListControl_Updates.Size = new Size(194, 416); - radListControl_Updates.TabIndex = 0; - radListControl_Updates.SelectedIndexChanged += RadListControl_Updates_SelectedIndexChanged; + radTreeView_Sets.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + radTreeView_Sets.ItemHeight = 24; + radTreeView_Sets.LineColor = Color.FromArgb(152, 152, 152); + radTreeView_Sets.LineStyle = Telerik.WinControls.UI.TreeLineStyle.Solid; + radTreeView_Sets.Location = new Point(3, 3); + radTreeView_Sets.Name = "radTreeView_Sets"; + radTreeView_Sets.Size = new Size(226, 416); + radTreeView_Sets.TabIndex = 0; + radTreeView_Sets.SelectedNodeChanged += RadTreeView_Sets_SelectedNodeChanged; // // splitPanel2 // - splitPanel2.Controls.Add(tableLayoutPanel1); - splitPanel2.Location = new Point(204, 0); + splitPanel2.Controls.Add(tableLayoutPanel_ActionSet); + splitPanel2.Location = new Point(236, 0); splitPanel2.Name = "splitPanel2"; - splitPanel2.Size = new Size(596, 422); - splitPanel2.SizeInfo.AutoSizeScale = new SizeF(0.190954745F, 0F); - splitPanel2.SizeInfo.SplitterCorrection = new Size(152, 0); + splitPanel2.Size = new Size(564, 422); + splitPanel2.SizeInfo.AutoSizeScale = new SizeF(-0.0600000024F, 0F); + splitPanel2.SizeInfo.SplitterCorrection = new Size(120, 0); splitPanel2.TabIndex = 1; splitPanel2.TabStop = false; // - // tableLayoutPanel1 + // tableLayoutPanel_ActionSet // - tableLayoutPanel1.ColumnCount = 1; - tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); - tableLayoutPanel1.Controls.Add(radGridView_Actions, 0, 0); - tableLayoutPanel1.Dock = DockStyle.Fill; - tableLayoutPanel1.Location = new Point(0, 0); - tableLayoutPanel1.Name = "tableLayoutPanel1"; - tableLayoutPanel1.RowCount = 1; - tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); - tableLayoutPanel1.Size = new Size(596, 422); - tableLayoutPanel1.TabIndex = 0; + tableLayoutPanel_ActionSet.ColumnCount = 1; + tableLayoutPanel_ActionSet.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); + tableLayoutPanel_ActionSet.Controls.Add(radGridView_Actions, 0, 1); + tableLayoutPanel_ActionSet.Controls.Add(tableLayoutPanel_ActionSetInfo, 0, 0); + tableLayoutPanel_ActionSet.Dock = DockStyle.Fill; + tableLayoutPanel_ActionSet.Location = new Point(0, 0); + tableLayoutPanel_ActionSet.Name = "tableLayoutPanel_ActionSet"; + tableLayoutPanel_ActionSet.RowCount = 2; + tableLayoutPanel_ActionSet.RowStyles.Add(new RowStyle()); + tableLayoutPanel_ActionSet.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + tableLayoutPanel_ActionSet.Size = new Size(564, 422); + tableLayoutPanel_ActionSet.TabIndex = 0; // // radGridView_Actions // radGridView_Actions.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; - radGridView_Actions.Location = new Point(3, 3); + radGridView_Actions.Location = new Point(3, 33); // // // @@ -156,9 +167,9 @@ partial class MainForm radGridView_Actions.MasterTemplate.AllowRowResize = false; radGridView_Actions.MasterTemplate.AllowSearchRow = true; radGridView_Actions.MasterTemplate.EnableGrouping = false; - radGridView_Actions.MasterTemplate.ViewDefinition = tableViewDefinition1; + radGridView_Actions.MasterTemplate.ViewDefinition = tableViewDefinition2; radGridView_Actions.Name = "radGridView_Actions"; - radGridView_Actions.Size = new Size(590, 416); + radGridView_Actions.Size = new Size(558, 386); radGridView_Actions.TabIndex = 0; radGridView_Actions.CellFormatting += RadGridView_Actions_CellFormatting; radGridView_Actions.UserAddedRow += RadGridView_Actions_UserAddedRow; @@ -166,6 +177,55 @@ partial class MainForm radGridView_Actions.CellValueChanged += RadGridView_Actions_CellValueChanged; radGridView_Actions.ContextMenuOpening += RadGridView_Actions_ContextMenuOpening; // + // tableLayoutPanel_ActionSetInfo + // + tableLayoutPanel_ActionSetInfo.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + tableLayoutPanel_ActionSetInfo.AutoSize = true; + tableLayoutPanel_ActionSetInfo.ColumnCount = 3; + tableLayoutPanel_ActionSetInfo.ColumnStyles.Add(new ColumnStyle()); + tableLayoutPanel_ActionSetInfo.ColumnStyles.Add(new ColumnStyle()); + tableLayoutPanel_ActionSetInfo.ColumnStyles.Add(new ColumnStyle()); + tableLayoutPanel_ActionSetInfo.Controls.Add(radLabel1, 0, 0); + tableLayoutPanel_ActionSetInfo.Controls.Add(radTextBoxControl_Version, 1, 0); + tableLayoutPanel_ActionSetInfo.Controls.Add(radCheckBox_IsPublic, 2, 0); + tableLayoutPanel_ActionSetInfo.Location = new Point(0, 0); + tableLayoutPanel_ActionSetInfo.Margin = new Padding(0); + tableLayoutPanel_ActionSetInfo.Name = "tableLayoutPanel_ActionSetInfo"; + tableLayoutPanel_ActionSetInfo.RowCount = 1; + tableLayoutPanel_ActionSetInfo.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); + tableLayoutPanel_ActionSetInfo.Size = new Size(564, 30); + tableLayoutPanel_ActionSetInfo.TabIndex = 1; + // + // radLabel1 + // + radLabel1.Anchor = AnchorStyles.Left; + radLabel1.Location = new Point(3, 4); + radLabel1.Name = "radLabel1"; + radLabel1.Size = new Size(58, 22); + radLabel1.TabIndex = 0; + radLabel1.Text = "Version:"; + // + // radTextBoxControl_Version + // + radTextBoxControl_Version.Anchor = AnchorStyles.Left; + radTextBoxControl_Version.AutoSize = true; + radTextBoxControl_Version.Location = new Point(67, 3); + radTextBoxControl_Version.Name = "radTextBoxControl_Version"; + radTextBoxControl_Version.NullText = "e.g. 1.2.5.0"; + radTextBoxControl_Version.Size = new Size(150, 24); + radTextBoxControl_Version.TabIndex = 1; + radTextBoxControl_Version.TextChanged += RadTextBoxControl1_TextChanged; + // + // radCheckBox_IsPublic + // + radCheckBox_IsPublic.Anchor = AnchorStyles.Left; + radCheckBox_IsPublic.Location = new Point(223, 5); + radCheckBox_IsPublic.Name = "radCheckBox_IsPublic"; + radCheckBox_IsPublic.Size = new Size(76, 20); + radCheckBox_IsPublic.TabIndex = 2; + radCheckBox_IsPublic.Text = "Is public"; + radCheckBox_IsPublic.ToggleStateChanged += RadCheckBox1_ToggleStateChanged; + // // radMenuItem_Workspace // radMenuItem_Workspace.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_WorkspacePreferences, radMenuItem_SaveWorkspace, radMenuSeparatorItem1, radMenuHeaderItem_NewWorkspace, radMenuSeparatorItem3, radMenuHeaderItem_RecentWorkspaces }); @@ -190,6 +250,22 @@ partial class MainForm radMenuSeparatorItem1.Text = "radMenuSeparatorItem1"; radMenuSeparatorItem1.TextAlignment = ContentAlignment.MiddleLeft; // + // radMenuHeaderItem_NewWorkspace + // + radMenuHeaderItem_NewWorkspace.Name = "radMenuHeaderItem_NewWorkspace"; + radMenuHeaderItem_NewWorkspace.Text = "New workspace"; + // + // radMenuSeparatorItem3 + // + radMenuSeparatorItem3.Name = "radMenuSeparatorItem3"; + radMenuSeparatorItem3.Text = "radMenuSeparatorItem3"; + radMenuSeparatorItem3.TextAlignment = ContentAlignment.MiddleLeft; + // + // radMenuHeaderItem_RecentWorkspaces + // + radMenuHeaderItem_RecentWorkspaces.Name = "radMenuHeaderItem_RecentWorkspaces"; + radMenuHeaderItem_RecentWorkspaces.Text = "Recent workspaces"; + // // radMenuItem_Tools // radMenuItem_Tools.Name = "radMenuItem_Tools"; @@ -197,23 +273,11 @@ partial class MainForm // // radMenuItem_Updates // - radMenuItem_Updates.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_EditUpdate, radMenuSeparatorItem2, radMenuItem_CreateUpdate, radMenuItem_RemoveUpdate }); + radMenuItem_Updates.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_CreateUpdate, radMenuItem_RemoveUpdate }); radMenuItem_Updates.Name = "radMenuItem_Updates"; radMenuItem_Updates.Text = "Updates"; radMenuItem_Updates.DropDownOpening += RadMenuItem_Updates_DropDownOpening; // - // radMenuItem_EditUpdate - // - radMenuItem_EditUpdate.Name = "radMenuItem_EditUpdate"; - radMenuItem_EditUpdate.Text = "Edit"; - radMenuItem_EditUpdate.Click += RadMenuItem_EditUpdate_Click; - // - // radMenuSeparatorItem2 - // - radMenuSeparatorItem2.Name = "radMenuSeparatorItem2"; - radMenuSeparatorItem2.Text = "radMenuSeparatorItem2"; - radMenuSeparatorItem2.TextAlignment = ContentAlignment.MiddleLeft; - // // radMenuItem_CreateUpdate // radMenuItem_CreateUpdate.Name = "radMenuItem_CreateUpdate"; @@ -228,7 +292,7 @@ partial class MainForm // // radWaitingBar_Updates // - radWaitingBar_Updates.AssociatedControl = radListControl_Updates; + radWaitingBar_Updates.AssociatedControl = radTreeView_Sets; radWaitingBar_Updates.Location = new Point(0, 78); radWaitingBar_Updates.Name = "radWaitingBar_Updates"; radWaitingBar_Updates.Size = new Size(70, 70); @@ -260,29 +324,6 @@ partial class MainForm // dotsRingWaitingBarIndicatorElement2.Name = "dotsRingWaitingBarIndicatorElement2"; // - // radMenuHeaderItem_NewWorkspace - // - radMenuHeaderItem_NewWorkspace.Name = "radMenuHeaderItem_NewWorkspace"; - radMenuHeaderItem_NewWorkspace.Text = "New workspace"; - // - // radMenuHeaderItem_RecentWorkspaces - // - radMenuHeaderItem_RecentWorkspaces.Name = "radMenuHeaderItem_RecentWorkspaces"; - radMenuHeaderItem_RecentWorkspaces.Text = "Recent workspaces"; - // - // radMenuSeparatorItem3 - // - radMenuSeparatorItem3.Name = "radMenuSeparatorItem3"; - radMenuSeparatorItem3.Text = "radMenuSeparatorItem3"; - radMenuSeparatorItem3.TextAlignment = ContentAlignment.MiddleLeft; - // - // MainForm - // - AutoScaleBaseSize = new Size(7, 15); - AutoScaleDimensions = new SizeF(7F, 15F); - AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); - // // radMenu1 // radMenu1.Items.AddRange(new Telerik.WinControls.RadItem[] { radMenuItem_Workspace, radMenuItem_Updates, radMenuItem_Tools }); @@ -290,6 +331,13 @@ partial class MainForm radMenu1.Name = "radMenu1"; radMenu1.Size = new Size(800, 28); radMenu1.TabIndex = 1; + // + // MainForm + // + AutoScaleBaseSize = new Size(7, 15); + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); Controls.Add(radWaitingBar_Actions); Controls.Add(radWaitingBar_Updates); Controls.Add(radSplitContainer1); @@ -305,12 +353,18 @@ partial class MainForm ((System.ComponentModel.ISupportInitialize)splitPanel1).EndInit(); splitPanel1.ResumeLayout(false); tableLayoutPanel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)radListControl_Updates).EndInit(); + ((System.ComponentModel.ISupportInitialize)radTreeView_Sets).EndInit(); ((System.ComponentModel.ISupportInitialize)splitPanel2).EndInit(); splitPanel2.ResumeLayout(false); - tableLayoutPanel1.ResumeLayout(false); + tableLayoutPanel_ActionSet.ResumeLayout(false); + tableLayoutPanel_ActionSet.PerformLayout(); ((System.ComponentModel.ISupportInitialize)radGridView_Actions.MasterTemplate).EndInit(); ((System.ComponentModel.ISupportInitialize)radGridView_Actions).EndInit(); + tableLayoutPanel_ActionSetInfo.ResumeLayout(false); + tableLayoutPanel_ActionSetInfo.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)radLabel1).EndInit(); + ((System.ComponentModel.ISupportInitialize)radTextBoxControl_Version).EndInit(); + ((System.ComponentModel.ISupportInitialize)radCheckBox_IsPublic).EndInit(); ((System.ComponentModel.ISupportInitialize)radWaitingBar_Updates).EndInit(); ((System.ComponentModel.ISupportInitialize)radWaitingBar_Actions).EndInit(); ((System.ComponentModel.ISupportInitialize)radMenu1).EndInit(); @@ -329,7 +383,7 @@ partial class MainForm private Telerik.WinControls.UI.RadMenuItem radMenuItem_WorkspacePreferences; private Telerik.WinControls.UI.RadMenuItem radMenuItem_Tools; private TableLayoutPanel tableLayoutPanel2; - private TableLayoutPanel tableLayoutPanel1; + private TableLayoutPanel tableLayoutPanel_ActionSet; private Telerik.WinControls.UI.RadGridView radGridView_Actions; private Telerik.WinControls.UI.RadMenuSeparatorItem radMenuSeparatorItem1; private Telerik.WinControls.UI.RadMenuItem radMenuItem_SaveWorkspace; @@ -337,13 +391,15 @@ partial class MainForm private Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement dotsRingWaitingBarIndicatorElement1; private Telerik.WinControls.UI.RadWaitingBar radWaitingBar_Actions; private Telerik.WinControls.UI.DotsRingWaitingBarIndicatorElement dotsRingWaitingBarIndicatorElement2; - private Telerik.WinControls.UI.RadListControl radListControl_Updates; private Telerik.WinControls.UI.RadMenuItem radMenuItem_Updates; - private Telerik.WinControls.UI.RadMenuItem radMenuItem_EditUpdate; - private Telerik.WinControls.UI.RadMenuSeparatorItem radMenuSeparatorItem2; private Telerik.WinControls.UI.RadMenuItem radMenuItem_CreateUpdate; private Telerik.WinControls.UI.RadMenuItem radMenuItem_RemoveUpdate; private Telerik.WinControls.UI.RadMenuHeaderItem radMenuHeaderItem_NewWorkspace; private Telerik.WinControls.UI.RadMenuSeparatorItem radMenuSeparatorItem3; private Telerik.WinControls.UI.RadMenuHeaderItem radMenuHeaderItem_RecentWorkspaces; + private Telerik.WinControls.UI.RadTreeView radTreeView_Sets; + private TableLayoutPanel tableLayoutPanel_ActionSetInfo; + private Telerik.WinControls.UI.RadLabel radLabel1; + private Telerik.WinControls.UI.RadTextBoxControl radTextBoxControl_Version; + private Telerik.WinControls.UI.RadCheckBox radCheckBox_IsPublic; } diff --git a/ModpackUpdater.Apps.Manager/Ui/MainForm.cs b/ModpackUpdater.Apps.Manager/Ui/MainForm.cs index 8d6e88c..b9d364c 100644 --- a/ModpackUpdater.Apps.Manager/Ui/MainForm.cs +++ b/ModpackUpdater.Apps.Manager/Ui/MainForm.cs @@ -7,8 +7,6 @@ using Pilz.Plugins.Advanced; using Pilz.Plugins.Advanced.UI.WinForms.Telerik; using Pilz.UI.Symbols; using Pilz.UI.WinForms.Extensions; -using Pilz.UI.WinForms.Telerik.Dialogs; -using Pilz.UI.WinForms.Telerik.Extensions; using Telerik.WinControls; using Telerik.WinControls.UI; @@ -19,13 +17,14 @@ public partial class MainForm : RadForm, IMainApi private record RecentFilesItemTag(WorkspaceConfig Config, WorkspaceFeature Feature); private record WorkspaceTag(IWorkspace Workspace, WorkspaceFeature Feature); + private bool loadingMainView; private WorkspaceTag? wsInfo; private InstallAction? tempAction; Form IMainApi.MainWindow => this; IWorkspace? IMainApi.CurWorkspace => wsInfo?.Workspace; - public IActionSetInfos? CurActionSet => radListControl_Updates.SelectedValue as IActionSetInfos; + public IActionSetInfos? CurActionSet => radTreeView_Sets.SelectedNode?.Tag as IActionSetInfos; public MainForm() { @@ -37,7 +36,6 @@ public partial class MainForm : RadForm, IMainApi //radMenuItem_OpenNewWorkspace.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.new_window, SymbolSize.Small); //radMenuItem_RecentWorkspaces.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.time_machine, SymbolSize.Small); radMenuItem_Updates.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.update_done, SymbolSize.Small); - radMenuItem_EditUpdate.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.edit, SymbolSize.Small); radMenuItem_CreateUpdate.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.add, SymbolSize.Small); radMenuItem_RemoveUpdate.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.remove, SymbolSize.Small); radMenuItem_Tools.SvgImage = Program.Symbols.GetSvgImage(AppSymbols.tools, SymbolSize.Small); @@ -119,47 +117,74 @@ public partial class MainForm : RadForm, IMainApi radWaitingBar_Updates.StartWaiting(); Text = wsInfo.Workspace.Config.DisplayText; - radListControl_Updates.BeginUpdate(); - radListControl_Updates.Items.Clear(); + radTreeView_Sets.BeginUpdate(); + radTreeView_Sets.Nodes.Clear(); AddUpdateItem(wsInfo.Workspace.InstallInfos); - wsInfo.Workspace.UpdateInfos.Updates.ForEach(n => AddUpdateItem(n)); + var nodeUpdates = new RadTreeNode + { + Text = "Updates", + Name = "updates", + SvgImage = Program.Symbols.GetSvgImage(AppSymbols.update_done, SymbolSize.Small), + }; + wsInfo.Workspace.UpdateInfos.Updates.ForEach(n => AddUpdateItem(n, nodeUpdates.Nodes)); + radTreeView_Sets.Nodes.Add(nodeUpdates); - radListControl_Updates.EndUpdate(); + radTreeView_Sets.EndUpdate(); radWaitingBar_Updates.StopWaiting(); } - private RadListDataItem AddUpdateItem(IActionSetInfos infos) + private RadTreeNode AddUpdateItem(IActionSetInfos infos) + { + return AddUpdateItem(infos, radTreeView_Sets.Nodes); + } + + private RadTreeNode AddUpdateItem(IActionSetInfos infos, RadTreeNodeCollection parent) { var item = CreateUpdateItem(infos); - radListControl_Updates.Items.Add(item); + parent.Add(item); return item; } - private RadListDataItem InsertUpdateItem(IActionSetInfos infos) + private RadTreeNode InsertUpdateItem(IActionSetInfos infos) { var item = CreateUpdateItem(infos); - radListControl_Updates.Items.Insert(Math.Min(1, radListControl_Updates.Items.Count), item); + var nodeUpdates = radTreeView_Sets.Nodes["updates"]; + nodeUpdates.Nodes.Insert(Math.Min(1, nodeUpdates.Nodes.Count), item); return item; } - private RadListDataItem CreateUpdateItem(IActionSetInfos infos) + private RadTreeNode CreateUpdateItem(IActionSetInfos infos) { - var item = new RadListDataItem(); + var item = new RadTreeNode(); UpdateUpdateItem(item, infos); return item; } - private void UpdateUpdateItem(RadListDataItem item) + private void UpdateUpdateItem(RadTreeNode item) { - if (item.Value is IActionSetInfos infos) + if (item.Tag is IActionSetInfos infos) UpdateUpdateItem(item, infos); } - private void UpdateUpdateItem(RadListDataItem item, IActionSetInfos infos) + private void SaveActionsSet() { - if (item.Value != infos) - item.Value = infos; + if (loadingMainView || CurActionSet is not IActionSetInfos infos) + return; + + if (!Version.TryParse(radTextBoxControl_Version.Text.Trim(), out Version? version)) + version = new Version("1.0.0.0"); + + infos.Version = version; + infos.IsPublic = radCheckBox_IsPublic.Checked; + + UpdateUpdateItem(radTreeView_Sets.SelectedNode); + } + + private void UpdateUpdateItem(RadTreeNode item, IActionSetInfos infos) + { + if (item.Tag != infos) + item.Tag = infos; if (infos is UpdateInfo) item.Text = string.Format(GeneralLangRes.Node_Update, infos.Version?.ToString() ?? "?"); @@ -173,9 +198,10 @@ public partial class MainForm : RadForm, IMainApi public void UpdateItem(IActionSetInfos actionSetInfos) { - RadListDataItem? item = null; + RadTreeNode? item = null; + var nodeUpdates = radTreeView_Sets.Nodes["updates"]; - foreach (var iitem in radListControl_Updates.Items) + foreach (var iitem in nodeUpdates.Nodes) { if (item == null && iitem.Value == actionSetInfos) item = iitem; @@ -184,7 +210,7 @@ public partial class MainForm : RadForm, IMainApi if (item == null) InsertUpdateItem(actionSetInfos); else if (wsInfo?.Workspace.UpdateInfos != null && !wsInfo.Workspace.UpdateInfos.Updates.Contains(actionSetInfos)) - radListControl_Updates.Items.Remove(item); + item.Remove(); else UpdateUpdateItem(item); } @@ -198,7 +224,29 @@ public partial class MainForm : RadForm, IMainApi } } - private void LoadActionSet(IActionSetInfos infos) + private void LoadMainView() + { + loadingMainView = true; + + tableLayoutPanel_ActionSet.Visible = false; + tableLayoutPanel_ActionSetInfo.Visible = false; + + if (CurActionSet is IActionSet set) + { + if (set is IActionSetInfos infos) + { + radTextBoxControl_Version.Text = infos.Version?.ToString(); + radCheckBox_IsPublic.Checked = infos.IsPublic; + tableLayoutPanel_ActionSetInfo.Visible = true; + } + tableLayoutPanel_ActionSet.Visible = true; + LoadActionSet(set); + } + + loadingMainView = false; + } + + private void LoadActionSet(IActionSet infos) { radGridView_Actions.BeginUpdate(); radGridView_Actions.Rows.Clear(); @@ -263,6 +311,12 @@ public partial class MainForm : RadForm, IMainApi Width = 50, IsVisible = infos is UpdateInfo, }, + new GridViewTextBoxColumn + { + Name = "destpath", + HeaderText = ActionsListLangRes.Col_DestPath, + Width = 250, + }, new GridViewComboBoxColumn { Name = "srctype", @@ -314,12 +368,6 @@ public partial class MainForm : RadForm, IMainApi IsVisible = infos is UpdateInfo, }, new GridViewTextBoxColumn - { - Name = "destpath", - HeaderText = ActionsListLangRes.Col_DestPath, - Width = 250, - }, - new GridViewTextBoxColumn { Name = "website", HeaderText = ActionsListLangRes.Col_Website, @@ -409,10 +457,9 @@ public partial class MainForm : RadForm, IMainApi func.Execute(new MainApiParameters(this)); } - private void RadListControl_Updates_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) + private void RadTreeView_Sets_SelectedNodeChanged(object sender, RadTreeViewEventArgs e) { - if (radListControl_Updates.Items.ElementAtOrDefault(e.Position)?.Value is IActionSetInfos infos) - LoadActionSet(infos); + LoadMainView(); } private void RadGridView_Actions_CellFormatting(object sender, CellFormattingEventArgs e) @@ -537,36 +584,29 @@ public partial class MainForm : RadForm, IMainApi private void RadMenuItem_Updates_DropDownOpening(object sender, System.ComponentModel.CancelEventArgs e) { - radMenuItem_EditUpdate.Enabled = radListControl_Updates.SelectedItem?.Value is IActionSetInfos; - radMenuItem_RemoveUpdate.Enabled = radListControl_Updates.SelectedItem?.Value is UpdateInfo; - } - - private void RadMenuItem_EditUpdate_Click(object sender, EventArgs e) - { - if (radListControl_Updates.SelectedItem?.Value is IActionSetInfos infos - && RadDialogBase.ShowDialog(new UpdatePropertiesEditorFlyout(infos), TitlesLangRes.EditUpdate, Program.Symbols.GetSvgImage(AppSymbols.edit, SymbolSize.Small)).IsValid()) - UpdateUpdateItem(radListControl_Updates.SelectedItem); + radMenuItem_RemoveUpdate.Enabled = radTreeView_Sets.SelectedNode?.Tag is UpdateInfo; } private void RadMenuItem_CreateUpdate_Click(object sender, EventArgs e) { - var infos = new UpdateInfo(); + if (wsInfo?.Workspace.UpdateInfos is null) + return; - if (wsInfo?.Workspace.UpdateInfos is not null - && RadDialogBase.ShowDialog(new UpdatePropertiesEditorFlyout(infos), TitlesLangRes.EditUpdate, Program.Symbols.GetSvgImage(AppSymbols.edit, SymbolSize.Small)).IsValid()) + var infos = new UpdateInfo { - wsInfo.Workspace.UpdateInfos.Updates.Insert(0, infos); - InsertUpdateItem(infos); - } + Version = wsInfo.Workspace.InstallInfos?.Version, + }; + wsInfo.Workspace.UpdateInfos.Updates.Insert(0, infos); + InsertUpdateItem(infos); } private void RadMenuItem_RemoveUpdate_Click(object sender, EventArgs e) { - if (radListControl_Updates.SelectedItem?.Value is UpdateInfo infos && wsInfo?.Workspace.UpdateInfos is not null + if (radTreeView_Sets.SelectedNode?.Tag is UpdateInfo infos && wsInfo?.Workspace.UpdateInfos is not null && RadMessageBox.Show(MsgBoxLangRes.RemoveUpdate, MsgBoxLangRes.RemoveUpdate_Title, MessageBoxButtons.YesNo, RadMessageIcon.Exclamation).IsYes()) { wsInfo.Workspace.UpdateInfos.Updates.Remove(infos); - radListControl_Updates.Items.Remove(radListControl_Updates.SelectedItem); + radTreeView_Sets.SelectedNode.Remove(); } } @@ -598,4 +638,14 @@ public partial class MainForm : RadForm, IMainApi PluginFeatureController.Instance.Functions.Get(FeatureTypes.ActionsContextMenu).InsertItemsTo(e.ContextMenu.Items, customClickHandler: RadMenuItem_ToolsItem_Click, insertPrioSplitters: true); } } + + private void RadTextBoxControl1_TextChanged(object sender, EventArgs e) + { + SaveActionsSet(); + } + + private void RadCheckBox1_ToggleStateChanged(object sender, StateChangedEventArgs args) + { + SaveActionsSet(); + } } diff --git a/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.Designer.cs b/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.Designer.cs deleted file mode 100644 index bfc066e..0000000 --- a/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.Designer.cs +++ /dev/null @@ -1,114 +0,0 @@ -namespace ModpackUpdater.Apps.Manager.Ui; - -partial class UpdatePropertiesEditorFlyout -{ - /// - /// Erforderliche Designervariable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Verwendete Ressourcen bereinigen. - /// - /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Vom Komponenten-Designer generierter Code - - /// - /// Erforderliche Methode für die Designerunterstützung. - /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. - /// - private void InitializeComponent() - { - tableLayoutPanel1 = new TableLayoutPanel(); - radLabel1 = new Telerik.WinControls.UI.RadLabel(); - radTextBox_Version = new Telerik.WinControls.UI.RadTextBox(); - radCheckBox_IsPublic = new Telerik.WinControls.UI.RadCheckBox(); - tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)radLabel1).BeginInit(); - ((System.ComponentModel.ISupportInitialize)radTextBox_Version).BeginInit(); - ((System.ComponentModel.ISupportInitialize)radCheckBox_IsPublic).BeginInit(); - SuspendLayout(); - // - // tableLayoutPanel1 - // - tableLayoutPanel1.AutoSize = true; - tableLayoutPanel1.AutoSizeMode = AutoSizeMode.GrowAndShrink; - tableLayoutPanel1.ColumnCount = 1; - tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); - tableLayoutPanel1.Controls.Add(radLabel1, 0, 0); - tableLayoutPanel1.Controls.Add(radTextBox_Version, 0, 1); - tableLayoutPanel1.Controls.Add(radCheckBox_IsPublic, 0, 3); - tableLayoutPanel1.Dock = DockStyle.Fill; - tableLayoutPanel1.Location = new Point(0, 30); - tableLayoutPanel1.Name = "tableLayoutPanel1"; - tableLayoutPanel1.RowCount = 4; - tableLayoutPanel1.RowStyles.Add(new RowStyle()); - tableLayoutPanel1.RowStyles.Add(new RowStyle()); - tableLayoutPanel1.RowStyles.Add(new RowStyle()); - tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); - tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); - tableLayoutPanel1.Size = new Size(300, 84); - tableLayoutPanel1.TabIndex = 4; - // - // radLabel1 - // - radLabel1.Location = new Point(3, 3); - radLabel1.Name = "radLabel1"; - radLabel1.Size = new Size(55, 22); - radLabel1.TabIndex = 0; - radLabel1.Text = "Version"; - // - // radTextBox_Version - // - radTextBox_Version.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; - radTextBox_Version.Location = new Point(3, 31); - radTextBox_Version.Name = "radTextBox_Version"; - radTextBox_Version.NullText = "1.5.37.0"; - radTextBox_Version.Size = new Size(294, 24); - radTextBox_Version.TabIndex = 1; - // - // radCheckBox_IsPublic - // - radCheckBox_IsPublic.Location = new Point(3, 61); - radCheckBox_IsPublic.Name = "radCheckBox_IsPublic"; - radCheckBox_IsPublic.Size = new Size(76, 20); - radCheckBox_IsPublic.TabIndex = 3; - radCheckBox_IsPublic.Text = "Is public"; - // - // UpdatePropertiesEditorFlyout - // - AutoScaleDimensions = new SizeF(7F, 15F); - AutoScaleMode = AutoScaleMode.Font; - AutoSize = true; - AutoSizeMode = AutoSizeMode.GrowAndShrink; - BackColor = Color.Transparent; - Controls.Add(tableLayoutPanel1); - MinimumSize = new Size(300, 0); - Name = "UpdatePropertiesEditorFlyout"; - Size = new Size(300, 144); - Controls.SetChildIndex(tableLayoutPanel1, 0); - tableLayoutPanel1.ResumeLayout(false); - tableLayoutPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)radLabel1).EndInit(); - ((System.ComponentModel.ISupportInitialize)radTextBox_Version).EndInit(); - ((System.ComponentModel.ISupportInitialize)radCheckBox_IsPublic).EndInit(); - ResumeLayout(false); - PerformLayout(); - } - - #endregion - - private TableLayoutPanel tableLayoutPanel1; - private Telerik.WinControls.UI.RadLabel radLabel1; - private Telerik.WinControls.UI.RadTextBox radTextBox_Version; - private Telerik.WinControls.UI.RadCheckBox radCheckBox_IsPublic; -} diff --git a/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.cs b/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.cs deleted file mode 100644 index b580cc3..0000000 --- a/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Pilz.UI; -using Pilz.UI.WinForms.Telerik.Dialogs; - -namespace ModpackUpdater.Apps.Manager.Ui; - -public partial class UpdatePropertiesEditorFlyout : RadFlyoutBase, ILoadContent -{ - private readonly IActionSetInfos infos; - - public UpdatePropertiesEditorFlyout(IActionSetInfos infos) - { - this.infos = infos; - InitializeComponent(); - } - - public void LoadContent() - { - radTextBox_Version.Text = infos.Version?.ToString(); - radCheckBox_IsPublic.Checked = infos.IsPublic; - } - - protected override bool ValidateOK() - { - if (!Version.TryParse(radTextBox_Version.Text.Trim(), out Version? version)) - return false; - - infos.Version = version; - infos.IsPublic = radCheckBox_IsPublic.Checked; - - return base.ValidateOK(); - } -} diff --git a/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.resx b/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.resx deleted file mode 100644 index 8b2ff64..0000000 --- a/ModpackUpdater.Apps.Manager/Ui/UpdatePropertiesEditorFlyout.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file