forked from mirrors/NBTExplorer
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?"))
|
if (!ConfirmAction("Open new folder anyway?"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((ModifierKeys & Keys.Control) == 0) {
|
if ((ModifierKeys & Keys.Control) > 0 && (ModifierKeys & Keys.Shift) == 0) {
|
||||||
// if the user isn't holding Control, use the standard folder browser dialog
|
// If the user is holding Control, use a file open dialog and open whichever directory has the selected file.
|
||||||
using (FolderBrowserDialog ofd = new FolderBrowserDialog()) {
|
// But not if the user is also holding Shift, as Ctrl+Shift+O is the keyboard shortcut for this menu item.
|
||||||
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
|
|
||||||
using (OpenFileDialog ofd = new OpenFileDialog()) {
|
using (OpenFileDialog ofd = new OpenFileDialog()) {
|
||||||
ofd.Title = "Select any file in the directory to open";
|
ofd.Title = "Select any file in the directory to open";
|
||||||
ofd.Filter = "All files (*.*)|*.*";
|
ofd.Filter = "All files (*.*)|*.*";
|
||||||
|
@ -187,6 +177,17 @@ namespace NBTExplorer.Windows
|
||||||
OpenPaths(new string[] { _openFolderPath });
|
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();
|
UpdateUI();
|
||||||
|
|
Loading…
Reference in a new issue