#include "Buffer.h"
#include "BufferParams.h"
+#include "BufferView.h"
+#include "Cursor.h"
#include "DispatchResult.h"
#include "Floating.h"
#include "FloatList.h"
#include "Font.h"
+#include "FuncRequest.h"
#include "Language.h"
#include "LaTeXFeatures.h"
#include "Lexer.h"
}
+void InsetFloatList::doDispatch(Cursor & cur, FuncRequest & cmd) {
+ switch (cmd.action()) {
+ case LFUN_MOUSE_RELEASE:
+ if (!cur.selection() && cmd.button() == mouse_button::button1) {
+ cur.bv().showDialog("toc", params2string(params()));
+ cur.dispatched();
+ }
+ break;
+
+ default:
+ InsetCommand::doDispatch(cur, cmd);
+ }
+}
+
+
void InsetFloatList::write(ostream & os) const
{
os << "FloatList " << to_ascii(getParam("type")) << "\n";
if (cit != floats.end()) {
Floating const & fl = cit->second;
- if (fl.usesFloatPkg())
+ if (fl.usesFloatPkg()) {
+ docstring const name =
+ buffer().language()->translateLayout(fl.listName());
os << "\\listof{" << getParam("type") << "}{"
- << buffer().B_(fl.listName()) << "}\n";
- else {
+ << name << "}\n";
+ } else {
if (!fl.listCommand().empty())
os << "\\" << from_ascii(fl.listCommand()) << "\n";
else
<< "\n";
}
} else {
+ string const flName = "List of " + to_utf8(getParam("type"));
+ docstring const name = buffer().language()->translateLayout(flName);
os << "%%\\listof{" << getParam("type") << "}{"
- << bformat(_("List of %1$s"), getParam("type"))
- << "}\n";
+ << name << "}\n";
}
}