N_("Top right"), N_("Bottom right"), N_("Baseline right")
};
-} // namespace anon
+} // namespace
GuiExternal::GuiExternal(GuiView & lv)
{
setupUi(this);
- connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
- connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
- connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
+ connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+ this, SLOT(slotButtonBox(QAbstractButton *)));
/*
connect(displayGB, SIGNAL(toggled(bool)),
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
- bc().setOK(okPB);
- bc().setApply(applyPB);
- bc().setCancel(closePB);
+ bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+ bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
+ bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
bc().addReadOnly(fileED);
bc().addReadOnly(browsePB);
external::TemplateManager::Templates::const_iterator i1, i2;
i1 = external::TemplateManager::get().getTemplates().begin();
i2 = external::TemplateManager::get().getTemplates().end();
+ QMap<QString, QString> localizedTemplates;
for (; i1 != i2; ++i1)
- externalCO->addItem(qt_(i1->second.guiName), toqstr(i1->second.lyxName));
- // Sort alphabetically by(localized) GUI name
- externalCO->model()->sort(0);
+ localizedTemplates.insert(qt_(i1->second.guiName), toqstr(i1->second.lyxName));
+ // Sort alphabetically by (localized) GUI name
+ QStringList keys = localizedTemplates.keys();
+ qSort(keys.begin(), keys.end(), SortLocaleAware);
+ for (QString & key : keys) {
+ QString const value = localizedTemplates[key];
+ externalCO->addItem(key, value);
+ }
// Fill the origins combo
for (size_t i = 0; i != sizeof(origins) / sizeof(origins[0]); ++i)
void GuiExternal::updateContents()
{
+ if (params_.filename.empty())
+ tab->setCurrentIndex(0);
+
string const name =
params_.filename.outputFileName(fromqstr(bufferFilePath()));
fileED->setText(toqstr(name));
}
-bool GuiExternal::initialiseParams(string const & data)
+bool GuiExternal::initialiseParams(string const & sdata)
{
- InsetExternal::string2params(data, buffer(), params_);
+ InsetExternal::string2params(sdata, buffer(), params_);
return true;
}
QString const bufpath = bufferFilePath();
QStringList const filter = templateFilters(template_name);
- QString const label1 = qt_("Documents|#o#O");
+ QString const label1 = qt_("D&ocuments");
QString const dir1 = toqstr(lyxrc.document_path);
return browseRelToParent(input, bufpath, title, filter, false, label1, dir1);