]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
next one
[lyx.git] / src / LyXFunc.cpp
index c6dd2ed9e6f4eb437c1900b3da72a1fffe36f56c..209f12ce1825b486b9c825bd6e210e9522d82058 100644 (file)
@@ -28,7 +28,6 @@
 #include "BufferList.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "callback.h"
 #include "Color.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
@@ -145,9 +144,37 @@ using support::prefixIs;
 
 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.