Store paths in the last used paths options rather than file names. Updates #1340.

Originally committed to SVN as r5914.
This commit is contained in:
Thomas Goyne 2011-11-25 19:29:46 +00:00
parent e095dc06cd
commit 5f7ca1c7a8
4 changed files with 6 additions and 6 deletions

View file

@ -99,7 +99,7 @@ struct audio_open : public Command {
wxString filename = wxFileSelector(_("Open audio file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); wxString filename = wxFileSelector(_("Open audio file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST);
if (!filename.empty()) { if (!filename.empty()) {
c->audioController->OpenAudio(filename); 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&) { } catch (agi::UserCancelException const&) { }

View file

@ -91,7 +91,7 @@ struct keyframe_open : public Command {
wxFD_FILE_MUST_EXIST | wxFD_OPEN); wxFD_FILE_MUST_EXIST | wxFD_OPEN);
if (filename.empty()) return; 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); c->videoController->LoadKeyframes(filename);
} }
}; };
@ -113,7 +113,7 @@ struct keyframe_save : public Command {
wxString path = lagi_wxString(OPT_GET("Path/Last/Keyframes")->GetString()); 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); 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; 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); c->videoController->SaveKeyframes(filename);
} }
}; };

View file

@ -85,7 +85,7 @@ struct timecode_open : public Command {
wxString filename = wxFileSelector(_("Open timecodes file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); wxString filename = wxFileSelector(_("Open timecodes file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST);
if (!filename.empty()) { if (!filename.empty()) {
c->videoController->LoadTimecodes(filename); 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); wxString filename = wxFileSelector(_("Save timecodes file"),path,"","",str,wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (!filename.empty()) { if (!filename.empty()) {
c->videoController->SaveTimecodes(filename); c->videoController->SaveTimecodes(filename);
OPT_SET("Path/Last/Timecodes")->SetString(STD_STR(filename)); OPT_SET("Path/Last/Timecodes")->SetString(STD_STR(wxFileName(filename).GetPath()));
} }
} }
}; };

View file

@ -557,7 +557,7 @@ struct video_open : public Command {
wxString filename = wxFileSelector(_("Open video file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST); wxString filename = wxFileSelector(_("Open video file"),path,"","",str,wxFD_OPEN | wxFD_FILE_MUST_EXIST);
if (!filename.empty()) { if (!filename.empty()) {
c->videoController->SetVideo(filename); c->videoController->SetVideo(filename);
OPT_SET("Path/Last/Video")->SetString(STD_STR(filename)); OPT_SET("Path/Last/Video")->SetString(STD_STR(wxFileName(filename).GetPath()));
} }
} }
}; };