From b642b3aee40fa49e089eb3cf1ef983eccec77747 Mon Sep 17 00:00:00 2001 From: flarn2006 Date: Tue, 17 Dec 2013 19:24:15 -0500 Subject: [PATCH] Don't want to mess with the keyboard shortcut See previous commit/added comments --- NBTExplorer/Windows/MainForm.cs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/NBTExplorer/Windows/MainForm.cs b/NBTExplorer/Windows/MainForm.cs index 4c7e887..4a325ed 100644 --- a/NBTExplorer/Windows/MainForm.cs +++ b/NBTExplorer/Windows/MainForm.cs @@ -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();