Commit d4558cad authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Switch failed operation messages to ErrorMessage for better visibility

parent 26d74467
Pipeline #47790 passed with stage
in 10 minutes and 41 seconds
...@@ -163,7 +163,7 @@ void KeyframeView::slotRemoveKeyframe(QVector<int> positions) ...@@ -163,7 +163,7 @@ void KeyframeView::slotRemoveKeyframe(QVector<int> positions)
{ {
if (m_model->singleKeyframe()) { if (m_model->singleKeyframe()) {
// Don't allow zero keyframe // Don't allow zero keyframe
pCore->displayMessage(i18n("Cannot remove the last keyframe"), MessageType::InformationMessage, 500); pCore->displayMessage(i18n("Cannot remove the last keyframe"), MessageType::ErrorMessage, 500);
return; return;
} }
int offset = pCore->getItemIn(m_model->getOwnerId()); int offset = pCore->getItemIn(m_model->getOwnerId());
......
...@@ -3075,7 +3075,7 @@ void Bin::slotItemDropped(const QStringList &ids, const QModelIndex &parent) ...@@ -3075,7 +3075,7 @@ void Bin::slotItemDropped(const QStringList &ids, const QModelIndex &parent)
} }
} }
if (moveCommand->childCount() == 0) { if (moveCommand->childCount() == 0) {
pCore->displayMessage(i18n("No valid clip to insert"), MessageType::InformationMessage, 500); pCore->displayMessage(i18n("No valid clip to insert"), MessageType::ErrorMessage, 500);
} else { } else {
m_doc->commandStack()->push(moveCommand); m_doc->commandStack()->push(moveCommand);
} }
...@@ -3099,7 +3099,7 @@ void Bin::slotAddEffect(QString id, const QStringList &effectData) ...@@ -3099,7 +3099,7 @@ void Bin::slotAddEffect(QString id, const QStringList &effectData)
return; return;
} }
} }
pCore->displayMessage(i18n("Select a clip to apply an effect"), MessageType::InformationMessage, 500); pCore->displayMessage(i18n("Select a clip to apply an effect"), MessageType::ErrorMessage, 500);
} }
void Bin::slotEffectDropped(const QStringList &effectData, const QModelIndex &parent) void Bin::slotEffectDropped(const QStringList &effectData, const QModelIndex &parent)
...@@ -3133,7 +3133,7 @@ void Bin::slotEffectDropped(const QStringList &effectData, const QModelIndex &pa ...@@ -3133,7 +3133,7 @@ void Bin::slotEffectDropped(const QStringList &effectData, const QModelIndex &pa
res = std::static_pointer_cast<ProjectClip>(parentItem)->addEffect(effectData.constFirst()); res = std::static_pointer_cast<ProjectClip>(parentItem)->addEffect(effectData.constFirst());
} }
if (!res) { if (!res) {
pCore->displayMessage(i18n("Cannot add effect to clip"), MessageType::InformationMessage); pCore->displayMessage(i18n("Cannot add effect to clip"), MessageType::ErrorMessage);
} else { } else {
m_proxyModel->selectionModel()->clearSelection(); m_proxyModel->selectionModel()->clearSelection();
const QModelIndex id = m_itemModel->index(row, 0, parentIndex); const QModelIndex id = m_itemModel->index(row, 0, parentIndex);
...@@ -3179,14 +3179,14 @@ void Bin::slotTagDropped(const QString &tag, const QModelIndex &parent) ...@@ -3179,14 +3179,14 @@ void Bin::slotTagDropped(const QString &tag, const QModelIndex &parent)
return; return;
} }
} }
pCore->displayMessage(i18n("Select a clip to add a tag"), MessageType::InformationMessage); pCore->displayMessage(i18n("Select a clip to add a tag"), MessageType::ErrorMessage);
} }
void Bin::switchTag(const QString &tag, bool add) void Bin::switchTag(const QString &tag, bool add)
{ {
const QModelIndexList indexes = m_proxyModel->selectionModel()->selectedIndexes(); const QModelIndexList indexes = m_proxyModel->selectionModel()->selectedIndexes();
if (indexes.isEmpty()) { if (indexes.isEmpty()) {
pCore->displayMessage(i18n("Select a clip to add a tag"), MessageType::InformationMessage); pCore->displayMessage(i18n("Select a clip to add a tag"), MessageType::ErrorMessage);
} }
// Check for folders // Check for folders
QList <QString> allClips; QList <QString> allClips;
......
...@@ -343,7 +343,7 @@ bool EffectStackModel::fromXml(const QDomElement &effectsXml, Fun &undo, Fun &re ...@@ -343,7 +343,7 @@ bool EffectStackModel::fromXml(const QDomElement &effectsXml, Fun &undo, Fun &re
continue; continue;
} }
if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) { if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) {
pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), InformationMessage); pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), ErrorMessage);
return false; return false;
} }
bool effectEnabled = true; bool effectEnabled = true;
...@@ -428,7 +428,7 @@ bool EffectStackModel::copyEffect(const std::shared_ptr<AbstractEffectItem> &sou ...@@ -428,7 +428,7 @@ bool EffectStackModel::copyEffect(const std::shared_ptr<AbstractEffectItem> &sou
std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(sourceItem); std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(sourceItem);
const QString effectId = sourceEffect->getAssetId(); const QString effectId = sourceEffect->getAssetId();
if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) { if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) {
pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), InformationMessage); pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), ErrorMessage);
return false; return false;
} }
bool enabled = sourceEffect->isEnabled(); bool enabled = sourceEffect->isEnabled();
...@@ -481,7 +481,7 @@ bool EffectStackModel::appendEffect(const QString &effectId, bool makeCurrent) ...@@ -481,7 +481,7 @@ bool EffectStackModel::appendEffect(const QString &effectId, bool makeCurrent)
{ {
QWriteLocker locker(&m_lock); QWriteLocker locker(&m_lock);
if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) { if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) {
pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), InformationMessage); pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), ErrorMessage);
return false; return false;
} }
std::unordered_set<int> previousFadeIn = m_fadeIns; std::unordered_set<int> previousFadeIn = m_fadeIns;
...@@ -1000,7 +1000,7 @@ void EffectStackModel::importEffects(const std::weak_ptr<Mlt::Service> &service, ...@@ -1000,7 +1000,7 @@ void EffectStackModel::importEffects(const std::weak_ptr<Mlt::Service> &service,
} }
const QString effectId = qstrdup(filter->get("kdenlive_id")); const QString effectId = qstrdup(filter->get("kdenlive_id"));
if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) { if (EffectsRepository::get()->isUnique(effectId) && hasEffect(effectId)) {
pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), InformationMessage); pCore->displayMessage(i18n("Effect %1 cannot be added twice.", EffectsRepository::get()->getName(effectId)), ErrorMessage);
continue; continue;
} }
if (filter->get_int("disable") == 0) { if (filter->get_int("disable") == 0) {
......
...@@ -177,7 +177,7 @@ void EffectStackView::dropEvent(QDropEvent *event) ...@@ -177,7 +177,7 @@ void EffectStackView::dropEvent(QDropEvent *event)
} }
} }
if (!added) { if (!added) {
pCore->displayMessage(i18n("Cannot add effect to clip"), InformationMessage); pCore->displayMessage(i18n("Cannot add effect to clip"), ErrorMessage);
} else { } else {
m_scrollTimer.start(); m_scrollTimer.start();
} }
......
...@@ -1633,7 +1633,7 @@ void GLWidget::switchPlay(bool play, double speed) ...@@ -1633,7 +1633,7 @@ void GLWidget::switchPlay(bool play, double speed)
bool GLWidget::playZone(bool loop) bool GLWidget::playZone(bool loop)
{ {
if (!m_producer || m_proxy->zoneOut() <= m_proxy->zoneIn()) { if (!m_producer || m_proxy->zoneOut() <= m_proxy->zoneIn()) {
pCore->displayMessage(i18n("Select a zone to play"), InformationMessage, 500); pCore->displayMessage(i18n("Select a zone to play"), ErrorMessage, 500);
return false; return false;
} }
m_producer->seek(m_proxy->zoneIn()); m_producer->seek(m_proxy->zoneIn());
...@@ -1669,7 +1669,7 @@ bool GLWidget::restartConsumer() ...@@ -1669,7 +1669,7 @@ bool GLWidget::restartConsumer()
bool GLWidget::loopClip(QPoint inOut) bool GLWidget::loopClip(QPoint inOut)
{ {
if (!m_producer || inOut.y() <= inOut.x()) { if (!m_producer || inOut.y() <= inOut.x()) {
pCore->displayMessage(i18n("Select a clip to play"), InformationMessage, 500); pCore->displayMessage(i18n("Select a clip to play"), ErrorMessage, 500);
return false; return false;
} }
m_loopIn = inOut.x(); m_loopIn = inOut.x();
......
...@@ -191,7 +191,7 @@ void NotesWidget::assignProjectNote() ...@@ -191,7 +191,7 @@ void NotesWidget::assignProjectNote()
if (!anchors.isEmpty()) { if (!anchors.isEmpty()) {
emit reAssign(anchors, anchorPoints); emit reAssign(anchors, anchorPoints);
} else { } else {
pCore->displayMessage(i18n("Select some timecodes to reassign"), InformationMessage); pCore->displayMessage(i18n("Select some timecodes to reassign"), ErrorMessage);
} }
} }
...@@ -202,7 +202,7 @@ void NotesWidget::createMarkers() ...@@ -202,7 +202,7 @@ void NotesWidget::createMarkers()
if (!anchors.isEmpty()) { if (!anchors.isEmpty()) {
createMarker(anchors); createMarker(anchors);
} else { } else {
pCore->displayMessage(i18n("Select some timecodes to create markers"), InformationMessage); pCore->displayMessage(i18n("Select some timecodes to create markers"), ErrorMessage);
} }
} }
......
...@@ -74,7 +74,7 @@ void NotesPlugin::slotInsertTimecode() ...@@ -74,7 +74,7 @@ void NotesPlugin::slotInsertTimecode()
QString position = pCore->timecode().getTimecodeFromFrames(frames); QString position = pCore->timecode().getTimecodeFromFrames(frames);
const QString binId = pCore->monitorManager()->clipMonitor()->activeClipId(); const QString binId = pCore->monitorManager()->clipMonitor()->activeClipId();
if (binId.isEmpty()) { if (binId.isEmpty()) {
pCore->displayMessage(i18n("Cannot add note, no clip selected in project bin"), InformationMessage); pCore->displayMessage(i18n("Cannot add note, no clip selected in project bin"), ErrorMessage);
return; return;
} }
QString clipName = pCore->bin()->getBinClipName(binId); QString clipName = pCore->bin()->getBinClipName(binId);
...@@ -92,7 +92,7 @@ void NotesPlugin::slotReAssign(QStringList anchors, QList <QPoint> points) ...@@ -92,7 +92,7 @@ void NotesPlugin::slotReAssign(QStringList anchors, QList <QPoint> points)
int ix = 0; int ix = 0;
if (points.count() != anchors.count()) { if (points.count() != anchors.count()) {
// Something is wrong, abort // Something is wrong, abort
pCore->displayMessage(i18n("Cannot perform assign"), InformationMessage); pCore->displayMessage(i18n("Cannot perform assign"), ErrorMessage);
return; return;
} }
for (const QString & a : anchors) { for (const QString & a : anchors) {
......
...@@ -285,7 +285,7 @@ bool TimelineFunctions::requestClipCutAll(std::shared_ptr<TimelineItemModel> tim ...@@ -285,7 +285,7 @@ bool TimelineFunctions::requestClipCutAll(std::shared_ptr<TimelineItemModel> tim
} }
if (affectedTracks.isEmpty()) { if (affectedTracks.isEmpty()) {
pCore->displayMessage(i18n("All tracks are locked"), InformationMessage, 500); pCore->displayMessage(i18n("All tracks are locked"), ErrorMessage, 500);
return false; return false;
} }
...@@ -307,7 +307,7 @@ bool TimelineFunctions::requestClipCutAll(std::shared_ptr<TimelineItemModel> tim ...@@ -307,7 +307,7 @@ bool TimelineFunctions::requestClipCutAll(std::shared_ptr<TimelineItemModel> tim
} }
if (!count) { if (!count) {
pCore->displayMessage(i18n("No clips to cut"), InformationMessage); pCore->displayMessage(i18n("No clips to cut"), ErrorMessage);
} else { } else {
pCore->pushUndo(undo, redo, i18n("Cut all clips")); pCore->pushUndo(undo, redo, i18n("Cut all clips"));
} }
...@@ -447,7 +447,7 @@ bool TimelineFunctions::insertZone(const std::shared_ptr<TimelineItemModel> &tim ...@@ -447,7 +447,7 @@ bool TimelineFunctions::insertZone(const std::shared_ptr<TimelineItemModel> &tim
if (res) { if (res) {
pCore->pushUndo(undo, redo, overwrite ? i18n("Overwrite zone") : i18n("Insert zone")); pCore->pushUndo(undo, redo, overwrite ? i18n("Overwrite zone") : i18n("Insert zone"));
} else { } else {
pCore->displayMessage(i18n("Could not insert zone"), InformationMessage); pCore->displayMessage(i18n("Could not insert zone"), ErrorMessage);
undo(); undo();
} }
return res; return res;
...@@ -480,7 +480,7 @@ bool TimelineFunctions::insertZone(const std::shared_ptr<TimelineItemModel> &tim ...@@ -480,7 +480,7 @@ bool TimelineFunctions::insertZone(const std::shared_ptr<TimelineItemModel> &tim
} }
} }
if (affectedTracks.isEmpty()) { if (affectedTracks.isEmpty()) {
pCore->displayMessage(i18n("Please activate a track by clicking on a track's label"), InformationMessage); pCore->displayMessage(i18n("Please activate a track by clicking on a track's label"), ErrorMessage);
return false; return false;
} }
result = breakAffectedGroups(timeline, affectedTracks, QPoint(insertFrame, insertFrame + (zone.y() - zone.x())), undo, redo); result = breakAffectedGroups(timeline, affectedTracks, QPoint(insertFrame, insertFrame + (zone.y() - zone.x())), undo, redo);
...@@ -950,7 +950,7 @@ QStringList TimelineFunctions::enableMultitrackView(const std::shared_ptr<Timeli ...@@ -950,7 +950,7 @@ QStringList TimelineFunctions::enableMultitrackView(const std::shared_ptr<Timeli
videoTracks.push_back(tid); videoTracks.push_back(tid);
} }
if (videoTracks.size() < 2) { if (videoTracks.size() < 2) {
pCore->displayMessage(i18n("Cannot enable multitrack view on a single track"), InformationMessage); pCore->displayMessage(i18n("Cannot enable multitrack view on a single track"), ErrorMessage);
} }
// First, dis/enable track compositing // First, dis/enable track compositing
QScopedPointer<Mlt::Service> service(timeline->m_tractor->field()); QScopedPointer<Mlt::Service> service(timeline->m_tractor->field());
...@@ -1413,7 +1413,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1413,7 +1413,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
qDebug() << " / / READING CLIPS FROM CLIPBOARD"; qDebug() << " / / READING CLIPS FROM CLIPBOARD";
} else { } else {
semaphore.release(1); semaphore.release(1);
pCore->displayMessage(i18n("No valid data in clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("No valid data in clipboard"), ErrorMessage, 500);
return false; return false;
} }
const QString docId = copiedItems.documentElement().attribute(QStringLiteral("documentid")); const QString docId = copiedItems.documentElement().attribute(QStringLiteral("documentid"));
...@@ -1439,7 +1439,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1439,7 +1439,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
QDomElement prod = clips.at(i).toElement(); QDomElement prod = clips.at(i).toElement();
int trackPos = prod.attribute(QStringLiteral("track")).toInt(); int trackPos = prod.attribute(QStringLiteral("track")).toInt();
if (trackPos < 0) { if (trackPos < 0) {
pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), ErrorMessage, 500);
semaphore.release(1); semaphore.release(1);
return false; return false;
} }
...@@ -1497,7 +1497,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1497,7 +1497,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
int requestedVideoTracks = videoTracks.isEmpty() ? 0 : videoTracks.last() - videoTracks.first() + 1; int requestedVideoTracks = videoTracks.isEmpty() ? 0 : videoTracks.last() - videoTracks.first() + 1;
int requestedAudioTracks = audioTracks.isEmpty() ? 0 : audioTracks.last() - audioTracks.first() + 1; int requestedAudioTracks = audioTracks.isEmpty() ? 0 : audioTracks.last() - audioTracks.first() + 1;
if (requestedVideoTracks > projectTracks.second.size() || requestedAudioTracks > projectTracks.first.size()) { if (requestedVideoTracks > projectTracks.second.size() || requestedAudioTracks > projectTracks.first.size()) {
pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), ErrorMessage, 500);
semaphore.release(1); semaphore.release(1);
return false; return false;
} }
...@@ -1526,7 +1526,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1526,7 +1526,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
if (requestedAudioTracks > 0 && projectTracks.first.size() <= (projectTracks.second.indexOf(trackId) + topAudioOffset)) { if (requestedAudioTracks > 0 && projectTracks.first.size() <= (projectTracks.second.indexOf(trackId) + topAudioOffset)) {
int updatedPos = projectTracks.first.size() - topAudioOffset - 1; int updatedPos = projectTracks.first.size() - topAudioOffset - 1;
if (updatedPos < 0 || updatedPos >= projectTracks.second.size()) { if (updatedPos < 0 || updatedPos >= projectTracks.second.size()) {
pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), ErrorMessage, 500);
semaphore.release(1); semaphore.release(1);
return false; return false;
} }
...@@ -1557,7 +1557,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1557,7 +1557,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
for (int tk : qAsConst(videoTracks)) { for (int tk : qAsConst(videoTracks)) {
int newPos = masterIx + tk - masterSourceTrack; int newPos = masterIx + tk - masterSourceTrack;
if (newPos < 0 || newPos >= projectTracks.second.size()) { if (newPos < 0 || newPos >= projectTracks.second.size()) {
pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), ErrorMessage, 500);
semaphore.release(1); semaphore.release(1);
return false; return false;
} }
...@@ -1591,7 +1591,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1591,7 +1591,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
} }
int offsetId = oldPos + audioOffset; int offsetId = oldPos + audioOffset;
if (offsetId < 0 || offsetId >= projectTracks.first.size()) { if (offsetId < 0 || offsetId >= projectTracks.first.size()) {
pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), ErrorMessage, 500);
semaphore.release(1); semaphore.release(1);
return false; return false;
} }
...@@ -1661,7 +1661,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim ...@@ -1661,7 +1661,7 @@ bool TimelineFunctions::pasteClips(const std::shared_ptr<TimelineItemModel> &tim
clipsImported = true; clipsImported = true;
bool insert = pCore->projectItemModel()->requestAddBinClip(clipId, currentProd, folderId, undo, redo, callBack); bool insert = pCore->projectItemModel()->requestAddBinClip(clipId, currentProd, folderId, undo, redo, callBack);
if (!insert) { if (!insert) {
pCore->displayMessage(i18n("Could not add bin clip"), InformationMessage, 500); pCore->displayMessage(i18n("Could not add bin clip"), ErrorMessage, 500);
undo(); undo();
semaphore.release(1); semaphore.release(1);
return false; return false;
...@@ -1705,7 +1705,7 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod ...@@ -1705,7 +1705,7 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod
int curTrackId = tracksMap.value(prod.attribute(QStringLiteral("track")).toInt()); int curTrackId = tracksMap.value(prod.attribute(QStringLiteral("track")).toInt());
if (!timeline->isTrack(curTrackId)) { if (!timeline->isTrack(curTrackId)) {
// Something is broken // Something is broken
pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), InformationMessage, 500); pCore->displayMessage(i18n("Not enough tracks to paste clipboard"), ErrorMessage, 500);
timeline_undo(); timeline_undo();
semaphore.release(1); semaphore.release(1);
return false; return false;
...@@ -1721,7 +1721,7 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod ...@@ -1721,7 +1721,7 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod
bool created = timeline->requestClipCreation(originalId, newId, timeline->getTrackById_const(curTrackId)->trackType(), audioStream, speed, warp_pitch, timeline_undo, timeline_redo); bool created = timeline->requestClipCreation(originalId, newId, timeline->getTrackById_const(curTrackId)->trackType(), audioStream, speed, warp_pitch, timeline_undo, timeline_redo);
if (!created) { if (!created) {
// Something is broken // Something is broken
pCore->displayMessage(i18n("Could not paste items in timeline"), InformationMessage, 500); pCore->displayMessage(i18n("Could not paste items in timeline"), ErrorMessage, 500);
timeline_undo(); timeline_undo();
semaphore.release(1); semaphore.release(1);
return false; return false;
...@@ -1781,7 +1781,7 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod ...@@ -1781,7 +1781,7 @@ bool TimelineFunctions::pasteTimelineClips(const std::shared_ptr<TimelineItemMod
} }
if (!res) { if (!res) {
timeline_undo(); timeline_undo();
pCore->displayMessage(i18n("Could not paste items in timeline"), InformationMessage, 500); pCore->displayMessage(i18n("Could not paste items in timeline"), ErrorMessage, 500);
semaphore.release(1); semaphore.release(1);
return false; return false;
} }
......
...@@ -798,9 +798,10 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool ...@@ -798,9 +798,10 @@ bool TimelineModel::requestClipMove(int clipId, int trackId, int position, bool
bool TimelineModel::mixClip(int idToMove, int delta) bool TimelineModel::mixClip(int idToMove, int delta)
{ {
int selectedTrack = -1; int selectedTrack = -1;
qDebug()<<"==== REQUEST CLIP MIX STEP 1";
std::unordered_set<int> initialSelection = getCurrentSelection(); std::unordered_set<int> initialSelection = getCurrentSelection();
if (idToMove == -1 && initialSelection.empty()) { if (idToMove == -1 && initialSelection.empty()) {
pCore->displayMessage(i18n("Select a clip to apply the mix"), InformationMessage, 500); pCore->displayMessage(i18n("Select a clip to apply the mix"), ErrorMessage, 500);
return false; return false;
} }
std::pair<int, int> clipsToMix; std::pair<int, int> clipsToMix;
...@@ -884,12 +885,12 @@ bool TimelineModel::mixClip(int idToMove, int delta) ...@@ -884,12 +885,12 @@ bool TimelineModel::mixClip(int idToMove, int delta)
break; break;
} }
} }
if (noSpaceInClip > 0) {
pCore->displayMessage(i18n("Not enough frames at clip %1 to apply the mix", noSpaceInClip == 1 ? i18n("start") : i18n("end")), ErrorMessage, 500);
return false;
}
if (idToMove == -1 || !isClip(idToMove)) { if (idToMove == -1 || !isClip(idToMove)) {
if (noSpaceInClip > 0) { pCore->displayMessage(i18n("Select a clip to apply the mix"), ErrorMessage, 500);
pCore->displayMessage(i18n("Not enough frames at clip %1 to apply the mix", noSpaceInClip == 1 ? i18n("start") : i18n("end")), InformationMessage, 500);
} else {
pCore->displayMessage(i18n("Select a clip to apply the mix"), InformationMessage, 500);
}
return false; return false;
} }
...@@ -1511,7 +1512,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId, ...@@ -1511,7 +1512,7 @@ bool TimelineModel::requestClipInsertion(const QString &binClipId, int trackId,
} }
} }
if (useTargets && allowedTracks.isEmpty()) { if (useTargets && allowedTracks.isEmpty()) {
pCore->displayMessage(i18n("No available track for insert operation"), InformationMessage, 500); pCore->displayMessage(i18n("No available track for insert operation"), ErrorMessage, 500);
return false; return false;
} }
bool result = requestClipInsertion(binClipId, trackId, position, id, logUndo, refreshView, useTargets, undo, redo, allowedTracks); bool result = requestClipInsertion(binClipId, trackId, position, id, logUndo, refreshView, useTargets, undo, redo, allowedTracks);
...@@ -2869,7 +2870,7 @@ bool TimelineModel::removeMix(int cid) ...@@ -2869,7 +2870,7 @@ bool TimelineModel::removeMix(int cid)
if (res) { if (res) {
PUSH_UNDO(undo, redo, i18n("Remove mix")); PUSH_UNDO(undo, redo, i18n("Remove mix"));
} else { } else {
pCore->displayMessage(i18n("Removing mix failed"), InformationMessage, 500); pCore->displayMessage(i18n("Removing mix failed"), ErrorMessage, 500);
} }
return res; return res;
} }
...@@ -3430,7 +3431,7 @@ bool TimelineModel::requestTrackDeletion(int trackId, Fun &undo, Fun &redo) ...@@ -3430,7 +3431,7 @@ bool TimelineModel::requestTrackDeletion(int trackId, Fun &undo, Fun &redo)
{ {
Q_ASSERT(isTrack(trackId)); Q_ASSERT(isTrack(trackId));
if (m_allTracks.size() < 2) { if (m_allTracks.size() < 2) {
pCore->displayMessage(i18n("Cannot delete last track in timeline"), InformationMessage, 500); pCore->displayMessage(i18n("Cannot delete last track in timeline"), ErrorMessage, 500);
return false; return false;
} }
// Discard running jobs // Discard running jobs
...@@ -3663,7 +3664,7 @@ bool TimelineModel::addTrackEffect(int trackId, const QString &effectId) ...@@ -3663,7 +3664,7 @@ bool TimelineModel::addTrackEffect(int trackId, const QString &effectId)
Q_ASSERT(m_iteratorTable.count(trackId) > 0); Q_ASSERT(m_iteratorTable.count(trackId) > 0);
if ((*m_iteratorTable.at(trackId))->addEffect(effectId) == false) { if ((*m_iteratorTable.at(trackId))->addEffect(effectId) == false) {
QString effectName = EffectsRepository::get()->getName(effectId); QString effectName = EffectsRepository::get()->getName(effectId);
pCore->displayMessage(i18n("Cannot add effect %1 to selected track", effectName), InformationMessage, 500); pCore->displayMessage(i18n("Cannot add effect %1 to selected track", effectName), ErrorMessage, 500);
return false; return false;
} }
return true; return true;
...@@ -3678,7 +3679,7 @@ bool TimelineModel::copyTrackEffect(int trackId, const QString &sourceId) ...@@ -3678,7 +3679,7 @@ bool TimelineModel::copyTrackEffect(int trackId, const QString &sourceId)
int itemRow = source.at(2).toInt(); int itemRow = source.at(2).toInt();
std::shared_ptr<EffectStackModel> effectStack = pCore->getItemEffectStack(itemType, itemId); std::shared_ptr<EffectStackModel> effectStack = pCore->getItemEffectStack(itemType, itemId);
if ((*m_iteratorTable.at(trackId))->copyEffect(effectStack, itemRow) == false) { if ((*m_iteratorTable.at(trackId))->copyEffect(effectStack, itemRow) == false) {
pCore->displayMessage(i18n("Cannot paste effect to selected track"), InformationMessage, 500); pCore->displayMessage(i18n("Cannot paste effect to selected track"), ErrorMessage, 500);
return false; return false;
} }
return true; return true;
...@@ -3696,7 +3697,7 @@ bool TimelineModel::addClipEffect(int clipId, const QString &effectId, bool noti ...@@ -3696,7 +3697,7 @@ bool TimelineModel::addClipEffect(int clipId, const QString &effectId, bool noti
bool result = m_allClips.at(clipId)->addEffect(effectId); bool result = m_allClips.at(clipId)->addEffect(effectId);
if (!result && notify) { if (!result && notify) {
QString effectName = EffectsRepository::get()->getName(effectId); QString effectName = EffectsRepository::get()->getName(effectId);
pCore->displayMessage(i18n("Cannot add effect %1 to selected clip", effectName), InformationMessage, 500); pCore->displayMessage(i18n("Cannot add effect %1 to selected clip", effectName), ErrorMessage, 500);
} }
return result; return result;
} }
......
...@@ -1648,7 +1648,7 @@ bool TrackModel::requestClipMix(std::pair<int, int> clipIds, int mixDuration, bo ...@@ -1648,7 +1648,7 @@ bool TrackModel::requestClipMix(std::pair<int, int> clipIds, int mixDuration, bo
// check if we have enough frames, or limit duration // check if we have enough frames, or limit duration
int leftFrames = secondClip->getIn(); int leftFrames = secondClip->getIn();
if (leftFrames < 3) { if (leftFrames < 3) {
pCore->displayMessage(i18n("Not enough frames at clip %1 to apply the mix", i18n("start")), InformationMessage, 500); pCore->displayMessage(i18n("Not enough frames at clip %1 to apply the mix", i18n("start")), ErrorMessage, 500);
return false; return false;
} }
if (leftFrames < mixDuration / 2) { if (leftFrames < mixDuration / 2) {
......
This diff is collapsed.
...@@ -279,7 +279,7 @@ void TimelineWidget::showTargetMenu(int tid) ...@@ -279,7 +279,7 @@ void TimelineWidget::showTargetMenu(int tid)
return; return;
} }