private void treeView1_KeyDown(object sender, KeyEventArgs e) { //Console.WriteLine("---------"); //Console.WriteLine(e.KeyValue); switch (e.KeyValue) { case 46: toggleDeleteState(treeView1.SelectedNode); break; case 8: toggleDeleteState(treeView1.SelectedNode); break; case 116: //F5 refresh OsuDB.cleanUp(); CollectionDB.cleanUp(); treeView1.Nodes.Clear(); statusLabel.Text = "Refreshing Data..."; runWorker(); break; default: break; } }
private void browseButton_Click(object sender, EventArgs e) { if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { bool oldLastSuccess = lastLoadSuccess; string oldOsuFolder = osuFolder; osuFolder = folderBrowserDialog1.SelectedPath + "\\"; //Console.WriteLine("Folder selected: " + osuFolder); treeView1.Nodes.Clear(); statusLabel.Text = "Loading new data..."; OsuDB.cleanUp(); CollectionDB.cleanUp(); loadFiles(); if (!lastLoadSuccess) { osuFolder = oldOsuFolder; lastLoadSuccess = oldLastSuccess; MessageBox.Show("Going back to old path", "Reverting"); statusLabel.Text = "Loading previous data..."; treeView1.Nodes.Clear(); runWorker(); } else { populateForm(); statusLabel.Text = "Loaded new osu! folder, osu.db has " + OsuDB.Songs.Count + " entries, " + CollectionDB.Collections.Count() + " collections loaded"; } folderBrowserDialog1.SelectedPath = osuFolder; //Console.WriteLine(osuFolder); } }