if (!success) // It is corrupted
KMessageBox::error(parent, errorMsg);
else {
+ parent->slotGotProgressInfo(i18n("Validating file %1", m_url.path()), 0);
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()), 100);
+ if (!success) {
+ // It is not a project file
+ parent->slotGotProgressInfo(i18n("File %1 is not a Kdenlive project file.", m_url.path()), 0);
+ }
else {
/*
* Validate the file against the current version (upgrade
// 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);
QDomElement mlt = m_document.firstChildElement("mlt");
QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
const int max = producers.count();
const int infomax = infoproducers.count();
- QDomNodeList folders = m_document.elementsByTagName("folder");
+ QDomNodeList folders = m_document.elementsByTagName("folder");
for (int i = 0; i < folders.count(); i++) {
e = folders.item(i).cloneNode().toElement();
m_clipManager->addFolder(e.attribute("id"), e.attribute("name"));
}
- if (max > 0) {
+ /*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();
- if (m_documentLoadingStep > 0) {
+ /*if (m_documentLoadingStep > 0) {
m_documentLoadingProgress += m_documentLoadingStep;
parent->slotGotProgressInfo(QString(), (int) m_documentLoadingProgress);
- //qApp->processEvents();
- }
+ // QApp->processEvents();
+ }*/
QString prodId = e.attribute("id");
if (!e.isNull() && prodId != "black" && !prodId.startsWith("slowmotion") && !m_abortLoading) {
e.setTagName("producer");
// precedence, then "openlastproject", then just a plain empty file.
// If opening Url fails, openlastproject will _not_ be used.
if (!Url.isEmpty()) {
- openFile(Url);
- } else {
- if (KdenliveSettings::openlastproject()) {
- openLastFile();
- }
+ // delay loading so that the window shows up
+ m_startUrl = Url;
+ QTimer::singleShot(500, this, SLOT(openFile()));
+ } else if (KdenliveSettings::openlastproject()) {
+ QTimer::singleShot(500, this, SLOT(openLastFile()));
}
- if (m_timelineArea->count() == 0) {
+ else { //if (m_timelineArea->count() == 0) {
newFile(false);
}
void MainWindow::openFile()
{
+ if (!m_startUrl.isEmpty()) {
+ openFile(m_startUrl);
+ m_startUrl = KUrl();
+ return;
+ }
// Check that the Kdenlive mime type is correctly installed
QString mimetype = "application/x-kdenlive";
KMimeType::Ptr mime = KMimeType::mimeType(mimetype);
}
}
if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
+ m_messageLabel->setMessage(i18n("Opening file %1", url.path()), InformationMessage);
+ qApp->processEvents();
doOpenFile(url, NULL);
}
QMenu *m_timelineContextMenu;
QMenu *m_timelineContextClipMenu;
QMenu *m_timelineContextTransitionMenu;
+ KUrl m_startUrl;
/**
* Shortcut to remove the focus of any element. Allows to get out
m_infoQueue.remove(j.key());
emit getFileProperties(dom, id, false);
}
-
- if (!m_infoQueue.isEmpty() && !m_queueTimer.isActive()) m_queueTimer.start();
+ //if (!m_infoQueue.isEmpty() && !m_queueTimer.isActive()) m_queueTimer.start();
}
void ProjectList::slotUpdateClip(const QString &id)
}
slotRefreshClipThumbnail(m_thumbnailQueue.takeFirst(), false);
if (m_thumbnailQueue.count() > 1) {
- emit displayMessage(i18n("Loading clips (%1)", m_thumbnailQueue.count()), InformationMessage);
- qApp->processEvents();
+ emit displayMessage(i18n("Loading thumbnails (%1)", m_thumbnailQueue.count()), InformationMessage);
}
}
m_doc->cachePixmap(item->getClipHash(), pix);
}
if (update) emit projectModified();
- QTimer::singleShot(100, this, SLOT(slotProcessNextThumbnail()));
+ QTimer::singleShot(30, this, SLOT(slotProcessNextThumbnail()));
}
}
requestClipThumbnail(clipId);
}
} else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
-
- slotProcessNextClipInQueue();
+ emit displayMessage(i18n("Loading clips (%1)", m_infoQueue.count()), InformationMessage);
+
+ // small delay so that the app can display the progress info
+ QTimer::singleShot(30, this, SLOT(slotProcessNextClipInQueue()));
}
void ProjectList::slotReplyGetImage(const QString &clipId, const QPixmap &pix)