svn path=/trunk/kdenlive/; revision=3960
14 files changed:
for (int i = 0; i < children.count(); i++) {
collindingItems.removeAll(children.at(i));
}
for (int i = 0; i < children.count(); i++) {
collindingItems.removeAll(children.at(i));
}
if (!collindingItems.isEmpty()) {
bool forwardMove = xpos > start.x();
int offset = 0;
if (!collindingItems.isEmpty()) {
bool forwardMove = xpos > start.x();
int offset = 0;
+int ClipManager::clipsCount() const
+{
+ return m_clipList.count();
+}
+
+
AbstractGroupItem *createGroup();
void removeGroup(AbstractGroupItem *group);
QDomElement groupsXml() const;
AbstractGroupItem *createGroup();
void removeGroup(AbstractGroupItem *group);
QDomElement groupsXml() const;
+ int clipsCount() const;
public slots:
void updatePreviewSettings();
public slots:
void updatePreviewSettings();
if (!collision)
m_selectionGroup->translate(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0);
//m_selectionGroup->setPos(mappedXPos + (((int) m_selectionGroup->boundingRect().topLeft().x() + 0.5) - mappedClick) , m_selectionGroup->pos().y());
if (!collision)
m_selectionGroup->translate(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0);
//m_selectionGroup->setPos(mappedXPos + (((int) m_selectionGroup->boundingRect().topLeft().x() + 0.5) - mappedClick) , m_selectionGroup->pos().y());
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->parentItem() == 0 && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
rectUnion = rectUnion.united(selection.at(i)->sceneBoundingRect());
for (int i = 0; i < selection.count(); i++) {
if (selection.at(i)->parentItem() == 0 && (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET || selection.at(i)->type() == GROUPWIDGET)) {
rectUnion = rectUnion.united(selection.at(i)->sceneBoundingRect());
- }
- else if (selection.at(i)->parentItem()) {
+ } else if (selection.at(i)->parentItem()) {
rectUnion = rectUnion.united(selection.at(i)->parentItem()->sceneBoundingRect());
}
}
rectUnion = rectUnion.united(selection.at(i)->parentItem()->sceneBoundingRect());
}
}
// Make sure there is no group in the way
QRectF rect(pos.frames(m_document->fps()), track * m_tracksHeight + m_tracksHeight / 2, sceneRect().width() - pos.frames(m_document->fps()), m_tracksHeight / 2 - 2);
// Make sure there is no group in the way
QRectF rect(pos.frames(m_document->fps()), track * m_tracksHeight + m_tracksHeight / 2, sceneRect().width() - pos.frames(m_document->fps()), m_tracksHeight / 2 - 2);
bool isOk;
QList<QGraphicsItem *> items = checkForGroups(rect, isOk);
if (!isOk) {
bool isOk;
QList<QGraphicsItem *> items = checkForGroups(rect, isOk);
if (!isOk) {
deleteProducers();
}
QString id = producer->get("id");
deleteProducers();
}
QString id = producer->get("id");
- kDebug() << "// set prod: " << id;
if (id.contains('_')) {
// this is a subtrack producer, insert it at correct place
id = id.section('_', 1);
if (id.contains('_')) {
// this is a subtrack producer, insert it at correct place
id = id.section('_', 1);
m_commandStack(new QUndoStack(undoGroup)),
m_modified(false),
m_projectFolder(projectFolder),
m_commandStack(new QUndoStack(undoGroup)),
m_modified(false),
m_projectFolder(projectFolder),
- m_documentLoadingStep(0.0),
- m_documentLoadingProgress(0),
m_abortLoading(false)
{
m_clipManager = new ClipManager(this);
m_abortLoading(false)
{
m_clipManager = new ClipManager(this);
if (!success) // It is corrupted
KMessageBox::error(parent, errorMsg);
else {
if (!success) // It is corrupted
KMessageBox::error(parent, errorMsg);
else {
- parent->slotGotProgressInfo(i18n("Validating file %1", m_url.path()), 0);
+ parent->slotGotProgressInfo(i18n("Validating"), 0);
DocumentValidator validator(m_document);
success = validator.isProject();
if (!success) {
// It is not a project file
DocumentValidator validator(m_document);
success = validator.isProject();
if (!success) {
// It is not a project file
- parent->slotGotProgressInfo(i18n("File %1 is not a Kdenlive project file.", m_url.path()), 0);
- }
- else {
+ parent->slotGotProgressInfo(i18n("File %1 is not a Kdenlive project file", m_url.path()), 0);
+ } else {
/*
* Validate the file against the current version (upgrade
* and recover it if needed). It is NOT a passive operation
/*
* Validate the file against the current version (upgrade
* and recover it if needed). It is NOT a passive operation
// TODO: backup the document or alert the user?
success = validator.validate(DOCUMENTVERSION);
if (success) { // Let the validator handle error messages
// TODO: backup the document or alert the user?
success = validator.validate(DOCUMENTVERSION);
if (success) { // Let the validator handle error messages
- parent->slotGotProgressInfo(i18n("Loading file %1", m_url.path()), 0);
+ parent->slotGotProgressInfo(i18n("Loading"), 0);
QDomElement mlt = m_document.firstChildElement("mlt");
QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
QDomElement mlt = m_document.firstChildElement("mlt");
QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
}
QDomNodeList producers = m_document.elementsByTagName("producer");
QDomNodeList infoproducers = m_document.elementsByTagName("kdenlive_producer");
}
QDomNodeList producers = m_document.elementsByTagName("producer");
QDomNodeList infoproducers = m_document.elementsByTagName("kdenlive_producer");
+ parent->slotGotProgressInfo(i18n("Check missing clips"), 0);
if (checkDocumentClips(infoproducers) == false) m_abortLoading = true;
const int max = producers.count();
const int infomax = infoproducers.count();
if (checkDocumentClips(infoproducers) == false) m_abortLoading = true;
const int max = producers.count();
const int infomax = infoproducers.count();
m_clipManager->addFolder(e.attribute("id"), e.attribute("name"));
}
m_clipManager->addFolder(e.attribute("id"), e.attribute("name"));
}
- /*if (max > 0) {
- m_documentLoadingStep = 100.0 / (max + infomax + m_document.elementsByTagName("entry").count());
- parent->slotGotProgressInfo(i18n("Loading project clips"), (int) m_documentLoadingProgress);
- }*/
-
-
for (int i = 0; i < infomax && !m_abortLoading; i++) {
e = infoproducers.item(i).cloneNode().toElement();
for (int i = 0; i < infomax && !m_abortLoading; i++) {
e = infoproducers.item(i).cloneNode().toElement();
- /*if (m_documentLoadingStep > 0) {
- m_documentLoadingProgress += m_documentLoadingStep;
- parent->slotGotProgressInfo(QString(), (int) m_documentLoadingProgress);
- // QApp->processEvents();
- }*/
QString prodId = e.attribute("id");
if (!e.isNull() && prodId != "black" && !prodId.startsWith("slowmotion") && !m_abortLoading) {
e.setTagName("producer");
QString prodId = e.attribute("id");
if (!e.isNull() && prodId != "black" && !prodId.startsWith("slowmotion") && !m_abortLoading) {
e.setTagName("producer");
emit progressInfo(message, progress);
}
emit progressInfo(message, progress);
}
-void KdenliveDoc::loadingProgressed()
-{
- m_documentLoadingProgress += m_documentLoadingStep;
- emit progressInfo(QString(), (int) m_documentLoadingProgress);
-}
-
QUndoStack *KdenliveDoc::commandStack()
{
return m_commandStack;
QUndoStack *KdenliveDoc::commandStack()
{
return m_commandStack;
bool isModified() const;
/** Returns project folder, used to store project files (titles, effects,...) */
KUrl projectFolder() const;
bool isModified() const;
/** Returns project folder, used to store project files (titles, effects,...) */
KUrl projectFolder() const;
- /** Used to inform main app of the current document loading progress */
- void loadingProgressed();
void syncGuides(QList <Guide *> guides);
void setZoom(int horizontal, int vertical);
QPoint zoom() const;
void syncGuides(QList <Guide *> guides);
void setZoom(int horizontal, int vertical);
QPoint zoom() const;
bool m_modified;
/** Project folder, used to store project files (titles, effects,...) */
KUrl m_projectFolder;
bool m_modified;
/** Project folder, used to store project files (titles, effects,...) */
KUrl m_projectFolder;
- double m_documentLoadingStep;
- double m_documentLoadingProgress;
bool m_abortLoading;
QMap <QString, QString> m_documentProperties;
bool m_abortLoading;
QMap <QString, QString> m_documentProperties;
QTimer::singleShot(500, this, SLOT(openFile()));
} else if (KdenliveSettings::openlastproject()) {
QTimer::singleShot(500, this, SLOT(openLastFile()));
QTimer::singleShot(500, this, SLOT(openFile()));
} else if (KdenliveSettings::openlastproject()) {
QTimer::singleShot(500, this, SLOT(openLastFile()));
- }
- else { //if (m_timelineArea->count() == 0) {
+ } else { //if (m_timelineArea->count() == 0) {
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
- disconnect(m_projectList, SIGNAL(displayMessage(const QString&, MessageType)), m_messageLabel, SLOT(setMessage(const QString&, MessageType)));
+ disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
m_effectStack->clear();
}
//m_activeDocument->setRenderer(NULL);
m_effectStack->clear();
}
//m_activeDocument->setRenderer(NULL);
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
connect(m_projectList, SIGNAL(loadingIsOver()), trackView->projectView(), SLOT(slotUpdateAllThumbs()));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
connect(m_projectList, SIGNAL(loadingIsOver()), trackView->projectView(), SLOT(slotUpdateAllThumbs()));
- connect(m_projectList, SIGNAL(displayMessage(const QString&, MessageType)), m_messageLabel, SLOT(setMessage(const QString&, MessageType)));
+ connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu, m_clipTypeGroup);
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu, m_clipTypeGroup);
//m_render->getFileProperties(clip->toXML(), clip->getId(), true);
}
const QString parent = clip->getProperty("groupid");
//m_render->getFileProperties(clip->toXML(), clip->getId(), true);
}
const QString parent = clip->getProperty("groupid");
- kDebug() << "Adding clip with groupid: " << parent;
ProjectItem *item = NULL;
if (!parent.isEmpty()) {
ProjectItem *parentitem = getFolderItemById(parent);
ProjectItem *item = NULL;
if (!parent.isEmpty()) {
ProjectItem *parentitem = getFolderItemById(parent);
if (!m_refreshed && m_thumbnailQueue.isEmpty() && m_infoQueue.isEmpty()) {
m_refreshed = true;
emit loadingIsOver();
if (!m_refreshed && m_thumbnailQueue.isEmpty() && m_infoQueue.isEmpty()) {
m_refreshed = true;
emit loadingIsOver();
- emit displayMessage(QString(), DefaultMessage);
+ emit displayMessage(QString(), -1);
m_listView->blockSignals(false);
m_listView->setEnabled(true);
} else if (!m_refreshed) QTimer::singleShot(300, this, SLOT(slotCheckForEmptyQueue()));
m_listView->blockSignals(false);
m_listView->setEnabled(true);
} else if (!m_refreshed) QTimer::singleShot(300, this, SLOT(slotCheckForEmptyQueue()));
void ProjectList::reloadClipThumbnails()
{
void ProjectList::reloadClipThumbnails()
{
+ kDebug() << "////////////// RELOAD CLIPS THUMBNAILS!!!";
m_thumbnailQueue.clear();
QTreeWidgetItemIterator it(m_listView);
while (*it) {
m_thumbnailQueue.clear();
QTreeWidgetItemIterator it(m_listView);
while (*it) {
void ProjectList::requestClipThumbnail(const QString id)
{
void ProjectList::requestClipThumbnail(const QString id)
{
- m_thumbnailQueue.append(id);
+ if (!m_thumbnailQueue.contains(id)) m_thumbnailQueue.append(id);
}
void ProjectList::slotProcessNextThumbnail()
}
void ProjectList::slotProcessNextThumbnail()
//QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
return;
}
//QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
return;
}
- slotRefreshClipThumbnail(m_thumbnailQueue.takeFirst(), false);
if (m_thumbnailQueue.count() > 1) {
if (m_thumbnailQueue.count() > 1) {
- emit displayMessage(i18n("Loading thumbnails (%1)", m_thumbnailQueue.count()), InformationMessage);
+ int max = m_doc->clipManager()->clipsCount();
+ emit displayMessage(i18n("Loading thumbnails"), (int)(100 * (max - m_thumbnailQueue.count()) / max));
+ slotRefreshClipThumbnail(m_thumbnailQueue.takeFirst(), false);
}
void ProjectList::slotRefreshClipThumbnail(const QString &clipId, bool update)
}
void ProjectList::slotRefreshClipThumbnail(const QString &clipId, bool update)
requestClipThumbnail(clipId);
}
} else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
requestClipThumbnail(clipId);
}
} else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
- emit displayMessage(i18n("Loading clips (%1)", m_infoQueue.count()), InformationMessage);
-
+ int max = m_doc->clipManager()->clipsCount();
+ emit displayMessage(i18n("Loading clips"), (int)(100 * (max - m_infoQueue.count()) / max));
// small delay so that the app can display the progress info
QTimer::singleShot(30, this, SLOT(slotProcessNextClipInQueue()));
}
// small delay so that the app can display the progress info
QTimer::singleShot(30, this, SLOT(slotProcessNextClipInQueue()));
}
void showClipProperties(DocClipBase *);
void projectModified();
void loadingIsOver();
void showClipProperties(DocClipBase *);
void projectModified();
void loadingIsOver();
- void displayMessage(const QString, MessageType);
+ void displayMessage(const QString, int progress);
void clipNameChanged(const QString, const QString);
void refreshClip();
};
void clipNameChanged(const QString, const QString);
void refreshClip();
};
if (device_selector->currentIndex() == FIREWIRE)
KMessageBox::information(this, i18n("You need to disconnect and reconnect in the capture monitor to apply your changes"), i18n("Capturing"));
else KMessageBox::information(this, i18n("You need to stop capture before your changes can be applied"), i18n("Capturing"));
if (device_selector->currentIndex() == FIREWIRE)
KMessageBox::information(this, i18n("You need to disconnect and reconnect in the capture monitor to apply your changes"), i18n("Capturing"));
else KMessageBox::information(this, i18n("You need to stop capture before your changes can be applied"), i18n("Capturing"));
- }
- else slotVideoDeviceChanged(device_selector->currentIndex());
+ } else slotVideoDeviceChanged(device_selector->currentIndex());
kDebug() << "// UPDATE CAPT FOLD: " << KdenliveSettings::capturefolder();
#if KDE_IS_VERSION(4,2,0)
kDebug() << "// UPDATE CAPT FOLD: " << KdenliveSettings::capturefolder();
#if KDE_IS_VERSION(4,2,0)
}
m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName);
}
m_pixmap = (iconName == 0) ? QPixmap() : SmallIcon(iconName);
- QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
+
+ /*QFontMetrics fontMetrics(font());
+ setMaximumWidth(fontMetrics.boundingRect(m_text).width() + m_pixmap.width() + (BorderGap * 4));
+ updateGeometry();*/
+
+ //QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
{
QWidget::resizeEvent(event);
updateCloseButtonPosition();
{
QWidget::resizeEvent(event);
updateCloseButtonPosition();
- QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
+ //QTimer::singleShot(GeometryTimeout, this, SLOT(assureVisibleText()));
}
void StatusBarMessageLabel::timerDone()
}
void StatusBarMessageLabel::timerDone()
if (p.attribute("id") == playlist_name) break;
}
int black_clips = p.childNodes().count();
if (p.attribute("id") == playlist_name) break;
}
int black_clips = p.childNodes().count();
- for (int i = 0; i < black_clips; i++)
- m_doc->loadingProgressed();
- qApp->processEvents();
if (elem.tagName() == "blank") {
position += elem.attribute("length").toInt();
} else if (elem.tagName() == "entry") {
if (elem.tagName() == "blank") {
position += elem.attribute("length").toInt();
} else if (elem.tagName() == "entry") {
- m_doc->loadingProgressed();
- qApp->processEvents();
// Found a clip
int in = elem.attribute("in").toInt();
int out = elem.attribute("out").toInt();
// Found a clip
int in = elem.attribute("in").toInt();
int out = elem.attribute("out").toInt();
if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, m_badIcon);
else item->setIcon(0, m_okIcon);
if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, m_badIcon);
else item->setIcon(0, m_okIcon);
item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("genisoimage or mkisofs"));
item->setData(1, Qt::UserRole, i18n("Required for creation of DVD ISO images"));
item->setSizeHint(0, itemSize);
item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("genisoimage or mkisofs"));
item->setData(1, Qt::UserRole, i18n("Required for creation of DVD ISO images"));
item->setSizeHint(0, itemSize);
// no GenIso, check for mkisofs
if (!KStandardDirs::findExe("mkisofs").isEmpty()) {
item->setIcon(0, m_okIcon);
// no GenIso, check for mkisofs
if (!KStandardDirs::findExe("mkisofs").isEmpty()) {
item->setIcon(0, m_okIcon);
- }
- else item->setIcon(0, m_badIcon);
- }
- else item->setIcon(0, m_okIcon);
+ } else item->setIcon(0, m_badIcon);
+ } else item->setIcon(0, m_okIcon);
// set up some default applications
QString program;
// set up some default applications
QString program;