Skip to content

Commit dbfe823

Browse files
committed
Fixed inconsistent icons in question dialogs
1 parent 8857cbb commit dbfe823

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

src/JsonConfig.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public static void LoadConfig()
7272
catch (JsonReaderException)
7373
{
7474
DialogResult result = MessageDialog.ShowQuestion("The WinDynamicDesktop configuration file is " +
75-
"corrupt and could not be loaded. Do you want to reset to default settings?", "Error", true);
75+
"corrupt and could not be loaded. Do you want to reset to default settings?", "Error",
76+
MessageBoxIcon.Error);
7677
if (result == DialogResult.Yes)
7778
{
7879
firstRun = true;

src/LocationIQ.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private static void HandleLocationSuccess(LocationIQData data, ScheduleDialog di
2525
SolarData solarData = SunriseSunsetService.GetSolarData(DateTime.Today);
2626

2727
DialogResult result = MessageDialog.ShowQuestion(string.Format(_("Is this location correct?\n\n{0}\n{1}"),
28-
data.display_name, SunriseSunsetService.GetSunriseSunsetString(solarData)), _("Question"), true);
28+
data.display_name, SunriseSunsetService.GetSunriseSunsetString(solarData)), _("Question"));
2929

3030
if (result == DialogResult.Yes)
3131
{

src/MessageDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public static DialogResult ShowInfo(string message, string title = null, bool ca
1919
cancelButton ? MessageBoxButtons.OKCancel : MessageBoxButtons.OK, MessageBoxIcon.Information);
2020
}
2121

22-
public static DialogResult ShowQuestion(string message, string title = null, bool useWarningIcon = false)
22+
public static DialogResult ShowQuestion(string message, string title = null,
23+
MessageBoxIcon questionIcon = MessageBoxIcon.Question)
2324
{
24-
return MessageBox.Show(message, title ?? "WinDynamicDesktop", MessageBoxButtons.YesNo,
25-
useWarningIcon ? MessageBoxIcon.Warning : MessageBoxIcon.Question);
25+
return MessageBox.Show(message, title ?? "WinDynamicDesktop", MessageBoxButtons.YesNo, questionIcon);
2626
}
2727

2828
public static DialogResult ShowWarning(string message, string title = null)

src/ScheduleDialog.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ private void OnFormClosing(object sender, FormClosingEventArgs e)
210210
{
211211
DialogResult result = MessageDialog.ShowQuestion(_("WinDynamicDesktop cannot display wallpapers " +
212212
"until you have entered a valid location, so that it can calculate sunrise and sunset times for " +
213-
"your location. Are you sure you want to cancel and quit the program?"), _("Question"), true);
213+
"your location. Are you sure you want to cancel and quit the program?"), _("Question"),
214+
MessageBoxIcon.Warning);
214215

215216
if (result == DialogResult.Yes)
216217
{

src/ThemeDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void ImportThemes(List<string> themePaths)
8484
{
8585
DialogResult result = MessageDialog.ShowQuestion(string.Format(_("The following themes are already " +
8686
"installed:\n\t{0}\n\nDo you want to overwrite them?"), string.Join("\n\t", duplicateThemeNames)),
87-
_("Question"), true);
87+
_("Question"), MessageBoxIcon.Warning);
8888

8989
if (result != DialogResult.Yes)
9090
{
@@ -481,7 +481,7 @@ private void deleteThemeMenuItem_Click(object sender, EventArgs e)
481481
ThemeConfig theme = ThemeManager.themeSettings.Find(t => t.themeId == themeId);
482482

483483
DialogResult result = MessageDialog.ShowQuestion(string.Format(_("Are you sure you want to remove " +
484-
"the '{0}' theme?"), ThemeManager.GetThemeName(theme)), _("Question"), true);
484+
"the '{0}' theme?"), ThemeManager.GetThemeName(theme)), _("Question"), MessageBoxIcon.Warning);
485485

486486
if (result == DialogResult.Yes)
487487
{
@@ -543,7 +543,7 @@ private void OnFormClosing(object sender, FormClosingEventArgs e)
543543
{
544544
DialogResult result = MessageDialog.ShowQuestion(_("WinDynamicDesktop cannot dynamically update your " +
545545
"wallpaper until you have selected a theme. Are you sure you want to continue without a theme " +
546-
"selected?"), _("Question"), true);
546+
"selected?"), _("Question"), MessageBoxIcon.Warning);
547547

548548
if (result != DialogResult.Yes)
549549
{

src/ThemeLoader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public static void HandleError(ThemeError e)
7777
{
7878
DialogResult result = MessageDialog.ShowQuestion(string.Format(_("Failed to load '{0}' theme:\n{1}\n" +
7979
"\nDo you want to disable this theme to prevent the error from happening again?"), e.themeId,
80-
e.errorMsg), _("Error"), true);
80+
e.errorMsg), _("Error"), MessageBoxIcon.Warning);
8181
ThemeManager.DisableTheme(e.themeId, result == DialogResult.Yes);
8282
}
8383

@@ -94,7 +94,7 @@ public static bool PromptDialog(string dialogText)
9494
TaskbarProgress.SetState(taskbarHandle, TaskbarProgress.TaskbarStates.Paused);
9595
}
9696

97-
DialogResult result = MessageDialog.ShowQuestion(dialogText, _("Question"), true);
97+
DialogResult result = MessageDialog.ShowQuestion(dialogText, _("Question"), MessageBoxIcon.Warning);
9898
bool isAffirmative = (result == DialogResult.Yes);
9999

100100
if (taskbarHandle != IntPtr.Zero)

0 commit comments

Comments
 (0)