this, SLOT(change_adaptor()));
connect(browsePB, SIGNAL(clicked()),
this, SLOT(browseClicked()));
- connect(externalCO, SIGNAL(activated(QString)),
+ connect(externalCO, SIGNAL(activated(int)),
this, SLOT(templateChanged()));
connect(extraED, SIGNAL(textChanged(QString)),
this, SLOT(extraChanged(QString)));
- connect(extraFormatCO, SIGNAL(activated(QString)),
- this, SLOT(formatChanged(QString)));
+ connect(extraFormatCO, SIGNAL(activated(int)),
+ this, SLOT(formatChanged(int)));
connect(widthUnitCO, SIGNAL(activated(int)),
this, SLOT(widthUnitChanged()));
connect(heightUnitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)),
bc().addReadOnly(extraFormatCO);
bc().addReadOnly(extraED);
+ // Add validated widgets to those that will be
+ // visually marked if invalid
bc().addCheckedLineEdit(angleED, angleLA);
bc().addCheckedLineEdit(displayscaleED, scaleLA);
bc().addCheckedLineEdit(heightED, heightLA);
bc().addCheckedLineEdit(ytED, rtLA);
bc().addCheckedLineEdit(fileED, fileLA);
+ // We also mark the tabs the widgets are in
+ int const tabindex = tab->indexOf(sizetab);
+ bc().addCheckedLineEdit(angleED, tab, tabindex);
+ bc().addCheckedLineEdit(heightED, tab, tabindex);
+ bc().addCheckedLineEdit(widthED, tab, tabindex);
+ bc().addCheckedLineEdit(xlED, tab, tabindex);
+ bc().addCheckedLineEdit(ybED, tab, tabindex);
+ bc().addCheckedLineEdit(xrED, tab, tabindex);
+ bc().addCheckedLineEdit(ytED, tab, tabindex);
+ bc().addCheckedLineEdit(displayscaleED, tab, tab->indexOf(lyxviewtab));
+ bc().addCheckedLineEdit(fileED, tab, tab->indexOf(filetab));
+
external::TemplateManager::Templates::const_iterator i1, i2;
i1 = external::TemplateManager::get().getTemplates().begin();
i2 = external::TemplateManager::get().getTemplates().end();
}
-void GuiExternal::formatChanged(const QString & format)
+void GuiExternal::formatChanged(int const i)
{
- extraED->setText(extra_[format]);
+ extraED->setText(extra_[extraFormatCO->itemText(i)]);
}
data.scale = widgetToDoubleStr(&widthED);
data.width = Length();
} else {
- data.width = Length(widgetsToLength(&widthED, &widthUnitCO));
+ data.width = widgetsToLength(&widthED, &widthUnitCO);
data.scale = string();
}
data.height = Length(widgetsToLength(&heightED, &heightUnitCO));
{
string const lfun = InsetExternal::params2string(params_, buffer());
dispatch(FuncRequest(getLfun(), lfun));
+ connectToNewInset();
}
QString GuiExternal::browse(QString const & input,
- QString const & template_name) const
+ QString const & template_name)
{
QString const title = qt_("Select external file");
QString const bufpath = bufferFilePath();