mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Embedding: mark buffer dirty after changing embedding status
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20253 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c5302d6e70
commit
3cdd9376f5
@ -83,6 +83,8 @@ void ControlEmbeddedFiles::view(EmbeddedFile const & item)
|
||||
|
||||
void ControlEmbeddedFiles::setEmbed(EmbeddedFile & item, bool embed, bool update)
|
||||
{
|
||||
if (item.embedded() == embed)
|
||||
return;
|
||||
item.setEmbed(embed);
|
||||
if (update) {
|
||||
if (embed)
|
||||
@ -91,6 +93,11 @@ void ControlEmbeddedFiles::setEmbed(EmbeddedFile & item, bool embed, bool update
|
||||
item.extract(&buffer());
|
||||
item.updateInsets(&buffer());
|
||||
}
|
||||
if (embed)
|
||||
dispatchMessage("Embed file " + item.outputFilename(buffer().filePath()));
|
||||
else
|
||||
dispatchMessage("Stop embedding file " + item.outputFilename(buffer().filePath()));
|
||||
buffer().markDirty();
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,14 +36,12 @@ void GuiEmbeddedFilesDialog::on_filesLW_itemChanged(QListWidgetItem* item)
|
||||
// this should not be needed after EmbeddedFiles are updated correctly.
|
||||
files.update();
|
||||
controller_.setEmbed(files[filesLW->row(item)], true, files.enabled());
|
||||
controller_.dispatchMessage("Embed file " + fromqstr(item->text()));
|
||||
} else {
|
||||
if (!files[filesLW->row(item)].embedded())
|
||||
return;
|
||||
// this should not be needed after EmbeddedFiles are updated correctly.
|
||||
files.update();
|
||||
controller_.setEmbed(files[filesLW->row(item)], false, files.enabled());
|
||||
controller_.dispatchMessage("Stop embedding file " + fromqstr(item->text()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user