]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiChanges.cpp
Avoid deprecation warnings
[features.git] / src / frontends / qt / GuiChanges.cpp
index e6363cd6becf32132e9350b2de625c6e8d2ceba9..eda161d0d54fc67ee0c82e2cb249239d5ceb106f 100644 (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;
@@ -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