]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiGraphics.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiGraphics.cpp
index e89bd4cfe6467e0e050ea0d0c88df64609a2b07a..3bc7b943bec2342cb630e5f14c246cb4858ad9b4 100644 (file)
@@ -24,8 +24,8 @@
 #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"
@@ -75,7 +75,7 @@ char const * const rorigin_gui_strs[] = {
 
 size_t const rorigin_size = sizeof(rorigin_lyx_strs) / sizeof(char *);
 
-static string autostr = N_("automatically");
+static string const autostr = N_("automatically");
 
 } // namespace anon
 
@@ -473,7 +473,7 @@ void GuiGraphics::on_angle_textChanged(const QString & filename)
 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();
@@ -495,14 +495,14 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
        // 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));
@@ -575,7 +575,7 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
        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())
@@ -647,7 +647,7 @@ void GuiGraphics::applyView()
 {
        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();
@@ -787,14 +787,14 @@ QString GuiGraphics::browse(QString const & in_name) const
        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));
@@ -803,11 +803,11 @@ QString GuiGraphics::browse(QString const & in_name) const
 
 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;
 
@@ -832,7 +832,7 @@ string GuiGraphics::readBoundingBox(string const & file)
 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();
 }