Make Merge Changes dialog work in read only.

Make LFUN_CHANGES_MERGE active in read-only documents.

Remove dummy call to ButtonController::addReadonly and replace with
proper code.
This commit is contained in:
Jean-Marc Lasgouttes 2020-12-05 19:51:07 +01:00
parent e561358be9
commit f02311241a
2 changed files with 3 additions and 5 deletions

View File

@ -1048,7 +1048,7 @@ void LyXAction::init()
* \li Origin: Levon, 16 Oct 2002
* \endvar
*/
{ LFUN_CHANGES_MERGE, "changes-merge", Noop, Edit },
{ LFUN_CHANGES_MERGE, "changes-merge", ReadOnly, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_CHANGES_OUTPUT

View File

@ -46,8 +46,6 @@ GuiChanges::GuiChanges(GuiView & lv)
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel));
bc().addReadOnly(acceptPB);
bc().addReadOnly(rejectPB);
}
@ -60,8 +58,8 @@ void GuiChanges::updateContents()
Change const & c = bufferview()->getCurrentChange();
bool const changePresent = c.type != Change::UNCHANGED;
rejectPB->setEnabled(changePresent);
acceptPB->setEnabled(changePresent);
rejectPB->setEnabled(changePresent && !isBufferReadonly());
acceptPB->setEnabled(changePresent && !isBufferReadonly());
bool const inserted = c.type == Change::INSERTED;
QString text;