From 8cf46f514ad754f906dcc0d9a708cea6cb76cca7 Mon Sep 17 00:00:00 2001 From: Kai Patrick Reisert Date: Tue, 17 Sep 2013 11:01:55 +0200 Subject: [PATCH] Use recent directory when saving slideshows --- WordsLive/Images/ImagesHandler.cs | 3 +++ WordsLive/MainWindow.xaml.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/WordsLive/Images/ImagesHandler.cs b/WordsLive/Images/ImagesHandler.cs index 8d97fab6..e75ac459 100644 --- a/WordsLive/Images/ImagesHandler.cs +++ b/WordsLive/Images/ImagesHandler.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Windows; using WordsLive.Core; @@ -62,9 +63,11 @@ public override IEnumerable HandleMultiple(IEnumerable uris) var dlg = new Microsoft.Win32.SaveFileDialog(); dlg.DefaultExt = ".show"; dlg.Filter = "Diashow|*.show"; // TODO: localize + dlg.InitialDirectory = Properties.Settings.Default.LastMediaDirectory; if (dlg.ShowDialog() == true) { + Properties.Settings.Default.LastMediaDirectory = Path.GetDirectoryName(dlg.FileName); var media = new ImagesMedia(new Uri(dlg.FileName)); media.CreateSlideshow(uris); return new Media[] { media }; diff --git a/WordsLive/MainWindow.xaml.cs b/WordsLive/MainWindow.xaml.cs index 76c469d4..a5c71a1a 100644 --- a/WordsLive/MainWindow.xaml.cs +++ b/WordsLive/MainWindow.xaml.cs @@ -318,6 +318,8 @@ private void ShowAddMediaDialog() if (dlg.ShowDialog() == true) { + Properties.Settings.Default.LastMediaDirectory = Path.GetDirectoryName(dlg.FileNames[0]); + if (dlg.FileNames.Count() > 1) { foreach (var m in MediaManager.LoadMultipleMediaMetadata(dlg.FileNames.Select(f => new Uri(f)))) @@ -328,8 +330,6 @@ private void ShowAddMediaDialog() orderList.Add(MediaManager.LoadMediaMetadata(new Uri(dlg.FileName), null)); } - Properties.Settings.Default.LastMediaDirectory = Path.GetDirectoryName(dlg.FileNames[0]); - portfolioModified = true; } }