]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiListings.cpp
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / GuiListings.cpp
index 561022f595423138571d6892426a458cd75addc4..85a79b5d3e60fdcc4d4fded6eabfc2622340bebd 100644 (file)
@@ -167,9 +167,8 @@ GuiListings::GuiListings(GuiView & lv)
 {
        setupUi(this);
 
-       connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
-       connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
-       connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
+       connect(buttonBox, SIGNAL(clicked(QAbstractButton *)),
+               this, SLOT(slotButtonBox(QAbstractButton *)));
 
        connect(languageCO, SIGNAL(currentIndexChanged(int)),
                this, SLOT(change_adaptor()));
@@ -234,9 +233,9 @@ GuiListings::GuiListings(GuiView & lv)
        placementLE->setValidator(new QRegExpValidator(QRegExp("[\\*tbph]*"), this));
 
        bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
-       bc().setOK(okPB);
-       bc().setApply(applyPB);
-       bc().setCancel(closePB);
+       bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
+       bc().setApply(buttonBox->button(QDialogButtonBox::Apply));
+       bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
        listingsTB->setPlainText(
                qt_("Input listing parameters on the right. Enter ? for a list of parameters."));
 
@@ -433,7 +432,8 @@ void GuiListings::on_languageCO_currentIndexChanged(int index)
                }
        }
        dialectCO->setCurrentIndex(default_dialect);
-       dialectCO->setEnabled(dialectCO->count() > 1);
+       dialectCO->setEnabled(dialectCO->count() > 1
+                             && !buffer().params().use_minted);
 }
 
 
@@ -660,9 +660,9 @@ bool GuiListings::isValid()
 }
 
 
-bool GuiListings::initialiseParams(string const & data)
+bool GuiListings::initialiseParams(string const & sdata)
 {
-       InsetListings::string2params(data, params_);
+       InsetListings::string2params(sdata, params_);
        return true;
 }