+void ProjectList::updatePalette()
+{
+ m_infoLabel->setStyleSheet(SmallInfoLabel::getStyleSheet(QApplication::palette()));
+ m_listView->updateStyleSheet();
+}
+
+void ProjectList::slotResetInfoMessage()
+{
+#if KDE_IS_VERSION(4,7,0)
+ m_errorLog.clear();
+ QList<QAction *> actions = m_infoMessage->actions();
+ for (int i = 0; i < actions.count(); i++) {
+ m_infoMessage->removeAction(actions.at(i));
+ }
+#endif
+}
+
+void ProjectList::slotClosePopup()
+{
+ m_errorLog.clear();
+}
+
+void ProjectList::slotGotFilterJobResults(QString id, int , int , QString filter, stringMap results, QStringList extra)
+{
+ ProjectItem *clip = getItemById(id);
+ if (!clip) return;
+ // Check for return value
+ QString returnKey;
+ int markersType = -1;
+ for (int i = 0; i < extra.count(); i++) {
+ if (extra.at(i).startsWith("key:"))
+ returnKey = extra.at(i).section(':', 1);
+ if (extra.at(i).startsWith("addmarkers:")) {
+ markersType = extra.at(i).section(':', 1).toInt();
+ }
+ }
+ if (returnKey.isEmpty()) {
+ emit displayMessage(i18n("No data returned from clip analysis"), ErrorMessage);
+ return;
+ }
+ QStringList returnData = results.value(returnKey).split(';', QString::SkipEmptyParts);
+ if (returnData.isEmpty()) {
+ emit displayMessage(i18n("No data returned from clip analysis"), ErrorMessage);
+ return;
+ }
+ emit displayMessage(i18n("Processing data analysis"), InformationMessage);
+ bool dataProcessed = false;
+ if (extra.contains("cutscenes")) {
+ // Check if we want to cut scenes from returned data
+ dataProcessed = true;
+ int cutPos = 0;
+ QUndoCommand *command = new QUndoCommand();
+ command->setText(i18n("Auto Split Clip"));
+ foreach (QString pos, returnData) {
+ if (!pos.contains("=")) continue;
+ int newPos = pos.section("=", 0, 0).toInt();
+ // Don't use scenes shorter than 1 second
+ if (newPos - cutPos < 24) continue;
+ (void) new AddClipCutCommand(this, id, cutPos, newPos, QString(), true, false, command);
+ cutPos = newPos;
+ }
+ if (command->childCount() == 0)
+ delete command;
+ else m_commandStack->push(command);
+ }
+ if (markersType >= 0) {
+ // Add markers from returned data
+ dataProcessed = true;
+ int cutPos = 0;
+ QUndoCommand *command = new QUndoCommand();
+ command->setText(i18n("Add Markers"));
+ QList <CommentedTime> markersList;
+ int index = 1;
+ foreach (QString pos, returnData) {
+ if (!pos.contains("=")) continue;
+ int newPos = pos.section("=", 0, 0).toInt();
+ // Don't use scenes shorter than 1 second
+ if (newPos - cutPos < 24) continue;
+ CommentedTime m(GenTime(newPos, m_fps), QString::number(index), markersType);
+ markersList << m;
+ index++;
+ cutPos = newPos;
+ }
+ emit addMarkers(id, markersList);
+ }
+ if (!dataProcessed || extra.contains("storedata")) {
+ // Store returned data as clip extra data
+
+ clip->referencedClip()->setAnalysisData(i18n("Motion vectors"), results.value(returnKey));
+ emit updateAnalysisData(clip->referencedClip());
+ }
+}
+
+