Fixed up the profile manager form, added back all broken functions I forgot about after changing over the TreeView into a ListView.

This commit is contained in:
Admin
2020-11-09 11:20:35 -06:00
parent 09ef449909
commit 297b70c76c
5 changed files with 15 additions and 11 deletions
Binary file not shown.
+1
View File
@@ -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);
+1
View File
@@ -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();
+3 -1
View File
@@ -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();
+10 -10
View File
@@ -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);
}