#include "frontends/alert.h"
#include "frontends/Application.h"
-#include "frontends/Dialogs.h"
#include "frontends/Gui.h"
#include "frontends/LyXView.h"
{
if (quitting || !inset)
return 0;
-
- Buffer const * buffer_ptr = 0;
- vector<int> const & view_ids = pimpl_->application_->gui().viewIds();
- vector<int>::const_iterator it = view_ids.begin();
- vector<int>::const_iterator const end = view_ids.end();
- for (; it != end; ++it) {
- Buffer const * ptr =
- pimpl_->application_->gui().view(*it).updateInset(inset);
- if (ptr)
- buffer_ptr = ptr;
- }
- return buffer_ptr;
+ return application().gui().updateInset(inset);
}
{
if (quitting || !use_gui)
return;
-
- vector<int> const & view_ids = pimpl_->application_->gui().viewIds();
- vector<int>::const_iterator it = view_ids.begin();
- vector<int>::const_iterator const end = view_ids.end();
- for (; it != end; ++it)
- pimpl_->application_->gui().view(*it).getDialogs().
- hide(name, inset);
+ application().gui().hideDialogs(name, inset);
}
// do any other cleanup procedures now
if (package().temp_dir() != package().system_temp_dir()) {
- LYXERR(Debug::INFO) << "Deleting tmp dir "
- << package().temp_dir().absFilename() << endl;
+ LYXERR(Debug::INFO, "Deleting tmp dir "
+ << package().temp_dir().absFilename());
if (!package().temp_dir().destroyDirectory()) {
docstring const msg =
}
// Initialization of LyX (reads lyxrc and more)
- LYXERR(Debug::INIT) << "Initializing LyX::init..." << endl;
+ LYXERR(Debug::INIT, "Initializing LyX::init...");
bool success = init();
- LYXERR(Debug::INIT) << "Initializing LyX::init...done" << endl;
+ LYXERR(Debug::INIT, "Initializing LyX::init...done");
if (!success)
return EXIT_FAILURE;
if (pimpl_->batch_command.empty())
return;
- LYXERR(Debug::INIT) << "About to handle -x '"
- << pimpl_->batch_command << '\'' << endl;
+ LYXERR(Debug::INIT, "About to handle -x '" << pimpl_->batch_command << '\'');
pimpl_->lyxfunc_.dispatch(lyxaction.lookupFunc(pimpl_->batch_command));
}
return false;
// Load the layouts
- LYXERR(Debug::INIT) << "Reading layouts..." << endl;
+ LYXERR(Debug::INIT, "Reading layouts...");
if (!LyXSetStyle())
return false;
//...and the modules
return false;
}
- LYXERR(Debug::INIT) << "LyX tmp dir: `"
- << package().temp_dir().absFilename()
- << '\'' << endl;
+ LYXERR(Debug::INIT, "LyX tmp dir: `"
+ << package().temp_dir().absFilename() << '\'');
- LYXERR(Debug::INIT) << "Reading session information '.lyx/session'..." << endl;
+ LYXERR(Debug::INIT, "Reading session information '.lyx/session'...");
pimpl_->session_.reset(new Session(lyxrc.num_lastfiles));
// This must happen after package initialization and after lyxrc is
bool LyX::readRcFile(string const & name)
{
- LYXERR(Debug::INIT) << "About to read " << name << "... ";
+ LYXERR(Debug::INIT, "About to read " << name << "... ");
FileName const lyxrc_path = libFileSearch(string(), name);
if (!lyxrc_path.empty()) {
-
- LYXERR(Debug::INIT) << "Found in " << lyxrc_path << endl;
-
+ LYXERR(Debug::INIT, "Found in " << lyxrc_path);
if (lyxrc.read(lyxrc_path) < 0) {
showFileError(name);
return false;
}
- } else
- LYXERR(Debug::INIT) << "Not found." << lyxrc_path << endl;
+ } else {
+ LYXERR(Debug::INIT, "Not found." << lyxrc_path);
+ }
return true;
-
}
std::list<string>::const_iterator end = uifiles.end();
it = std::find(it, end, name);
if (it != end) {
- LYXERR(Debug::INIT) << "UI file '" << name
- << "' has been read already. "
- << "Is this an include loop?"
- << endl;
+ LYXERR(Debug::INIT, "UI file '" << name << "' has been read already. "
+ << "Is this an include loop?");
return false;
}
- LYXERR(Debug::INIT) << "About to read " << name << "..." << endl;
+ LYXERR(Debug::INIT, "About to read " << name << "...");
FileName ui_path;
ui_path = libFileSearch("ui", name, "ui");
if (ui_path.empty()) {
- LYXERR(Debug::INIT) << "Could not find " << name << endl;
+ LYXERR(Debug::INIT, "Could not find " << name);
showFileError(name);
return false;
}
uifiles.push_back(name);
- LYXERR(Debug::INIT) << "Found " << name
- << " in " << ui_path << endl;
+ LYXERR(Debug::INIT, "Found " << name << " in " << ui_path);
Lexer lex(uitags, ui_last - 1);
lex.setFile(ui_path);
if (!lex.isOK()) {
// Read the languages file `name'
bool LyX::readLanguagesFile(string const & name)
{
- LYXERR(Debug::INIT) << "About to read " << name << "..." << endl;
+ LYXERR(Debug::INIT, "About to read " << name << "...");
FileName const lang_path = libFileSearch(string(), name);
if (lang_path.empty()) {
bool LyX::readEncodingsFile(string const & enc_name,
string const & symbols_name)
{
- LYXERR(Debug::INIT) << "About to read " << enc_name << " and "
- << symbols_name << "..." << endl;
+ LYXERR(Debug::INIT, "About to read " << enc_name << " and "
+ << symbols_name << "...");
FileName const symbols_path = libFileSearch(string(), symbols_name);
if (symbols_path.empty()) {