mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
More Alert/ error message fixes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6629 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
31dabbd890
commit
4bd79eda68
@ -2,6 +2,9 @@
|
||||
|
||||
* bufferview_funcs.C: remove pointless Alert
|
||||
|
||||
* buffer.C: fix confusing error message when
|
||||
a template is chmoded 000
|
||||
|
||||
2003-03-29 John Levon <levon@movementarian.org>
|
||||
|
||||
* BufferView.C:
|
||||
|
31
src/buffer.C
31
src/buffer.C
@ -501,10 +501,28 @@ bool Buffer::readFile(LyXLex & lex, string const & filename)
|
||||
// FIXME: all the below Alerts should give the filename..
|
||||
bool Buffer::readFile(LyXLex & lex, string const & filename, ParagraphList::iterator pit)
|
||||
{
|
||||
if (lex.isOK()) {
|
||||
if (!lex.isOK()) {
|
||||
Alert::error(_("Document could not be read"),
|
||||
_("The specified document could not be read."));
|
||||
return false;
|
||||
}
|
||||
|
||||
lex.next();
|
||||
string const token(lex.getString());
|
||||
if (token == "\\lyxformat") { // the first token _must_ be...
|
||||
|
||||
if (!lex.isOK()) {
|
||||
Alert::error(_("Document could not be read"),
|
||||
_("The specified document could not be read."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// the first token _must_ be...
|
||||
if (token != "\\lyxformat") {
|
||||
Alert::error(_("Document format failure"),
|
||||
_("The specified document is not a LyX document."));
|
||||
return false;
|
||||
}
|
||||
|
||||
lex.eatLine();
|
||||
string tmp_format = lex.getString();
|
||||
//lyxerr << "LyX Format: `" << tmp_format << '\'' << endl;
|
||||
@ -573,15 +591,6 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, ParagraphList::iter
|
||||
"that it is probably corrupted."));
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
Alert::error(_("Document format failure"),
|
||||
_("The specified document is not a LyX document."));
|
||||
}
|
||||
} else {
|
||||
Alert::error(_("Document could not be read"),
|
||||
_("The specified document could not be read."));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -331,8 +331,16 @@ Buffer * BufferList::readFile(string const & s, bool ronly)
|
||||
FileInfo fileInfo2(s);
|
||||
|
||||
if (!fileInfo2.exist()) {
|
||||
Alert::alert(_("Error!"), _("Cannot open file"),
|
||||
MakeDisplayPath(s));
|
||||
string const file = MakeDisplayPath(s, 50);
|
||||
#if USE_BOOST_FORMAT
|
||||
boost::format fmt(_("The specified document\n%1$s\ncould not be read."));
|
||||
fmt % file;
|
||||
string text = fmt.str();
|
||||
#else
|
||||
string text = _("The specified document\n");
|
||||
text += file + _(" could not be read.");
|
||||
#endif
|
||||
Alert::error(_("Could not read document"), text);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -463,8 +471,16 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
|
||||
}
|
||||
}
|
||||
if (!templateok) {
|
||||
Alert::alert(_("Error!"), _("Unable to open template"),
|
||||
MakeDisplayPath(tname));
|
||||
string const file = MakeDisplayPath(tname, 50);
|
||||
#if USE_BOOST_FORMAT
|
||||
boost::format fmt(_("The specified document template\n%1$s\ncould not be read."));
|
||||
fmt % file;
|
||||
string text = fmt.str();
|
||||
#else
|
||||
string text = _("The specified document template\n");
|
||||
text += file + _(" could not be read.");
|
||||
#endif
|
||||
Alert::error(_("Could not read template"), text);
|
||||
// no template, start with empty buffer
|
||||
b->paragraphs.set(new Paragraph);
|
||||
b->paragraphs.begin()->layout(b->params.getLyXTextClass().defaultLayout());
|
||||
|
@ -1,3 +1,7 @@
|
||||
2003-03-29 John Levon <levon@movementarian.org>
|
||||
|
||||
* ControlSpellchecker.C: Alert cleanup
|
||||
|
||||
2003-03-29 John Levon <levon@movementarian.org>
|
||||
|
||||
* helper_funcs.C: Alert cleanup
|
||||
|
@ -115,7 +115,7 @@ void ControlSpellchecker::startSession()
|
||||
message = _("The spell-checker could not be started.\n"
|
||||
"Maybe it is mis-configured.");
|
||||
|
||||
Alert::alert(_("The spell-checker has failed"), message);
|
||||
Alert::error(_("The spell-checker has failed"), message);
|
||||
speller_.reset(0);
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ bool ControlSpellchecker::checkAlive()
|
||||
view().hide();
|
||||
speller_.reset(0);
|
||||
|
||||
Alert::alert(_("The spell-checker has failed"), message);
|
||||
Alert::error(_("The spell-checker has failed"), message);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ void ControlSpellchecker::showSummary()
|
||||
#endif
|
||||
|
||||
view().hide();
|
||||
Alert::alert(_("Spell-checking is complete"), message);
|
||||
Alert::information(_("Spell-checking is complete"), message);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user