2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiBibitem.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 John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiBibitem.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
#include "qt_helpers.h"
|
2007-10-07 10:31:37 +00:00
|
|
|
#include "FuncRequest.h"
|
|
|
|
|
2007-04-25 08:42:22 +00:00
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QPushButton>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiBibitem::GuiBibitem(GuiView & lv)
|
2008-02-05 12:43:19 +00:00
|
|
|
: GuiCommand(lv, "bibitem", qt_("Bibliography Entry Settings"))
|
2007-04-25 08:42:22 +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 08:42:22 +00:00
|
|
|
|
2007-10-07 10:31:37 +00:00
|
|
|
connect(keyED, SIGNAL(textChanged(QString)),
|
2007-04-25 08:42:22 +00:00
|
|
|
this, SLOT(change_adaptor()));
|
2007-10-07 10:31:37 +00:00
|
|
|
connect(labelED, SIGNAL(textChanged(QString)),
|
2007-04-25 08:42:22 +00:00
|
|
|
this, SLOT(change_adaptor()));
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().setPolicy(ButtonPolicy::OkCancelReadOnlyPolicy);
|
|
|
|
bc().setOK(okPB);
|
|
|
|
bc().setCancel(closePB);
|
|
|
|
bc().addReadOnly(keyED);
|
|
|
|
bc().addReadOnly(labelED);
|
2007-04-25 08:42:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 10:31:37 +00:00
|
|
|
void GuiBibitem::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-07 10:31:37 +00:00
|
|
|
void GuiBibitem::updateContents()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-10-07 10:31:37 +00:00
|
|
|
keyED->setText(toqstr(params_["key"]));
|
|
|
|
labelED->setText(toqstr(params_["label"]));
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 10:31:37 +00:00
|
|
|
void GuiBibitem::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-10-07 10:31:37 +00:00
|
|
|
params_["key"] = qstring_to_ucs4(keyED->text());
|
|
|
|
params_["label"] = qstring_to_ucs4(labelED->text());
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-07 10:31:37 +00:00
|
|
|
bool GuiBibitem::isValid()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
return !keyED->text().isEmpty();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
2007-10-07 10:31:37 +00:00
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
|
2007-10-07 10:31:37 +00:00
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-25 08:42:22 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiBibitem_moc.cpp"
|