replace LyXView::message() direct call with Buffer::message() boost signal emission.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14827 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-08-23 21:14:43 +00:00
parent 415970fcb5
commit 1451d739c4
3 changed files with 27 additions and 14 deletions

View File

@ -630,7 +630,8 @@ void BufferView::Pimpl::savePosition(unsigned int i)
cursor_.paragraph().id(),
cursor_.pos());
if (i > 0)
owner_->message(bformat(_("Saved bookmark %1$d"), i));
// emit message signal.
buffer_->message(bformat(_("Saved bookmark %1$d"), i));
}
@ -663,7 +664,8 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
bv_->setCursor(makeDocIterator(par, min(par->size(), saved_positions[i].par_pos)));
if (i > 0)
owner_->message(bformat(_("Moved to bookmark %1$d"), i));
// emit message signal.
buffer_->message(bformat(_("Moved to bookmark %1$d"), i));
}
@ -752,7 +754,8 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm)
// check selected filename
if (filename.empty()) {
owner_->message(_("Canceled."));
// emit message signal.
buffer_->message(_("Canceled."));
return;
}
}
@ -762,7 +765,8 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm)
filename = fileSearch(string(), filename, "lyx");
string const disp_fn = makeDisplayPath(filename);
owner_->message(bformat(_("Inserting document %1$s..."), disp_fn));
// emit message signal.
buffer_->message(bformat(_("Inserting document %1$s..."), disp_fn));
string res;
Buffer buf("", false);
@ -776,7 +780,8 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm)
} else
res = _("Could not insert document %1$s");
owner_->message(bformat(res, disp_fn));
// emit message signal.
buffer_->message(bformat(res, disp_fn));
buffer_->errors("Parse");
resizeCurrentBuffer();
}

View File

@ -285,7 +285,8 @@ int AutoSaveBuffer::generateChild()
// It is dangerous to do this in the child,
// but safe in the parent, so...
if (pid == -1)
bv_.owner()->message(_("Autosave failed!"));
// emit message signal.
bv_.buffer()->message(_("Autosave failed!"));
}
}
if (pid == 0) { // we are the child so...
@ -311,7 +312,8 @@ void autoSave(BufferView * bv)
return;
}
bv->owner()->message(_("Autosaving current document..."));
// emit message signal.
bv->buffer()->message(_("Autosaving current document..."));
// create autosave filename
string fname = bv->buffer()->filePath();
@ -436,7 +438,8 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap
// reconfigure the automatic settings.
void reconfigure(BufferView * bv)
{
bv->owner()->message(_("Running configure..."));
// emit message signal.
bv->buffer()->message(_("Running configure..."));
// Run configure in user lyx directory
Path p(package().user_support());
@ -444,7 +447,8 @@ void reconfigure(BufferView * bv)
Systemcall one;
one.startscript(Systemcall::Wait, configure_command);
p.pop();
bv->owner()->message(_("Reloading configuration..."));
// emit message signal.
bv->buffer()->message(_("Reloading configuration..."));
lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
// Re-read packages.lst
LaTeXFeatures::getAvailable();

View File

@ -288,7 +288,8 @@ void find(BufferView * bv, FuncRequest const & ev)
casesensitive, matchword, forward);
if (!found)
bv->owner()->message(_("String not found!"));
// emit message signal.
bv->buffer()->message(_("String not found!"));
}
@ -311,21 +312,24 @@ void replace(BufferView * bv, FuncRequest const & ev)
bool all = parse_bool(howto);
bool forward = parse_bool(howto);
LyXView * lv = bv->owner();
Buffer * buf = bv->buffer();
int const replace_count = all
? ::replaceAll(bv, search, replace, casesensitive, matchword)
: ::replace(bv, search, replace, casesensitive, matchword, forward);
if (replace_count == 0) {
lv->message(_("String not found!"));
// emit message signal.
buf->message(_("String not found!"));
} else {
if (replace_count == 1) {
lv->message(_("String has been replaced."));
// emit message signal.
buf->message(_("String has been replaced."));
} else {
string str = convert<string>(replace_count);
str += _(" strings have been replaced.");
lv->message(str);
// emit message signal.
buf->message(str);
}
}
}