+2005-07-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * toc.[Ch]: new method getGuiName, which is used by the frontends
+ to set the toc combo (fixes bug 1870). Make TOC string translatable.
+
2005-07-01 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* dociterator.[Ch]: implement operator==(StableDocIterator const &,
+2005-07-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * ControlToc.[Ch]: new method getGuiName, which is used by the frontends
+ to set the toc combo (fixes bug 1870).
+
2005-06-30 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* ControlPrint.C (browse):
}
+string const ControlToc::getGuiName() const
+{
+ return toc::getGuiName(params().getCmdName(), kernel().buffer());
+}
+
+
toc::Toc const ControlToc::getContents(string const & type) const
{
toc::Toc empty_list;
/// Return the list of types available
std::vector<std::string> const getTypes() const;
+ /// Return the guiname from a given cmdName of the TOC param
+ std::string const getGuiName() const;
+
/// Given a type, returns the contents
toc::Toc const getContents(std::string const & type) const;
};
+2005-07-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * GToc.C: consider gui name, not type, when trying to set the
+ toc combo (fixes bug 1870).
+
2005-05-14 Michael Schmitt <michael.schmitt@teststep.org>
* Dialogs.C: dialog title "Index" => "Index Entry"
void GToc::updateType()
{
changing_views_ = true;
- string const targettype =
- toc::getType(controller().params().getCmdName());
+ string const targettype = controller().getGuiName();
typestore_->clear();
vector<string> types = controller().getTypes();
+2005-07-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * QToc.C: consider gui name, not type, when trying to set the
+ toc combo (fixes bug 1870).
+
2005-07-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QChanges.C: use bformat() for translatable strings.
dialog_->typeCO->clear();
vector<string> const & choice = controller().getTypes();
- string const & type = toc::getType(controller().params().getCmdName());
+ string const & guiname = controller().getGuiName();
for (vector<string>::const_iterator it = choice.begin();
it != choice.end(); ++it) {
dialog_->typeCO->insertItem(toqstr(*it));
- if (*it == type) {
+ if (*it == guiname) {
dialog_->typeCO->setCurrentItem(it - choice.begin());
- setTitle(type);
+ setTitle(guiname);
}
}
}
+2005-07-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FormToc.C: consider gui name, not type, when trying to set the
+ toc combo (fixes bug 1870).
+
2005-05-31 Angus Leeming <leeming@lyx.org>
* checkedwidgets.C (check): allow ':' characters in file names. data.
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
// And select the correct one
- string const type = toc::getType(controller().params().getCmdName());
- fl_set_choice_text(dialog_->choice_toc_type, type.c_str());
+ string const guiname = controller().getGuiName();
+ fl_set_choice_text(dialog_->choice_toc_type, guiname.c_str());
}
#include "buffer.h"
#include "bufferparams.h"
+#include "FloatList.h"
#include "funcrequest.h"
+#include "gettext.h"
#include "LyXAction.h"
#include "paragraph.h"
#include "pariterator.h"
{
// special case
if (cmdName == "tableofcontents")
- return "TOC";
+ return _("TOC");
else
return cmdName;
}
+string const getGuiName(string const & cmdName, Buffer const & buffer)
+{
+ FloatList const & floats =
+ buffer.params().getLyXTextClass().floats();
+ if (floats.typeExist(cmdName))
+ return _(floats.getType(cmdName).name());
+ else
+ return getType(cmdName);
+}
+
+
TocList const getTocList(Buffer const & buf)
{
TocList toclist;
tocstring = pit->asString(buf, true);
TocItem const item(pit->id(), toclevel - min_toclevel,
tocstring);
- toclist["TOC"].push_back(item);
+ toclist[_("TOC")].push_back(item);
}
}
return toclist;
by ControlToc::getContents() */
std::string const getType(std::string const & cmdName);
+/// Returns the guiname from a given CmdName
+std::string const getGuiName(std::string const & cmdName, Buffer const &);
+
inline
bool operator==(TocItem const & a, TocItem const & b)
{