}
-ControlRef & GuiRefDialog::controller() const
+ControlRef & GuiRefDialog::controller()
{
- return static_cast<ControlRef &>(Dialog::controller());
-}
-
-
-void GuiRefDialog::showView()
-{
- QDialog::show();
+ return static_cast<ControlRef &>(GuiDialog::controller());
}
void GuiRefDialog::selectionChanged()
{
- if (readOnly())
+ if (controller().isBufferReadonly())
return;
QList<QListWidgetItem *> selections = refsLW->selectedItems();
void GuiRefDialog::refHighlighted(QListWidgetItem * sel)
{
- if (readOnly())
+ if (controller().isBufferReadonly())
return;
/* int const cur_item = refsLW->currentRow();
void GuiRefDialog::refSelected(QListWidgetItem * sel)
{
- if (readOnly())
+ if (controller().isBufferReadonly())
return;
/* int const cur_item = refsLW->currentRow();
void GuiRefDialog::closeEvent(QCloseEvent * e)
{
- slotWMHide();
+ slotClose();
reset_dialog();
e->accept();
}
-void GuiRefDialog::update_contents()
+void GuiRefDialog::updateContents()
{
InsetCommandParams const & params = controller().params();
referenceED->setText(toqstr(params["reference"]));
nameED->setText(toqstr(params["name"]));
- nameED->setReadOnly(!nameAllowed() && !readOnly());
+ nameED->setReadOnly(!nameAllowed() && !controller().isBufferReadonly());
// restore type settings for new insets
if (params["reference"].empty())
typeCO->setCurrentIndex(orig_type);
else
typeCO->setCurrentIndex(InsetRef::getType(params.getCmdName()));
- typeCO->setEnabled(typeAllowed() && !readOnly());
+ typeCO->setEnabled(typeAllowed() && !controller().isBufferReadonly());
if (!typeAllowed())
typeCO->setCurrentIndex(0);
bool GuiRefDialog::nameAllowed()
{
- Kernel::DocType const doc_type = kernel().docType();
- return doc_type != Kernel::LATEX &&
- doc_type != Kernel::LITERATE;
+ KernelDocType const doc_type = controller().docType();
+ return doc_type != LATEX && doc_type != LITERATE;
}
bool GuiRefDialog::typeAllowed()
{
- Kernel::DocType const doc_type = kernel().docType();
- return doc_type != Kernel::DOCBOOK;
+ return controller().docType() != DOCBOOK;
}
void GuiRefDialog::gotoRef()
{
- string ref(fromqstr(referenceED->text()));
+ string ref = fromqstr(referenceED->text());
if (at_ref_) {
// go back