]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiGraphics.cpp
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / GuiGraphics.cpp
index 53b248d4b51ccb8b714587aee0047b2e21cd61e3..465ffcea34406d8d5e0804b8962e1fe3838e9526 100644 (file)
@@ -24,7 +24,6 @@
 #include "LengthCombo.h"
 #include "Length.h"
 #include "LyXRC.h"
-#include "Undo.h"
 
 #include "graphics/GraphicsCache.h"
 #include "graphics/GraphicsCacheItem.h"
@@ -149,6 +148,7 @@ GuiGraphics::GuiGraphics(GuiView & lv)
                this, SLOT(change_adaptor()));
 
        filename->setValidator(new PathValidator(true, filename));
+       setFocusProxy(filename);
 
        QDoubleValidator * scaleValidator = 
                new DoubleAutoValidator(Scale, qt_(autostr));
@@ -472,7 +472,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();
@@ -494,14 +494,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));
@@ -646,7 +646,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();
@@ -786,14 +786,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));
@@ -802,7 +802,7 @@ 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
@@ -831,7 +831,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();
 }