Skip to content

Commit 7ad4727

Browse files
committed
Improved ShortcutDialog update 7
Dialog is less grumpy. It is full.
1 parent df0c94f commit 7ad4727

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

FlashDevelop/Dialogs/ShortcutDialog.cs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,22 @@ void InitializeShortcutListItems()
287287
this.GetConflictItems(item);
288288
conflicts = conflicts || item.HasConflicts;
289289
}
290-
if (conflicts)
290+
if (conflicts) this.ShowConflictsPresent();
291+
}
292+
293+
/// <summary>
294+
/// Display a warning message to show conflicts.
295+
/// </summary>
296+
bool ShowConflictsPresent()
297+
{
298+
string text = TextHelper.GetString("Info.ShortcutConflictsPresent");
299+
string caption = TextHelper.GetString("Title.WarningDialog");
300+
if (MessageBox.Show(this, text, " " + caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
291301
{
292-
ErrorManager.ShowWarning(TextHelper.GetString("Info.ShortcutConflictsPresent"), null);
293302
this.filterTextBox.Text = ViewConflictsKey.ToString();
303+
return true;
294304
}
305+
return false;
295306
}
296307

297308
/// <summary>
@@ -395,10 +406,14 @@ void AssignNewShortcut(ShortcutListItem item, Keys shortcut)
395406
this.GetConflictItems(item);
396407
if (item.HasConflicts)
397408
{
398-
ErrorManager.ShowWarning(TextHelper.GetString("Info.ShortcutIsAlreadyUsed"), null);
409+
string text = TextHelper.GetString("Info.ShortcutIsAlreadyUsed");
410+
string caption = TextHelper.GetString("Title.WarningDialog");
411+
if (MessageBox.Show(Globals.MainForm, text, " " + caption, MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Yes)
412+
{
413+
this.filterTextBox.Text = ViewConflictsKey + item.KeysString;
414+
this.filterTextBox.SelectAll();
415+
}
399416
this.filterTextBox.Focus(); // Set focus to filter...
400-
this.filterTextBox.Text = ViewConflictsKey + item.KeysString;
401-
this.filterTextBox.SelectAll();
402417
}
403418
}
404419

@@ -550,9 +565,7 @@ void DialogClosing(object sender, FormClosingEventArgs e)
550565
{
551566
if (this.shortcutListItems[i].HasConflicts)
552567
{
553-
ErrorManager.ShowError(TextHelper.GetString("Info.ShortcutConflictsPresent"), null);
554-
this.filterTextBox.Text = ViewConflictsKey.ToString();
555-
e.Cancel = true;
568+
e.Cancel = this.ShowConflictsPresent();
556569
break;
557570
}
558571
}

PluginCore/PluginCore/Resources/de_DE.resX

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5965,8 +5965,9 @@ Eigene Sprachumgebungen müssen eine Erweiterung der Standard-Sprachumgebung sei
59655965
<comment>Added after 5.0.2</comment>
59665966
</data>
59675967
<data name="FlashDevelop.Info.ShortcutConflictsPresent" xml:space="preserve">
5968-
<value>There are one or more conflicts present.</value>
5968+
<value>There are one or more conflicts present. Ignore and continue?</value>
59695969
<comment>REQUIRES TRANSLATION</comment>
5970+
</data>
59705971
<data name="ASCompletion.Info.NoContextGeneratorCode" xml:space="preserve">
59715972
<value>No contextual code generation available.</value>
59725973
<comment>REQUIRES TRANSLATION</comment>

PluginCore/PluginCore/Resources/en_US.resX

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5981,7 +5981,8 @@ Custom locales must be an extension of a default locale, e.g. en-US.</value>
59815981
<comment>Added after 5.0.2</comment>
59825982
</data>
59835983
<data name="FlashDevelop.Info.ShortcutConflictsPresent" xml:space="preserve">
5984-
<value>There are one or more conflicts present.</value>
5984+
<value>There are one or more conflicts present. Ignore and continue?</value>
5985+
</data>
59855986
<data name="ASCompletion.Info.NoContextGeneratorCode" xml:space="preserve">
59865987
<value>No contextual code generation available.</value>
59875988
</data>

PluginCore/PluginCore/Resources/eu_ES.resX

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5962,8 +5962,9 @@ Lokalizazio pertsonalizatuek lehenetsiaren luzapen bat izan behar dute, adb. en-
59625962
<comment>Added after 5.0.2</comment>
59635963
</data>
59645964
<data name="FlashDevelop.Info.ShortcutConflictsPresent" xml:space="preserve">
5965-
<value>There are one or more conflicts present.</value>
5965+
<value>There are one or more conflicts present. Ignore and continue?</value>
59665966
<comment>REQUIRES TRANSLATION</comment>
5967+
</data>
59675968
<data name="ASCompletion.Info.NoContextGeneratorCode" xml:space="preserve">
59685969
<value>No contextual code generation available.</value>
59695970
<comment>REQUIRES TRANSLATION</comment>

PluginCore/PluginCore/Resources/ja_JP.resX

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6023,8 +6023,9 @@ UseData:"</value>
60236023
<comment>Added after 5.0.2</comment>
60246024
</data>
60256025
<data name="FlashDevelop.Info.ShortcutConflictsPresent" xml:space="preserve">
6026-
<value>There are one or more conflicts present.</value>
6026+
<value>There are one or more conflicts present. Ignore and continue?</value>
60276027
<comment>REQUIRES TRANSLATION</comment>
6028+
</data>
60286029
<data name="ASCompletion.Info.NoContextGeneratorCode" xml:space="preserve">
60296030
<value>No contextual code generation available.</value>
60306031
<comment>REQUIRES TRANSLATION</comment>

PluginCore/PluginCore/Resources/zh_CN.resx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5975,8 +5975,9 @@
59755975
<comment>Added after 5.0.2</comment>
59765976
</data>
59775977
<data name="FlashDevelop.Info.ShortcutConflictsPresent" xml:space="preserve">
5978-
<value>There are one or more conflicts present.</value>
5978+
<value>There are one or more conflicts present. Ignore and continue?</value>
59795979
<comment>REQUIRES TRANSLATION</comment>
5980+
</data>
59805981
<data name="ASCompletion.Info.NoContextGeneratorCode" xml:space="preserve">
59815982
<value>No contextual code generation available.</value>
59825983
<comment>REQUIRES TRANSLATION</comment>

0 commit comments

Comments
 (0)