mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(ChangePosition): new history navigation method.
Push current position into undo stack only if directory has been changed.
This commit is contained in:
parent
d1bde19bb3
commit
cfd71f5519
@ -188,8 +188,7 @@ namespace GARbro.GUI
|
||||
{
|
||||
Settings.Default.appLastCreatedArchive = m_arc_name;
|
||||
m_main.Dispatcher.Invoke (() => {
|
||||
m_main.SaveCurrentPosition();
|
||||
m_main.SetCurrentPosition (new DirectoryPosition (m_arc_name));
|
||||
m_main.ChangePosition (new DirectoryPosition (m_arc_name));
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -613,6 +613,14 @@ namespace GARbro.GUI
|
||||
m_history.Push (GetCurrentPosition());
|
||||
}
|
||||
|
||||
public void ChangePosition (DirectoryPosition new_pos)
|
||||
{
|
||||
var current = GetCurrentPosition();
|
||||
if (current.Path != new_pos.Path || current.ArchivePath != new_pos.ArchivePath)
|
||||
SaveCurrentPosition();
|
||||
SetCurrentPosition (new_pos);
|
||||
}
|
||||
|
||||
private void GoBackExec (object sender, ExecutedRoutedEventArgs e)
|
||||
{
|
||||
DirectoryPosition current = m_history.Undo (GetCurrentPosition());
|
||||
|
Loading…
x
Reference in New Issue
Block a user