2001-02-14 19:43:56 +00:00
|
|
|
/**
|
2001-08-19 13:25:15 +00:00
|
|
|
* \file QParagraphDialog.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-02-14 19:43:56 +00:00
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
* \author Edwin Leuven
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-02-14 19:43:56 +00:00
|
|
|
*/
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "QParagraphDialog.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
#include "QParagraph.h"
|
2001-02-14 19:43:56 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#include <qlineedit.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qpushbutton.h>
|
2002-07-17 15:51:23 +00:00
|
|
|
#include <qvalidator.h>
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
#include "helper_funcs.h"
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
using std::vector;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
QParagraphDialog::QParagraphDialog(QParagraph * form)
|
|
|
|
: QParagraphDialogBase(0, 0, false, 0),
|
|
|
|
form_(form)
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2002-07-17 15:51:23 +00:00
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
form_, SLOT(slotOK()));
|
|
|
|
connect(applyPB, SIGNAL(clicked()),
|
|
|
|
form_, SLOT(slotApply()));
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form_, SLOT(slotClose()));
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
linespacingValue->setValidator(new QDoubleValidator(linespacingValue));
|
2002-09-24 13:57:09 +00:00
|
|
|
// disabled to allow glue spacing for latexperts
|
2002-09-11 17:53:15 +00:00
|
|
|
//valueAbove->setValidator(new QDoubleValidator(valueAbove));
|
|
|
|
//valueBelow->setValidator(new QDoubleValidator(valueBelow));
|
2001-02-14 19:43:56 +00:00
|
|
|
}
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
void QParagraphDialog::closeEvent(QCloseEvent * e)
|
2001-02-14 19:43:56 +00:00
|
|
|
{
|
2002-07-17 15:51:23 +00:00
|
|
|
form_->slotWMHide();
|
|
|
|
e->accept();
|
2001-02-14 19:43:56 +00:00
|
|
|
}
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
void QParagraphDialog::change_adaptor()
|
2001-02-14 19:43:56 +00:00
|
|
|
{
|
2002-07-17 15:51:23 +00:00
|
|
|
form_->changed();
|
2001-02-14 19:43:56 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
void QParagraphDialog::enableAbove(int)
|
2001-02-14 19:43:56 +00:00
|
|
|
{
|
2002-07-17 15:51:23 +00:00
|
|
|
bool const enable = spacingAbove->currentItem()==6;
|
|
|
|
valueAbove->setEnabled(enable);
|
|
|
|
unitAbove->setEnabled(enable);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2001-02-14 19:43:56 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
void QParagraphDialog::enableBelow(int)
|
2001-02-14 19:43:56 +00:00
|
|
|
{
|
2002-07-17 15:51:23 +00:00
|
|
|
bool const enable = spacingBelow->currentItem()==6;
|
|
|
|
valueBelow->setEnabled(enable);
|
|
|
|
unitBelow->setEnabled(enable);
|
2001-02-14 19:43:56 +00:00
|
|
|
}
|
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-07-17 15:51:23 +00:00
|
|
|
void QParagraphDialog::enableLinespacingValue(int)
|
2001-02-14 19:43:56 +00:00
|
|
|
{
|
2002-07-17 15:51:23 +00:00
|
|
|
bool const enable = linespacing->currentItem()==4;
|
|
|
|
linespacingValue->setEnabled(enable);
|
2001-02-14 19:43:56 +00:00
|
|
|
}
|