X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiPrintindex.cpp;h=c639fd9e4735e978c96872bac29c31c4898f4a6b;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=a175f8b651c3735f256e5f6b7c342913c91a82b7;hpb=0bd5c5fca866a53c4bf319b41afbb9b655d8e108;p=lyx.git diff --git a/src/frontends/qt4/GuiPrintindex.cpp b/src/frontends/qt4/GuiPrintindex.cpp index a175f8b651..c639fd9e47 100644 --- a/src/frontends/qt4/GuiPrintindex.cpp +++ b/src/frontends/qt4/GuiPrintindex.cpp @@ -21,11 +21,14 @@ #include "FuncRequest.h" #include "IndicesList.h" +#include "support/lstrings.h" + #include "insets/InsetCommand.h" #include using namespace std; +using namespace lyx::support; namespace lyx { namespace frontend { @@ -58,10 +61,14 @@ void GuiPrintindex::updateContents() typedef IndicesList::const_iterator const_iterator; IndicesList const & indiceslist = buffer().params().indiceslist(); - docstring const cur_index = params_["type"]; + docstring const cur_index = suffixIs(params_.getCmdName(), '*') ? + from_ascii("printall") : params_["type"]; indicesCO->clear(); + indicesCO->addItem(qt_(""), + QVariant(QString("printall"))); + const_iterator const begin = indiceslist.begin(); const_iterator const end = indiceslist.end(); for (const_iterator it = begin; it != end; ++it) @@ -78,17 +85,24 @@ void GuiPrintindex::applyView() { QString const index = indicesCO->itemData( indicesCO->currentIndex()).toString(); + string cmd = "printindex"; if (subindexCB->isChecked()) - params_.setCmdName("printsubindex"); + cmd = "printsubindex"; + if (index == QString("printall")) + cmd += '*'; + params_.setCmdName(cmd); + if (index == QString("printall")) + params_["type"] = docstring(); else - params_.setCmdName("printindex"); - params_["type"] = qstring_to_ucs4(index); + params_["type"] = qstring_to_ucs4(index); } void GuiPrintindex::paramsToDialog(InsetCommandParams const & /*icp*/) { - int const pos = indicesCO->findData(toqstr(params_["type"])); + int const pos = suffixIs(params_.getCmdName(), '*') ? + indicesCO->findData(QString("printall")) : + indicesCO->findData(toqstr(params_["type"])); subindexCB->setChecked(params_.getCmdName() == "printsubindex"); indicesCO->setCurrentIndex(pos); bc().setValid(isValid()); @@ -100,6 +114,7 @@ bool GuiPrintindex::initialiseParams(string const & data) // The name passed with LFUN_INSET_APPLY is also the name // used to identify the mailer. InsetCommand::string2params("index_print", data, params_); + paramsToDialog(params_); return true; }