+ 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()));
+
+ //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()),
+ this, SLOT(change_adaptor()));
+ connect(Width, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+ connect(Height, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+ connect(heightUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)),
+ this, SLOT(change_adaptor()));
+ connect(widthUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)),
+ this, SLOT(change_adaptor()));
+ connect(aspectratio, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(angle, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+ connect(origin, SIGNAL(activated(int)),
+ this, SLOT(change_adaptor()));
+ connect(scaleCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(Scale, SIGNAL(textChanged(const QString &)),
+ this, SLOT(change_adaptor()));
+ connect(rotateOrderCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+
+ filename->setValidator(new PathValidator(true, filename));
+ setFocusProxy(filename);
+
+ QDoubleValidator * scaleValidator = new DoubleAutoValidator(Scale);
+ scaleValidator->setBottom(0);
+ scaleValidator->setDecimals(256); //I guess that will do
+ Scale->setValidator(scaleValidator);
+ Height->setValidator(unsignedLengthAutoValidator(Height));
+ Width->setValidator(unsignedLengthAutoValidator(Width));
+ angle->setValidator(new QDoubleValidator(-360, 360, 2, angle));
+
+ //clipping pane
+ connect(clip, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(lbY, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(lbYunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(rtY, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(rtYunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(lbX, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(lbXunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(rtX, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_bb()));
+ connect(rtXunit, SIGNAL(activated(int)),
+ this, SLOT(change_bb()));
+ connect(getPB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+
+ lbX->setValidator(new QDoubleValidator(lbX));
+ lbY->setValidator(new QDoubleValidator(lbY));
+ rtX->setValidator(new QDoubleValidator(rtX));
+ rtY->setValidator(new QDoubleValidator(rtY));
+
+ //extra options pane
+ connect(latexoptions, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(draftCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(unzipCB, SIGNAL(stateChanged(int)),
+ this, SLOT(change_adaptor()));
+ // FIXME: we should connect to clicked() when we move to Qt 4.2 because
+ // the toggled(bool) signal is also trigged when we update the widgets
+ // (rgh-4/07) this isn't as much or a problem as it was, because we're now
+ // using blockSignals() to keep from triggering that signal when we call
+ // setChecked(). Note, too, that clicked() would get called whenever it
+ // is clicked, even right clicked (I think), not just whenever it is
+ // toggled.
+ connect(subfigure, SIGNAL(toggled(bool)),
+ this, SLOT(change_adaptor()));
+ connect(subcaption, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ connect(displayGB, SIGNAL(toggled(bool)),
+ this, SLOT(change_adaptor()));
+ connect(showCB, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(change_adaptor()));
+ connect(displayscale, SIGNAL(textChanged(const QString&)),
+ this, SLOT(change_adaptor()));
+ displayscale->setValidator(new QIntValidator(displayscale));
+
+ bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
+ bc().setOK(okPB);
+ bc().setApply(applyPB);
+ bc().setRestore(restorePB);
+ bc().setCancel(closePB);
+
+ bc().addReadOnly(latexoptions);
+ bc().addReadOnly(subfigure);
+ bc().addReadOnly(filenameL);
+ bc().addReadOnly(filename);
+ bc().addReadOnly(browsePB);
+ bc().addReadOnly(unzipCB);
+ bc().addReadOnly(bbFrame);
+ bc().addReadOnly(draftCB);
+ bc().addReadOnly(clip);
+ bc().addReadOnly(unzipCB);
+ bc().addReadOnly(displayGB);
+ bc().addReadOnly(sizeGB);
+ bc().addReadOnly(rotationGB);
+ bc().addReadOnly(latexoptions);
+ bc().addReadOnly(getPB);
+ bc().addReadOnly(rotateOrderCB);