lyx_mirror/src/frontends/qt2/FormTocDialog.C
Kalle Dalheimer 67dc240bc9 quick fix to make qt2 compile
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1808 a592a061-630c-0410-9148-cb99ea01b6c8
2001-03-23 06:31:30 +00:00

88 lines
1.6 KiB
C

#include <config.h>
#include <debug.h>
#include "FormTocDialog.h"
#include "Dialogs.h"
#include "FormToc.h"
#include <qlistview.h>
/*
* Constructs a FormTocDialog which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
FormTocDialog::FormTocDialog( FormToc* form_, QWidget* parent, const char* name, bool modal, WFlags fl )
: FormTocDialogBase( parent, name, modal, fl ),
form( form_ )
{
}
/*
* Destroys the object and frees any allocated resources
*/
FormTocDialog::~FormTocDialog()
{
// no need to delete child widgets, Qt does it all for us
}
/*
* public slot
*/
void FormTocDialog::activate_adaptor(int index)
{
switch (index) {
case 0:
form->set_type(Buffer::TOC_TOC);
break;
case 1:
form->set_type(Buffer::TOC_LOF);
break;
case 2:
form->set_type(Buffer::TOC_LOT);
break;
case 3:
form->set_type(Buffer::TOC_LOA);
break;
default:
lyxerr[Debug::GUI] << "Unknown TOC combo selection." << std::endl;
break;
}
}
/*
* public slot
*/
void FormTocDialog::close_adaptor()
{
form->close();
hide();
}
/*
* public slot
*/
void FormTocDialog::depth_adaptor(int depth)
{
form->set_depth(depth);
}
/*
* public slot
*/
void FormTocDialog::select_adaptor(QListViewItem* item)
{
form->select(item->text(0));
}
/*
* public slot
*/
void FormTocDialog::update_adaptor()
{
form->update();
}
void FormTocDialog::closeEvent(QCloseEvent *e)
{
form->close();
e->accept();
}