2006-03-05 17:24:44 +00:00
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
|
* \file GuiNote.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiNote.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include "Qt2BC.h"
|
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "insets/InsetNote.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
|
#include <QCloseEvent>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2007-08-31 05:53:55 +00:00
|
|
|
|
// GuiNoteDialog
|
2007-04-25 10:57:54 +00:00
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiNoteDialog::GuiNoteDialog(GuiNote * form)
|
2007-04-25 10:57:54 +00:00
|
|
|
|
: form_(form)
|
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|
|
|
|
|
|
connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
|
|
|
|
|
connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
|
|
|
|
|
|
|
|
|
|
connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiNoteDialog::closeEvent(QCloseEvent * e)
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
|
|
|
|
form_->slotWMHide();
|
|
|
|
|
e->accept();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiNoteDialog::change_adaptor()
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2007-08-31 05:53:55 +00:00
|
|
|
|
// GuiNote
|
2007-04-25 10:57:54 +00:00
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiNote::GuiNote(Dialog & parent)
|
2007-08-31 22:16:11 +00:00
|
|
|
|
: GuiView<GuiNoteDialog>(parent, _("Note Settings"))
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiNote::build_dialog()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-08-31 05:53:55 +00:00
|
|
|
|
dialog_.reset(new GuiNoteDialog(this));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
bcview().setOK(dialog_->okPB);
|
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiNote::update_contents()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
QRadioButton * rb = 0;
|
|
|
|
|
|
|
|
|
|
switch (controller().params().type) {
|
|
|
|
|
case InsetNoteParams::Note:
|
|
|
|
|
rb = dialog_->noteRB;
|
|
|
|
|
break;
|
|
|
|
|
case InsetNoteParams::Comment:
|
|
|
|
|
rb = dialog_->commentRB;
|
|
|
|
|
break;
|
|
|
|
|
case InsetNoteParams::Greyedout:
|
|
|
|
|
rb = dialog_->greyedoutRB;
|
|
|
|
|
break;
|
2006-08-16 08:57:00 +00:00
|
|
|
|
case InsetNoteParams::Framed:
|
|
|
|
|
rb = dialog_->framedRB;
|
|
|
|
|
break;
|
|
|
|
|
case InsetNoteParams::Shaded:
|
|
|
|
|
rb = dialog_->shadedRB;
|
|
|
|
|
break;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rb->setChecked(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiNote::apply()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
InsetNoteParams::Type type;
|
|
|
|
|
|
|
|
|
|
if (dialog_->greyedoutRB->isChecked())
|
|
|
|
|
type = InsetNoteParams::Greyedout;
|
|
|
|
|
else if (dialog_->commentRB->isChecked())
|
|
|
|
|
type = InsetNoteParams::Comment;
|
2006-08-16 08:57:00 +00:00
|
|
|
|
else if (dialog_->framedRB->isChecked())
|
|
|
|
|
type = InsetNoteParams::Framed;
|
|
|
|
|
else if (dialog_->shadedRB->isChecked())
|
|
|
|
|
type = InsetNoteParams::Shaded;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
else
|
|
|
|
|
type = InsetNoteParams::Note;
|
|
|
|
|
|
|
|
|
|
controller().params().type = type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiNote_moc.cpp"
|