mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
remember last directory used for extraction.
This commit is contained in:
parent
d0a09261e7
commit
28ec300c12
@ -88,6 +88,9 @@
|
||||
<setting name="appIgnoreConversionErrors" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="appLastDestination" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</GARbro.GUI.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
|
@ -55,13 +55,15 @@ namespace GARbro.GUI
|
||||
GarExtract extractor = null;
|
||||
try
|
||||
{
|
||||
string destination = Settings.Default.appLastDestination;
|
||||
if (!ViewModel.IsArchive)
|
||||
{
|
||||
if (!entry.IsDirectory)
|
||||
{
|
||||
var arc_dir = CurrentPath;
|
||||
var source = Path.Combine (arc_dir, entry.Name);
|
||||
string destination = arc_dir;
|
||||
if (string.IsNullOrEmpty (destination))
|
||||
destination = arc_dir;
|
||||
// extract into directory named after archive
|
||||
if (!string.IsNullOrEmpty (Path.GetExtension (entry.Name)))
|
||||
destination = Path.GetFileNameWithoutExtension (source);
|
||||
@ -72,7 +74,8 @@ namespace GARbro.GUI
|
||||
else if (null != m_app.CurrentArchive)
|
||||
{
|
||||
var vm = ViewModel as ArchiveViewModel;
|
||||
string destination = Path.GetDirectoryName (vm.Path);
|
||||
if (string.IsNullOrEmpty (destination))
|
||||
destination = Path.GetDirectoryName (vm.Path);
|
||||
extractor = new GarExtract (this, vm.Path, m_app.CurrentArchive);
|
||||
if (null == entry || (entry.Name == ".." && vm.SubDir == "")) // root entry
|
||||
extractor.ExtractAll (destination);
|
||||
@ -150,6 +153,7 @@ namespace GARbro.GUI
|
||||
{
|
||||
Directory.CreateDirectory (destination);
|
||||
Directory.SetCurrentDirectory (destination);
|
||||
Settings.Default.appLastDestination = destination;
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user