disable watching after directory changes while archive is being created.

This commit is contained in:
morkt 2014-07-26 23:22:06 +04:00
parent 39d00a86b0
commit 6bc2627bf5

View File

@ -39,6 +39,7 @@ namespace GARbro.GUI
{ {
private void CreateArchiveExec (object sender, ExecutedRoutedEventArgs e) private void CreateArchiveExec (object sender, ExecutedRoutedEventArgs e)
{ {
StopWatchDirectoryChanges();
try try
{ {
Directory.SetCurrentDirectory (CurrentPath); Directory.SetCurrentDirectory (CurrentPath);
@ -80,10 +81,12 @@ namespace GARbro.GUI
using (var file = File.Create (tmp_file.Name)) using (var file = File.Create (tmp_file.Name))
format.Create (file, file_list, dialog.ArchiveOptions); format.Create (file, file_list, dialog.ArchiveOptions);
GARbro.Shell.File.Rename (tmp_file.Name, arc_name); GARbro.Shell.File.Rename (tmp_file.Name, arc_name);
SetCurrentPosition (new DirectoryPosition (arc_name));
} }
} }
catch (Exception X) catch (Exception X)
{ {
m_watcher.EnableRaisingEvents = true;
PopupError (X.Message, guiStrings.TextCreateArchiveError); PopupError (X.Message, guiStrings.TextCreateArchiveError);
} }
} }