+2005-07-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * toc.[Ch]: Do not use translatable strings (bug 1870).
+
2005-07-20 John Levon <levon@movementarian.org>
* tabular.C: fix 1748 - setting multicolumn adds
+2005-07-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * ControlToc.[Ch]: getGuiName takes a type argument now.
+ * ControlToc.C (getGuiName): Do all guiname translations here (bug 1870)
+
2005-07-16 José Matos <jamatos@fc.up.pt>
* ControlTabular.C (set): use a single papersize variable.
#include <config.h>
#include "ControlToc.h"
+#include "gettext.h"
using std::vector;
using std::string;
namespace lyx {
namespace frontend {
+
ControlToc::ControlToc(Dialog & d)
: ControlCommand(d, "toc")
{}
}
-string const ControlToc::getGuiName() const
+string const ControlToc::getGuiName(string const & type) const
{
- return toc::getGuiName(params().getCmdName(), kernel().buffer());
+ if (type == "TOC")
+ return _("Table of Contents");
+ else
+ return _(toc::getGuiName(type, kernel().buffer()));
}
std::vector<std::string> const getTypes() const;
/// Return the guiname from a given cmdName of the TOC param
- std::string const getGuiName() const;
+ std::string const getGuiName(std::string const & type) const;
/// Given a type, returns the contents
toc::Toc const getContents(std::string const & type) const;
+2005-07-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * GToc.C (update, updateContents): Do not compare against
+ translatable strings (bug 1870).
+ Someone who can actually compile against gtk should verify this.
+
2005-07-24 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* GDocument.[Ch], glade/document.glade: remove remaining
void GToc::updateType()
{
changing_views_ = true;
- string const targettype = controller().getGuiName();
+ string const targettype =
+ toc::getType(controller().params().getCmdName());
typestore_->clear();
vector<string> types = controller().getTypes();
vector<string>::iterator it = types.begin();
vector<string>::iterator end = types.end();
for(;it != end; ++it) {
+ string const & guiname = controller().getGuiName(*it);
Gtk::TreeModel::iterator row = typestore_->append();
- (*row)[listCol_] = *it;
+ (*row)[listCol_] = guiname;
if (*it == targettype)
typecombo_->set_active(row);
}
}
Gtk::TreeModel::iterator it = typecombo_->get_active();
- Glib::ustring const type = (*it)[listCol_];
+ vector<string> const & choice = controller().getTypes();
+ string const type = choice[(*it)[listColIndex_]];
toc::Toc const contents = controller().getContents(type);
// Check if all elements are the same.
+2005-07-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * QToc.C (updateType, update_contents): Do not compare against
+ translatable strings (bug 1870).
+
2005-07-23 Angus Leeming <leeming@lyx.org>
* QRefDialogBase.ui: disconnect two refsLB signals to the
dialog_->typeCO->clear();
vector<string> const & choice = controller().getTypes();
- string const & guiname = controller().getGuiName();
+ string const & type = toc::getType(controller().params().getCmdName());
for (vector<string>::const_iterator it = choice.begin();
it != choice.end(); ++it) {
- dialog_->typeCO->insertItem(toqstr(*it));
- if (*it == guiname) {
+ string const & guiname = controller().getGuiName(*it);
+ dialog_->typeCO->insertItem(toqstr(guiname));
+ if (*it == type) {
dialog_->typeCO->setCurrentItem(it - choice.begin());
setTitle(guiname);
}
void QToc::updateToc(int newdepth)
{
- string type = fromqstr(dialog_->typeCO->currentText());
+ vector<string> const & choice = controller().getTypes();
+ string const & type = choice[dialog_->typeCO->currentItem()];
toc::Toc const & contents = controller().getContents(type);
dialog_->tocLV->setUpdatesEnabled(true);
dialog_->tocLV->update();
+ setTitle(dialog_->typeCO->currentText());
}
+2005-07-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * FormToc.C (updateType, update_contents): Do not compare against
+ translatable strings (bug 1870).
+
2005-07-22 Angus Leeming <leeming@lyx.org>
* FormSearch.C (input): do not trim the find and replace strings.
vector<string> types = controller().getTypes();
-
string const choice =
- ' ' + getStringFromVector(controller().getTypes(), " | ") + ' ';
+ ' ' + getStringFromVector(types, " | ") + ' ';
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
// Manage the cancel/close button
{
// Update the choice list from scratch
fl_clear_choice(dialog_->choice_toc_type);
- string const choice = getStringFromVector(controller().getTypes(), "|");
- fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
-
- // And select the correct one
- string const guiname = controller().getGuiName();
- fl_set_choice_text(dialog_->choice_toc_type, guiname.c_str());
+ vector<string> const & choice = controller().getTypes();
+ string const & type = toc::getType(controller().params().getCmdName());
+ for (vector<string>::const_iterator it = choice.begin();
+ it != choice.end(); ++it) {
+ string const & guiname = controller().getGuiName(*it);
+ fl_addto_choice(dialog_->choice_toc_type, guiname.c_str());
+ // And select the correct one
+ if (*it == type)
+ fl_set_choice(dialog_->choice_toc_type, it - choice.begin() + 1);
+ }
}
void FormToc::updateContents()
{
- string const type = getString(dialog_->choice_toc_type);
+ vector<string> types = controller().getTypes();
+ string const type = types[fl_get_choice(dialog_->choice_toc_type) - 1];
if (type.empty()) {
fl_clear_browser(dialog_->browser_toc);
fl_add_browser_line(dialog_->browser_toc,
+2005-07-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
+
+ * insetfloat.C:
+ * insetwrap.C: Do not use translatable strings as internal identifier
+ (bug 1870).
+
2005-07-18 Lars Gullik Bjønnes <larsbj@lyx.org>
* insetbase.C: include boost/current_function.hpp
// Find a caption layout in one of the (child inset's) pars
for (; pit != end; ++pit) {
if (pit->layout()->labeltype == LABEL_SENSITIVE) {
- string const name = floatname(params_.type, buf.params());
+ string const type = params_.type;
string const str =
- convert<string>(toclist[name].size() + 1)
+ convert<string>(toclist[type].size() + 1)
+ ". " + pit->asString(buf, false);
lyx::toc::TocItem const item(pit->id(), 0 , str);
- toclist[name].push_back(item);
+ toclist[type].push_back(item);
}
}
}
// Find a caption layout in one of the (child inset's) pars
for (; pit != end; ++pit) {
if (pit->layout()->labeltype == LABEL_SENSITIVE) {
- string const name = floatname(params_.type, buf.params());
+ string const type = params_.type;
string const str =
- convert<string>(toclist[name].size() + 1)
+ convert<string>(toclist[type].size() + 1)
+ ". " + pit->asString(buf, false);
lyx::toc::TocItem const item(pit->id(), 0 , str);
- toclist[name].push_back(item);
+ toclist[type].push_back(item);
}
}
}
#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)
+string const getGuiName(string const & type, Buffer const & buffer)
{
FloatList const & floats =
buffer.params().getLyXTextClass().floats();
- if (floats.typeExist(cmdName))
- return _(floats.getType(cmdName).name());
+ if (floats.typeExist(type))
+ return floats.getType(type).name();
else
- return getType(cmdName);
+ return type;
}
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 &);
+/** Returns the guiname from a given @c type
+ The localization of the names will be done in the frontends */
+std::string const getGuiName(std::string const & type, Buffer const &);
inline
bool operator==(TocItem const & a, TocItem const & b)