]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiGraphics.cpp
header cleanup
[lyx.git] / src / frontends / qt4 / GuiGraphics.cpp
index 31d00f63476efe9cfe27032ed859df3e6d820edf..b48c2fd06f0c2231cc1d088a744e711538d37165 100644 (file)
@@ -36,7 +36,6 @@
 #include "support/FileFilterList.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
-#include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/Package.h"
 #include "support/types.h"
@@ -44,7 +43,6 @@
 #include <boost/bind.hpp>
 
 #include <QCheckBox>
-#include <QCloseEvent>
 #include <QLabel>
 #include <QLineEdit>
 #include <QPushButton>
@@ -107,18 +105,17 @@ getSecond(vector<Pair> const & pr)
         return tmp;
 }
 
-/// The (tranlated) GUI std::string and it's LaTeX equivalent.
-typedef std::pair<docstring, std::string> RotationOriginPair;
+/// The (tranlated) GUI string and it's LaTeX equivalent.
+typedef pair<docstring, string> RotationOriginPair;
 ///
-std::vector<RotationOriginPair> getRotationOriginData();
+vector<RotationOriginPair> getRotationOriginData();
 
 
 GuiGraphics::GuiGraphics(GuiView & lv)
-       : GuiDialog(lv, "graphics")
+       : GuiDialog(lv, "graphics", qt_("Graphics"))
 {
        setupUi(this);
-       setViewTitle(_("Graphics"));
-
+       
        //main buttons
        connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
        connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
@@ -128,6 +125,8 @@ GuiGraphics::GuiGraphics(GuiView & lv)
        //graphics pane
        connect(filename, SIGNAL(textChanged(const QString &)),
                this, SLOT(change_adaptor()));
+       connect(embedCB, SIGNAL(toggled(bool)),
+               this, SLOT(change_adaptor()));
        connect(WidthCB, SIGNAL( clicked()),
                this, SLOT(change_adaptor()));
        connect(HeightCB, SIGNAL( clicked()),
@@ -268,19 +267,11 @@ void GuiGraphics::change_bb()
 }
 
 
-void GuiGraphics::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       GuiDialog::closeEvent(e);
-}
-
-
 void GuiGraphics::on_browsePB_clicked()
 {
        docstring const str = browse(qstring_to_ucs4(filename->text()));
        if (!str.empty()) {
                filename->setText(toqstr(str));
-               embedCB->setCheckState(Qt::Unchecked);
                changed();
        }
 }
@@ -301,6 +292,7 @@ void GuiGraphics::on_editPB_clicked()
 void GuiGraphics::on_filename_textChanged(const QString & filename)
 {
        editPB->setDisabled(filename.isEmpty());
+       EmbeddedFile file = EmbeddedFile(fromqstr(filename), bufferFilepath());
 }
 
 
@@ -450,7 +442,7 @@ void GuiGraphics::updateContents()
        string const name =
                igp.filename.outputFilename(bufferFilepath());
        filename->setText(toqstr(name));
-    embedCB->setCheckState(igp.filename.embedded() ? Qt::Checked : Qt::Unchecked);
+       embedCB->setCheckState(igp.filename.embedded() ? Qt::Checked : Qt::Unchecked);
 
        // set the bounding box values
        if (igp.bb.empty()) {
@@ -672,7 +664,7 @@ void GuiGraphics::applyView()
        igp.rotateAngle = fromqstr(angle->text());
 
        double rotAngle = convert<double>(igp.rotateAngle);
-       if (std::abs(rotAngle) > 360.0) {
+       if (abs(rotAngle) > 360.0) {
                rotAngle -= 360.0 * floor(rotAngle / 360.0);
                igp.rotateAngle = convert<string>(rotAngle);
        }