#include "support/systemcall.h"
#include "support/lstrings.h"
-#include "BoostFormat.h"
+#include "support/BoostFormat.h"
#include <fstream>
#include <algorithm>
#include <utility>
+#include <cerrno>
using std::vector;
using std::ifstream;
string const & msg2,
string const & msg3)
{
- if (lyxrc.use_gui
+ if (lyx_gui::use_gui
&& buf && buf->getUser() && buf->getUser()->owner()) {
string const str = msg1 + ' ' + msg2 + ' ' + msg3;
buf->getUser()->owner()->message(str);
text += file + _(" could not be saved.\n\nDo you want to rename the document and try again?");
#endif
int const ret = Alert::prompt(_("Rename and save?"),
- text, 0, _("&Rename"), _("&Cancel"));
+ text, 0, 1, _("&Rename"), _("&Cancel"));
if (ret == 0)
return WriteAs(bv, buffer);
text += file + _(" already exists.\n\nDo you want to over-write that document?");
#endif
int const ret = Alert::prompt(_("Over-write document?"),
- text, 1, _("&Over-write"), _("&Cancel"));
+ text, 0, 1, _("&Over-write"), _("&Cancel"));
if (ret == 1)
return false;
}
-int MenuRunChktex(Buffer * buffer)
-{
- int ret;
-
- if (buffer->isSGML()) {
- Alert::alert(_("Chktex does not work with SGML derived documents."));
- return 0;
- } else
- ret = buffer->runChktex();
-
- if (ret >= 0) {
- string s;
- string t;
- if (ret == 0) {
- s = _("No warnings found.");
- } else if (ret == 1) {
- s = _("One warning found.");
- t = _("Use `Navigate->Error' to find it.");
- } else {
- s += tostr(ret);
- s += _(" warnings found.");
- t = _("Use `Navigate->Error' to find them.");
- }
- Alert::alert(_("Chktex run successfully"), s, t);
- } else {
- Alert::alert(_("Error!"), _("It seems chktex does not work."));
- }
- return ret;
-}
-
-
void QuitLyX()
{
lyxerr[Debug::INFO] << "Running QuitLyX." << endl;
- if (lyxrc.use_gui) {
+ if (lyx_gui::use_gui) {
if (!bufferlist.quitWriteAll())
return;
string const getPossibleLabel(BufferView const & bv)
{
- Paragraph * par = bv.getLyXText()->cursor.par();
+ Paragraph * par = &*bv.getLyXText()->cursor.par();
LyXLayout_ptr layout = par->layout();
if (layout->latextype == LATEX_PARAGRAPH && par->previous()) {
Paragraph * par2 = par->previous();