]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_cb.C
remove noload/don't typeset
[lyx.git] / src / lyx_cb.C
index 6548ea1edb4e9b619eb375f0e5a1e4a71e7369b6..30f2d89da14f0d98808660482f405574260099a5 100644 (file)
 #include "bufferview_funcs.h"
 #include "debug.h"
 #include "lastfiles.h"
-#include "frontends/LyXView.h"
 #include "lyxrc.h"
 #include "lyxtext.h"
 #include "gettext.h"
 #include "BufferView.h"
-#include "lyxtextclasslist.h"
 
 #include "insets/insetlabel.h"
 
+#include "frontends/lyx_gui.h"
+#include "frontends/LyXView.h"
 #include "frontends/Alert.h"
 #include "frontends/FileDialog.h"
 
@@ -53,7 +53,6 @@ using std::make_pair;
 extern BufferList bufferlist;
 // this should be static, but I need it in buffer.C
 bool quitting; // flag, that we are quitting the program
-extern bool finished; // all cleanup done just let it run through now.
 
 
 void ShowMessage(Buffer const * buf,
@@ -240,7 +239,7 @@ void QuitLyX()
 
        DestroyLyXTmpDir(system_tempdir);
 
-       finished = true;
+       lyx_gui::exit();
 }
 
 
@@ -279,7 +278,7 @@ void AutoSave(BufferView * bv)
 
                string const tmp_ret = lyx::tempName(string(), "lyxauto");
                if (!tmp_ret.empty()) {
-                       bv->buffer()->writeFile(tmp_ret, 1);
+                       bv->buffer()->writeFile(tmp_ret);
                        // assume successful write of tmp_ret
                        if (!lyx::rename(tmp_ret, fname)) {
                                failed = true;
@@ -294,7 +293,7 @@ void AutoSave(BufferView * bv)
 
                if (failed) {
                        // failed to write/rename tmp_ret so try writing direct
-                       if (!bv->buffer()->writeFile(fname, 1)) {
+                       if (!bv->buffer()->writeFile(fname)) {
                                // It is dangerous to do this in the child,
                                // but safe in the parent, so...
                                if (pid == -1)
@@ -318,7 +317,7 @@ void AutoSave(BufferView * bv)
 // create new file with template
 // SERVERCMD !
 //
-Buffer * NewLyxFile(string const & filename)
+Buffer * NewFile(string const & filename)
 {
        // Split argument by :
        string name;
@@ -429,7 +428,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap
 
 void MenuInsertLabel(BufferView * bv, string const & arg)
 {
-       string label(arg);
+       string label = arg;
        bv->owner()->prohibitInput();
        if (label.empty()) {
                Paragraph * par = bv->getLyXText()->cursor.par();
@@ -467,7 +466,7 @@ void MenuInsertLabel(BufferView * bv, string const & arg)
                pair<bool, string> result =
                        Alert::askForText(_("Enter new label to insert:"), text);
                if (result.first) {
-                       label = frontStrip(strip(result.second));
+                       label = trim(result.second);
                }
        }
        if (!label.empty()) {