#include "BufferList.h"
#include "BufferParams.h"
#include "BufferView.h"
-#include "callback.h"
#include "Color.h"
#include "Cursor.h"
#include "CutAndPaste.h"
namespace Alert = frontend::Alert;
+extern bool quitting;
namespace {
+// This function runs "configure" and then rereads lyx.defaults to
+// reconfigure the automatic settings.
+void reconfigure(LyXView & lv, string const & option)
+{
+ // emit message signal.
+ lv.message(_("Running configure..."));
+
+ // Run configure in user lyx directory
+ support::Path p(package().user_support());
+ string configure_command = package().configure_command();
+ configure_command += option;
+ Systemcall one;
+ one.startscript(Systemcall::Wait, configure_command);
+ p.pop();
+ // emit message signal.
+ lv.message(_("Reloading configuration..."));
+ lyxrc.read(support::libFileSearch(string(), "lyxrc.defaults"));
+ // Re-read packages.lst
+ LaTeXFeatures::getAvailable();
+
+ Alert::information(_("System reconfigured"),
+ _("The system has been reconfigured.\n"
+ "You need to restart LyX to make use of any\n"
+ "updated document class specifications."));
+}
+
+
bool getLocalStatus(Cursor cursor, FuncRequest const & cmd, FuncStatus & status)
{
// Try to fix cursor in case it is broken.
updateFlags = Update::None;
break;
- case LFUN_FILE_NEW:
+ case LFUN_FILE_NEW: {
BOOST_ASSERT(lyx_view_);
- newFile(*lyx_view_, argument);
+ string name;
+ string tmpname = split(argument, name, ':'); // Split filename
+ Buffer * const b = newFile(name, tmpname);
+ if (b)
+ lyx_view_->setBuffer(b);
updateFlags = Update::None;
break;
+ }
case LFUN_FILE_OPEN:
BOOST_ASSERT(lyx_view_);