#include "graphics/GraphicsCacheItem.h"
#include "graphics/GraphicsImage.h"
-#include "insets/InsetGraphicsParams.h"
+#include "insets/InsetGraphics.h"
#include "support/convert.h"
#include "support/debug.h"
//FIXME setAutoTextCB should really take an argument, as indicated, that
//determines what text is to be written for "auto". But making
//that work involves more extensive revisions than we now want
-//to make, since "auto" also appears in updateContents() (see
-//GuiGraphics.cpp).
+//to make, since "auto" also appears in paramsToDialog().
//The right way to do this, I think, would be to define a class
//checkedLengthSet (and a partnering labeledLengthSete) that encapsulated
//the checkbox, line edit, and length combo together, and then made e.g.
this, SLOT(change_adaptor()));
connect(displayscale, SIGNAL(textChanged(const QString&)),
this, SLOT(change_adaptor()));
+ connect(groupId, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
displayscale->setValidator(new QIntValidator(displayscale));
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
}
-void GuiGraphics::updateContents()
+void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
{
static char const * const bb_units[] = { "bp", "cm", "mm", "in" };
size_t const bb_size = sizeof(bb_units) / sizeof(bb_units[0]);
rtYunit->addItem(toqstr(*it));
}
- InsetGraphicsParams & igp = params_;
-
// set the right default unit
Length::UNIT unitDefault = Length::CM;
switch (lyxrc.default_papersize) {
break;
}
- lyxerr << fromqstr(bufferFilepath());
+ //lyxerr << bufferFilepath();
string const name =
igp.filename.outputFilename(fromqstr(bufferFilepath()));
filename->setText(toqstr(name));
scaleCB->blockSignals(false);
Scale->setEnabled(scaleChecked);
+ groupId->setText(toqstr(igp.groupId));
+
lengthAutoToWidgets(Width, widthUnit, igp.width,
unitDefault);
bool const widthChecked = !Width->text().isEmpty() &&
// more latex options
igp.special = fromqstr(latexoptions->text());
+
+ igp.groupId = fromqstr(groupId->text());
}
bool GuiGraphics::initialiseParams(string const & data)
{
InsetGraphics::string2params(data, buffer(), params_);
+ paramsToDialog(params_);
return true;
}
InsetGraphicsParams tmp_params(params_);
string const lfun = InsetGraphics::params2string(tmp_params, buffer());
dispatch(FuncRequest(getLfun(), lfun));
+ if (!params_.groupId.empty())
+ dispatch(FuncRequest(LFUN_GRAPHICS_GROUPS_UNIFY,
+ InsetGraphics::params2string(params_, buffer())));
}
string GuiGraphics::readBoundingBox(string const & file)
{
- FileName const abs_file = makeAbsPath(file, fromqstr(bufferFilepath()));
+ FileName const abs_file = support::makeAbsPath(file, fromqstr(bufferFilepath()));
// try to get it from the file, if possible. Zipped files are
// unzipped in the readBB_from_PSFile-Function
bool GuiGraphics::isFileNameValid(string const & fname) const
{
// It may be that the filename is relative.
- return makeAbsPath(fname, fromqstr(bufferFilepath())).isReadableFile();
+ return support::makeAbsPath(fname, fromqstr(bufferFilepath())).isReadableFile();
}