mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 05:12:40 +00:00
fix file dialog bug
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3010 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
fb16a10b8e
commit
f06372807d
@ -1,3 +1,8 @@
|
||||
2001-11-12 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* FormFiledialog.C: don't reset path if new dir
|
||||
doesn't exist.
|
||||
|
||||
2001-11-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* forms/form_document.fd: Renamed "Save as Class Defaults"
|
||||
|
@ -376,11 +376,24 @@ void FileDialog::Private::Reread()
|
||||
// SetDirectory: sets dialog current directory
|
||||
void FileDialog::Private::SetDirectory(string const & Path)
|
||||
{
|
||||
string tmp;
|
||||
|
||||
if (!pszDirectory.empty()) {
|
||||
string TempPath = ExpandPath(Path); // Expand ~/
|
||||
TempPath = MakeAbsPath(TempPath, pszDirectory);
|
||||
pszDirectory = MakeAbsPath(TempPath);
|
||||
} else pszDirectory = MakeAbsPath(Path);
|
||||
tmp = MakeAbsPath(TempPath);
|
||||
} else {
|
||||
tmp = MakeAbsPath(Path);
|
||||
}
|
||||
|
||||
// must check the directory exists
|
||||
DIR * pDirectory = ::opendir(tmp.c_str());
|
||||
if (!pDirectory) {
|
||||
WriteFSAlert(_("Warning! Couldn't open directory."), tmp);
|
||||
} else {
|
||||
::closedir(pDirectory);
|
||||
pszDirectory = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user