#include "buffer.h"
#include "bufferlist.h"
#include "BufferView.h"
+#include "buffer_funcs.h"
#include "cursor.h"
#include "debug.h"
#include "gettext.h"
if (filename.empty()) {
FileDialog fileDlg(_("Choose a filename to save document as"),
- LFUN_WRITEAS,
+ LFUN_BUFFER_WRITE_AS,
make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
make_pair(string(_("Templates|#T#t")),
Alert::warning(_("Unable to remove temporary directory"), msg);
}
- lyx_gui::exit();
+ lyx_gui::exit(0);
}
// It is dangerous to do this in the child,
// but safe in the parent, so...
if (pid == -1)
- bv_.owner()->message(_("Autosave failed!"));
+ // emit message signal.
+ bv_.buffer()->message(_("Autosave failed!"));
}
}
if (pid == 0) { // we are the child so...
return;
}
- bv->owner()->message(_("Autosaving current document..."));
+ // emit message signal.
+ bv->buffer()->message(_("Autosaving current document..."));
// create autosave filename
string fname = bv->buffer()->filePath();
// Split argument by :
string name;
string tmpname = split(filename, name, ':');
-#ifdef __EMX__ // Fix me! lyx_cb.C may not be low level enough to allow this.
- if (name.length() == 1
- && isalpha(static_cast<unsigned char>(name[0]))
- && (prefixIs(tmpname, "/") || prefixIs(tmpname, "\\"))) {
- name += ':';
- name += token(tmpname, ':', 0);
- tmpname = split(tmpname, ':');
- }
-#endif
lyxerr[Debug::INFO] << "Arg is " << filename
<< "\nName is " << name
<< "\nTemplate is " << tmpname << endl;
- bv->newFile(name, tmpname);
+ Buffer * const b = newFile(name, tmpname);
+ if (b)
+ bv->setBuffer(b);
}
// reconfigure the automatic settings.
void reconfigure(BufferView * bv)
{
- bv->owner()->message(_("Running configure..."));
+ // emit message signal.
+ bv->buffer()->message(_("Running configure..."));
// Run configure in user lyx directory
Path p(package().user_support());
Systemcall one;
one.startscript(Systemcall::Wait, configure_command);
p.pop();
- bv->owner()->message(_("Reloading configuration..."));
+ // emit message signal.
+ bv->buffer()->message(_("Reloading configuration..."));
lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
// Re-read packages.lst
LaTeXFeatures::getAvailable();