Embedding: mark buffer dirty after enable/disable bundling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20254 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-09-13 04:56:46 +00:00
parent 3cdd9376f5
commit eb04266ab9
3 changed files with 16 additions and 7 deletions

View File

@ -67,6 +67,19 @@ void ControlEmbeddedFiles::dispatchMessage(string const & msg)
} }
void ControlEmbeddedFiles::setEmbedding(bool enable)
{
if (embeddedFiles().enabled() == enable)
return;
embeddedFiles().enable(enable);
buffer().markDirty();
if (enable)
dispatchMessage("Stop saving in bundled format.");
else
dispatchMessage("Save in bundled format.");
}
void ControlEmbeddedFiles::goTo(EmbeddedFile const & item, int idx) void ControlEmbeddedFiles::goTo(EmbeddedFile const & item, int idx)
{ {
BOOST_ASSERT(idx < item.refCount()); BOOST_ASSERT(idx < item.refCount());

View File

@ -44,6 +44,8 @@ public:
/// ///
void dispatchParams() {}; void dispatchParams() {};
/// ///
void setEmbedding(bool enable);
///
void goTo(EmbeddedFile const & item, int idx); void goTo(EmbeddedFile const & item, int idx);
/// ///
void view(EmbeddedFile const & item); void view(EmbeddedFile const & item);

View File

@ -199,13 +199,7 @@ void GuiEmbeddedFilesDialog::on_updatePB_clicked()
void GuiEmbeddedFilesDialog::on_enableCB_toggled(bool enable) void GuiEmbeddedFilesDialog::on_enableCB_toggled(bool enable)
{ {
// controller_.setEmbedding(enable);
controller_.embeddedFiles().enable(enable);
// immediately post the change to buffer (and bufferView)
if (enable)
controller_.dispatchMessage("Enable file embedding");
else
controller_.dispatchMessage("Disable file embedding");
} }