From 297b70c76cf7ab332cffc119a9fe22884aa99523 Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 9 Nov 2020 11:20:35 -0600 Subject: [PATCH] Fixed up the profile manager form, added back all broken functions I forgot about after changing over the TreeView into a ListView. --- .vs/DataOrganizer/v16/.suo | Bin 49152 -> 49664 bytes DataOrganizer/FileViewer.Designer.cs | 1 + DataOrganizer/MainForm.Designer.cs | 1 + DataOrganizer/ProfileManager.Designer.cs | 4 +++- DataOrganizer/ProfileManager.cs | 20 ++++++++++---------- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.vs/DataOrganizer/v16/.suo b/.vs/DataOrganizer/v16/.suo index 59fd2b4fc30fa8fe1d33ce4c6c989bbc33be5eda..608bdcefdd571e2309e798f3fef5911265bcb1ba 100644 GIT binary patch delta 1881 zcmZo@U~Xt(o?sx$!~g{X3=I4X3=AOtzyJULgG8A(`pPr$Jz(9dx@X%pMtueb1_#Z_ zRZLZkOD2D1s%JEsT*_R}7(4kZb1-A*WKR}r#@NZNEZM9<3=9l*lfSa~8-ffHWME(j zVPIeYvBMY`7-AS082&@S-~a#rgD{Az$iTo5JXw)Nd167vB&HlbhNu4nLDtIQw3a=X zF=DbOhc#{dptOQvf4l$NR5hM`Jz`y{q6NKZC z+yb)S7o>3V0?rqk*Kma}PApKF#MJ>~ZsIFpVvLzwDp1cDJ^8CZJ!915Qo(x0(8*r~ z>lv*!mkRx7#wRWDpOH~-a;emRM%~G!(#=e-m^c5Du3}^~m|QAbrot86_ZXff50GO3E-IQW2ZK`!JTFDx==or2k-v>pL`(HW>S*K0RCRz(R_ib@Fa&~2x%o{eHakoi077LZFf-<_e%IQhWJmdPzOHtZ4Sxj=%GkH=e1KCoItoEgMpux0>>Ix-|P zlrUs6lrf}E{=d6%@`2e-o1J$2W1KvHmeFSODOSw5?3pY$-EXq`%$pS0vWtnkiXjzT z|A307i|Z@}c1s%A#i{JgdzNwX|L)0q?I#PY{;+9|1LNd|Jr0xoGXy3J?Ef&?JHuh| zfmMu?nc~zYr>&8id})o;V$BJu`HSi3=9m>3=9k) zdqFrJ$vw#Kh=6E_n8ekgyO@E2VF?2R!%_wYhGh&449gi97*;SaFsx)?U|7Y#z_1!> z3CIusHYR#AlBH=AUkMXq{p3=Cdd8~BUj^zJD<_u<)-%RU{wi3{=()L6=sz<)X^H=g zjOLR|rT#OTO)iygW)fiA{7brukf-sL2)LS+T3=ES$C>Zd7{O1J~oUEg$q7w>@ z)Nlp{h6n}*hDZhmhA3zNgCZIf=^#xYJh?_OMFGTs;Ti@8hFS&&hB~N;An{2`Ul>a_ ze^shy1^Gn-*)N(^%pkw$g8iaf&k6F2`JncT)fZM51_p+^lYd(MX7t|t)mn^+#m&Xs zWHP_qUpK87UqPX3=M{bZw4MBnyjC$N{3*U>tL>!TwEV`ef2^94e%ek8+tjriOZ8+g z*lIid+c@*7>ULWm4;yW#0}MI-%@g-IOp@IkWWR_R6k<**`52ie&kxjQoHDsT)O1qN z7gjrn-9f*(y%`u7-hgs81H)v;UCF#t85kG@7#J8p^pVMqaoWrq7#JoihDbB&P2T7# zU+>6}!jQt?&rrk=%22?N!jQ;N!jQ@kz)-}H&ydED$&ka4%HYIM%22{k!jR99#}Lop z%#g#7$&k#D&7i@M&yd8B#gNL7%uvFhz);MP%85C@exAUt_zOyT6TP>aQkTbLF_uuKk`owC_3?+w%BPo-LHdJI7f zsSJ}1<3uJ;$!(}rGcqtRGJ+Bl0|P^*16=p!q{f*{ld293 zgvEcD1dE|AVqnlY0LpyQoAW39Wnl#s#ipAJr)DruW(u*H+^~yna>CvPlMl>x+RU^D zlv1i2Ce3n~ys=qfvUH0x5vDB65SeVWs*5|3ArD-mg9`A2bL1!gnIk5W%uvj*ThhQT zPGxW2vy7AfcTe7HKl#FJBP6R@CR_m@01+4+mjD0& diff --git a/DataOrganizer/FileViewer.Designer.cs b/DataOrganizer/FileViewer.Designer.cs index 835bf0e..f37b1fc 100644 --- a/DataOrganizer/FileViewer.Designer.cs +++ b/DataOrganizer/FileViewer.Designer.cs @@ -204,6 +204,7 @@ this.Controls.Add(this.MainMenu); this.MainMenuStrip = this.MainMenu; this.Name = "FileViewer"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "File Viewer & Comparison"; this.tableLayoutPanel1.ResumeLayout(false); this.PanelOne.ResumeLayout(false); diff --git a/DataOrganizer/MainForm.Designer.cs b/DataOrganizer/MainForm.Designer.cs index fc6b29c..b893689 100644 --- a/DataOrganizer/MainForm.Designer.cs +++ b/DataOrganizer/MainForm.Designer.cs @@ -94,6 +94,7 @@ this.Controls.Add(this.MainMenu); this.MainMenuStrip = this.MainMenu; this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; this.MainMenu.ResumeLayout(false); this.MainMenu.PerformLayout(); diff --git a/DataOrganizer/ProfileManager.Designer.cs b/DataOrganizer/ProfileManager.Designer.cs index 78aa831..32c5760 100644 --- a/DataOrganizer/ProfileManager.Designer.cs +++ b/DataOrganizer/ProfileManager.Designer.cs @@ -285,6 +285,7 @@ this.FolderGroupListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.NameColumn, this.PathColumn}); + this.FolderGroupListView.FullRowSelect = true; this.FolderGroupListView.HideSelection = false; this.FolderGroupListView.Location = new System.Drawing.Point(20, 407); this.FolderGroupListView.MultiSelect = false; @@ -316,7 +317,8 @@ this.MinimizeBox = false; this.Name = "ProfileManager"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.Text = "ProfileManager"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Profile Manager"; this.MainLayoutPanel.ResumeLayout(false); this.MainPanel.ResumeLayout(false); this.MainPanel.PerformLayout(); diff --git a/DataOrganizer/ProfileManager.cs b/DataOrganizer/ProfileManager.cs index 0640ed5..69d20d4 100644 --- a/DataOrganizer/ProfileManager.cs +++ b/DataOrganizer/ProfileManager.cs @@ -13,10 +13,10 @@ namespace DataOrganizer { public partial class ProfileManager : Form { - private string MachineNameLabelText { get; } = "The Machine Name property determines what\r\nprofile will be loaded automatically (Currently: '{0}')."; + private string MachineNameLabelText { get; } = "The Machine Name property determines what profile will be loaded automatically.\r\nCurrently: '{0}'."; private bool IsUpdating { get; set; } private ContextMenu FolderGroupListContextMenu { get; set; } = new ContextMenu(); - private TreeNode ClickedNode { get; set; } + private ListViewItem SelectedItem { get; set; } public ProfileManager() { @@ -29,20 +29,20 @@ namespace DataOrganizer ProfileNameTextBox.TextChanged += ToggleAddOrUpdateButton; NewContentLocationTextBox.TextChanged += ToggleAddOrUpdateButton; MachineNameTextBox.TextChanged += MachineNameTextBox_TextChanged; - //FolderGroupsTreeView.NodeMouseClick += FolderGroupsTreeView_NodeMouseClick; FolderGroupPathTextBox.TextChanged += ToggleGroupInsertButton; FolderGroupNameTextBox.TextChanged += ToggleGroupInsertButton; + FolderGroupListView.MouseClick += FolderGroupListView_MouseClick; deleteMenuItem.Click += DeleteMenuItem_Click; UpdateProfileComboBox(); } - private void FolderGroupsTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) + private void FolderGroupListView_MouseClick(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Right) + if(e.Button == MouseButtons.Right) { - ClickedNode = e.Node; - //FolderGroupListContextMenu.Show(FolderGroupsTreeView, e.Location); + SelectedItem = FolderGroupListView.GetItemAt(e.X, e.Y); + FolderGroupListContextMenu.Show(FolderGroupListView, e.Location); } } @@ -57,7 +57,7 @@ namespace DataOrganizer var db = new DB(); var currentIndex = ProfilesComboBox.SelectedIndex; - db.DeleteFolderGroup((DB.FolderGroup) ClickedNode.Tag); + db.DeleteFolderGroup((DB.FolderGroup) SelectedItem.Tag); UpdateProfileComboBox(); @@ -67,10 +67,9 @@ namespace DataOrganizer else { FolderGroupListView.Items.Remove(FolderGroupListView.SelectedItems[0]); - //FolderGroupsTreeView.Nodes.Remove(ClickedNode); } - ClickedNode = null; + SelectedItem = null; } private void MachineNameTextBox_TextChanged(object sender, EventArgs e) @@ -199,6 +198,7 @@ namespace DataOrganizer { var item = new ListViewItem(group.Name); item.SubItems.Add(group.Path); + item.Tag = group; FolderGroupListView.Items.Add(item); }