Required changes to make Kdenlive work with some locales that have a comma (,)...

Required changes to make Kdenlive work with some locales that have a comma (,) as numeric separator. Also now documents with a different locale will open as read only. Sadly this breaks the string freeze by introducing a new string and probably messing up some effects translation, since I changed the "paramlist" type to use ';' as separator instead of ','.

svn path=/trunk/kdenlive/; revision=5793
parent d922e620
......@@ -14,15 +14,14 @@ include(MacroLibrary)
include(FindGettext)
include(MacroOptionalAddSubdirectory)
set(catalogname kdenlive)
find_package(Qt COMPONENTS QtOpenGL)
find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtScript REQUIRED)
if ( NOT QT_QTOPENGL_FOUND )
message(FATAL_ERROR "QtOpenGL (most likely called libqt4-opengl-dev) not found.")
else ( NOT QT_QTOPENGL_FOUND )
message(-- " Found QtOpenGL.")
endif ( NOT QT_QTOPENGL_FOUND )
find_library(Qt COMPONENTS QtOpenGL REQUIRED)
find_library(Qt COMPONENTS QtScript REQUIRED)
find_library(Qt COMPONENTS QtOpenGL QtScript REQUIRED)
add_definitions(${QT_DEFINITIONS})
......
......@@ -8,7 +8,7 @@
<text>Colour</text>
</group>
<group list="frei0r.letterb0xed,pan_zoom,frei0r.scale0tilt,crop,affine,affinerotate">
<text>Crop &amp; transform</text>
<text>Crop and transform</text>
</group>
<group list="volume,normalise,gain,ladspa.1049,ladspa.1048,ladspa.1413,mute">
<text>Audio correction</text>
......@@ -22,8 +22,8 @@
<group list="burningtv,charcoal,dust,grain,lines,lightgraffiti,oldfilm,vignette">
<text>Fun</text>
</group>
<group list="boxblur,obscure,autotrack_rectangle,frei0r.squareblur,frei0r.glow">
<text>Blur &amp; hide</text>
<group list="boxblur,obscure,autotrack_rectangle,frei0r.squareblur,frei0r.glow,frei0r.IIRblur">
<text>Blur and hide</text>
</group>
<group list="speed,freeze">
<text>Motion</text>
......
......@@ -3,7 +3,7 @@
<name>Pan</name>
<description>Adjust the left/right spread of a channel</description>
<author>Dan Dennedy</author>
<parameter type="list" name="channel" default="0" paramlist="0,1">
<parameter type="list" name="channel" default="0" paramlist="0;1">
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>Channel</name>
</parameter>
......
......@@ -3,11 +3,11 @@
<name>Mono to stereo</name>
<description>Copy one channel to another</description>
<author>Dan Dennedy</author>
<parameter type="list" name="from" default="0" paramlist="0,1">
<parameter type="list" name="from" default="0" paramlist="0;1">
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>From</name>
</parameter>
<parameter type="list" name="to" default="1" paramlist="0,1">
<parameter type="list" name="to" default="1" paramlist="0;1">
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>To</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.alpha0ps" id="frei0r.alpha0ps">
<effect LC_NUMERIC="C" tag="frei0r.alpha0ps" id="frei0r.alpha0ps">
<name>Alpha operations</name>
<description>Display and manipulation of the alpha channel</description>
<author>Marko Cebokli</author>
<parameter type="list" name="Display" default="0.0" paramlist="0.0,0.21,0.36,0.50,0.64,0.79,1.0">
<parameter type="list" name="Display" default="0.0" paramlist="0.0;0.21;0.36;0.50;0.64;0.79;1.0">
<paramlistdisplay>Image,Alpha as gray,Gray + red,Selection on black,Selection on gray,Selection on white,Selection on checkers</paramlistdisplay>
<name>Display</name>
</parameter>
......@@ -13,7 +13,7 @@
<name>Display input alpha</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.21,0.36,0.50,0.64,0.79,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.21;0.36;0.50;0.64;0.79;1.0">
<paramlistdisplay>NO OP,Shave,Shrink hard,Shrink soft,Grow hard,Grow soft,Threshold</paramlistdisplay>
<name>Operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.alphagrad" id="frei0r.alphagrad">
<effect LC_NUMERIC="C" tag="frei0r.alphagrad" id="frei0r.alphagrad">
<name>Alpha gradient</name>
<description>Fill the alpha channel with a specified gradient</description>
<author>Marko Cebokli</author>
......@@ -25,7 +25,7 @@
<name>Max</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Max,Min,Add,Subtract</paramlistdisplay>
<name>Operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.alphaspot" id="frei0r.alphaspot">
<effect LC_NUMERIC="C" tag="frei0r.alphaspot" id="frei0r.alphaspot">
<name>Alpha shapes</name>
<description>Draws simple shapes into the alpha channel</description>
<author>Marko Cebokli</author>
<parameter type="list" name="Shape" default="0.0" paramlist="0.0,0.38,0.62,1.0">
<parameter type="list" name="Shape" default="0.0" paramlist="0.0;0.38;0.62;1.0">
<paramlistdisplay>Rectangle,Ellipse,Triangle,Diamond</paramlistdisplay>
<name>Shape</name>
</parameter>
......@@ -42,7 +42,7 @@
<name>Max</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Max,Min,Add,Subtract</paramlistdisplay>
<name>Operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.curves" id="frei0r.bezier_curves" version="0.2">
<effect LC_NUMERIC="C" tag="frei0r.curves" id="frei0r.bezier_curves" version="0.2">
<name>Bézier Curves</name>
<description>Color curves adjustment</description>
<author>Till Theato, Maksim Golovkin</author>
<parameter type="list" name="Channel" default="0.5" paramlist="0.5,0,0.1,0.2,0.3,0.4,0.6,0.71">
<parameter type="list" name="Channel" default="0.5" paramlist="0.5;0;0.1;0.2;0.3;0.4;0.6;0.71">
<paramlistdisplay>RGB,Red,Green,Blue,Alpha,Luma,Hue,Saturation</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter type="list" name="Luma formula" default="1" paramlist="0,1">
<parameter type="list" name="Luma formula" default="1" paramlist="0;1">
<paramlistdisplay>Rec. 601,Rec. 709</paramlistdisplay>
<name>Luma formula</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.c0rners" id="frei0r.c0rners">
<effect LC_NUMERIC="C" tag="frei0r.c0rners" id="frei0r.c0rners">
<name>Corners</name>
<description>Four corners geometry engine</description>
<author>Marko Cebokli</author>
......@@ -52,7 +52,7 @@
<name>Enable Stretch</name>
</parameter>
<parameter type="list" name="Interpolator" default="0.166" paramlist="0,0.166,0.333,0.5,0.666,0.833,1.0">
<parameter type="list" name="Interpolator" default="0.166" paramlist="0;0.166;0.333;0.5;0.666;0.833;1.0">
<paramlistdisplay>Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos</paramlistdisplay>
<name>Interpolator</name>
</parameter>
......@@ -61,7 +61,7 @@
<name>Transparent Background</name>
</parameter>
<parameter type="list" name="Alpha operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Alpha operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Maximum,Minimum,Add,Subtract</paramlistdisplay>
<name>Alpha operation</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.coloradj_RGB" id="frei0r.coloradj_RGB">
<effect LC_NUMERIC="C" tag="frei0r.coloradj_RGB" id="frei0r.coloradj_RGB">
<name>RGB adjustment</name>
<description>Simple color adjustment</description>
<author>Marko Cebokli</author>
......@@ -16,7 +16,7 @@
<name>B</name>
</parameter>
<parameter type="list" name="Action" default="0.5" paramlist="0.0,0.5,1.0">
<parameter type="list" name="Action" default="0.5" paramlist="0.0;0.5;1.0">
<paramlistdisplay>Add constant,Change gamma,Multiply</paramlistdisplay>
<name>Action</name>
</parameter>
......@@ -29,7 +29,7 @@
<name>Alpha controlled</name>
</parameter>
<parameter type="list" name="Luma formula" default="1.0" paramlist="0.0,1.0">
<parameter type="list" name="Luma formula" default="1.0" paramlist="0.0;1.0">
<paramlistdisplay>Rec. 601,Rec. 709</paramlistdisplay>
<name>Luma formula</name>
</parameter>
......
......@@ -3,7 +3,7 @@
<name>Curves</name>
<description>Color curves adjustment</description>
<author>Maksim Golovkin</author>
<parameter type="list" name="Channel" default="0" paramlist="0,1,2,3">
<parameter type="list" name="Channel" default="0" paramlist="0;1;2;3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
......@@ -51,7 +51,7 @@
<parameter type="bool" name="Show curves" default="0">
<name>Show graph in picture</name>
</parameter>
<parameter type="list" name="Graph position" default="3" paramlist="0,1,2,3">
<parameter type="list" name="Graph position" default="3" paramlist="0;1;2;3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Graph position</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.defish0r" id="frei0r.defish0r">
<effect LC_NUMERIC="C" tag="frei0r.defish0r" id="frei0r.defish0r">
<name>Defish</name>
<description>Non rectilinear lens mappings</description>
<author>Marko Cebokli</author>
......@@ -9,22 +9,22 @@
<parameter type="bool" name="DeFish" default="1">
<name>DeFish</name>
</parameter>
<parameter type="list" name="Type" default="0.666" paramlist="0,0.333,0.666,1.0">
<parameter type="list" name="Type" default="0.666" paramlist="0;0.333;0.666;1.0">
<paramlistdisplay>Equidistant,Orthographic,Equiarea,Stereographic</paramlistdisplay>
<name>Type</name>
</parameter>
<parameter type="list" name="Scaling" default="0" paramlist="0,0.333,0.666,1.0">
<parameter type="list" name="Scaling" default="0" paramlist="0;0.333;0.666;1.0">
<paramlistdisplay>Fill,Center,Fit,Manual</paramlistdisplay>
<name>Scaling</name>
</parameter>
<parameter type="constant" name="Manual Scale" default="500" min="0" max="1000" factor="1000">
<name>Manual Scale</name>
</parameter>
<parameter type="list" name="Interpolator" default="0.166" paramlist="0,0.166,0.333,0.5,0.666,0.833,1.0">
<parameter type="list" name="Interpolator" default="0.166" paramlist="0;0.166;0.333;0.5;0.666;0.833;1.0">
<paramlistdisplay>Nearest neighbor,Bilinear,Bicubic smooth,Bicubic sharp,Spline 4x4,Spline 6x6,Lanczos</paramlistdisplay>
<name>Interpolator</name>
</parameter>
<parameter type="list" name="Aspect type" default="0" paramlist="0,0.25,0.5,0.75,1.0">
<parameter type="list" name="Aspect type" default="0" paramlist="0;0.25;0.5;0.75;1.0">
<paramlistdisplay>Square,PAL DV,NTSC DV,HDV,Manual</paramlistdisplay>
<name>Aspect type</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.facedetect" id="frei0r.facedetect">
<effect LC_NUMERIC="C" tag="frei0r.facedetect" id="frei0r.facedetect">
<name>Face detect</name>
<description>Detect faces and draw shapes on them using OpenCV</description>
<author>binarymillenium, Dan Dennedy</author>
......@@ -24,7 +24,7 @@
<comment>How often to detect a face. In between checks, it does object motion tracking.</comment>
</parameter>
<parameter type="list" name="Shape" default="0.0" paramlist="0.0,0.1,0.2,1.0">
<parameter type="list" name="Shape" default="0.0" paramlist="0.0;0.1;0.2;1.0">
<paramlistdisplay>circle,ellipse,rectangle,random</paramlistdisplay>
<name>Shape</name>
</parameter>
......
......@@ -3,7 +3,7 @@
<name>Levels</name>
<description>Adjust levels</description>
<author>Maksim Golovkin</author>
<parameter type="list" name="Channel" default="3" paramlist="0,1,2,3">
<parameter type="list" name="Channel" default="3" paramlist="0;1;2;3">
<paramlistdisplay>Red,Green,Blue,Luma</paramlistdisplay>
<name>Channel</name>
</parameter>
......@@ -25,7 +25,7 @@
<parameter type="bool" name="Show histogram" default="0">
<name>Show histogram</name>
</parameter>
<parameter type="list" name="Histogram position" default="3" paramlist="0,1,2,3">
<parameter type="list" name="Histogram position" default="3" paramlist="0;1;2;3">
<paramlistdisplay>Top Left,Top Right,Bottom Left,Bottom Right</paramlistdisplay>
<name>Histogram position</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.pr0be" id="frei0r.pr0be">
<effect LC_NUMERIC="C" tag="frei0r.pr0be" id="frei0r.pr0be">
<name>pr0be</name>
<description>Measure video values</description>
<author>Marko Cebokli</author>
<parameter type="list" name="Measurement" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Measurement" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>RGB,Y'PbPr - rec. 601,Y'PbPr - rec. 709,HSV,HSL</paramlistdisplay>
<name>Measurement</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.pr0file" id="frei0r.pr0file">
<effect LC_NUMERIC="C" tag="frei0r.pr0file" id="frei0r.pr0file">
<name>pr0file</name>
<description>2D video oscilloscope</description>
<author>Marko Cebokli</author>
......@@ -20,7 +20,7 @@
<name>Length</name>
</parameter>
<parameter type="list" name="Channel" default="0.5" paramlist="0.0,0.2,0.4,0.5,0.6,0.8,1.0">
<parameter type="list" name="Channel" default="0.5" paramlist="0.0;0.2;0.4;0.5;0.6;0.8;1.0">
<paramlistdisplay>R,G,B,Y',Pr,Pb,Alpha</paramlistdisplay>
<name>Channel</name>
</parameter>
......@@ -81,7 +81,7 @@
<name>256 scale</name>
</parameter>
<parameter type="list" name="Color" default="0.0" paramlist="0.0,1.0">
<parameter type="list" name="Color" default="0.0" paramlist="0.0;1.0">
<paramlistdisplay>CCIR rec. 601,CCIR rec. 709</paramlistdisplay>
<name>Color</name>
</parameter>
......
<!DOCTYPE kpartgui>
<effect tag="frei0r.select0r" id="frei0r.select0r">
<effect LC_NUMERIC="C" tag="frei0r.select0r" id="frei0r.select0r">
<name>Color Selection</name>
<description>Color based alpha selection</description>
<author>Marko Cebokli</author>
......@@ -24,22 +24,22 @@
<name>Delta B / I / I</name>
</parameter>
<parameter type="list" name="Selection subspace" default="0.0" paramlist="0.0,0.5,1.0">
<parameter type="list" name="Selection subspace" default="0.0" paramlist="0.0;0.5;1.0">
<paramlistdisplay>RGB,ABI,HCI</paramlistdisplay>
<name>Selection subspace</name>
</parameter>
<parameter type="list" name="Subspace shape" default="0.0" paramlist="0.0,0.5,1.0">
<parameter type="list" name="Subspace shape" default="0.0" paramlist="0.0;0.5;1.0">
<paramlistdisplay>Box,Ellipsoid,Diamond</paramlistdisplay>
<name>Subspace shape</name>
</parameter>
<parameter type="list" name="Edge mode" default="0.0" paramlist="0.0,0.35,0.60,1.0">
<parameter type="list" name="Edge mode" default="0.0" paramlist="0.0;0.35;0.60;1.0">
<paramlistdisplay>Hard,Fat,Normal,Skinny</paramlistdisplay>
<name>Edge mode</name>
</parameter>
<parameter type="list" name="Operation" default="0.0" paramlist="0.0,0.3,0.5,0.7,1.0">
<parameter type="list" name="Operation" default="0.0" paramlist="0.0;0.3;0.5;0.7;1.0">
<paramlistdisplay>Write on clear,Max,Min,Add,Subtract</paramlistdisplay>
<name>Operation</name>
</parameter>
......
......@@ -3,7 +3,7 @@
<name>Mirror</name>
<description>Flip your image in any direction</description>
<author>Charles Yates</author>
<parameter type="list" name="mirror" default="horizontal" paramlist="horizontal,vertical,diagonal,xdiagonal,flip,flop">
<parameter type="list" name="mirror" default="horizontal" paramlist="horizontal;vertical;diagonal;xdiagonal;flip;flop">
<name>Mirroring direction</name>
</parameter>
<parameter type="bool" name="reverse" default="0">
......
......@@ -3,7 +3,7 @@
<name>Obscure</name>
<description>Hide a region of the clip</description>
<author>Charles Yates</author>
<parameter type="geometry" name="start" default="40%,40%:20%x20%" fixed="1">
<parameter type="geometry" name="start" default="40%,40%:20%x20%">
<name>Region</name>
</parameter>
</effect>
......@@ -4,12 +4,12 @@
<description>Keyframable vector based rotoscoping</description>
<author>Till Theato</author>
<parameter type="list" name="mode" default="alpha" paramlist="alpha,luma,rgb">
<parameter type="list" name="mode" default="alpha" paramlist="alpha;luma;rgb">
<paramlistdisplay>Alpha,Luma,RGB</paramlistdisplay>
<name>Mode</name>
</parameter>
<parameter type="list" name="alpha_operation" default="clear" paramlist="clear,max,min,add,sub">
<parameter type="list" name="alpha_operation" default="clear" paramlist="clear;max;min;add;sub">
<paramlistdisplay>Write on clear,Maximum,Minimum,Add,Subtract</paramlistdisplay>
<name>Alpha Operation</name>
</parameter>
......
......@@ -18,13 +18,13 @@
<parameter type="constant" name="speed" max="100" min="0" default="5" factor="10" suffix="Hz">
<name>Speed</name>
</parameter>
<parameter type="list" name="shape" default="sine" paramlist="sine,triangle">
<parameter type="list" name="shape" default="sine" paramlist="sine;triangle">
<name>Shape</name>
</parameter>
<parameter type="constant" name="phase" max="100" min="0" default="25" suffix="%">
<name>Phase</name>
</parameter>
<parameter type="list" name="interp" default="linear" paramlist="linear,quadratic">
<parameter type="list" name="interp" default="linear" paramlist="linear;quadratic">
<name>Interpolation</name>
</parameter>
</effect>
......@@ -17,7 +17,7 @@
***************************************************************************/
#include "cubicbezierspline.h"
#include <KDebug>
/** @brief For sorting a Bezier spline. Whether a is before b. */
static bool pointLessThan(const BPoint &a, const BPoint &b)
......@@ -69,10 +69,11 @@ void CubicBezierSpline::fromString(const QString& spline)
QString CubicBezierSpline::toString() const
{
QStringList spline;
QLocale locale;
foreach(const BPoint &p, m_points) {
spline << QString("%1;%2#%3;%4#%5;%6").arg(p.h1.x()).arg(p.h1.y())
.arg(p.p.x()).arg(p.p.y())
.arg(p.h2.x()).arg(p.h2.y());
spline << QString("%1;%2#%3;%4#%5;%6").arg(locale.toString(p.h1.x())).arg(locale.toString(p.h1.y()))
.arg(locale.toString(p.p.x())).arg(locale.toString(p.p.y()))
.arg(locale.toString(p.h2.x())).arg(locale.toString(p.h2.y()));
}
return spline.join("|");
}
......
This diff is collapsed.
......@@ -711,6 +711,7 @@ const QString &ClipProperties::clipId() const
QMap <QString, QString> ClipProperties::properties()
{
QMap <QString, QString> props;
QLocale locale;
CLIPTYPE t = UNKNOWN;
if (m_clip != NULL) {
t = m_clip->clipType();
......@@ -741,7 +742,7 @@ QMap <QString, QString> ClipProperties::properties()
double fps = m_view.clip_framerate->value();
if (m_view.clip_force_framerate->isChecked()) {
if (fps != m_old_props.value("force_fps").toDouble()) {
props["force_fps"] = QString::number(fps);
props["force_fps"] = locale.toString(fps);
m_clipNeedsRefresh = true;
}
} else if (m_old_props.contains("force_fps") && !m_old_props.value("force_fps").isEmpty()) {
......
......@@ -215,7 +215,7 @@ QImage Vectorscope::renderHUD(uint)
{
QImage hud;
QLocale locale;
if (m_mouseWithinWidget) {
// Mouse moved: Draw a circle over the scope
......@@ -247,10 +247,10 @@ QImage Vectorscope::renderHUD(uint)
}
davinci.drawEllipse(m_centerPoint, (int)r, (int)r);
davinci.setPen(penThin);
davinci.drawText(QPoint(m_scopeRect.width()-40, m_scopeRect.height()), i18n("%1 \%", QString::number(percent, 'f', 0)));
davinci.drawText(QPoint(m_scopeRect.width()-40, m_scopeRect.height()), i18n("%1 \%", locale.toString(percent, 'f', 0)));
float angle = copysign(acos(dx/r)*180/M_PI, dy);
davinci.drawText(QPoint(10, m_scopeRect.height()), i18n("%1°", QString::number(angle, 'f', 1)));
davinci.drawText(QPoint(10, m_scopeRect.height()), i18n("%1°", locale.toString(angle, 'f', 1)));
// m_circleEnabled = false;
} else {
......@@ -505,8 +505,9 @@ QImage Vectorscope::renderBackground(uint)
void Vectorscope::slotGainChanged(int newval)
{
QLocale locale;
m_gain = 1 + (float)newval/10;
ui->lblGain->setText(QString::number(m_gain, 'f', 1) + "x");
ui->lblGain->setText(locale.toString(m_gain, 'f', 1) + "x");
forceUpdateScope();
}
......
......@@ -130,7 +130,7 @@ CustomTrackView::CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscen
m_commandStack = doc->commandStack();
else
m_commandStack = NULL;
m_ct = 0;
setMouseTracking(true);
setAcceptDrops(true);
setFrameShape(QFrame::NoFrame);
......@@ -3711,9 +3711,15 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
void CustomTrackView::deleteClip(ItemInfo info, bool refresh)
{
ClipItem *item = getClipItemAt((int) info.startPos.frames(m_document->fps()), info.track);
m_ct++;
if (!item) kDebug()<<"// PROBLEM FINDING CLIP ITEM TO REMOVVE!!!!!!!!!";
else kDebug()<<"// deleting CLIP: "<<info.startPos.frames(m_document->fps())<<", "<<item->baseClip()->fileURL();
//m_document->renderer()->saveSceneList(QString("/tmp/error%1.mlt").arg(m_ct), QDomElement());
if (!item || m_document->renderer()->mltRemoveClip(m_document->tracksCount() - info.track, info.startPos) == false) {
emit displayMessage(i18n("Error removing clip at %1 on track %2", m_document->timecode().getTimecodeFromFrames(info.startPos.frames(m_document->fps())), info.track), ErrorMessage);
kDebug()<<"CANNOT REMOVE: "<<info.startPos.frames(m_document->fps())<<", TK: "<<info.track;
//m_document->renderer()->saveSceneList(QString("/tmp/error%1.mlt").arg(m_ct), QDomElement());
exit(1);
return;
}
m_waitingThumbs.removeAll(item);
......@@ -5514,6 +5520,7 @@ void CustomTrackView::adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime
// parse parameters to check if we need to adjust to the new crop start
int diff = (newstart - oldstart).frames(m_document->fps());
int max = (newstart + duration).frames(m_document->fps());
QLocale locale;
QDomNodeList params = xml.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
......@@ -5527,9 +5534,9 @@ void CustomTrackView::adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime
double val = str.section(':', 1, 1).toDouble();
pos += diff;
if (pos > max) {
newKeyFrames.append(QString::number(max) + ':' + QString::number(val));
newKeyFrames.append(QString::number(max) + ':' + locale.toString(val));
break;
} else newKeyFrames.append(QString::number(pos) + ':' + QString::number(val));
} else newKeyFrames.append(QString::number(pos) + ':' + locale.toString(val));
}
//kDebug()<<"ORIGIN: "<<keys<<", FIXED: "<<newKeyFrames;
e.setAttribute("keyframes", newKeyFrames.join(";"));
......@@ -5641,8 +5648,8 @@ void CustomTrackView::slotUpdateAllThumbs()
} else {
QString startThumb = thumbBase + item->baseClip()->getClipHash() + '_';
QString endThumb = startThumb;
startThumb.append(QString::number(item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
endThumb.append(QString::number((item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
startThumb.append(QString::number((int) item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
endThumb.append(QString::number((int) (item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
if (QFile::exists(startThumb)) {
QPixmap pix(startThumb);
if (pix.isNull()) KIO::NetAccess::del(KUrl(startThumb), this);
......@@ -5680,8 +5687,8 @@ void CustomTrackView::saveThumbnails()
} else {
QString startThumb = thumbBase + item->baseClip()->getClipHash() + '_';
QString endThumb = startThumb;
startThumb.append(QString::number(item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
endThumb.append(QString::number((item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
startThumb.append(QString::number((int) item->speedIndependantCropStart().frames(m_document->fps())) + ".png");
endThumb.append(QString::number((int) (item->speedIndependantCropStart() + item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");
if (!QFile::exists(startThumb)) {
QPixmap pix(item->startThumb());
pix.save(startThumb);
......@@ -5809,6 +5816,7 @@ void CustomTrackView::autoTransition()
QStringList CustomTrackView::getLadspaParams(QDomElement effect) const
{
QStringList result;
QLocale locale;
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
......@@ -5817,7 +5825,7 @@ QStringList CustomTrackView::getLadspaParams(QDomElement effect) const
double factor = e.attribute("factor").toDouble();
double value = e.attribute("value").toDouble();
value = value / factor;
result.append(QString::number(value));
result.append(locale.toString(value));
} else result.append(e.attribute("value"));
}
}
......@@ -6531,6 +6539,7 @@ void CustomTrackView::slotAddTrackEffect(const QDomElement effect, int ix)
EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
{
EffectsParameterList parameters;
QLocale locale;
parameters.addParam("tag", effect.attribute("tag"));
if (effect.hasAttribute("region")) parameters.addParam("region", effect.attribute("region"));
parameters.addParam("kdenlive_ix", effect.attribute("kdenlive_ix"));
......@@ -6554,7 +6563,7 @@ EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
for (int j = 0; j < values.count(); j++) {
QString pos = values.at(j).section(':', 0, 0);
double val = values.at(j).section(':', 1, 1).toDouble() / factor;
values[j] = pos + "=" + QString::number(val);
values[j] = pos + "=" + locale.toString(val);
}
// kDebug() << "/ / / /SENDING KEYFR:" << values;
parameters.addParam(e.attribute("name"), values.join(";"));
......@@ -6589,7 +6598,7 @@ EffectsParameterList CustomTrackView::getEffectArgs(const QDomElement effect)
if (e.attribute("factor").contains('%')) {
fact = ProfilesDialog::getStringEval(m_document->mltProfile(), e.attribute("factor"));
} else fact = e.attribute("factor", "1").toDouble();
parameters.addParam(e.attribute("name"), QString::number(e.attribute("value").toDouble() / fact));
parameters.addParam(e.attribute("name"), locale.toString(e.attribute("value").toDouble() / fact));
} else {
parameters.addParam(e.attribute("name"), e.attribute("value"));
}
......
......@@ -282,6 +282,7 @@ protected:
virtual Qt::DropActions supportedDropActions() const;
private:
int m_ct;
int m_tracksHeight;
int m_projectDuration;
int m_cursorPos;
......
......@@ -48,8 +48,25 @@ bool DocumentValidator::validate(const double currentVersion)
// Check if we're validating a Kdenlive project
if (kdenliveDoc.isNull())
return false;
QLocale documentLocale;
if (mlt.hasAttribute("LC_NUMERIC")) {
// Set locale for the document
documentLocale = QLocale(mlt.attribute("LC_NUMERIC"));
if (documentLocale.decimalPoint() != QLocale().decimalPoint()) {
QDomElement docProperties = kdenliveDoc.firstChildElement("documentproperties");
if (docProperties.isNull()) {
docProperties = m_doc.createElement("documentproperties");
kdenliveDoc.appendChild(docProperties);
}
docProperties.setAttribute("readonly", 1);
KMessageBox::sorry(kapp->activeWindow(), i18n("The document you are opening uses a different locale (%1) than your system. You can only open and render it, no editing is supported unless you change your system's locale.", mlt.attribute("LC_NUMERIC")), i18n("Read only project"));
}
}