diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index fc46e8ab72..b4972b541a 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -626,31 +626,6 @@ GuiDocument::GuiDocument(LyXView & lv) // embedded files embeddedFilesModule = new UiWidget; - connect(embeddedFilesModule, SIGNAL(changed()), - this, SLOT(change_adaptor())); - - // add current embedded files - EmbeddedFiles & files = buffer().embeddedFiles(); - files.update(); - EmbeddedFiles::EmbeddedFileList::iterator fit = files.begin(); - EmbeddedFiles::EmbeddedFileList::iterator fit_end = files.end(); - for (; fit != fit_end; ++fit) { - QString label = toqstr(fit->relFilename(buffer().filePath())); - if (fit->refCount() > 1) - label += " (" + QString::number(fit->refCount()) + ")"; - QListWidgetItem * item = new QListWidgetItem(label); - Qt::ItemFlags flag = Qt::ItemIsSelectable; - if (!buffer().isReadonly()) - flag |= Qt::ItemIsUserCheckable; - item->setFlags(flag); - if(fit->embedded()) - item->setCheckState(Qt::Checked); - else - item->setCheckState(Qt::Unchecked); - // index of the currently used ParConstIterator - embeddedFilesModule->filesLW->addItem(item); - } - connect(embeddedFilesModule->bundleCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); connect(embeddedFilesModule->addPB, SIGNAL(clicked()), @@ -997,6 +972,31 @@ void GuiDocument::updateModuleInfo() } +void GuiDocument::updateEmbeddedFileList() +{ + embeddedFilesModule->filesLW->clear(); + // add current embedded files + EmbeddedFiles & files = buffer().embeddedFiles(); + files.update(); + EmbeddedFiles::EmbeddedFileList::iterator fit = files.begin(); + EmbeddedFiles::EmbeddedFileList::iterator fit_end = files.end(); + for (; fit != fit_end; ++fit) { + QString label = toqstr(fit->relFilename(buffer().filePath())); + if (fit->refCount() > 1) + label += " (" + QString::number(fit->refCount()) + ")"; + QListWidgetItem * item = new QListWidgetItem(label); + item->setFlags(item->flags() | Qt::ItemIsSelectable + | Qt::ItemIsUserCheckable); + if(fit->embedded()) + item->setCheckState(Qt::Checked); + else + item->setCheckState(Qt::Unchecked); + // index of the currently used ParConstIterator + embeddedFilesModule->filesLW->addItem(item); + } +} + + void GuiDocument::updateNumbering() { TextClass const & tclass = bp_.getTextClass(); @@ -1603,6 +1603,9 @@ void GuiDocument::updateParams(BufferParams const & params) pdfSupportModule->optionsLE->setText( toqstr(pdf.quoted_options)); + + // embedded files + updateEmbeddedFileList(); } diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index 424fc33e4f..fcab1802f1 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -108,6 +108,7 @@ private Q_SLOTS: void portraitChanged(); void classChanged(); void updateModuleInfo(); + void updateEmbeddedFileList(); private: void closeEvent(QCloseEvent * e);