/// Current ratio between physical pixels and device-independent pixels
double pixelRatio() const {
#if QT_VERSION >= 0x050000
- return devicePixelRatio();
+ return qt_scale_factor * devicePixelRatio();
#else
return 1.0;
#endif
Buffer const & buf = wa->bufferView().buffer();
// Set the windows title
docstring title = buf.fileName().displayName(130) + from_ascii("[*]");
+ if (buf.notifiesExternalModification()) {
+ title = bformat(_("%1$s (modified externally)"), title);
+ // If the external modification status has changed, then maybe the status of
+ // buffer-save has changed too.
+ updateToolbars();
+ }
#ifndef Q_WS_MAC
title += from_ascii(" - LyX");
#endif
double GuiView::pixelRatio() const
{
#if QT_VERSION >= 0x050000
- return devicePixelRatio();
+ return qt_scale_factor * devicePixelRatio();
#else
return 1.0;
#endif
case LFUN_BUFFER_RELOAD:
enable = doc_buffer && !doc_buffer->isUnnamed()
- && doc_buffer->fileName().exists()
- && (!doc_buffer->isClean()
- || doc_buffer->isExternallyModified(Buffer::timestamp_method));
+ && doc_buffer->fileName().exists() && !doc_buffer->isClean();
break;
case LFUN_BUFFER_CHILD_OPEN:
break;
}
+ case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
+ enable = doc_buffer && doc_buffer->notifiesExternalModification();
+ break;
+
case LFUN_BUFFER_WRITE_AS:
case LFUN_BUFFER_EXPORT_AS:
enable = doc_buffer != 0;
BufferList::iterator const bend = theBufferList().end();
for (; bit != bend; ++bit) {
Buffer * buf = *bit;
- if (buf->fileName().exists()
- && buf->isExternallyModified(Buffer::checksum_method)) {
+ if (buf->fileName().exists() && buf->isChecksumModified()) {
docstring text = bformat(_("Document \n%1$s\n has been externally modified."
" Reload now? Any local changes will be lost."),
from_utf8(buf->absFileName()));
else
target_dir = doc_buffer->fileName().onlyPath();
+ string const format = (argument.empty() || argument == "default") ?
+ doc_buffer->params().getDefaultOutputFormat() : argument;
+
if ((dest.empty() && doc_buffer->isUnnamed())
|| !target_dir.isDirWritable()) {
- exportBufferAs(*doc_buffer, cmd.argument());
+ exportBufferAs(*doc_buffer, from_utf8(format));
break;
}
/* TODO/Review: Is it a problem to also export the children?
See the update_unincluded flag */
- d.asyncBufferProcessing(argument,
+ d.asyncBufferProcessing(format,
doc_buffer,
_("Exporting ..."),
&GuiViewPrivate::exportAndDestroy,
break;
}
+ case LFUN_BUFFER_EXTERNAL_MODIFICATION_CLEAR:
+ LASSERT(doc_buffer, break);
+ doc_buffer->clearExternalModification();
+ break;
+
case LFUN_BUFFER_CLOSE:
closeBuffer();
break;