lyx_mirror/src/frontends/qt2/QGraphicsDialog.C
John Levon 6391d04bf9 bug 1028 fix
(the clone() patch needs some additional stuff for this, it will
wait until that's applied - it's in my tree)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7075 a592a061-630c-0410-9148-cb99ea01b6c8
2003-06-01 00:59:56 +00:00

101 lines
1.8 KiB
C

/**
* \file QGraphicsDialog.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Herbert Voss
*
* Full author contact details are available in file CREDITS
*/
#include <config.h>
#include "ControlGraphics.h"
#include "debug.h"
#include "qt_helpers.h"
#include "LString.h"
#include <qwidget.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qfiledialog.h>
#include <qcombobox.h>
#include "lengthcombo.h"
#include "QGraphicsDialog.h"
#include "QGraphics.h"
#include <vector>
QGraphicsDialog::QGraphicsDialog(QGraphics * form)
: QGraphicsDialogBase(0, 0, false, 0),
form_(form)
{
connect(okPB, SIGNAL(clicked()),
form, SLOT(slotOK()));
connect(applyPB, SIGNAL(clicked()),
form, SLOT(slotApply()));
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
connect(restorePB, SIGNAL(clicked()),
form, SLOT(slotRestore()));
}
void QGraphicsDialog::show()
{
QGraphicsDialogBase::show();
filename->setFocus();
}
void QGraphicsDialog::change_adaptor()
{
form_->changed();
}
void QGraphicsDialog::change_bb()
{
form_->controller().bbChanged = true;
lyxerr[Debug::GRAPHICS]
<< "[controller().bb_Changed set to true]\n";
form_->changed();
}
void QGraphicsDialog::change_WUnit()
{
bool useHeight = (widthUnit->currentItem() > 0);
height->setEnabled(useHeight);
heightUnit->setEnabled(useHeight);
form_->changed();
}
void QGraphicsDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
e->accept();
}
void QGraphicsDialog::browse_clicked()
{
string const str =
form_->controller().Browse(fromqstr(filename->text()));
filename->setText(toqstr(str));
form_->changed();
}
void QGraphicsDialog::getBB_clicked()
{
form_->getBB();
}