Skip to content

Commit

Permalink
Use recent directory when saving slideshows
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Patrick Reisert committed Sep 17, 2013
1 parent bc3d5f1 commit 8cf46f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions WordsLive/Images/ImagesHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows;
using WordsLive.Core;
Expand Down Expand Up @@ -62,9 +63,11 @@ public override IEnumerable<Media> HandleMultiple(IEnumerable<Uri> 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 };
Expand Down
4 changes: 2 additions & 2 deletions WordsLive/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 8cf46f5

Please sign in to comment.