...
 
Commits (20)
......@@ -2,7 +2,7 @@ project(Kdenlive)
# An odd patch version number means development version, while an even one means
# stable release. An additional number can be used for bugfix-only releases.
set(KDENLIVE_VERSION 15.04.1)
set(KDENLIVE_VERSION 15.04.3)
cmake_minimum_required(VERSION 2.8.12)
# Minimum versions of main dependencies.
set(MLT_MIN_MAJOR_VERSION 0)
......@@ -28,7 +28,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
SET(CMAKE_CXX_FLAGS "-fPIC")
# To be switched on when releasing.
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" OFF)
# Get current version.
set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION}")
......
......@@ -11,6 +11,8 @@
<name xml:lang="de">Kdenlive</name>
<name xml:lang="en-GB">Kdenlive</name>
<name xml:lang="es">Kdenlive</name>
<name xml:lang="fi">Kdenlive</name>
<name xml:lang="gl">Kdenlive</name>
<name xml:lang="it">Kdenlive</name>
<name xml:lang="nl">Kdenlive</name>
<name xml:lang="pl">Kdenlive</name>
......@@ -32,6 +34,9 @@
<summary xml:lang="cs">Editor videí</summary>
<summary xml:lang="de">Video-Editor</summary>
<summary xml:lang="en-GB">Video Editor</summary>
<summary xml:lang="es">Editor de vídeo</summary>
<summary xml:lang="fi">Videoeditori</summary>
<summary xml:lang="gl">Editor de vídeo</summary>
<summary xml:lang="it">Editor video</summary>
<summary xml:lang="nl">Videobewerker</summary>
<summary xml:lang="pl">Edytor wideo</summary>
......@@ -48,7 +53,11 @@
<description>
<p>Kdenlive is a non linear video editor. It is based on the MLT framework and accepts many audio and video formats, allows you to add effects, transitions and render into the format of your choice.</p>
<p xml:lang="ca">El Kdenlive és un editor no lineal de vídeo. Està basat en l'entorn de treball MLT i accepta molts formats d'àudio i vídeo, permetent afegir efectes, transicions i representacions en el format de la vostra elecció.</p>
<p xml:lang="de">Kdenlive ist ein Video-Editor für nicht linearen Schnitt. Es basiert auf MLT und verarbeitet viele Audio- und Video-Formate. Sie können Effekte und Übergänge benutzen und in Formate Ihrer Wahl umwandeln.</p>
<p xml:lang="en-GB">Kdenlive is a non linear video editor. It is based on the MLT framework and accepts many audio and video formats, allows you to add effects, transitions and render into the format of your choice.</p>
<p xml:lang="es">Kdenlive es un editor de vídeo no lineal. Está basado en la infraestructura MLT y acepta numerosos formatos de audio y de vídeo, permitiéndole añadir efectos, transiciones y obtener el resultado final en el formato que elija.</p>
<p xml:lang="fi">Kdenlive on epälineaarinen videoeditori. Se perustuu MLT-frameworkiin ja toimii monen eri ääni- ja videoformaatin kanssa. Voit lisätä efektejä ja siirtymiä, sekä renderöidä projektin haluamaasi tiedostomuotoon.</p>
<p xml:lang="gl">Kdenlive é un editor de vídeo non lineal. Está baseado na infraestrutura MLT e permite moitos formatos de son e vídeo, e permite engadir efectos, engadir transicións, e exportar en calquera formato.</p>
<p xml:lang="it">Kdenlive è un editor video non lineare. È basato sull'infrastruttura MLT e accetta numerosi formati audio e video, consente di aggiungere effetti, transizioni e produrre il formato che si desidera.</p>
<p xml:lang="nl">Kdenlive is een niet lineaire videobewerker. Het is gebaseerd op het MLT-framework en accepteert vele audio- en video-formaten, biedt de mogelijkheid effecten en overgangen toe te voegen en om te zetten naar het formaat van uw keuze.</p>
<p xml:lang="pl">Kdenlive jest nieliniowym edytorem wideo. Oparty jest na szkielecie MLT i może pracować na wielu formatach obrazu i dźwięku, umożliwia dodawanie efektów, przejść i renderowanie ich do dowolnego formatu.</p>
......@@ -70,6 +79,9 @@
<p xml:lang="cs">Vlastnosti:</p>
<p xml:lang="de">Funktionen:</p>
<p xml:lang="en-GB">Features:</p>
<p xml:lang="es">Funciones:</p>
<p xml:lang="fi">Ominaisuuksia:</p>
<p xml:lang="gl">Funcionalidades:</p>
<p xml:lang="it">Funzionalità:</p>
<p xml:lang="nl">Mogelijkheden:</p>
<p xml:lang="pl">Możliwości:</p>
......@@ -88,6 +100,9 @@
<li xml:lang="ca">Interfície multipista intuïtiva.</li>
<li xml:lang="de">Intuitive Benutzerschnittstelle für mehrere Spuren.</li>
<li xml:lang="en-GB">Intuitive multitrack interface.</li>
<li xml:lang="es">Interfaz multipista intuitiva.</li>
<li xml:lang="fi">Selkeä moniraitainen käyttöliittymä</li>
<li xml:lang="gl">Interface intuitiva con varias pistas.</li>
<li xml:lang="it">Interfaccia multitraccia intuitiva.</li>
<li xml:lang="nl">Intuïtief interface met meerdere tracks.</li>
<li xml:lang="pl">Intuicyjny interfejs wielościeżkowy.</li>
......@@ -106,6 +121,9 @@
<li xml:lang="ca">Molts efectes i transicions.</li>
<li xml:lang="de">Viele Effekte und Übergänge.</li>
<li xml:lang="en-GB">Many effects and transitions.</li>
<li xml:lang="es">Muchos efectos y transiciones.</li>
<li xml:lang="fi">Monia erilaisia efektejä ja siirtymiä</li>
<li xml:lang="gl">Moitos efectos e transicións.</li>
<li xml:lang="it">Numerosi effetti e transizioni.</li>
<li xml:lang="nl">Veel effecten en overgangen.</li>
<li xml:lang="pl">Wiele efektów i przejść.</li>
......@@ -122,7 +140,11 @@
<li>Color scopes</li>
<li xml:lang="ar">نطاقات الألوان</li>
<li xml:lang="ca">Àmbits de color</li>
<li xml:lang="de">Farbbereiche</li>
<li xml:lang="en-GB">Colour scopes</li>
<li xml:lang="es">Ámbitos de color</li>
<li xml:lang="fi">Väriavaruuksien säätömahdollisuus</li>
<li xml:lang="gl">Ámbitos de cores.</li>
<li xml:lang="it">Diagrammi di colore</li>
<li xml:lang="nl">Kleurreeksen</li>
<li xml:lang="pl">Zakresy barw</li>
......@@ -140,7 +162,11 @@
<li xml:lang="ar">مُرشد DVD أساسيّ</li>
<li xml:lang="ast">Encontu básicu pa DVD</li>
<li xml:lang="ca">Assistent bàsic per als DVD</li>
<li xml:lang="de">DVD-Assistent</li>
<li xml:lang="en-GB">Basic DVD Wizard</li>
<li xml:lang="es">Asistente de DVD básico</li>
<li xml:lang="fi">Yksinkertainen DVD:n luonti</li>
<li xml:lang="gl">Asistente básico para DVD</li>
<li xml:lang="it">Procedura guidata di base DVD</li>
<li xml:lang="nl">Basis dvd-assistent</li>
<li xml:lang="pl">Pomocnik podstawowego DVD</li>
......
......@@ -8,6 +8,9 @@
<comment xml:lang="da">Kdenlive videoprojekt-dokument</comment>
<comment xml:lang="de">Kdenlive-Videoprojektdokument</comment>
<comment xml:lang="en_GB">Kdenlive video project document</comment>
<comment xml:lang="es">Documento de proyecto de vídeo de Kdenlive</comment>
<comment xml:lang="fi">Kdenlive-videoprojektitiedosto</comment>
<comment xml:lang="gl">Documento dun proxecto de vídeo de Kdenlive</comment>
<comment xml:lang="ko">Kdenlive 동영상 프로젝트 문서</comment>
<comment xml:lang="nl">Video projectdocument van Kdenlive</comment>
<comment xml:lang="pl">Dokument projektowy filmu w Kdenlive</comment>
......@@ -33,6 +36,9 @@
<comment xml:lang="da">Kdenlive videotitel</comment>
<comment xml:lang="de">Kdenlive-Videotitel</comment>
<comment xml:lang="en_GB">Kdenlive video title</comment>
<comment xml:lang="es">Título de vídeo de Kdenlive</comment>
<comment xml:lang="fi">Kdenlive-video-otsikko</comment>
<comment xml:lang="gl">Título de vídeo de Kdenlive</comment>
<comment xml:lang="ko">Kdenlive 동영상 타이틀</comment>
<comment xml:lang="nl">Titel van Kdenlive-video</comment>
<comment xml:lang="pl">Tytuł filmu w Kdenlive</comment>
......
......@@ -54,19 +54,20 @@ const QString stopmotionMonitor("stopmotionMonitor");
enum OperationType {
None = 0,
MoveOperation = 1,
ResizeStart = 2,
ResizeEnd = 3,
FadeIn = 4,
FadeOut = 5,
TransitionStart = 6,
TransitionEnd = 7,
MoveGuide = 8,
KeyFrame = 9,
Seek = 10,
Spacer = 11,
RubberSelection = 12,
ScrollTimeline = 13
MoveOperation,
ResizeStart,
ResizeEnd,
FadeIn,
FadeOut,
TransitionStart,
TransitionEnd,
MoveGuide,
KeyFrame,
Seek,
Spacer,
RubberSelection,
ScrollTimeline,
ZoomTimeline
};
enum ClipType {
......
......@@ -850,8 +850,9 @@ void KdenliveSettingsDialog::loadTranscodeProfiles()
void KdenliveSettingsDialog::saveTranscodeProfiles()
{
KSharedConfigPtr config = KSharedConfig::openConfig(QStandardPaths::locate(QStandardPaths::DataLocation, "kdenlivetranscodingrc"), KConfig::CascadeConfig);
//KSharedConfigPtr config = KSharedConfig::openConfig();
QString transcodeFile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/kdenlivetranscodingrc";
KSharedConfigPtr config = KSharedConfig::openConfig(transcodeFile);
KConfigGroup transConfig(config, "Transcoding");
// read the entries
transConfig.deleteGroup();
......
......@@ -312,7 +312,7 @@ bool ProfilesDialog::existingProfileDescription(const QString &desc)
}
// List custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "profiles");
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "/profiles/", QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QDir customDir(customProfiles.at(i));
profilesFiles = customDir.entryList(profilesFilter, QDir::Files);
......@@ -350,7 +350,7 @@ QString ProfilesDialog::existingProfile(const MltVideoProfile &profile)
}
// Check custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "profiles");
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "/profiles/", QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
......@@ -388,7 +388,7 @@ QMap <QString, QString> ProfilesDialog::getProfilesInfo()
}
// List custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "profiles");
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "/profiles/", QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
profilesFiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profilesFiles.size(); ++j) {
......@@ -457,7 +457,7 @@ QMap <QString, QString> ProfilesDialog::getProfilesFromProperties(int width, int
}
// List custom profiles
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "profiles");
QStringList customProfiles = QStandardPaths::locateAll(QStandardPaths::DataLocation, "/profiles/", QStandardPaths::LocateDirectory);
for (int i = 0; i < customProfiles.size(); ++i) {
QStringList profiles = QDir(customProfiles.at(i)).entryList(profilesFilter, QDir::Files);
for (int j = 0; j < profiles.size(); ++j) {
......
......@@ -588,7 +588,7 @@ void KdenliveDoc::syncGuides(const QList <Guide *> &guides)
for (int i = 0; i < guides.count(); ++i) {
e = m_guidesXml.createElement("guide");
e.setAttribute("time", guides.at(i)->position().ms() / 1000);
e.setAttribute("time", QString::number(guides.at(i)->position().ms() / 1000));
e.setAttribute("comment", guides.at(i)->label());
guideNode.appendChild(e);
}
......@@ -769,7 +769,7 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &
QList < CommentedTime > marks = list.at(i)->commentedSnapMarkers();
for (int j = 0; j < marks.count(); ++j) {
QDomElement marker = sceneList.createElement("marker");
marker.setAttribute("time", marks.at(j).time().ms() / 1000);
marker.setAttribute("time", QString::number(marks.at(j).time().ms() / 1000));
marker.setAttribute("comment", marks.at(j).comment());
marker.setAttribute("id", e.attribute("id"));
marker.setAttribute("type", marks.at(j).markerType());
......@@ -1669,7 +1669,7 @@ void KdenliveDoc::updateProjectFolderPlacesEntry()
*/
const QString file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/user-places.xbel";
KBookmarkManager *bookmarkManager = KBookmarkManager::managerForFile(file, "kfilePlaces");
KBookmarkManager *bookmarkManager = KBookmarkManager::managerForExternalFile(file);
if (!bookmarkManager) return;
KBookmarkGroup root = bookmarkManager->root();
......
......@@ -113,6 +113,10 @@ int main(int argc, char *argv[])
QUrl url;
if (parser.positionalArguments().count()) {
url = QUrl::fromLocalFile(parser.positionalArguments().first());
// Make sure we get an absolute URL so that we can autosave correctly
QString currentPath = QDir::currentPath();
QUrl startup = QUrl::fromLocalFile(currentPath.endsWith(QDir::separator()) ? currentPath : currentPath + QDir::separator());
url = startup.resolved(url);
}
window = new MainWindow(mltPath, url, clipsToLoad);
window->show();
......
......@@ -458,7 +458,7 @@ void MainWindow::slotThemeChanged(const QString &theme)
KSharedConfigPtr config = KSharedConfig::openConfig(theme);
setPalette(KColorScheme::createApplicationPalette(config));
qApp->setPalette(palette());
KdenliveSettings::setColortheme(ThemeManager::instance()->currentThemeName());
KdenliveSettings::setColortheme(theme);
QPalette plt = palette();
if (m_effectStack) m_effectStack->updatePalette();
if (m_effectList) m_effectList->updatePalette();
......
......@@ -44,9 +44,9 @@ StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) :
m_closeButton(0)
{
setMinimumHeight(KIconLoader::SizeSmall);
QPalette palette;
/*QPalette palette);
palette.setColor(QPalette::Background, Qt::transparent);
setPalette(palette);
setPalette(palette);*/
m_closeButton = new QPushButton(i18nc("@action:button", "Confirm"), this);
m_closeButton->hide();
......@@ -224,7 +224,7 @@ void StatusBarMessageLabel::paintEvent(QPaintEvent*)
backgroundColor = KStatefulBrush(KColorScheme::Window, KColorScheme::NegativeBackground, KSharedConfig::openConfig(KdenliveSettings::colortheme())).brush(this).color();
}
if (m_state == Desaturate && m_illumination > 0) {
backgroundColor.setAlpha(m_illumination * 2);
backgroundColor.setAlpha(qMax(m_illumination * 2, 255));
}
painter.fillRect(0, 0, width(), height(), backgroundColor);
......@@ -238,7 +238,7 @@ void StatusBarMessageLabel::paintEvent(QPaintEvent*)
}
// draw text
painter.setPen(palette().windowText().color());
painter.setPen(palette().text().color());
int flags = Qt::AlignVCenter;
if (height() > m_minTextHeight) {
flags = flags | Qt::TextWordWrap;
......
......@@ -184,10 +184,20 @@ void AbstractGroupItem::paint(QPainter *p, const QStyleOptionGraphicsItem *optio
QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedChange) {
if (value.toBool()) setZValue(10);
if (value.toBool()) setZValue(3);
else setZValue(1);
}
if (change == ItemPositionChange && scene() && parentItem() == 0) {
CustomTrackScene *scene = NULL;
if (change == ItemPositionChange && parentItem() == 0) {
scene = projectScene();
}
if (scene) {
// calculate new position.
if (scene->isZooming) {
// For some reason, mouse wheel on selected itm sometimes triggered
// a position change event corrupting timeline, so discard it
return pos();
}
// calculate new position.
const int trackHeight = KdenliveSettings::trackheight();
QPointF start = sceneBoundingRect().topLeft();
......@@ -277,7 +287,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
QPainterPath shape;
if (projectScene()->editMode() == NormalEdit) {
shape = clipGroupShape(newPos - pos());
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems = scene->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == GroupWidget) {
......@@ -315,7 +325,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
newPos.setX(newPos.x() + offset);
}
// If there is still a collision after our position adjust, restore original pos
collidingItems = scene()->items(clipGroupShape(newPos - pos()), Qt::IntersectsItemShape);
collidingItems = scene->items(clipGroupShape(newPos - pos()), Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == GroupWidget) {
......@@ -333,7 +343,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
if (projectScene()->editMode() == NormalEdit) {
shape = transitionGroupShape(newPos - pos());
collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
collidingItems = scene->items(shape, Qt::IntersectsItemShape);
collidingItems.removeAll(this);
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == GroupWidget) {
......@@ -372,7 +382,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
newPos.setX(newPos.x() + offset);
}
// If there is still a collision after our position adjust, restore original pos
collidingItems = scene()->items(transitionGroupShape(newPos - pos()), Qt::IntersectsItemShape);
collidingItems = scene->items(transitionGroupShape(newPos - pos()), Qt::IntersectsItemShape);
for (int i = 0; i < children.count(); ++i) {
collidingItems.removeAll(children.at(i));
}
......
......@@ -1368,23 +1368,32 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedChange) {
if (value.toBool())
setZValue(10);
setZValue(3);
else
setZValue(2);
}
if (change == ItemPositionChange && scene()) {
CustomTrackScene *scene = NULL;
if (change == ItemPositionChange) {
scene = projectScene();
}
if (scene) {
// calculate new position.
//if (parentItem()) return pos();
if (scene->isZooming) {
// For some reason, mouse wheel on selected itm sometimes triggered
// a position change event corrupting timeline, so discard it
return pos();
}
if (property("resizingEnd").isValid()) return pos();
QPointF newPos = value.toPointF();
////qDebug() << "/// MOVING CLIP ITEM.------------\n++++++++++";
int xpos = projectScene()->getSnapPointForPos((int) newPos.x(), KdenliveSettings::snaptopoints());
int xpos = scene->getSnapPointForPos((int) newPos.x(), KdenliveSettings::snaptopoints());
xpos = qMax(xpos, 0);
newPos.setX(xpos);
// Warning: newPos gives a position relative to the click event, so hack to get absolute pos
int yOffset = property("y_absolute").toInt() + newPos.y();
int newTrack = yOffset / KdenliveSettings::trackheight();
newTrack = qMin(newTrack, projectScene()->tracksCount() - 1);
newTrack = qMin(newTrack, scene->tracksCount() - 1);
newTrack = qMax(newTrack, 0);
QStringList lockedTracks = property("locked_tracks").toStringList();
if (lockedTracks.contains(QString::number(newTrack))) {
......@@ -1396,8 +1405,8 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
QRectF sceneShape = rect();
sceneShape.translate(newPos);
QList<QGraphicsItem*> items;
if (projectScene()->editMode() == NormalEdit) {
items = scene()->items(sceneShape, Qt::IntersectsItemShape);
if (scene->editMode() == NormalEdit) {
items = scene->items(sceneShape, Qt::IntersectsItemShape);
}
items.removeAll(this);
bool forwardMove = newPos.x() > pos().x();
......@@ -1425,7 +1434,7 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
sceneShape.translate(QPointF(offset, 0));
newPos.setX(newPos.x() + offset);
}
QList<QGraphicsItem*> subitems = scene()->items(sceneShape, Qt::IntersectsItemShape);
QList<QGraphicsItem*> subitems = scene->items(sceneShape, Qt::IntersectsItemShape);
subitems.removeAll(this);
for (int j = 0; j < subitems.count(); ++j) {
if (!subitems.at(j)->isEnabled()) continue;
......
......@@ -25,7 +25,8 @@ CustomTrackScene::CustomTrackScene(KdenliveDoc *doc, QObject *parent) :
QGraphicsScene(parent),
m_document(doc),
m_scale(1.0, 1.0),
m_editMode(NormalEdit)
m_editMode(NormalEdit),
isZooming(false)
{
}
......
......@@ -59,6 +59,7 @@ public:
MltVideoProfile profile() const;
void setEditMode(EditMode mode);
EditMode editMode() const;
bool isZooming;
private:
KdenliveDoc *m_document;
......
......@@ -315,14 +315,32 @@ bool CustomTrackView::checkTrackHeight()
void CustomTrackView::wheelEvent(QWheelEvent * e)
{
if (e->modifiers() == Qt::ControlModifier) {
if (e->delta() > 0) emit zoomIn();
else emit zoomOut();
if (m_operationMode == None || m_operationMode == ZoomTimeline) {
if (e->delta() > 0) emit zoomIn();
else emit zoomOut();
}
} else {
if (m_operationMode == ResizeStart || m_operationMode == ResizeEnd) {
// Don't allow scrolling + resizing
return;
}
if (m_operationMode == None || m_operationMode == ZoomTimeline) {
// Prevent unwanted object move
m_scene->isZooming = true;
}
if (e->delta() <= 0) horizontalScrollBar()->setValue(horizontalScrollBar()->value() + horizontalScrollBar()->singleStep());
else horizontalScrollBar()->setValue(horizontalScrollBar()->value() - horizontalScrollBar()->singleStep());
if (m_operationMode == None || m_operationMode == ZoomTimeline) {
m_scene->isZooming = false;
}
}
}
void CustomTrackView::setOperation(OperationType op)
{
m_operationMode = op;
}
int CustomTrackView::getPreviousVideoTrack(int track)
{
track = m_document->tracksCount() - track - 1;
......@@ -501,7 +519,6 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
QGraphicsView::mouseMoveEvent(event);
return;
}
if (event->buttons() & Qt::MidButton) return;
if (dragMode() == QGraphicsView::RubberBandDrag || (event->modifiers() == Qt::ControlModifier && m_tool != SpacerTool && m_operationMode != ResizeStart && m_operationMode != ResizeEnd)) {
event->setAccepted(true);
......@@ -512,7 +529,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
if (event->buttons() != Qt::NoButton) {
bool move = (event->pos() - m_clickEvent).manhattanLength() >= QApplication::startDragDistance();
if (m_dragItem && move) m_clipDrag = true;
if (m_dragItem && move && m_operationMode != ZoomTimeline) m_clipDrag = true;
if (m_dragItem && m_tool == SelectTool) {
if (m_operationMode == MoveOperation && m_clipDrag) {
QGraphicsView::mouseMoveEvent(event);
......@@ -607,7 +624,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
return;
}
if (item && event->buttons() == Qt::NoButton) {
if (item && event->buttons() == Qt::NoButton && m_operationMode != ZoomTimeline) {
AbstractClipItem *clip = static_cast <AbstractClipItem*>(item);
if (m_tool == RazorTool) {
// razor tool over a clip, display current frame in monitor
......@@ -1002,7 +1019,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
}
QGraphicsView::mousePressEvent(event);
event->ignore();
return;
return;
}
if (m_tool == SpacerTool) {
......@@ -1122,7 +1139,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
//if (!(event->modifiers() | Qt::ControlModifier) && m_operationMode == NONE)
//QGraphicsView::mousePressEvent(event);
if (m_dragItem) {
if (m_dragItem && event->button() == Qt::LeftButton) {
m_clickPoint = QPoint((int)(mapToScene(event->pos()).x() - m_dragItem->startPos().frames(m_document->fps())), (int)(event->pos().y() - m_dragItem->pos().y()));
if (m_selectionGroup && m_dragItem->parentItem() == m_selectionGroup) {
// all other modes break the selection, so the user probably wants to move it
......@@ -3664,15 +3681,14 @@ void CustomTrackView::completeSpaceOperation(int track, GenTime &timeOffset)
}
clearSelection();
m_operationMode = None;
m_operationMode = None;
return;
}
void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
{
if (m_moveOpMode == Seek) m_moveOpMode = None;
if (m_operationMode == ScrollTimeline) {
if (m_operationMode == ScrollTimeline || m_operationMode == ZoomTimeline) {
m_operationMode = None;
setDragMode(QGraphicsView::NoDrag);
QGraphicsView::mouseReleaseEvent(event);
......@@ -5805,8 +5821,10 @@ void CustomTrackView::setTool(ProjectTool tool)
void CustomTrackView::setScale(double scaleFactor, double verticalScale)
{
QMatrix newmatrix;
newmatrix = newmatrix.scale(scaleFactor, verticalScale);
m_scene->isZooming = true;
m_scene->setScale(scaleFactor, verticalScale);
removeTipAnimation();
bool adjust = false;
......@@ -5830,6 +5848,7 @@ void CustomTrackView::setScale(double scaleFactor, double verticalScale)
}
double verticalPos = mapToScene(QPoint(0, viewport()->height() / 2)).y();
centerOn(QPointF(cursorPos(), verticalPos));
m_scene->isZooming = false;
}
void CustomTrackView::slotRefreshGuides()
......
......@@ -220,6 +220,8 @@ public:
void createGroupForSelectedItems(QList<QGraphicsItem *> &selection);
void selectItemsRightOfFrame(int frame);
void resetSelectionGroup(bool selectItems = true);
/** @brief We are performing a timeline operation. */
void setOperation(OperationType op);
public slots:
/** @brief Send seek request to MLT. */
......
......@@ -362,15 +362,15 @@ void TrackView::parseDocument(const QDomDocument &doc)
if (!e.isNull() && e.attribute("tag") == paramName) {
if (e.attribute("type") == "double") {
QString factor = e.attribute("factor", "1");
double offset = e.attribute("offset", "0").toDouble();
double offset = locale.toDouble(e.attribute("offset", "0"));
if (factor != "1" || offset != 0) {
double fact;
if (factor.contains('%')) {
fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else {
fact = factor.toDouble();
fact = locale.toDouble(factor);
}
paramValue = locale.toString(offset + paramValue.toDouble() * fact);
paramValue = locale.toString(offset + locale.toDouble(paramValue) * fact);
}
}
e.setAttribute("value", paramValue);
......@@ -833,7 +833,7 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
starttag = e.attribute("starttag", "start");
endtag = e.attribute("endtag", "end");
factor = e.attribute("factor", "1");
offset = e.attribute("offset", "0").toDouble();
offset = locale.toDouble(e.attribute("offset", "0"));
break;
}
}
......@@ -846,15 +846,16 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
if (factor.contains('%')) {
fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else {
fact = factor.toDouble();
fact = locale.toDouble(factor);
}
for (QDomNode n3 = effect.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
// parse effect parameters
QDomElement effectparam = n3.toElement();
if (effectparam.attribute("name") == starttag)
startvalue = offset + effectparam.text().toDouble() * fact;
if (effectparam.attribute("name") == endtag)
endvalue = offset + effectparam.text().toDouble() * fact;
startvalue = offset + locale.toDouble(effectparam.text()) * fact;
if (effectparam.attribute("name") == endtag) {
endvalue = offset + locale.toDouble(effectparam.text()) * fact;
}
}
// add first keyframe
if (effectout <= effectin) {
......@@ -880,7 +881,7 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
continueParsing = false;
break;
} else if (subeffectparam.attribute("name") == endtag) {
endvalue = offset + subeffectparam.text().toDouble() * fact;
endvalue = offset + locale.toDouble(subeffectparam.text()) * fact;
break;
}
}
......@@ -978,9 +979,9 @@ void TrackView::adjustparameterValue(QDomNodeList clipeffectparams, const QStrin
if (factor.contains('%')) {
fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else {
fact = factor.toDouble();
fact = locale.toDouble(factor);
}
double offset = e.attribute("offset", "0").toDouble();
double offset = locale.toDouble(e.attribute("offset", "0"));
if (type == "simplekeyframe") {
QStringList kfrs = paramvalue.split(';');
for (int l = 0; l < kfrs.count(); ++l) {
......
......@@ -37,7 +37,7 @@ Transition::Transition(const ItemInfo &info, int transitiontrack, double fps, co
m_automaticTransition(automaticTransition),
m_transitionTrack(transitiontrack)
{
setZValue(3);
setZValue(4);
m_info.cropDuration = info.endPos - info.startPos;
setPos(info.startPos.frames(fps), (int)(info.track * KdenliveSettings::trackheight() + itemOffset() + 1));
......@@ -204,11 +204,20 @@ int Transition::type() const
QVariant Transition::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedChange) {
if (value.toBool()) setZValue(10);
else setZValue(3);
if (value.toBool()) setZValue(5);
else setZValue(4);
}
if (change == ItemPositionChange && scene()) {
CustomTrackScene *scene = NULL;
if (change == ItemPositionChange) {
scene = projectScene();
}
if (scene) {
// calculate new position.
if (scene->isZooming) {
// For some reason, mouse wheel on selected itm sometimes triggered
// a position change event corrupting timeline, so discard it
return pos();
}
QPointF newPos = value.toPointF();
int xpos = projectScene()->getSnapPointForPos((int) newPos.x(), KdenliveSettings::snaptopoints());
xpos = qMax(xpos, 0);
......@@ -228,7 +237,7 @@ QVariant Transition::itemChange(GraphicsItemChange change, const QVariant &value
QList<QGraphicsItem*> items;
// TODO: manage transitions in OVERWRITE MODE
//if (projectScene()->editMode() == NORMALEDIT)
items = scene()->items(sceneShape, Qt::IntersectsItemShape);
items = scene->items(sceneShape, Qt::IntersectsItemShape);
items.removeAll(this);
bool forwardMove = newPos.x() > pos().x();
......@@ -256,7 +265,7 @@ QVariant Transition::itemChange(GraphicsItemChange change, const QVariant &value
sceneShape.translate(QPointF(offset, 0));
newPos.setX(newPos.x() + offset);
}
QList<QGraphicsItem*> subitems = scene()->items(sceneShape, Qt::IntersectsItemShape);
QList<QGraphicsItem*> subitems = scene->items(sceneShape, Qt::IntersectsItemShape);
subitems.removeAll(this);
for (int j = 0; j < subitems.count(); ++j) {
if (!subitems.at(j)->isEnabled()) continue;
......
......@@ -173,7 +173,7 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
cursor.select(QTextCursor::Document);
QColor fontcolor = cursor.charFormat().foreground().color();
content.setAttribute("font-color", colorToString(fontcolor));
if (!t->data(101).isNull()) content.setAttribute("font-outline", t->data(101).toDouble());
if (!t->data(101).isNull()) content.setAttribute("font-outline", QString::number(t->data(101).toDouble()));
if (!t->data(102).isNull()) {
QVariant variant = t->data(102);
QColor outlineColor = variant.value<QColor>();
......@@ -183,7 +183,7 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
if (!t->data(100).isNull()) {
QStringList effectParams = t->data(100).toStringList();
QString effectName = effectParams.takeFirst();
content.setAttribute("textwidth", t->sceneBoundingRect().width());
content.setAttribute("textwidth", QString::number(t->sceneBoundingRect().width()));
content.setAttribute(effectName, effectParams.join(";"));
}
......@@ -204,8 +204,8 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
// position
QDomElement pos = doc.createElement("position");
pos.setAttribute("x", item->pos().x());
pos.setAttribute("y", item->pos().y());
pos.setAttribute("x", QString::number(item->pos().x()));
pos.setAttribute("y", QString::number(item->pos().y()));
QTransform transform = item->transform();
QDomElement tr = doc.createElement("transform");
if (!item->data(ZOOMFACTOR).isNull()) {
......@@ -230,7 +230,7 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
QDomElement effect = doc.createElement("effect");
if (blur) {
effect.setAttribute("type", "blur");
effect.setAttribute("blurradius", blur->blurRadius());
effect.setAttribute("blurradius", QString::number(blur->blurRadius()));
} /*else {
//WARNING:those effects are anyways broken because they use QPixmaps which are not safe for MLT's threaded workflow
QGraphicsDropShadowEffect *shadow = static_cast <QGraphicsDropShadowEffect *>(eff);
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>296</height>
<width>376</width>
<height>458</height>
</rect>
</property>
<property name="windowTitle">
......@@ -243,26 +243,13 @@
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="4" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
......@@ -293,6 +280,19 @@
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
......
......@@ -111,13 +111,12 @@ QString ThemeManager::currentThemeName() const
: action->text().remove('&'));
}
void ThemeManager::setCurrentTheme(const QString& name)
void ThemeManager::setCurrentTheme(const QString& filename)
{
if (!d->themeMenuAction || !d->themeMenuActionGroup)
return;
QString name = d->themeMap.key(filename, d->defaultThemeName);
QList<QAction*> list = d->themeMenuActionGroup->actions();
foreach(QAction* const action, list)
{
if (action->text().remove('&') == name)
......