2001-03-26 19:34:45 +00:00
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
2001-06-05 17:05:51 +00:00
|
|
|
* LyX, The Document Processor
|
2001-03-26 19:34:45 +00:00
|
|
|
*
|
2001-06-05 17:05:51 +00:00
|
|
|
* Copyright 2000 The LyX Team.
|
2001-03-26 19:34:45 +00:00
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* \author Angus Leeming <a.leeming@ic.ac.uk>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <qdialog.h>
|
2001-08-25 03:00:19 +00:00
|
|
|
#include <qapplication.h>
|
2001-03-26 19:34:45 +00:00
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
#include "debug.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "QtLyXView.h"
|
2001-03-26 19:34:45 +00:00
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "Qt2Base.h"
|
2001-08-23 21:21:50 +00:00
|
|
|
#include "Qt2BC.h"
|
2001-03-26 19:34:45 +00:00
|
|
|
#include "support/LAssert.h"
|
|
|
|
|
2001-04-03 14:30:58 +00:00
|
|
|
Qt2Base::Qt2Base(ControlButtons & c, QString const & t)
|
2001-08-23 21:21:50 +00:00
|
|
|
: ViewBC<Qt2BC>(c), title_(t)
|
2001-03-26 19:34:45 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::show()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
if (!form()) {
|
|
|
|
build();
|
|
|
|
}
|
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
form()->setMinimumSize(form()->sizeHint());
|
|
|
|
|
2001-06-05 17:05:51 +00:00
|
|
|
update(); // make sure its up-to-date
|
|
|
|
|
|
|
|
if (form()->isVisible()) {
|
|
|
|
form()->raise();
|
|
|
|
} else {
|
2001-08-21 01:14:54 +00:00
|
|
|
form()->setCaption(title_);
|
2001-06-05 17:05:51 +00:00
|
|
|
form()->show();
|
|
|
|
}
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
void Qt2Base::reset()
|
|
|
|
{
|
|
|
|
qApp->processEvents();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-03-26 19:34:45 +00:00
|
|
|
void Qt2Base::hide()
|
|
|
|
{
|
2001-08-21 01:14:54 +00:00
|
|
|
if (form() && form()->isVisible())
|
2001-06-05 17:05:51 +00:00
|
|
|
form()->hide();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-23 21:21:50 +00:00
|
|
|
bool Qt2Base::isValid()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-21 01:14:54 +00:00
|
|
|
void Qt2Base::changed()
|
2001-03-26 19:34:45 +00:00
|
|
|
{
|
2001-08-23 21:21:50 +00:00
|
|
|
if (isValid())
|
|
|
|
bc().valid();
|
|
|
|
else
|
|
|
|
bc().invalid();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotWMHide()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
CancelButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotApply()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
ApplyButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotOK()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
OKButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
void Qt2Base::slotClose()
|
2001-03-26 19:34:45 +00:00
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
CancelButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Qt2Base::slotRestore()
|
|
|
|
{
|
2001-06-05 17:05:51 +00:00
|
|
|
RestoreButton();
|
2001-03-26 19:34:45 +00:00
|
|
|
}
|