mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Embedding patch 4: interaction between buffer and the embedding dialog. Emit embeddingChanged signal to update the embedding dialog.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20038 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
960af8f370
commit
3611b0ff33
@ -144,6 +144,8 @@ public:
|
||||
boost::signal<void()> changed;
|
||||
/// This signal is emitted when the buffer structure is changed.
|
||||
boost::signal<void()> structureChanged;
|
||||
/// This signal is emitted when an embedded file is changed
|
||||
boost::signal<void()> embeddingChanged;
|
||||
/// This signal is emitted when some parsing error shows up.
|
||||
boost::signal<void(std::string)> errors;
|
||||
/// This signal is emitted when some message shows up.
|
||||
|
@ -621,6 +621,11 @@ void updateLabels(Buffer const & buf, bool childonly)
|
||||
cbuf.tocBackend().update();
|
||||
if (!childonly)
|
||||
cbuf.structureChanged();
|
||||
// FIXME
|
||||
// the embedding signal is emitted with structureChanged signal
|
||||
// this is inaccurate so these two will be separated later.
|
||||
cbuf.embeddedFiles().update();
|
||||
cbuf.embeddingChanged();
|
||||
}
|
||||
|
||||
|
||||
|
@ -170,6 +170,10 @@ void LyXView::connectBuffer(Buffer & buf)
|
||||
buf.getMasterBuffer()->structureChanged.connect(
|
||||
boost::bind(&LyXView::updateToc, this));
|
||||
|
||||
bufferEmbeddingChangedConnection_ =
|
||||
buf.embeddingChanged.connect(
|
||||
boost::bind(&LyXView::updateEmbeddedFiles, this));
|
||||
|
||||
errorsConnection_ =
|
||||
buf.errors.connect(
|
||||
boost::bind(&LyXView::showErrorList, this, _1));
|
||||
@ -200,6 +204,7 @@ void LyXView::disconnectBuffer()
|
||||
{
|
||||
errorsConnection_.disconnect();
|
||||
bufferStructureChangedConnection_.disconnect();
|
||||
bufferEmbeddingChangedConnection_.disconnect();
|
||||
messageConnection_.disconnect();
|
||||
busyConnection_.disconnect();
|
||||
titleConnection_.disconnect();
|
||||
@ -291,6 +296,12 @@ void LyXView::updateToc()
|
||||
}
|
||||
|
||||
|
||||
void LyXView::updateEmbeddedFiles()
|
||||
{
|
||||
updateDialog("embedding", "");
|
||||
}
|
||||
|
||||
|
||||
void LyXView::updateToolbars()
|
||||
{
|
||||
WorkArea * wa = currentWorkArea();
|
||||
|
@ -215,6 +215,8 @@ private:
|
||||
|
||||
/// buffer structure changed signal connection
|
||||
boost::signals::connection bufferStructureChangedConnection_;
|
||||
/// embedded file change signal connection
|
||||
boost::signals::connection bufferEmbeddingChangedConnection_;
|
||||
/// buffer errors signal connection
|
||||
boost::signals::connection errorsConnection_;
|
||||
/// buffer messages signal connection
|
||||
@ -255,6 +257,8 @@ private:
|
||||
protected:
|
||||
///
|
||||
void updateToc();
|
||||
///
|
||||
void updateEmbeddedFiles();
|
||||
|
||||
private:
|
||||
int id_;
|
||||
|
@ -55,7 +55,7 @@ void ControlEmbeddedFiles::updateEmbeddedFiles()
|
||||
{
|
||||
// copy buffer embeddedFiles to a local copy
|
||||
kernel().buffer().embeddedFiles().update();
|
||||
//kernel().buffer().embeddingChanged();
|
||||
kernel().buffer().embeddingChanged();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user