Skip to content

Commit 4655230

Browse files
committed
Improved ShortcutDialog update 9
Updated the keydown conflict warning dialog.
1 parent 13dc1b6 commit 4655230

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

FlashDevelop/Dialogs/ShortcutDialog.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ void InitializeGraphics()
204204
using (var imageList = new ImageList())
205205
{
206206
imageList.ColorDepth = ColorDepth.Depth32Bit;
207-
imageList.ImageSize = new Size(16, 16);
208-
imageList.Images.Add(ScaleHelper.Scale((Bitmap) Globals.MainForm.FindImage("229", false)));
209-
imageList.Images.Add(ScaleHelper.Scale((Bitmap) Globals.MainForm.FindImage("153", false)));
207+
imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
208+
imageList.Images.Add(Globals.MainForm.FindImage("229", false));
209+
imageList.Images.Add(Globals.MainForm.FindImage("153", false));
210210
this.pictureBox.Image = imageList.Images[0];
211211
this.clearButton.Image = imageList.Images[1];
212212
}
@@ -408,19 +408,26 @@ void AssignNewShortcut(ShortcutListItem item, Keys shortcut)
408408
else if (!ToolStripManager.IsValidShortcut(shortcut)) return;
409409

410410
if (item.Custom == shortcut) return;
411+
var oldShortcut = item.Custom;
411412
item.Custom = shortcut;
412413
item.Selected = true;
413414
this.GetConflictItems(item);
414415
if (item.HasConflicts)
415416
{
416417
string text = TextHelper.GetString("Info.ShortcutIsAlreadyUsed");
417418
string caption = TextHelper.GetString("Title.WarningDialog");
418-
if (MessageBox.Show(Globals.MainForm, text, " " + caption, MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Yes)
419+
switch (MessageBox.Show(Globals.MainForm, text, " " + caption, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Warning))
419420
{
420-
this.filterTextBox.Text = ViewConflictsKey + item.KeysString;
421-
this.filterTextBox.SelectAll();
421+
case DialogResult.Abort:
422+
item.Custom = oldShortcut;
423+
this.GetConflictItems(item);
424+
break;
425+
case DialogResult.Retry:
426+
this.filterTextBox.Text = ViewConflictsKey + item.KeysString;
427+
this.filterTextBox.SelectAll();
428+
this.filterTextBox.Focus(); // Set focus to filter...
429+
break;
422430
}
423-
this.filterTextBox.Focus(); // Set focus to filter...
424431
}
425432
}
426433

0 commit comments

Comments
 (0)