X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiChanges.cpp;h=b2f809b026a5bd9c620f339dd060552d09e551d7;hb=cc257b4927f8833836a6f6caab6f91c5022063db;hp=e6363cd6becf32132e9350b2de625c6e8d2ceba9;hpb=43b16548b473d93b26489d8c4bbd9bf1e903a35f;p=lyx.git diff --git a/src/frontends/qt/GuiChanges.cpp b/src/frontends/qt/GuiChanges.cpp index e6363cd6be..b2f809b026 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,15 @@ 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); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) + QString const date = + QLocale().toString(QDateTime::fromSecsSinceEpoch(c.changetime), + QLocale::LongFormat); +#else + QString const date = + QLocale().toString(QDateTime::fromTime_t(c.changetime), + QLocale::LongFormat); +#endif if (!date.isEmpty()) { if (!author.isEmpty()) text += qt_(" on[[date]] %1").arg(date); @@ -125,9 +130,6 @@ void GuiChanges::rejectChange() } -Dialog * createGuiChanges(GuiView & lv) { return new GuiChanges(lv); } - - } // namespace frontend } // namespace lyx