]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiGraphics.cpp
Hack to display section symbol
[lyx.git] / src / frontends / qt / GuiGraphics.cpp
index fd4e8f52bfa534ef2b4a9711b8b27894da166a98..6801f4c5d009fbb88c3687f435f575bae2f4c1ee 100644 (file)
@@ -201,7 +201,7 @@ GuiGraphics::GuiGraphics(GuiView & lv)
        connect(groupCO, SIGNAL(currentIndexChanged(int)),
                this, SLOT(changeGroup(int)));
 
-       displayscale->setValidator(new QIntValidator(displayscale));
+       displayscale->setValidator(new QIntValidator(1, 1000, displayscale));
 
        bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
        bc().setOK(buttonBox->button(QDialogButtonBox::Ok));
@@ -224,17 +224,32 @@ GuiGraphics::GuiGraphics(GuiView & lv)
        bc().addReadOnly(getPB);
        bc().addReadOnly(rotateOrderCB);
 
-       // initialize the length validator
+       // Add validated widgets to those that will be
+       // visually marked if invalid
        bc().addCheckedLineEdit(Scale, scaleCB);
        bc().addCheckedLineEdit(Width, WidthCB);
        bc().addCheckedLineEdit(Height, HeightCB);
-       bc().addCheckedLineEdit(displayscale, scaleLA);
        bc().addCheckedLineEdit(angle, angleL);
+       bc().addCheckedLineEdit(filename, filenameL);
+       bc().addCheckedLineEdit(displayscale, scaleLA);
        bc().addCheckedLineEdit(lbX, xL);
        bc().addCheckedLineEdit(lbY, yL);
        bc().addCheckedLineEdit(rtX, xL_2);
        bc().addCheckedLineEdit(rtY, yL_2);
-       bc().addCheckedLineEdit(filename, filenameL);
+
+       // We also mark the tabs the widgets are in
+       int tabindex = tabWidget->indexOf(Graphics);
+       bc().addCheckedLineEdit(Scale, tabWidget, tabindex);
+       bc().addCheckedLineEdit(Width, tabWidget, tabindex);
+       bc().addCheckedLineEdit(Height, tabWidget, tabindex);
+       bc().addCheckedLineEdit(angle, tabWidget, tabindex);
+       bc().addCheckedLineEdit(filename, tabWidget, tabindex);
+       bc().addCheckedLineEdit(displayscale, tabWidget, tabWidget->indexOf(ExtraOptions));
+       tabindex = tabWidget->indexOf(Clipping);
+       bc().addCheckedLineEdit(lbX, tabWidget, tabindex);
+       bc().addCheckedLineEdit(lbY, tabWidget, tabindex);
+       bc().addCheckedLineEdit(rtX, tabWidget, tabindex);
+       bc().addCheckedLineEdit(rtY, tabWidget, tabindex);
 }
 
 
@@ -337,6 +352,7 @@ void GuiGraphics::on_newGroupPB_clicked()
 void GuiGraphics::changeBB()
 {
        bbChanged = isChangedBB();
+       getPB->setEnabled(bbChanged);
        LYXERR(Debug::GRAPHICS, "[bb_Changed set to " << bbChanged << "]");
        changed();
 }