#include "insets/ExternalTemplate.h"
#include "insets/InsetExternal.h"
+#include "graphics/epstools.h"
#include "graphics/GraphicsCache.h"
#include "graphics/GraphicsCacheItem.h"
#include "graphics/GraphicsImage.h"
i1 = external::TemplateManager::get().getTemplates().begin();
i2 = external::TemplateManager::get().getTemplates().end();
for (; i1 != i2; ++i1)
- externalCO->addItem(qt_(i1->second.lyxName));
+ externalCO->addItem(qt_(i1->second.guiName));
// Fill the origins combo
for (size_t i = 0; i != sizeof(origins) / sizeof(origins[0]); ++i)
FileName const abs_file(support::makeAbsPath(filename, fromqstr(bufferFilePath())));
// try to get it from the file, if possible
- string bb = readBB_from_PSFile(abs_file);
+ string bb = graphics::readBB_from_PSFile(abs_file);
if (bb.empty()) {
// we don't, so ask the Graphics Cache if it has loaded the file
int width = 0;
TransformIDs::const_iterator tr_begin = transformIds.begin();
TransformIDs::const_iterator const tr_end = transformIds.end();
- bool found = std::find(tr_begin, tr_end, external::Rotate) != tr_end;
- rotationGB->setEnabled(found);
+ bool rotate = std::find(tr_begin, tr_end, external::Rotate) != tr_end;
+ rotationGB->setEnabled(rotate);
- found = std::find(tr_begin, tr_end, external::Resize) != tr_end;
- scaleGB->setEnabled(found);
+ bool resize = std::find(tr_begin, tr_end, external::Resize) != tr_end;
+ scaleGB->setEnabled(resize);
- found = std::find(tr_begin, tr_end, external::Clip) != tr_end;
- cropGB->setEnabled(found);
+ bool clip = std::find(tr_begin, tr_end, external::Clip) != tr_end;
+ cropGB->setEnabled(clip);
- tab->setTabEnabled(tab->indexOf(sizetab),
- rotationGB->isEnabled()
- || scaleGB->isEnabled()
- || cropGB->isEnabled());
+ sizetab->setEnabled(rotate || resize || clip);
+ tab->setTabEnabled(tab->indexOf(sizetab), rotate || resize || clip);
- found = std::find(tr_begin, tr_end, external::Extra) != tr_end;
+ bool found = std::find(tr_begin, tr_end, external::Extra) != tr_end;
optionsGB->setEnabled(found);
bool scaled = displayGB->isChecked() && displayGB->isEnabled() &&
external::Template const * const et_ptr =
etm.getTemplateByName(fromqstr(template_name));
- return fileFilters(et_ptr ? toqstr(et_ptr->fileRegExp) : QString());
+ string filter;
+ if (et_ptr && et_ptr->fileRegExp != "" && et_ptr->fileRegExp != "*") {
+ filter += et_ptr->guiName;
+ filter += " (";
+ filter += et_ptr->fileRegExp;
+ filter += ")";
+ }
+ return fileFilters(toqstr(filter));
}