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.
|
|
|
|
|
*
|
2007-10-05 20:43:26 +00:00
|
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* \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"
|
2007-10-05 20:43:26 +00:00
|
|
|
|
#include "FuncRequest.h"
|
2007-11-29 07:04:28 +00:00
|
|
|
|
#include "support/gettext.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "insets/InsetNote.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
|
using namespace std;
|
2007-10-05 20:43:26 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
|
GuiNote::GuiNote(GuiView & lv)
|
2008-02-05 12:43:19 +00:00
|
|
|
|
: GuiDialog(lv, "note", qt_("Note Settings"))
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
|
|
|
|
connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
|
|
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
|
bc().setOK(okPB);
|
|
|
|
|
bc().setCancel(closePB);
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-10-05 20:43:26 +00:00
|
|
|
|
void GuiNote::change_adaptor()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
changed();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-10-05 20:43:26 +00:00
|
|
|
|
void GuiNote::updateContents()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-10-05 20:43:26 +00:00
|
|
|
|
switch (params_.type) {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
case InsetNoteParams::Note:
|
2007-10-05 20:43:26 +00:00
|
|
|
|
noteRB->setChecked(true);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case InsetNoteParams::Comment:
|
2007-10-05 20:43:26 +00:00
|
|
|
|
commentRB->setChecked(true);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case InsetNoteParams::Greyedout:
|
2007-10-05 20:43:26 +00:00
|
|
|
|
greyedoutRB->setChecked(true);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-10-05 20:43:26 +00:00
|
|
|
|
void GuiNote::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (greyedoutRB->isChecked())
|
2007-10-05 20:43:26 +00:00
|
|
|
|
params_.type = InsetNoteParams::Greyedout;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
else if (commentRB->isChecked())
|
2007-10-05 20:43:26 +00:00
|
|
|
|
params_.type = InsetNoteParams::Comment;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
else
|
2007-10-05 20:43:26 +00:00
|
|
|
|
params_.type = InsetNoteParams::Note;
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-10-05 20:43:26 +00:00
|
|
|
|
bool GuiNote::initialiseParams(string const & data)
|
|
|
|
|
{
|
2008-03-27 22:26:24 +00:00
|
|
|
|
InsetNote::string2params(data, params_);
|
2007-10-05 20:43:26 +00:00
|
|
|
|
return true;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-10-05 20:43:26 +00:00
|
|
|
|
|
|
|
|
|
void GuiNote::clearParams()
|
|
|
|
|
{
|
|
|
|
|
params_ = InsetNoteParams();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiNote::dispatchParams()
|
|
|
|
|
{
|
2008-03-27 22:26:24 +00:00
|
|
|
|
dispatch(FuncRequest(getLfun(), InsetNote::params2string(params_)));
|
2007-10-05 20:43:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
|
Dialog * createGuiNote(GuiView & lv) { return new GuiNote(lv); }
|
2007-10-05 20:43:26 +00:00
|
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiNote_moc.cpp"
|