mirror of
https://github.com/jaquadro/NBTExplorer.git
synced 2025-01-09 01:16:25 +00:00
Don't want to mess with the keyboard shortcut
See previous commit/added comments
This commit is contained in:
parent
400eb1f80a
commit
b642b3aee4
1 changed files with 14 additions and 13 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue