2 * \file QGraphicsDialog.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
14 #include "QGraphicsDialog.h"
15 #include "QGraphics.h"
17 #include "lengthcombo.h"
18 #include "validators.h"
19 #include "qt_helpers.h"
23 #include "controllers/ControlGraphics.h"
25 #include <qpushbutton.h>
26 #include <qlineedit.h>
27 #include <qvalidator.h>
36 QGraphicsDialog::QGraphicsDialog(QGraphics * form)
37 : QGraphicsDialogBase(0, 0, false, 0),
40 connect(okPB, SIGNAL(clicked()),
41 form, SLOT(slotOK()));
42 connect(applyPB, SIGNAL(clicked()),
43 form, SLOT(slotApply()));
44 connect(closePB, SIGNAL(clicked()),
45 form, SLOT(slotClose()));
46 connect(restorePB, SIGNAL(clicked()),
47 form, SLOT(slotRestore()));
48 connect(editPB, SIGNAL(clicked()),
49 this, SLOT(edit_clicked()));
51 angle->setValidator(new QDoubleValidator(-360, 360, 2, angle));
53 lbX->setValidator(new QIntValidator(lbX));
54 lbY->setValidator(new QIntValidator(lbY));
55 rtX->setValidator(new QIntValidator(rtX));
56 rtY->setValidator(new QIntValidator(rtY));
58 displayscale->setValidator(new QIntValidator(displayscale));
59 height->setValidator(unsignedLengthValidator(height));
60 width->setValidator(unsignedLengthValidator(width));
62 filename->setValidator(new PathValidator(true, filename));
66 void QGraphicsDialog::show()
68 QGraphicsDialogBase::show();
73 void QGraphicsDialog::change_adaptor()
79 void QGraphicsDialog::change_bb()
81 form_->controller().bbChanged = true;
82 lyxerr[Debug::GRAPHICS]
83 << "[controller().bb_Changed set to true]\n";
88 void QGraphicsDialog::change_WUnit()
90 bool useHeight = (widthUnit->currentItem() > 0);
91 height->setEnabled(useHeight);
92 heightUnit->setEnabled(useHeight);
97 void QGraphicsDialog::closeEvent(QCloseEvent * e)
104 void QGraphicsDialog::browse_clicked()
106 docstring const str =
107 form_->controller().browse(qstring_to_ucs4(filename->text()));
108 filename->setText(toqstr(str));
113 void QGraphicsDialog::getBB_clicked()
119 void QGraphicsDialog::edit_clicked()
121 form_->controller().editGraphics();
124 } // namespace frontend
127 #include "QGraphicsDialog_moc.cpp"