2001-08-28 03:35:17 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file QGraphicsDialog.C
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-08-28 03:35:17 +00:00
|
|
|
|
*
|
2002-10-20 01:48:28 +00:00
|
|
|
|
* \author John Levon
|
2003-09-07 01:45:40 +00:00
|
|
|
|
* \author Herbert Vo<EFBFBD>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-08-28 03:35:17 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
|
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
|
#include "ControlGraphics.h"
|
|
|
|
|
#include "debug.h"
|
2002-12-17 20:37:13 +00:00
|
|
|
|
#include "qt_helpers.h"
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2001-08-28 03:35:17 +00:00
|
|
|
|
#include <qpushbutton.h>
|
2002-09-11 17:42:45 +00:00
|
|
|
|
#include <qlineedit.h>
|
2001-08-28 03:35:17 +00:00
|
|
|
|
|
2002-11-17 11:24:08 +00:00
|
|
|
|
#include "lengthcombo.h"
|
|
|
|
|
|
2001-08-28 03:35:17 +00:00
|
|
|
|
#include "QGraphicsDialog.h"
|
|
|
|
|
#include "QGraphics.h"
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
|
|
|
2001-08-28 03:35:17 +00:00
|
|
|
|
QGraphicsDialog::QGraphicsDialog(QGraphics * form)
|
|
|
|
|
: QGraphicsDialogBase(0, 0, false, 0),
|
|
|
|
|
form_(form)
|
|
|
|
|
{
|
|
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
|
form, SLOT(slotOK()));
|
|
|
|
|
connect(applyPB, SIGNAL(clicked()),
|
2002-01-31 13:15:33 +00:00
|
|
|
|
form, SLOT(slotApply()));
|
2001-08-28 03:35:17 +00:00
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
|
form, SLOT(slotClose()));
|
2002-01-31 13:15:33 +00:00
|
|
|
|
connect(restorePB, SIGNAL(clicked()),
|
|
|
|
|
form, SLOT(slotRestore()));
|
2001-08-28 03:35:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
2002-09-11 17:42:45 +00:00
|
|
|
|
void QGraphicsDialog::show()
|
2002-10-20 01:48:28 +00:00
|
|
|
|
{
|
2002-09-11 17:42:45 +00:00
|
|
|
|
QGraphicsDialogBase::show();
|
|
|
|
|
filename->setFocus();
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
2001-08-28 03:35:17 +00:00
|
|
|
|
void QGraphicsDialog::change_adaptor()
|
|
|
|
|
{
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
2002-10-31 20:05:55 +00:00
|
|
|
|
void QGraphicsDialog::change_bb()
|
|
|
|
|
{
|
|
|
|
|
form_->controller().bbChanged = true;
|
2002-12-01 22:59:25 +00:00
|
|
|
|
lyxerr[Debug::GRAPHICS]
|
2002-11-17 11:24:08 +00:00
|
|
|
|
<< "[controller().bb_Changed set to true]\n";
|
2002-10-31 20:05:55 +00:00
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-11-07 00:21:28 +00:00
|
|
|
|
void QGraphicsDialog::change_WUnit()
|
|
|
|
|
{
|
|
|
|
|
bool useHeight = (widthUnit->currentItem() > 0);
|
|
|
|
|
height->setEnabled(useHeight);
|
|
|
|
|
heightUnit->setEnabled(useHeight);
|
2002-11-17 11:24:08 +00:00
|
|
|
|
form_->changed();
|
2002-11-07 00:21:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-08-28 03:35:17 +00:00
|
|
|
|
void QGraphicsDialog::closeEvent(QCloseEvent * e)
|
|
|
|
|
{
|
|
|
|
|
form_->slotWMHide();
|
|
|
|
|
e->accept();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-01-31 13:15:33 +00:00
|
|
|
|
void QGraphicsDialog::browse_clicked()
|
2001-08-28 03:35:17 +00:00
|
|
|
|
{
|
2003-06-01 00:59:56 +00:00
|
|
|
|
string const str =
|
|
|
|
|
form_->controller().Browse(fromqstr(filename->text()));
|
|
|
|
|
filename->setText(toqstr(str));
|
|
|
|
|
form_->changed();
|
2001-08-28 03:35:17 +00:00
|
|
|
|
}
|
2002-01-31 13:15:33 +00:00
|
|
|
|
|
2002-11-07 00:21:28 +00:00
|
|
|
|
|
|
|
|
|
void QGraphicsDialog::getBB_clicked()
|
2002-01-31 13:15:33 +00:00
|
|
|
|
{
|
2002-11-07 00:21:28 +00:00
|
|
|
|
form_->getBB();
|
2002-01-31 13:15:33 +00:00
|
|
|
|
}
|