#include "LengthCombo.h"
#include "Length.h"
#include "LyXRC.h"
-#include "Undo.h"
+#include "graphics/epstools.h"
#include "graphics/GraphicsCache.h"
#include "graphics/GraphicsCacheItem.h"
#include "graphics/GraphicsImage.h"
void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
{
static char const * const bb_units[] = { "bp", "cm", "mm", "in" };
- static char const * const bb_units_gui[] = { N_("bp"), N_("cm"), N_("mm"), N_("in") };
+ static char const * const bb_units_gui[] = { N_("bp"), N_("cm"), N_("mm"), N_("in[[unit of measure]]") };
size_t const bb_size = sizeof(bb_units) / sizeof(bb_units[0]);
lbXunit->clear();
rtXunit->clear();
rtYunit->clear();
- for (int i = 0; i < bb_size; i++) {
+ for (size_t i = 0; i < bb_size; i++) {
lbXunit->addItem(qt_(bb_units_gui[i]),
toqstr(bb_units[i]));
lbYunit->addItem(qt_(bb_units_gui[i]),
// set the right default unit
Length::UNIT const defaultUnit = Length::defaultUnit();
- //lyxerr << bufferFilepath();
+ //lyxerr << bufferFilePath();
string const name =
- igp.filename.outputFilename(fromqstr(bufferFilepath()));
+ igp.filename.outputFileName(fromqstr(bufferFilePath()));
filename->setText(toqstr(name));
// set the bounding box values
if (igp.bb.empty()) {
- string const bb = readBoundingBox(igp.filename.absFilename());
+ string const bb = readBoundingBox(igp.filename.absFileName());
// the values from the file always have the bigpoint-unit bp
doubleToWidget(lbX, token(bb, ' ', 0));
doubleToWidget(lbY, token(bb, ' ', 1));
set<string>::const_iterator end = grp.end();
groupCO->blockSignals(true);
groupCO->clear();
- for (; it != end; it++)
+ for (; it != end; ++it)
groupCO->addItem(toqstr(*it), toqstr(*it));
groupCO->insertItem(0, qt_("None"), QString());
if (igp.groupId.empty())
origin->clear();
- for (int i = 0; i < rorigin_size; i++) {
+ for (size_t i = 0; i < rorigin_size; i++) {
origin->addItem(qt_(rorigin_gui_strs[i]),
toqstr(rorigin_lyx_strs[i]));
}
// latex section
latexoptions->setText(toqstr(igp.special));
+ // cf bug #3852
+ filename->setFocus();
}
{
InsetGraphicsParams & igp = params_;
- igp.filename.set(fromqstr(filename->text()), fromqstr(bufferFilepath()));
+ igp.filename.set(fromqstr(filename->text()), fromqstr(bufferFilePath()));
// the bb section
igp.bb.erase();
QString const title = qt_("Select graphics file");
// Does user clipart directory exist?
- string clipdir = addName(package().user_support().absFilename(), "clipart");
+ string clipdir = addName(package().user_support().absFileName(), "clipart");
FileName clip(clipdir);
// bail out to system clipart directory
if (!clip.isDirectory())
- clipdir = addName(package().system_support().absFilename(), "clipart");
+ clipdir = addName(package().system_support().absFileName(), "clipart");
- return browseRelFile(in_name, bufferFilepath(),
+ return browseRelToParent(in_name, bufferFilePath(),
title, fileFilters(QString()), false,
qt_("Clipart|#C#c"), toqstr(clipdir),
qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
string GuiGraphics::readBoundingBox(string const & file)
{
- FileName const abs_file = support::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
- string const bb = readBB_from_PSFile(abs_file);
+ string const bb = graphics::readBB_from_PSFile(abs_file);
if (!bb.empty())
return bb;
bool GuiGraphics::isFileNameValid(string const & fname) const
{
// It may be that the filename is relative.
- return support::makeAbsPath(fname, fromqstr(bufferFilepath())).isReadableFile();
+ return support::makeAbsPath(fname, fromqstr(bufferFilePath())).isReadableFile();
}