- // check selected filename
- if (filename.empty()) {
- owner->getMiniBuffer()->Set(_("Canceled."));
- return;
- }
+ if (fname.empty()) {
+ FileDialog fileDlg(owner, _("Select document to open"),
+ LFUN_FILE_OPEN,
+ make_pair(string(_("Documents")), string(lyxrc.document_path)),
+ make_pair(string(_("Examples")), string(AddPath(system_lyxdir, "examples"))));
+
+ FileDialog::Result result = fileDlg.Select(initpath, "*.lyx|LyX Documents (*.lyx)");
+
+ if (result.first == FileDialog::Later)
+ return;
+
+ filename = result.second;
+
+ // check selected filename
+ if (filename.empty()) {
+ owner->getMiniBuffer()->Set(_("Canceled."));
+ return;
+ }
+ } else
+ filename = fname;