Merge pull request #1678 from dannoe/enh-add-confirm-dialogs-for-reset

Added confirmation dialogs to two "Reset" buttons.
This commit is contained in:
Jaex 2016-06-29 00:59:03 +03:00 committed by GitHub
commit 1d95e3c9bf
7 changed files with 49 additions and 5 deletions

View file

@ -2824,7 +2824,7 @@ private void btnCustomUploadersExportAll_Click(object sender, EventArgs e)
private void btnCustomUploaderClearUploaders_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Remove all custom uploaders?", "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (MessageBox.Show(Resources.UploadersConfigForm_Remove_all_custom_uploaders_Confirmation, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
CustomUploaderClearUploaders();
}

View file

@ -1186,6 +1186,15 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Remove all custom uploaders?.
/// </summary>
internal static string UploadersConfigForm_Remove_all_custom_uploaders_Confirmation {
get {
return ResourceManager.GetString("UploadersConfigForm_Remove_all_custom_uploaders_Confirmation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SendSpace registration.
/// </summary>

View file

@ -500,4 +500,7 @@ Created folders:</value>
<data name="puush-256" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\puush-256.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UploadersConfigForm_Remove_all_custom_uploaders_Confirmation" xml:space="preserve">
<value>Remove all custom uploaders?</value>
</data>
</root>

View file

@ -29,6 +29,7 @@
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using ShareX.Properties;
namespace ShareX
{
@ -211,8 +212,11 @@ private void btnDuplicate_Click(object sender, EventArgs e)
private void btnReset_Click(object sender, EventArgs e)
{
manager.ResetHotkeys();
AddControls();
if (MessageBox.Show(Resources.HotkeySettingsForm_btnReset_Click_Reset_all_hotkeys_to_defaults_, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
manager.ResetHotkeys();
AddControls();
}
}
}
}

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
@ -122,8 +123,11 @@ private void lvPresets_ItemMoved(object sender, int oldIndex, int newIndex)
private void btnReset_Click(object sender, EventArgs e)
{
Program.Settings.QuickTaskPresets = QuickTaskInfo.DefaultPresets;
UpdateItems();
if (MessageBox.Show(Resources.QuickTaskMenuEditorForm_Reset_all_quick_tasks_to_defaults_Confirmation, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Program.Settings.QuickTaskPresets = QuickTaskInfo.DefaultPresets;
UpdateItems();
}
}
private void btnClose_Click(object sender, EventArgs e)

View file

@ -1065,6 +1065,15 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Reset all hotkeys to defaults?.
/// </summary>
public static string HotkeySettingsForm_btnReset_Click_Reset_all_hotkeys_to_defaults_ {
get {
return ResourceManager.GetString("HotkeySettingsForm_btnReset_Click_Reset_all_hotkeys_to_defaults_", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -1548,6 +1557,15 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Reset all quick tasks to defaults?.
/// </summary>
public static string QuickTaskMenuEditorForm_Reset_all_quick_tasks_to_defaults_Confirmation {
get {
return ResourceManager.GetString("QuickTaskMenuEditorForm_Reset_all_quick_tasks_to_defaults_Confirmation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Left click to copy URL to clipboard. Right click to open URL..
/// </summary>

View file

@ -838,4 +838,10 @@ Would you like to restart ShareX?</value>
<data name="Patreon_Button_02" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Patreon_Button_02.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="HotkeySettingsForm_btnReset_Click_Reset_all_hotkeys_to_defaults_" xml:space="preserve">
<value>Reset all hotkeys to defaults?</value>
</data>
<data name="QuickTaskMenuEditorForm_Reset_all_quick_tasks_to_defaults_Confirmation" xml:space="preserve">
<value>Reset all quick tasks to defaults?</value>
</data>
</root>