From 474548bae51c875dbcd984086ccea98df905eaf5 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 30 Jul 2014 01:09:28 +0400 Subject: [PATCH] save last visited directory in MainWindow instead of App. --- App.xaml.cs | 1 - MainWindow.xaml.cs | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/App.xaml.cs b/App.xaml.cs index 080c475a..0f20f349 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -74,7 +74,6 @@ namespace GARbro.GUI void ApplicationExit (object sender, ExitEventArgs e) { - Settings.Default.appLastDirectory = Directory.GetCurrentDirectory(); Settings.Default.Save(); } diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 9c523d18..f6ba46e8 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -105,6 +105,16 @@ namespace GARbro.GUI } else Settings.Default.lvSortColumn = ""; + + string cwd = CurrentPath; + if (!string.IsNullOrEmpty (cwd)) + { + if (ViewModel.IsArchive) + cwd = Path.GetDirectoryName (cwd); + } + else + cwd = Directory.GetCurrentDirectory(); + Settings.Default.appLastDirectory = cwd; } ///