#include <boost/bind.hpp>
#include <boost/signals/connection.hpp>
+#include "BoostFormat.h"
#include <unistd.h>
#include <sys/wait.h>
void BufferView::Pimpl::buffer(Buffer * b)
{
lyxerr[Debug::INFO] << "Setting buffer in BufferView ("
- << b << ")" << endl;
+ << b << ')' << endl;
if (buffer_) {
buffer_->delUser(bv_);
// bv_->text->owner(bv_);
if (lyxerr.debugging())
textcache.show(lyxerr, "resizeCurrentBuffer");
+
+ buffer_->resizeInsets(bv_);
} else {
bv_->text = new LyXText(bv_);
bv_->text->init(bv_);
return;
}
- /* FIXME */
- extern void reapSpellchecker(void);
- reapSpellchecker();
-
if (!bv_->theLockingInset()) {
screen().cursorToggle(bv_);
} else {
bv_->text->cursor.pos());
if (i > 0) {
ostringstream str;
- str << _("Saved bookmark") << ' ' << i;
- owner_->message(str.str().c_str());
+#if USE_BOOST_FORMAT
+ str << boost::format(_("Saved bookmark %1$d")) % i;
+#else
+ str << _("Saved bookmark ") << i;
+#endif
+ owner_->message(STRCONV(str.str()));
}
}
update(bv_->text, BufferView::SELECT | BufferView::FITCUR);
if (i > 0) {
ostringstream str;
- str << _("Moved to bookmark") << ' ' << i;
- owner_->message(str.str().c_str());
+#if USE_BOOST_FORMAT
+ str << boost::format(_("Moved to bookmark %1$d")) % i;
+#else
+ str << _("Moved to bookmark ") << i;
+#endif
+ owner_->message(STRCONV(str.str()));
}
}
string(AddPath(system_lyxdir, "examples"))));
FileDialog::Result result =
- fileDlg.Select(initpath,
+ fileDlg.open(initpath,
_("*.lyx| LyX Documents (*.lyx)"));
if (result.first == FileDialog::Later)
string const disp_fn(MakeDisplayPath(filename));
ostringstream s1;
- s1 << _("Inserting document") << ' '
- << disp_fn << " ...";
- owner_->message(s1.str().c_str());
+#if USE_BOOST_FORMAT
+ s1 << boost::format(_("Inserting document %1$s ...")) % disp_fn;
+#else
+ s1 << _("Inserting document ") << disp_fn << _(" ...");
+#endif
+ owner_->message(STRCONV(s1.str()));
bool const res = bv_->insertLyXFile(filename);
if (res) {
ostringstream str;
- str << _("Document") << ' ' << disp_fn
- << ' ' << _("inserted.");
- owner_->message(str.str().c_str());
+#if USE_BOOST_FORMAT
+ str << boost::format(_("Document %1$s inserted.")) % disp_fn;
+#else
+ str << _("Document ") << disp_fn << _(" inserted.");
+#endif
+ owner_->message(STRCONV(str.str()));
} else {
ostringstream str;
- str << _("Could not insert document") << ' '
- << disp_fn;
- owner_->message(str.str().c_str());
+#if USE_BOOST_FORMAT
+ str << boost::format(_("Could not insert document %1$s")) % disp_fn;
+#else
+ str << _("Could not insert document ") << disp_fn;
+#endif
+ owner_->message(STRCONV(str.str()));
}
}
bool BufferView::Pimpl::dispatch(FuncRequest const & ev)
{
lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:"
- << " action[" << ev.action <<"]"
- << " arg[" << ev.argument << "]"
- << " x[" << ev.x << "]"
- << " y[" << ev.y << "]"
- << " button[" << ev.button() << "]"
+ << " action[" << ev.action << ']'
+ << " arg[" << ev.argument << ']'
+ << " x[" << ev.x << ']'
+ << " y[" << ev.y << ']'
+ << " button[" << ev.button() << ']'
<< endl;
// e.g. Qt mouse press when no buffer
if (!buffer_)
return false;
-
+
LyXTextClass const & tclass = buffer_->params.getLyXTextClass();
switch (ev.action) {
inset->setLoadingBuffer(bv_->buffer(), false);
updateInset(inset, true);
}
-
+
}
break;
{
InsetBibtex * inset =
static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
- if (inset)
+ if (inset)
inset->setOptions(ev.argument);
}
break;