summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-08-23 14:15:22 +0000
committersr55 <[email protected]>2015-08-23 14:15:22 +0000
commit1c8fd285ee81f4facae0684fa3d7bfd6599d597a (patch)
tree04bcb6f351a86ab6d46ac10d46b804402ff07955 /win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
parentf04245c5a03398eba8302b5c122d0f9c1bf07a22 (diff)
WinGui: Don't update config when user cancels file/folder dialogs - Patch by jorrit
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7408 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
index cca7b2334..e270e3c15 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
@@ -38,7 +38,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The source chapters backing field
/// </summary>
- private List<Chapter> sourceChaptersList;
+ private List<Chapter> sourceChaptersList;
#region Constructors and Destructors
@@ -99,13 +99,13 @@ namespace HandBrakeWPF.ViewModels
public void Export()
{
var saveFileDialog = new OpenFileDialog
- {
- Filter = "Csv File|*.csv",
- DefaultExt = "csv",
- CheckPathExists = true
- };
- saveFileDialog.ShowDialog();
- if (!string.IsNullOrEmpty(saveFileDialog.FileName))
+ {
+ Filter = "Csv File|*.csv",
+ DefaultExt = "csv",
+ CheckPathExists = true
+ };
+ bool? dialogResult = saveFileDialog.ShowDialog();
+ if (dialogResult.HasValue && dialogResult.Value && !string.IsNullOrEmpty(saveFileDialog.FileName))
{
this.ExportChaptersToCSV(saveFileDialog.FileName);
}
@@ -153,10 +153,10 @@ namespace HandBrakeWPF.ViewModels
public void Import()
{
var dialog = new OpenFileDialog { Filter = "CSV files (*.csv)|*.csv", CheckFileExists = true };
- dialog.ShowDialog();
+ bool? dialogResult = dialog.ShowDialog();
string filename = dialog.FileName;
- if (string.IsNullOrEmpty(filename))
+ if (!dialogResult.HasValue || !dialogResult.Value || string.IsNullOrEmpty(filename))
{
return;
}