Don't want to mess with the keyboard shortcut

See previous commit/added comments
This commit is contained in:
flarn2006 2013-12-17 19:24:15 -05:00
parent 400eb1f80a
commit b642b3aee4

View file

@ -162,19 +162,9 @@ namespace NBTExplorer.Windows
if (!ConfirmAction("Open new folder anyway?"))
return;
if ((ModifierKeys & Keys.Control) == 0) {
// if the user isn't holding Control, use the standard folder browser dialog
using (FolderBrowserDialog ofd = new FolderBrowserDialog()) {
if (_openFolderPath != null)
ofd.SelectedPath = _openFolderPath;
if (ofd.ShowDialog() == DialogResult.OK) {
_openFolderPath = ofd.SelectedPath;
OpenPaths(new string[] { ofd.SelectedPath });
}
}
} else {
// otherwise, use a file open dialog and open whichever directory has the selected file
if ((ModifierKeys & Keys.Control) > 0 && (ModifierKeys & Keys.Shift) == 0) {
// If the user is holding Control, use a file open dialog and open whichever directory has the selected file.
// But not if the user is also holding Shift, as Ctrl+Shift+O is the keyboard shortcut for this menu item.
using (OpenFileDialog ofd = new OpenFileDialog()) {
ofd.Title = "Select any file in the directory to open";
ofd.Filter = "All files (*.*)|*.*";
@ -187,6 +177,17 @@ namespace NBTExplorer.Windows
OpenPaths(new string[] { _openFolderPath });
}
}
} else {
// Otherwise, use the standard folder browser dialog.
using (FolderBrowserDialog ofd = new FolderBrowserDialog()) {
if (_openFolderPath != null)
ofd.SelectedPath = _openFolderPath;
if (ofd.ShowDialog() == DialogResult.OK) {
_openFolderPath = ofd.SelectedPath;
OpenPaths(new string[] { ofd.SelectedPath });
}
}
}
UpdateUI();