From 5f7ca1c7a81893b0ed9fb1e8d41e57ca70102bf6 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 25 Nov 2011 19:29:46 +0000 Subject: [PATCH] Store paths in the last used paths options rather than file names. Updates #1340. Originally committed to SVN as r5914. --- aegisub/src/command/audio.cpp | 2 +- aegisub/src/command/keyframe.cpp | 4 ++-- aegisub/src/command/timecode.cpp | 4 ++-- aegisub/src/command/video.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aegisub/src/command/audio.cpp b/aegisub/src/command/audio.cpp index ee2086f30..bf2886740 100644 --- a/aegisub/src/command/audio.cpp +++ b/aegisub/src/command/audio.cpp @@ -99,7 +99,7 @@ struct audio_open : public Command { wxString filename = wxFileSelector(_("Open audio file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (!filename.empty()) { c->audioController->OpenAudio(filename); - OPT_SET("Path/Last/Audio")->SetString(STD_STR(filename)); + OPT_SET("Path/Last/Audio")->SetString(STD_STR(wxFileName(filename).GetPath())); } } catch (agi::UserCancelException const&) { } diff --git a/aegisub/src/command/keyframe.cpp b/aegisub/src/command/keyframe.cpp index abad7ec03..970f6a898 100644 --- a/aegisub/src/command/keyframe.cpp +++ b/aegisub/src/command/keyframe.cpp @@ -91,7 +91,7 @@ struct keyframe_open : public Command { wxFD_FILE_MUST_EXIST | wxFD_OPEN); if (filename.empty()) return; - OPT_SET("Path/Last/Keyframes")->SetString(STD_STR(filename)); + OPT_SET("Path/Last/Keyframes")->SetString(STD_STR(wxFileName(filename).GetPath())); c->videoController->LoadKeyframes(filename); } }; @@ -113,7 +113,7 @@ struct keyframe_save : public Command { wxString path = lagi_wxString(OPT_GET("Path/Last/Keyframes")->GetString()); wxString filename = wxFileSelector("Select the Keyframes file to open",path,"","*.key.txt","Text files (*.txt)|*.txt",wxFD_OVERWRITE_PROMPT | wxFD_SAVE); if (filename.empty()) return; - OPT_SET("Path/Last/Keyframes")->SetString(STD_STR(filename)); + OPT_SET("Path/Last/Keyframes")->SetString(STD_STR(wxFileName(filename).GetPath())); c->videoController->SaveKeyframes(filename); } }; diff --git a/aegisub/src/command/timecode.cpp b/aegisub/src/command/timecode.cpp index 0a6528998..4c66a5c47 100644 --- a/aegisub/src/command/timecode.cpp +++ b/aegisub/src/command/timecode.cpp @@ -85,7 +85,7 @@ struct timecode_open : public Command { wxString filename = wxFileSelector(_("Open timecodes file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (!filename.empty()) { c->videoController->LoadTimecodes(filename); - OPT_SET("Path/Last/Timecodes")->SetString(STD_STR(filename)); + OPT_SET("Path/Last/Timecodes")->SetString(STD_STR(wxFileName(filename).GetPath())); } } }; @@ -109,7 +109,7 @@ struct timecode_save : public Command { wxString filename = wxFileSelector(_("Save timecodes file"),path,"","",str,wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (!filename.empty()) { c->videoController->SaveTimecodes(filename); - OPT_SET("Path/Last/Timecodes")->SetString(STD_STR(filename)); + OPT_SET("Path/Last/Timecodes")->SetString(STD_STR(wxFileName(filename).GetPath())); } } }; diff --git a/aegisub/src/command/video.cpp b/aegisub/src/command/video.cpp index 3b0acb224..c7c9ba20e 100644 --- a/aegisub/src/command/video.cpp +++ b/aegisub/src/command/video.cpp @@ -557,7 +557,7 @@ struct video_open : public Command { wxString filename = wxFileSelector(_("Open video file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (!filename.empty()) { c->videoController->SetVideo(filename); - OPT_SET("Path/Last/Video")->SetString(STD_STR(filename)); + OPT_SET("Path/Last/Video")->SetString(STD_STR(wxFileName(filename).GetPath())); } } };