Skip to content

Commit 16f01a5

Browse files
committed
Merge branch 'Shortcuts' into ShortcutDialog
# Conflicts: # FlashDevelop/Dialogs/ShortcutDialog.cs
2 parents 81d2d64 + 4655230 commit 16f01a5

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

FlashDevelop/Dialogs/ShortcutDialog.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ void InitializeGraphics()
216216
using (var imageList = new ImageList())
217217
{
218218
imageList.ColorDepth = ColorDepth.Depth32Bit;
219-
imageList.ImageSize = new Size(16, 16);
220-
imageList.Images.Add(ScaleHelper.Scale((Bitmap) Globals.MainForm.FindImage("229", false)));
221-
imageList.Images.Add(ScaleHelper.Scale((Bitmap) Globals.MainForm.FindImage("153", false)));
219+
imageList.ImageSize = ScaleHelper.Scale(new Size(16, 16));
220+
imageList.Images.Add(Globals.MainForm.FindImage("229", false));
221+
imageList.Images.Add(Globals.MainForm.FindImage("153", false));
222222
this.pictureBox.Image = imageList.Images[0];
223223
this.clearButton.Image = imageList.Images[1];
224224
}
@@ -432,6 +432,7 @@ void AssignNewShortcut(ShortcutListItem item, Keys shortcut)
432432

433433
if (item.Custom == shortcut) return;
434434
this.listView.BeginUpdate();
435+
var oldShortcut = item.Custom;
435436
item.Custom = shortcut;
436437
item.Selected = true;
437438
this.GetConflictItems(item);
@@ -440,12 +441,20 @@ void AssignNewShortcut(ShortcutListItem item, Keys shortcut)
440441
{
441442
string text = TextHelper.GetString("Info.ShortcutIsAlreadyUsed");
442443
string caption = TextHelper.GetString("Title.WarningDialog");
443-
if (MessageBox.Show(Globals.MainForm, text, " " + caption, MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Yes)
444+
switch (MessageBox.Show(Globals.MainForm, text, " " + caption, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Warning))
444445
{
445-
this.filterTextBox.Text = ViewConflictsKey + item.KeysString;
446-
this.filterTextBox.SelectAll();
446+
case DialogResult.Abort:
447+
this.listView.BeginUpdate();
448+
item.Custom = oldShortcut;
449+
this.GetConflictItems(item);
450+
this.listView.EndUpdate();
451+
break;
452+
case DialogResult.Retry:
453+
this.filterTextBox.Text = ViewConflictsKey + item.KeysString;
454+
this.filterTextBox.SelectAll();
455+
this.filterTextBox.Focus(); // Set focus to filter...
456+
break;
447457
}
448-
this.filterTextBox.Focus(); // Set focus to filter...
449458
}
450459
}
451460

0 commit comments

Comments
 (0)