#include "Dialog.h"
#include "FileDialog.h"
#include "GuiApplication.h"
+#include "GuiCompleter.h"
#include "GuiWorkArea.h"
#include "GuiKeySymbol.h"
#include "GuiToolbar.h"
#include "support/assert.h"
#include "support/debug.h"
-#include "support/FileFilterList.h"
#include "support/FileName.h"
#include "support/filetools.h"
#include "support/gettext.h"
break;
}
}
- if (b && !closeBuffer(*b)) {
+ if (b && !closeBuffer(*b, true)) {
close_event->ignore();
return;
}
if (wa == d.current_work_area_) {
disconnectBuffer();
disconnectBufferView();
- hideBufferDependent();
d.current_work_area_ = 0;
}
}
-void GuiView::updateEmbeddedFiles()
-{
- updateDialog("embedding", "");
-}
-
-
void GuiView::autoSave()
{
LYXERR(Debug::INFO, "Running autoSave()");
dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
dlg.setButton1(qt_("Templates|#T#t"), toqstr(lyxrc.template_path));
- FileDialog::Result result =
- dlg.open(toqstr(lyxrc.template_path),
- FileFilterList(_("LyX Documents (*.lyx)")));
+ FileDialog::Result result = dlg.open(toqstr(lyxrc.template_path),
+ QStringList(qt_("LyX Documents (*.lyx)")));
if (result.first == FileDialog::Later)
return FileName();
toqstr(addPath(package().system_support().absFilename(), "examples")));
FileDialog::Result result =
- dlg.open(toqstr(initpath), FileFilterList(_("LyX Documents (*.lyx)")));
+ dlg.open(toqstr(initpath), QStringList(qt_("LyX Documents (*.lyx)")));
if (result.first == FileDialog::Later)
return;
filter += ')';
FileDialog::Result result =
- dlg.open(toqstr(initpath), FileFilterList(filter));
+ dlg.open(toqstr(initpath), fileFilters(toqstr(filter)));
if (result.first == FileDialog::Later)
return;
return;
// get absolute path of file
- FileName const fullname(makeAbsPath(filename));
+ FileName const fullname(support::makeAbsPath(filename));
FileName const lyxfile(support::changeExtension(fullname.absFilename(), ".lyx"));
toqstr(addPath(package().system_support().absFilename(),
"examples")));
- FileDialog::Result result =
- dlg.open(toqstr(initpath),
- FileFilterList(_("LyX Documents (*.lyx)")));
+ FileDialog::Result result = dlg.open(toqstr(initpath),
+ QStringList(qt_("LyX Documents (*.lyx)")));
if (result.first == FileDialog::Later)
return;
LFUN_FILE_INSERT_PLAINTEXT_PARA : LFUN_FILE_INSERT_PLAINTEXT));
FileDialog::Result result = dlg.open(toqstr(bv->buffer().filePath()),
- FileFilterList());
+ QStringList());
if (result.first == FileDialog::Later)
return;
if (!newname.empty()) {
// FIXME UNICODE
- fname = makeAbsPath(to_utf8(newname), oldname.onlyPath().absFilename());
+ fname = support::makeAbsPath(to_utf8(newname), oldname.onlyPath().absFilename());
} else {
// Switch to this Buffer.
setBuffer(&b);
if (!isLyXFilename(fname.absFilename()))
fname.changeExtension(".lyx");
- FileFilterList const filter(_("LyX Documents (*.lyx)"));
-
FileDialog::Result result =
dlg.save(toqstr(fname.onlyPath().absFilename()),
- filter,
+ QStringList(qt_("LyX Documents (*.lyx)")),
toqstr(fname.onlyFileName()));
if (result.first == FileDialog::Later)
}
-bool GuiView::closeBuffer(Buffer & buf)
+bool GuiView::closeBuffer(Buffer & buf, bool tolastopened)
{
// goto bookmark to update bookmark pit.
//FIXME: we should update only the bookmarks related to this buffer!
theLyXFunc().gotoBookmark(i+1, false, false);
if (buf.isClean() || buf.paragraphs().empty()) {
- if (buf.masterBuffer() == &buf)
+ if (buf.masterBuffer() == &buf && tolastopened)
LyX::ref().session().lastOpened().add(buf.fileName());
theBufferList().release(&buf);
return true;
// save file names to .lyx/session
// if master/slave are both open, do not save slave since it
// will be automatically loaded when the master is loaded
- if (buf.masterBuffer() == &buf)
+ if (buf.masterBuffer() == &buf && tolastopened)
LyX::ref().session().lastOpened().add(buf.fileName());
theBufferList().release(&buf);
char const * const dialognames[] = {
"aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character",
-"citation", "document", "embedding", "errorlist", "ert", "external", "file",
+"citation", "document", "errorlist", "ert", "external", "file",
"findreplace", "float", "graphics", "include", "index", "nomenclature", "label", "log",
"mathdelimiter", "mathmatrix", "note", "paragraph", "prefs", "print",
"ref", "sendto", "space", "spellchecker", "symbols", "tabular", "tabularcreate",
}
-void GuiView::hideBufferDependent() const
-{
- map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();
- map<string, DialogPtr>::const_iterator end = d.dialogs_.end();
-
- for(; it != end; ++it) {
- Dialog * dialog = it->second.get();
- if (dialog->isBufferDependent())
- dialog->hideView();
- }
-}
-
-
void GuiView::updateBufferDependent(bool switched) const
{
map<string, DialogPtr>::const_iterator it = d.dialogs_.begin();