]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiGraphics.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiGraphics.cpp
index 5910ec88133f586fd7293c7769bcb6ac46ae64c2..b6bbaeac3fb13860c7a7049a4b0b01ec7c378af7 100644 (file)
@@ -77,7 +77,7 @@ size_t const rorigin_size = sizeof(rorigin_lyx_strs) / sizeof(char *);
 
 static string const autostr = N_("automatically");
 
-} // namespace anon
+} // namespace
 
 
 namespace lyx {
@@ -115,10 +115,8 @@ GuiGraphics::GuiGraphics(GuiView & lv)
        setupUi(this);
 
        //main buttons
-       connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
-       connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
-       connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
-       connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
+       connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+                       this, SLOT(slotButtonBox(QAbstractButton *)));
 
        //graphics pane
        connect(filename, SIGNAL(textChanged(const QString &)),
@@ -212,10 +210,10 @@ GuiGraphics::GuiGraphics(GuiView & lv)
        displayscale->setValidator(new QIntValidator(displayscale));
 
        bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
-       bc().setOK(okPB);
-       bc().setApply(applyPB);
-       bc().setRestore(restorePB);
-       bc().setCancel(closePB);
+       bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+       bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
+       bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
+       bc().setRestore(buttonBox->button(QDialogButtonBox::Reset));
 
        bc().addReadOnly(latexoptions);
        bc().addReadOnly(filenameL);
@@ -469,9 +467,9 @@ void GuiGraphics::updateAspectRatioStatus()
 }
 
 
-void GuiGraphics::on_aspectratio_toggled(bool aspectratio)
+void GuiGraphics::on_aspectratio_toggled(bool aspect_ratio)
 {
-       if (aspectratio) {
+       if (aspect_ratio) {
                WidthCB->setText(qt_("Set max. &width:"));
                HeightCB->setText(qt_("Set max. &height:"));
                Width->setToolTip(qt_("Maximal width of image in output"));
@@ -485,12 +483,12 @@ void GuiGraphics::on_aspectratio_toggled(bool aspectratio)
 }
 
 
-void GuiGraphics::on_angle_textChanged(const QString & filename)
+void GuiGraphics::on_angle_textChanged(const QString & file_name)
 {
        rotateOrderCB->setEnabled((WidthCB->isChecked() ||
                                 HeightCB->isChecked() ||
                                 scaleCB->isChecked()) &&
-                                (filename != "0"));
+                                (file_name != "0"));
 }
 
 
@@ -752,9 +750,9 @@ bool GuiGraphics::isValid()
 }
 
 
-bool GuiGraphics::initialiseParams(string const & data)
+bool GuiGraphics::initialiseParams(string const & sdata)
 {
-       InsetGraphics::string2params(data, buffer(), params_);
+       InsetGraphics::string2params(sdata, buffer(), params_);
        paramsToDialog(params_);
        current_group_ = params_.groupId;
        return true;
@@ -781,16 +779,16 @@ QString GuiGraphics::browse(QString const & in_name) const
 
        // Does user clipart directory exist?
        string clipdir = addName(package().user_support().absFileName(), "clipart");
-       FileName clip(clipdir);
+       FileName fclip(clipdir);
 
        // bail out to system clipart directory
-       if (!clip.isDirectory())
+       if (!fclip.isDirectory())
                clipdir = addName(package().system_support().absFileName(), "clipart");
 
        return browseRelToParent(in_name, bufferFilePath(),
                title, fileFilters(QString()), false,
-               qt_("Clipart|#C#c"), toqstr(clipdir),
-               qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
+               qt_("&Clipart"), toqstr(clipdir),
+               qt_("D&ocuments"), toqstr(lyxrc.document_path));
 }