2003-07-15 12:48:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file QNote.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
2003-09-07 01:45:40 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
2003-07-15 12:48:24 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-07-15 12:48:24 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2003-09-29 10:50:51 +00:00
|
|
|
|
#include "debug.h"
|
2003-07-15 12:48:24 +00:00
|
|
|
|
#include "ControlNote.h"
|
|
|
|
|
#include "insets/insetnote.h"
|
|
|
|
|
|
|
|
|
|
#include <qradiobutton.h>
|
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
|
|
|
|
|
|
#include "QNoteDialog.h"
|
|
|
|
|
#include "QNote.h"
|
|
|
|
|
#include "Qt2BC.h"
|
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
using std::string;
|
|
|
|
|
|
2003-07-15 12:48:24 +00:00
|
|
|
|
|
|
|
|
|
typedef QController<ControlNote, QView<QNoteDialog> > base_class;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QNote::QNote(Dialog & parent)
|
2003-07-30 13:43:15 +00:00
|
|
|
|
: base_class(parent, _("LyX: Note Settings"))
|
2003-07-15 12:48:24 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QNote::build_dialog()
|
|
|
|
|
{
|
|
|
|
|
dialog_.reset(new QNoteDialog(this));
|
|
|
|
|
|
|
|
|
|
bcview().setOK(dialog_->okPB);
|
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QNote::update_contents()
|
|
|
|
|
{
|
|
|
|
|
QRadioButton * rb = 0;
|
|
|
|
|
string type(controller().params().type);
|
|
|
|
|
|
|
|
|
|
if (type == "Note")
|
|
|
|
|
rb = dialog_->noteRB;
|
|
|
|
|
else if (type == "Comment")
|
|
|
|
|
rb = dialog_->commentRB;
|
|
|
|
|
else if (type == "Greyedout")
|
|
|
|
|
rb = dialog_->greyedoutRB;
|
|
|
|
|
|
|
|
|
|
rb->setChecked(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QNote::apply()
|
|
|
|
|
{
|
|
|
|
|
string type;
|
|
|
|
|
|
|
|
|
|
if (dialog_->greyedoutRB->isChecked())
|
|
|
|
|
type = "Greyedout";
|
|
|
|
|
else if (dialog_->commentRB->isChecked())
|
|
|
|
|
type = "Comment";
|
|
|
|
|
else
|
|
|
|
|
type = "Note";
|
|
|
|
|
|
|
|
|
|
controller().params().type = type;
|
|
|
|
|
}
|