Fixed another copy paste bug, changed speaker icon to button

This commit is contained in:
Ben
2015-07-04 17:28:34 +01:00
parent 0c470b3c97
commit 3337531161
14 changed files with 119 additions and 45 deletions

View File

@@ -1,11 +1,12 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Filtration.Common.Services;
using Filtration.Common.ViewModels;
using Filtration.Interface;
using Filtration.Models;
@@ -45,6 +46,7 @@ namespace Filtration.ViewModels
private readonly IThemeService _themeService;
private readonly IUpdateCheckService _updateCheckService;
private readonly IUpdateAvailableViewModel _updateAvailableViewModel;
private readonly IMessageBoxService _messageBoxService;
public MainWindowViewModel(IItemFilterScriptRepository itemFilterScriptRepository,
IItemFilterScriptTranslator itemFilterScriptTranslator,
@@ -54,7 +56,8 @@ namespace Filtration.ViewModels
IThemeProvider themeProvider,
IThemeService themeService,
IUpdateCheckService updateCheckService,
IUpdateAvailableViewModel updateAvailableViewModel)
IUpdateAvailableViewModel updateAvailableViewModel,
IMessageBoxService messageBoxService)
{
_itemFilterScriptRepository = itemFilterScriptRepository;
_itemFilterScriptTranslator = itemFilterScriptTranslator;
@@ -65,6 +68,7 @@ namespace Filtration.ViewModels
_themeService = themeService;
_updateCheckService = updateCheckService;
_updateAvailableViewModel = updateAvailableViewModel;
_messageBoxService = messageBoxService;
NewScriptCommand = new RelayCommand(OnNewScriptCommand);
CopyScriptCommand = new RelayCommand(OnCopyScriptCommand, () => ActiveDocumentIsScript);
@@ -319,9 +323,9 @@ namespace Filtration.ViewModels
{
_logger.Error(e);
}
MessageBox.Show(@"Error loading filter script - " + e.Message, @"Script Load Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
_messageBoxService.Show("Script Load Error", "Error loading filter script - " + e.Message,
MessageBoxButton.OK,
MessageBoxImage.Error);
return;
}
@@ -349,9 +353,9 @@ namespace Filtration.ViewModels
{
_logger.Error(e);
}
MessageBox.Show(@"Error loading filter theme - " + e.Message, @"Theme Load Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
_messageBoxService.Show("Theme Load Error", "Error loading filter theme - " + e.Message,
MessageBoxButton.OK,
MessageBoxImage.Error);
return;
}
@@ -378,15 +382,16 @@ namespace Filtration.ViewModels
{
_logger.Error(e);
}
MessageBox.Show(@"Error loading filter theme - " + e.Message, @"Theme Load Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
_messageBoxService.Show("Theme Load Error", "Error loading filter theme - " + e.Message,
MessageBoxButton.OK,
MessageBoxImage.Error);
return;
}
var result = MessageBox.Show(@"Are you sure you wish to apply this theme to the current filter script?",
@"Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No)
var result = _messageBoxService.Show("Confirm",
"Are you sure you wish to apply this theme to the current filter script?", MessageBoxButton.YesNo,
MessageBoxImage.Question);
if (result == MessageBoxResult.No)
{
return;
}