#include "frontends/Alert.h"
#include "frontends/Application.h"
#include "frontends/FileDialog.h"
+#include "frontends/LyXView.h"
#include "support/filefilterlist.h"
#include "support/filetools.h"
using support::addName;
using support::bformat;
using support::FileFilterList;
+using support::FileName;
using support::ForkedProcess;
using support::isLyXFilename;
using support::libFileSearch;
bool menuWrite(Buffer * buffer)
{
if (buffer->save()) {
- LyX::ref().session().lastFiles().add(buffer->fileName());
+ LyX::ref().session().lastFiles().add(FileName(buffer->fileName()));
return true;
}
class AutoSaveBuffer : public ForkedProcess {
public:
///
- AutoSaveBuffer(BufferView & bv, string const & fname)
+ AutoSaveBuffer(BufferView & bv, FileName const & fname)
: bv_(bv), fname_(fname) {}
///
virtual shared_ptr<ForkedProcess> clone() const
virtual int generateChild();
///
BufferView & bv_;
- string fname_;
+ FileName fname_;
};
int AutoSaveBuffer::start()
{
- command_ = to_utf8(bformat(_("Auto-saving %1$s"), from_utf8(fname_)));
+ command_ = to_utf8(bformat(_("Auto-saving %1$s"), from_utf8(fname_.absFilename())));
return run(DontWait);
}
// anyway.
bool failed = false;
- string const tmp_ret = tempName(string(), "lyxauto");
+ FileName const tmp_ret(tempName(string(), "lyxauto"));
if (!tmp_ret.empty()) {
bv_.buffer()->writeFile(tmp_ret);
// assume successful write of tmp_ret
fname += onlyFilename(bv->buffer()->fileName());
fname += '#';
- AutoSaveBuffer autosave(*bv, fname);
+ AutoSaveBuffer autosave(*bv, FileName(fname));
autosave.start();
bv->buffer()->markBakClean();
// This function runs "configure" and then rereads lyx.defaults to
// reconfigure the automatic settings.
-void reconfigure(BufferView * bv)
+void reconfigure(LyXView & lv)
{
// emit message signal.
- bv->buffer()->message(_("Running configure..."));
+ lv.message(_("Running configure..."));
// Run configure in user lyx directory
support::Path p(package().user_support());
one.startscript(Systemcall::Wait, configure_command);
p.pop();
// emit message signal.
- bv->buffer()->message(_("Reloading configuration..."));
+ lv.message(_("Reloading configuration..."));
lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
// Re-read packages.lst
LaTeXFeatures::getAvailable();