]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiRef.cpp
some remnaming
[lyx.git] / src / frontends / qt4 / GuiRef.cpp
index 91979cb0c0737fafa6b91e2fe0b67ba39f0662a5..cdb6e59c9440da780fd3add1b48427648fd03c20 100644 (file)
@@ -88,9 +88,9 @@ GuiRefDialog::GuiRefDialog(LyXView & lv)
 }
 
 
-ControlRef & GuiRefDialog::controller() const
+ControlRef & GuiRefDialog::controller()
 {
-       return static_cast<ControlRef &>(Dialog::controller());
+       return static_cast<ControlRef &>(GuiDialog::controller());
 }
 
 
@@ -107,7 +107,7 @@ void GuiRefDialog::gotoClicked()
 
 void GuiRefDialog::selectionChanged()
 {
-       if (readOnly())
+       if (controller().isBufferReadonly())
                return;
 
        QList<QListWidgetItem *> selections = refsLW->selectedItems();
@@ -121,7 +121,7 @@ void GuiRefDialog::selectionChanged()
 
 void GuiRefDialog::refHighlighted(QListWidgetItem * sel)
 {
-       if (readOnly())
+       if (controller().isBufferReadonly())
                return;
 
 /*     int const cur_item = refsLW->currentRow();
@@ -144,7 +144,7 @@ void GuiRefDialog::refHighlighted(QListWidgetItem * sel)
 
 void GuiRefDialog::refSelected(QListWidgetItem * sel)
 {
-       if (readOnly())
+       if (controller().isBufferReadonly())
                return;
 
 /*     int const cur_item = refsLW->currentRow();
@@ -181,13 +181,13 @@ void GuiRefDialog::reset_dialog()
 
 void GuiRefDialog::closeEvent(QCloseEvent * e)
 {
-       slotWMHide();
+       slotClose();
        reset_dialog();
        e->accept();
 }
 
 
-void GuiRefDialog::update_contents()
+void GuiRefDialog::updateContents()
 {
        InsetCommandParams const & params = controller().params();
 
@@ -196,14 +196,14 @@ void GuiRefDialog::update_contents()
        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);
 
@@ -244,16 +244,14 @@ void GuiRefDialog::applyView()
 
 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;
 }
 
 
@@ -275,7 +273,7 @@ void GuiRefDialog::setGotoRef()
 
 void GuiRefDialog::gotoRef()
 {
-       string ref(fromqstr(referenceED->text()));
+       string ref = fromqstr(referenceED->text());
 
        if (at_ref_) {
                // go back