X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiChanges.cpp;h=eda161d0d54fc67ee0c82e2cb249239d5ceb106f;hb=070270fdc719edcd0ae49a182acf58583038a765;hp=e6363cd6becf32132e9350b2de625c6e8d2ceba9;hpb=43b16548b473d93b26489d8c4bbd9bf1e903a35f;p=features.git diff --git a/src/frontends/qt/GuiChanges.cpp b/src/frontends/qt/GuiChanges.cpp index e6363cd6be..eda161d0d5 100644 --- a/src/frontends/qt/GuiChanges.cpp +++ b/src/frontends/qt/GuiChanges.cpp @@ -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; @@ -72,8 +70,9 @@ void GuiChanges::updateContents() text += inserted ? qt_("Inserted by %1").arg(author) : qt_("Deleted by %1").arg(author); - QString const date = QDateTime::fromTime_t(c.changetime) - .toString(Qt::DefaultLocaleLongDate); + QString const date = + QLocale().toString(QDateTime::fromTime_t(c.changetime), + QLocale::LongFormat); if (!date.isEmpty()) { if (!author.isEmpty()) text += qt_(" on[[date]] %1").arg(date); @@ -125,9 +124,6 @@ void GuiChanges::rejectChange() } -Dialog * createGuiChanges(GuiView & lv) { return new GuiChanges(lv); } - - } // namespace frontend } // namespace lyx