mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
Document->Settings: add currently embedded files
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21284 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e7768ff98e
commit
eabe6081c9
@ -18,6 +18,7 @@
|
||||
#include "Buffer.h"
|
||||
#include "BufferParams.h"
|
||||
#include "BufferView.h"
|
||||
#include "EmbeddedFiles.h"
|
||||
#include "Encoding.h"
|
||||
#include "FloatPlacement.h"
|
||||
#include "frontend_helpers.h"
|
||||
@ -628,6 +629,28 @@ GuiDocument::GuiDocument(LyXView & lv)
|
||||
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()),
|
||||
|
Loading…
Reference in New Issue
Block a user