2013-11-15 13:41:26 +01:00
|
|
|
|
/************************************************************************
|
2013-09-23 14:08:06 +02:00
|
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @file vapplication.cpp
|
2014-04-30 07:38:52 +02:00
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @date November 15, 2013
|
2013-09-23 14:08:06 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
2013-09-23 14:08:06 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-23 14:08:06 +02:00
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-23 14:08:06 +02:00
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
*************************************************************************/
|
2013-09-23 14:08:06 +02:00
|
|
|
|
|
|
|
|
|
#include "vapplication.h"
|
2014-12-10 19:01:33 +01:00
|
|
|
|
#include "../libs/ifc/exception/vexceptionobjecterror.h"
|
|
|
|
|
#include "../libs/ifc/exception/vexceptionbadid.h"
|
|
|
|
|
#include "../libs/ifc/exception/vexceptionconversionerror.h"
|
|
|
|
|
#include "../libs/ifc/exception/vexceptionemptyparameter.h"
|
|
|
|
|
#include "../libs/ifc/exception/vexceptionwrongid.h"
|
2014-06-08 20:10:57 +02:00
|
|
|
|
#include "vmaingraphicsview.h"
|
|
|
|
|
#include "../container/calculator.h"
|
2014-11-15 16:52:27 +01:00
|
|
|
|
#include "../version.h"
|
2015-04-01 14:51:54 +02:00
|
|
|
|
#include "../../utils/logging.h"
|
2013-09-23 14:08:06 +02:00
|
|
|
|
|
2013-11-21 13:05:26 +01:00
|
|
|
|
#include <QDebug>
|
2014-05-12 11:35:33 +02:00
|
|
|
|
#include <QDir>
|
2014-07-04 16:52:11 +02:00
|
|
|
|
#include <QProcess>
|
2014-10-23 23:44:50 +02:00
|
|
|
|
#include <QTemporaryFile>
|
2014-06-08 20:10:57 +02:00
|
|
|
|
#include <QUndoStack>
|
2014-10-03 12:32:12 +02:00
|
|
|
|
#include <QtCore/qmath.h>
|
2014-10-23 21:16:40 +02:00
|
|
|
|
#include <QTemporaryFile>
|
2014-11-20 13:18:43 +01:00
|
|
|
|
#include <QFile>
|
|
|
|
|
#include <QStandardPaths>
|
|
|
|
|
#include <QMessageBox>
|
2014-11-28 19:33:28 +01:00
|
|
|
|
#include <QThread>
|
|
|
|
|
#include <QDateTime>
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2015-04-02 14:54:35 +02:00
|
|
|
|
# include <QLockFile>
|
|
|
|
|
#endif
|
2014-11-29 13:12:43 +01:00
|
|
|
|
#include <QtXmlPatterns>
|
2014-11-20 18:52:51 +01:00
|
|
|
|
|
2014-12-04 18:55:49 +01:00
|
|
|
|
using namespace qmu;
|
|
|
|
|
|
2014-11-20 18:52:51 +01:00
|
|
|
|
Q_LOGGING_CATEGORY(vApp, "v.application")
|
2014-11-20 13:18:43 +01:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
|
|
|
|
{
|
|
|
|
|
// Why on earth didn't Qt want to make failed signal/slot connections qWarning?
|
|
|
|
|
if ((type == QtDebugMsg) && msg.contains("::connect"))
|
|
|
|
|
{
|
|
|
|
|
type = QtWarningMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// this is another one that doesn't make sense as just a debug message. pretty serious
|
|
|
|
|
// sign of a problem
|
|
|
|
|
// http://www.developer.nokia.com/Community/Wiki/QPainter::begin:Paint_device_returned_engine_%3D%3D_0_(Known_Issue)
|
|
|
|
|
if ((type == QtDebugMsg) && msg.contains("QPainter::begin") && msg.contains("Paint device returned engine"))
|
|
|
|
|
{
|
|
|
|
|
type = QtWarningMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This qWarning about "Cowardly refusing to send clipboard message to hung application..."
|
|
|
|
|
// is something that can easily happen if you are debugging and the application is paused.
|
|
|
|
|
// As it is so common, not worth popping up a dialog.
|
|
|
|
|
if ((type == QtWarningMsg) && QString(msg).contains("QClipboard::event")
|
|
|
|
|
&& QString(msg).contains("Cowardly refusing"))
|
|
|
|
|
{
|
|
|
|
|
type = QtDebugMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// only the GUI thread should display message boxes. If you are
|
|
|
|
|
// writing a multithreaded application and the error happens on
|
|
|
|
|
// a non-GUI thread, you'll have to queue the message to the GUI
|
|
|
|
|
QCoreApplication *instance = QCoreApplication::instance();
|
|
|
|
|
const bool isGuiThread = instance && (QThread::currentThread() == instance->thread());
|
|
|
|
|
|
|
|
|
|
if (isGuiThread)
|
|
|
|
|
{
|
2014-11-28 14:49:06 +01:00
|
|
|
|
QString debugdate = "[" + QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss");
|
2014-11-20 13:18:43 +01:00
|
|
|
|
QMessageBox messageBox;
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case QtDebugMsg:
|
2014-11-28 14:49:06 +01:00
|
|
|
|
debugdate += QString(":DEBUG:%1(%2)] %3: %4: %5").arg(context.file).arg(context.line)
|
|
|
|
|
.arg(context.function).arg(context.category).arg(msg);
|
2014-11-20 13:18:43 +01:00
|
|
|
|
break;
|
|
|
|
|
case QtWarningMsg:
|
2014-11-28 14:49:06 +01:00
|
|
|
|
debugdate += QString(":WARNING:%1(%2)] %3: %4: %5").arg(context.file).arg(context.line)
|
|
|
|
|
.arg(context.function).arg(context.category).arg(msg);
|
2014-11-20 13:18:43 +01:00
|
|
|
|
messageBox.setIcon(QMessageBox::Warning);
|
|
|
|
|
break;
|
|
|
|
|
case QtCriticalMsg:
|
2014-11-28 14:49:06 +01:00
|
|
|
|
debugdate += QString(":CRITICAL:%1(%2)] %3: %4: %5").arg(context.file).arg(context.line)
|
|
|
|
|
.arg(context.function).arg(context.category).arg(msg);
|
2014-11-20 13:18:43 +01:00
|
|
|
|
messageBox.setIcon(QMessageBox::Critical);
|
|
|
|
|
break;
|
|
|
|
|
case QtFatalMsg:
|
2014-11-28 14:49:06 +01:00
|
|
|
|
debugdate += QString(":FATAL:%1(%2)] %3: %4: %5").arg(context.file).arg(context.line)
|
|
|
|
|
.arg(context.function).arg(context.category).arg(msg);
|
2014-11-20 13:18:43 +01:00
|
|
|
|
messageBox.setIcon(QMessageBox::Critical);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(*qApp->LogFile()) << debugdate << endl;
|
|
|
|
|
|
2014-11-28 18:55:27 +01:00
|
|
|
|
if (type == QtWarningMsg || type == QtCriticalMsg || type == QtFatalMsg)
|
|
|
|
|
{
|
|
|
|
|
messageBox.setInformativeText(msg);
|
|
|
|
|
messageBox.setStandardButtons(QMessageBox::Ok);
|
|
|
|
|
messageBox.setWindowModality(Qt::ApplicationModal);
|
|
|
|
|
messageBox.setModal(true);
|
|
|
|
|
messageBox.exec();
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-20 13:18:43 +01:00
|
|
|
|
if (QtFatalMsg == type)
|
|
|
|
|
{
|
|
|
|
|
abort();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (type != QtDebugMsg)
|
|
|
|
|
{
|
|
|
|
|
abort(); // be NOISY unless overridden!
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-11-21 13:05:26 +01:00
|
|
|
|
|
2014-03-19 19:27:11 +01:00
|
|
|
|
const qreal VApplication::PrintDPI = 96.0;
|
2014-11-15 17:29:10 +01:00
|
|
|
|
|
|
|
|
|
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
2014-11-15 16:52:27 +01:00
|
|
|
|
const QString VApplication::GistFileName = QStringLiteral("gist.json");
|
2014-11-15 17:29:10 +01:00
|
|
|
|
#endif // defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
2014-03-19 19:27:11 +01:00
|
|
|
|
|
2014-03-26 05:39:07 +01:00
|
|
|
|
#define DefWidth 1.2//mm
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-13 19:02:41 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication constructor.
|
|
|
|
|
* @param argc number arguments.
|
|
|
|
|
* @param argv command line.
|
|
|
|
|
*/
|
2014-03-19 19:27:11 +01:00
|
|
|
|
VApplication::VApplication(int &argc, char **argv)
|
2014-06-12 09:22:29 +02:00
|
|
|
|
: QApplication(argc, argv), _patternUnit(Unit::Cm), _patternType(MeasurementsType::Individual),
|
2014-12-04 18:55:49 +01:00
|
|
|
|
_widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap<QString, QmuTranslation>()),
|
|
|
|
|
guiTexts(QMap<QString, QmuTranslation>()), descriptions(QMap<QString, QmuTranslation>()),
|
|
|
|
|
variables(QMap<QString, QmuTranslation>()), functions(QMap<QString, QmuTranslation>()),
|
|
|
|
|
postfixOperators(QMap<QString, QmuTranslation>()), stDescriptions(QMap<QString, QmuTranslation>()),
|
2014-11-20 13:18:43 +01:00
|
|
|
|
undoStack(nullptr), sceneView(nullptr), currentScene(nullptr), autoSaveTimer(nullptr), mainWindow(nullptr),
|
2015-04-05 16:31:28 +02:00
|
|
|
|
openingPattern(false), settings(nullptr), doc(nullptr), log(nullptr),
|
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
|
|
|
|
out(nullptr), logLock(nullptr)
|
|
|
|
|
#else
|
|
|
|
|
out(nullptr)
|
|
|
|
|
#endif
|
2014-03-19 19:27:11 +01:00
|
|
|
|
{
|
2014-06-04 13:30:45 +02:00
|
|
|
|
undoStack = new QUndoStack(this);
|
|
|
|
|
|
2014-03-26 05:39:07 +01:00
|
|
|
|
InitLineWidth();
|
2014-05-13 10:08:37 +02:00
|
|
|
|
InitMeasurements();
|
|
|
|
|
InitVariables();
|
|
|
|
|
InitFunctions();
|
2014-05-23 09:14:21 +02:00
|
|
|
|
InitPostfixOperators();
|
2014-09-18 11:30:33 +02:00
|
|
|
|
InitSTDescriptions();
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-11-20 13:18:43 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
VApplication::~VApplication()
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Application closing.");
|
2014-11-20 13:18:43 +01:00
|
|
|
|
qInstallMessageHandler(0); // Resore the message handler
|
|
|
|
|
delete out;
|
|
|
|
|
|
|
|
|
|
if (log != nullptr)
|
|
|
|
|
{
|
|
|
|
|
log->close();
|
|
|
|
|
delete log;
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2014-11-28 14:49:06 +01:00
|
|
|
|
delete logLock;
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#endif
|
2014-11-20 13:18:43 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-04 16:52:11 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief NewValentina start Valentina in new process, send path to pattern file in argument.
|
|
|
|
|
* @param fileName path to pattern file.
|
|
|
|
|
*/
|
|
|
|
|
void VApplication::NewValentina(const QString &fileName)
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Open new detached process.");
|
2014-10-23 11:13:18 +02:00
|
|
|
|
if (fileName.isEmpty())
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "New process without arguments. program = %s", qApp->applicationFilePath().toUtf8().constData());
|
2014-11-26 19:34:43 +01:00
|
|
|
|
// Path can contain spaces.
|
2014-11-28 16:16:39 +01:00
|
|
|
|
if (QProcess::startDetached("\""+qApp->applicationFilePath()+"\""))
|
2014-11-26 19:34:43 +01:00
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "The process was started successfully.");
|
2014-11-26 19:34:43 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCWarning(vApp, "Could not run process. The operation timed out or an error occurred.");
|
2014-11-26 19:34:43 +01:00
|
|
|
|
}
|
2014-10-23 11:13:18 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-11-28 16:16:39 +01:00
|
|
|
|
const QString run = QString("\"%1\" \"%2\"").arg(qApp->applicationFilePath()).arg(fileName);
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "New process with arguments. program = %s", run.toUtf8().constData());
|
2015-03-02 18:11:43 +01:00
|
|
|
|
if (QProcess::startDetached(run))
|
2014-11-26 19:34:43 +01:00
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "The process was started successfully.");
|
2014-11-26 19:34:43 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCWarning(vApp, "Could not run process. The operation timed out or an error occurred.");
|
2014-11-26 19:34:43 +01:00
|
|
|
|
}
|
2014-10-23 11:13:18 +02:00
|
|
|
|
}
|
2014-07-04 16:52:11 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-15 15:51:15 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::CheckFactor(qreal &oldFactor, const qreal &Newfactor)
|
|
|
|
|
{
|
|
|
|
|
if (Newfactor <= 2 && Newfactor >= 0.5)
|
|
|
|
|
{
|
|
|
|
|
oldFactor = Newfactor;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-13 19:02:41 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief notify Reimplemented from QApplication::notify().
|
|
|
|
|
* @param receiver receiver.
|
|
|
|
|
* @param event event.
|
|
|
|
|
* @return value that is returned from the receiver's event handler.
|
|
|
|
|
*/
|
2014-03-26 05:39:07 +01:00
|
|
|
|
// reimplemented from QApplication so we can throw exceptions in slots
|
2013-11-04 21:35:15 +01:00
|
|
|
|
bool VApplication::notify(QObject *receiver, QEvent *event)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2014-03-19 19:27:11 +01:00
|
|
|
|
return QApplication::notify(receiver, event);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionObjectError &e)
|
|
|
|
|
{
|
2014-07-08 12:59:50 +02:00
|
|
|
|
e.CriticalMessageBox(tr("Error parsing file. Program will be terminated."), mainWindow);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionBadId &e)
|
|
|
|
|
{
|
2014-07-08 12:59:50 +02:00
|
|
|
|
e.CriticalMessageBox(tr("Error bad id. Program will be terminated."), mainWindow);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionConversionError &e)
|
|
|
|
|
{
|
2014-07-08 12:59:50 +02:00
|
|
|
|
e.CriticalMessageBox(tr("Error can't convert value. Program will be terminated."), mainWindow);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VExceptionEmptyParameter &e)
|
|
|
|
|
{
|
2014-07-08 12:59:50 +02:00
|
|
|
|
e.CriticalMessageBox(tr("Error empty parameter. Program will be terminated."), mainWindow);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2014-03-03 18:32:38 +01:00
|
|
|
|
catch (const VExceptionWrongId &e)
|
2013-11-04 21:35:15 +01:00
|
|
|
|
{
|
2014-07-08 12:59:50 +02:00
|
|
|
|
e.CriticalMessageBox(tr("Error wrong id. Program will be terminated."), mainWindow);
|
2013-09-23 14:08:06 +02:00
|
|
|
|
abort();
|
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (const VException &e)
|
|
|
|
|
{
|
2014-07-08 12:59:50 +02:00
|
|
|
|
e.CriticalMessageBox(tr("Something's wrong!!"), mainWindow);
|
2014-03-03 16:42:14 +01:00
|
|
|
|
return true;
|
2013-10-10 20:45:58 +02:00
|
|
|
|
}
|
2013-11-04 21:35:15 +01:00
|
|
|
|
catch (std::exception& e)
|
|
|
|
|
{
|
2013-09-23 14:08:06 +02:00
|
|
|
|
qCritical() << "Exception thrown:" << e.what();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2014-03-19 19:27:11 +01:00
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-07-23 12:04:23 +02:00
|
|
|
|
double VApplication::toPixel(double val, const Unit &unit) const
|
2014-03-19 19:27:11 +01:00
|
|
|
|
{
|
2014-07-23 12:04:23 +02:00
|
|
|
|
switch (unit)
|
2014-03-19 19:27:11 +01:00
|
|
|
|
{
|
2015-01-14 15:14:51 +01:00
|
|
|
|
case Unit::Mm:
|
|
|
|
|
return (val / 25.4) * PrintDPI;
|
|
|
|
|
case Unit::Cm:
|
|
|
|
|
return ((val * 10.0) / 25.4) * PrintDPI;
|
|
|
|
|
case Unit::Inch:
|
|
|
|
|
return val * PrintDPI;
|
|
|
|
|
case Unit::Px:
|
|
|
|
|
return val;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
2015-01-14 15:14:51 +01:00
|
|
|
|
return 0;
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-07-23 12:04:23 +02:00
|
|
|
|
double VApplication::toPixel(double val) const
|
|
|
|
|
{
|
|
|
|
|
return toPixel(val, _patternUnit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
double VApplication::fromPixel(double pix, const Unit &unit) const
|
2014-03-19 19:27:11 +01:00
|
|
|
|
{
|
2014-07-23 12:04:23 +02:00
|
|
|
|
switch (unit)
|
2014-03-19 19:27:11 +01:00
|
|
|
|
{
|
2015-01-14 15:14:51 +01:00
|
|
|
|
case Unit::Mm:
|
|
|
|
|
return (pix / PrintDPI) * 25.4;
|
|
|
|
|
case Unit::Cm:
|
|
|
|
|
return ((pix / PrintDPI) * 25.4) / 10.0;
|
|
|
|
|
case Unit::Inch:
|
|
|
|
|
return pix / PrintDPI;
|
|
|
|
|
case Unit::Px:
|
|
|
|
|
return pix;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
2015-01-14 15:14:51 +01:00
|
|
|
|
return 0;
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
2014-05-02 13:11:30 +02:00
|
|
|
|
|
2014-07-23 12:04:23 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
double VApplication::fromPixel(double pix) const
|
|
|
|
|
{
|
|
|
|
|
return fromPixel(pix, _patternUnit);
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2015-01-26 16:02:57 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::TryLock(QLockFile *lock)
|
|
|
|
|
{
|
|
|
|
|
if (lock == nullptr)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lock->tryLock())
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (lock->error() == QLockFile::LockFailedError)
|
|
|
|
|
{
|
|
|
|
|
// This happens if a stale lock file exists and another process uses that PID.
|
|
|
|
|
// Try removing the stale file, which will fail if a real process is holding a
|
|
|
|
|
// file-level lock. A false error is more problematic than not locking properly
|
|
|
|
|
// on corner-case systems.
|
|
|
|
|
if (lock->removeStaleLockFile() == false || lock->tryLock() == false)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-19 19:27:11 +01:00
|
|
|
|
QString VApplication::translationsPath() const
|
|
|
|
|
{
|
2014-10-24 16:23:41 +02:00
|
|
|
|
const QString trPath = QStringLiteral("/translations");
|
2014-03-26 05:39:07 +01:00
|
|
|
|
#ifdef Q_OS_WIN
|
2014-10-24 16:23:41 +02:00
|
|
|
|
return QApplication::applicationDirPath() + trPath;
|
2014-03-26 05:39:07 +01:00
|
|
|
|
#else
|
|
|
|
|
#ifdef QT_DEBUG
|
2014-10-24 16:23:41 +02:00
|
|
|
|
return QApplication::applicationDirPath() + trPath;
|
2014-05-12 11:35:33 +02:00
|
|
|
|
#else
|
2014-10-24 16:23:41 +02:00
|
|
|
|
QDir dir(QApplication::applicationDirPath() + trPath);
|
2014-06-10 22:14:16 +02:00
|
|
|
|
if (dir.exists())
|
2014-05-12 11:35:33 +02:00
|
|
|
|
{
|
|
|
|
|
return dir.absolutePath();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-03-19 19:27:11 +01:00
|
|
|
|
return QStringLiteral("/usr/share/valentina/translations");
|
2014-05-12 11:35:33 +02:00
|
|
|
|
}
|
2014-03-19 19:27:11 +01:00
|
|
|
|
#endif
|
2014-05-12 11:35:33 +02:00
|
|
|
|
#endif
|
2014-03-19 19:27:11 +01:00
|
|
|
|
}
|
2014-03-26 05:39:07 +01:00
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-26 05:39:07 +01:00
|
|
|
|
void VApplication::InitLineWidth()
|
|
|
|
|
{
|
2014-05-01 13:33:40 +02:00
|
|
|
|
switch (_patternUnit)
|
2014-03-26 05:39:07 +01:00
|
|
|
|
{
|
2014-06-12 09:22:29 +02:00
|
|
|
|
case Unit::Mm:
|
2014-03-26 05:39:07 +01:00
|
|
|
|
_widthMainLine = DefWidth;
|
|
|
|
|
break;
|
2014-06-12 09:22:29 +02:00
|
|
|
|
case Unit::Cm:
|
2014-03-26 05:39:07 +01:00
|
|
|
|
_widthMainLine = DefWidth/10.0;
|
|
|
|
|
break;
|
2014-06-12 09:22:29 +02:00
|
|
|
|
case Unit::Inch:
|
2014-03-26 05:39:07 +01:00
|
|
|
|
_widthMainLine = DefWidth/25.4;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
_widthMainLine = DefWidth;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_widthHairLine = _widthMainLine/3.0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-16 21:08:48 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-12-04 18:55:49 +01:00
|
|
|
|
void VApplication::InitMeasurement(const QString &name, const QmuTranslation &m, const QmuTranslation &g,
|
|
|
|
|
const QmuTranslation &d)
|
2014-09-16 21:08:48 +02:00
|
|
|
|
{
|
|
|
|
|
measurements.insert(name, m);
|
|
|
|
|
guiTexts.insert(name, g);
|
|
|
|
|
descriptions.insert(name, d);
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-20 13:18:43 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::LogDirPath() const
|
|
|
|
|
{
|
|
|
|
|
#if defined(Q_OS_WIN) || defined(Q_OS_OSX)
|
|
|
|
|
const QString logDirPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString(),
|
|
|
|
|
QStandardPaths::LocateDirectory) + "Valentina";
|
|
|
|
|
#else
|
|
|
|
|
const QString logDirPath = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString(),
|
|
|
|
|
QStandardPaths::LocateDirectory) + organizationName();
|
|
|
|
|
#endif
|
|
|
|
|
return logDirPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::LogPath() const
|
|
|
|
|
{
|
2014-11-28 14:49:06 +01:00
|
|
|
|
return QString("%1/valentina-pid%2.log").arg(LogDirPath()).arg(qApp->applicationPid());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::CreateLogDir() const
|
|
|
|
|
{
|
|
|
|
|
QDir logDir(LogDirPath());
|
|
|
|
|
if (logDir.exists() == false)
|
|
|
|
|
{
|
|
|
|
|
logDir.mkpath("."); // Create directory for log if need
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::BeginLogging()
|
|
|
|
|
{
|
|
|
|
|
log = new QFile(LogPath());
|
|
|
|
|
if (log->open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
|
|
|
|
{
|
|
|
|
|
out = new QTextStream(log);
|
|
|
|
|
qInstallMessageHandler(noisyFailureMsgHandler);
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2014-11-28 14:49:06 +01:00
|
|
|
|
logLock = new QLockFile(LogPath()+".lock");
|
|
|
|
|
logLock->setStaleLockTime(0);
|
2015-01-26 16:02:57 +01:00
|
|
|
|
if (TryLock(logLock))
|
2014-11-28 14:49:06 +01:00
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Log file %s was locked.", LogPath().toUtf8().constData());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Failed to lock %s", LogPath().toUtf8().constData());
|
|
|
|
|
qCDebug(vApp, "Error type: %d", logLock->error());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
delete log;
|
2014-12-18 11:52:39 +01:00
|
|
|
|
log = nullptr;
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Error opening log file \'%s\'. All debug output redirected to console.",
|
|
|
|
|
LogPath().toUtf8().constData());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::ClearOldLogs() const
|
|
|
|
|
{
|
|
|
|
|
QStringList filters{"*.log"};
|
|
|
|
|
QDir logsDir(LogDirPath());
|
|
|
|
|
logsDir.setNameFilters(filters);
|
|
|
|
|
logsDir.setCurrent(LogDirPath());
|
|
|
|
|
|
|
|
|
|
const QStringList allFiles = logsDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
|
|
|
|
|
if (allFiles.isEmpty() == false)
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Clearing old logs");
|
2014-11-28 14:49:06 +01:00
|
|
|
|
for (int i = 0; i < allFiles.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
QFileInfo info(allFiles.at(i));
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2014-11-28 14:49:06 +01:00
|
|
|
|
QLockFile *lock = new QLockFile(info.absoluteFilePath() + ".lock");
|
2015-01-26 16:02:57 +01:00
|
|
|
|
if (TryLock(lock))
|
2014-11-28 14:49:06 +01:00
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Locked file %s", info.absoluteFilePath().toUtf8().constData());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
QFile oldLog(allFiles.at(i));
|
|
|
|
|
if (oldLog.remove())
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Deleted %s", info.absoluteFilePath().toUtf8().constData());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Could not delete %s", info.absoluteFilePath().toUtf8().constData());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "Failed to lock %s", info.absoluteFilePath().toUtf8().constData());
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
2015-04-05 16:31:28 +02:00
|
|
|
|
|
2014-11-28 14:49:06 +01:00
|
|
|
|
delete lock;
|
2014-12-17 13:57:17 +01:00
|
|
|
|
lock = nullptr;
|
2015-04-05 16:31:28 +02:00
|
|
|
|
#else
|
|
|
|
|
if (info.created().daysTo(QDateTime::currentDateTime()) >= 3)
|
|
|
|
|
{
|
|
|
|
|
QFile oldLog(allFiles.at(i));
|
|
|
|
|
if (oldLog.remove())
|
|
|
|
|
{
|
|
|
|
|
qCDebug(vApp, "Deleted %s", info.absoluteFilePath().toUtf8().constData());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
qCDebug(vApp, "Could not delete %s", info.absoluteFilePath().toUtf8().constData());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif //QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-01 19:08:35 +02:00
|
|
|
|
qCDebug(vApp, "There are no old logs.");
|
2014-11-28 14:49:06 +01:00
|
|
|
|
}
|
2014-11-20 13:18:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-13 10:08:37 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitMeasurements()
|
|
|
|
|
{
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//Note. We can't use here function and variables because lupdate tool doesn't see string in variables and doesn't
|
|
|
|
|
//mark such string to translation.
|
2014-12-04 18:55:49 +01:00
|
|
|
|
QmuTranslation m;
|
|
|
|
|
QmuTranslation g;
|
|
|
|
|
QmuTranslation d;
|
2014-05-13 10:08:37 +02:00
|
|
|
|
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
|
|
|
|
// head_and_neck
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "head_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Head girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around fullest part of Head",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(headGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "mid_neck_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Mid-neck girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around middle part of Neck",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(midNeckGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_base_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck Base girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Neck at base", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckBaseGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "head_and_neck_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Head and Neck length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Vertical Distance from Crown to Nape",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(headAndNeckLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-13 10:08:37 +02:00
|
|
|
|
// torso
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "center_front_waist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Center length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center over tape at Bustline to Front Waist "
|
|
|
|
|
"Center", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(centerFrontWaistLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "center_back_waist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Center length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back Neck Center to Back Waist Center",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(centerBackWaistLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to ShoulderTip",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "side_waist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Side Waist length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Armpit to Waist side", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(sideWaistLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "trunk_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Trunk length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions",
|
|
|
|
|
"Around Body from middle of Shoulder length to BustPoint to Crotch up back to "
|
|
|
|
|
"beginning point", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(trunkLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Arms and Torso, at bicep level parallel to "
|
|
|
|
|
"floor, with arms hanging at the sides", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "upper_chest_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Upper Chest girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Chest at Armfold level, will be parallel to "
|
|
|
|
|
"floor across back, will not be parallel to floor across front chest",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(upperChestGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "bust_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Bust girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around fullest part of Bust, parallel to floor",
|
2014-05-24 18:50:40 +02:00
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(bustGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "under_bust_girth",
|
2014-05-24 18:50:40 +02:00
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
2014-12-04 18:55:49 +01:00
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Under Bust girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Chest below the Bust, parallel to floor",
|
2014-05-24 18:50:40 +02:00
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(underBustGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Tie a string around smallest part of waist, keep string "
|
2014-09-16 21:08:48 +02:00
|
|
|
|
"tied while taking meaasurements. Not usually parallel to floor for front waist or "
|
|
|
|
|
"back waist.",
|
2014-12-04 18:55:49 +01:00
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "high_hip_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "HighHip girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around HighHip, parallel to floor",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(highHipGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hip_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hip girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Hip, parallel to floor",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(hipGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "upper_front_chest_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Upper Chest width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Across Front UpperChest, smallest width from armscye to "
|
|
|
|
|
"armscye", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(upperFrontChestWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_chest_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Chest width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Across Front Chest, from armfold to armfold",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontChestWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "across_front_shoulder_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Across Shoulder width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "From ShoulderTip to ShoulderTip, across Front",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(acrossFrontShoulderWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "across_back_shoulder_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Across Shoulder width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "From ShoulderTip to ShoulderTip, across Back",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(acrossBackShoulderWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "upper_back_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Upper Chest width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Across Back UpperChest, smallest width from armscye to "
|
|
|
|
|
"armscye", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(upperBackWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Chest width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Across Back Chest, from armfold to armfold",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "bustpoint_to_bustpoint",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "BustPoint to BustPoint", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Distance between BustPoints, across Chest",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(bustpointToBustpoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "halter_bustpoint_to_bustpoint",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Halter Bustpoint to Bustpoint", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from Bustpoint, behind neck, down to Bustpoint",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halterBustpointToBustpoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_bustpoint",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "NeckPoint to BustPoint", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "From NeckPoint to BustPoint",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToBustpoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "crotch_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Crotch length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "From Front Waist Center, down to crotch, up to Back "
|
|
|
|
|
"Waist Center", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(crotchLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "rise_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Rise height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Sit on hard chair, measure from side waist straight "
|
|
|
|
|
"down to chair bottom", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(riseHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_drop",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder Drop", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Vertical Distance from NeckPoint level to ShoulderTip "
|
|
|
|
|
"level", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderDrop_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_slope_degrees",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder Slope degrees", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Degrees of angle from NeckPoint to ShoulderTip – "
|
|
|
|
|
"requires goniometer", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderSlopeDegrees_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_shoulder_slope_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Shoulder Balance", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Front Waist Center",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontShoulderSlopeLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_shoulder_slope_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Shoulder Balance", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Back Waist Center",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backShoulderSlopeLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_shoulder_to_waist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Full Length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint straight down front chest to Waistline",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontShoulderToWaistLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_shoulder_to_waist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Full Length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back NeckPoint straight down back chest to Waistline",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backShoulderToWaistLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_neck_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Neck arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to NeckPoint through Front Neck Center",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontNeckArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_neck_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Neck arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to NeckPoint across Nape",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backNeckArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_upper_chest_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front upper-bust arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front upper-bust arc", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontUpperChestArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_upper_chest_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back UpperBust arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back UpperBust side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backUpperChestArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_waist_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Waist arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front Waist side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontWaistArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_waist_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Waist arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back Waist side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backWaistArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_upper_hip_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front UpperHip arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front UpperHip side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontUpperHipArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_upper_hip_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back UpperHip arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back UpperHip side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backUpperHipArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_hip_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Hip arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front Hip side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontHipArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_hip_arc",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Hip arc", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back Hip side to side", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backHipArc_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "chest_slope",
|
2014-05-24 18:50:40 +02:00
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
2014-12-04 18:55:49 +01:00
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Chest Balance", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to Front ArmfoldPoint",
|
2014-09-16 21:08:48 +02:00
|
|
|
|
"Full measurement description");
|
|
|
|
|
InitMeasurement(chestSlope_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_slope",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Balance", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to Back ArmfoldPoint",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backSlope_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_waist_slope",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Waist Balance", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint across Front Chest to Waist side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontWaistSlope_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_waist_slope",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back Waist Balance", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint across Back Chest to Waist side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backWaistSlope_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_neck_to_upper_chest_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front UpperChest height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center straight down to UpperChest line",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontNeckToUpperChestHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_neck_to_bust_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Bust height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front Neck Center straight down to Bust line",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontNeckToBustHeight_M, m, g, d);
|
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_waist_to_upper_chest",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front Upper chest waist", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front Upper chest waist",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontWaistToUpperChest_M, m, g, d);
|
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_waist_to_lower_breast",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front waist to lower breast", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front waist to lower breast",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontWaistToLowerBreast_M, m, g, d);
|
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "back_waist_to_upper_chest",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Back waist to upper chest", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Back waist to upper chest",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(backWaistToUpperChest_M, m, g, d);
|
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "strap_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Strap length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Strap length",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(strapLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-13 10:08:37 +02:00
|
|
|
|
// arm
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "armscye_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Armscye Girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Armscye", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(armscyeGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "elbow_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Elbow Girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Elbow with elbow bent",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(elbowGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "upper_arm_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Upperarm Girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around UpperArm", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(upperArmGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "wrist_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Wrist girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Wrist", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(wristGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "scye_depth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Armscye depth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Nape straight down to UnderBust line (same as Back "
|
|
|
|
|
"UpperBust height)", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(scyeDepth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_and_arm_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder and Arm length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "NeckPoint to ShoulderTip to Wrist, with elbow bent and "
|
|
|
|
|
"hand on hip", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderAndArmLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "underarm_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Underarm length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Armpit to Wrist, with arm straight and hanging at side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(underarmLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "cervicale_to_wrist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Nape to wrist length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Wrist, with elbow bent and hand on hip",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(cervicaleToWristLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_to_elbow_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Elbow length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Elbow, with elbow bent and hand on hip",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderToElbowLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "arm_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Arm length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "ShoulderTip to Wrist, with elbow bent and hand on hip",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(armLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-13 10:08:37 +02:00
|
|
|
|
// hand
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hand_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hand width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Hand side to side", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(handWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hand_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hand length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Hand Middle Finger tip to wrist",
|
2014-09-16 21:08:48 +02:00
|
|
|
|
"Full measurement description");
|
|
|
|
|
InitMeasurement(handLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hand_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hand girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Hand", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(handGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-13 10:08:37 +02:00
|
|
|
|
// leg
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "thigh_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Thigh girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Thigh", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(thighGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "mid_thigh_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Midthigh girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around MidThigh", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(midThighGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "knee_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Knee girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Knee", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(kneeGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "calf_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Calf girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Calf", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(calfGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "ankle_girth",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Ankle girth", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Around Ankle", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(ankleGirth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "knee_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Knee height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Knee to Floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(kneeHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "ankle_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Ankle height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Ankle to Floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(ankleHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-13 10:08:37 +02:00
|
|
|
|
// foot
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "foot_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Foot width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Widest part of Foot side to side",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(footWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "foot_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Foot length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Tip of Longest Toe straight to back of heel",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(footLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-13 10:08:37 +02:00
|
|
|
|
// heights
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Total Height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Top of head to floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(height_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "cervicale_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Nape height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(cervicaleHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "cervicale_to_knee_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Nape to knee height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Nape to Knee", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(cervicaleToKneeHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "high_hip_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "HighHip height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "HighHip side to Floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(highHipHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hip_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hip height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Hip side to Floor", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(hipHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_to_hip_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist to Hip height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to Hip", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistToHipHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_to_knee_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist to Knee height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Waist side to Knee", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistToKneeHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "crotch_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Crotch height/Inseam", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Crotch to Floor along inside leg",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(crotchHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-05-15 15:18:31 +02:00
|
|
|
|
//extended
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "size", "Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Size", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Size", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(size_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_front_neck_base_point",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height front neck base point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height of the point base of the neck in front",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightFrontNeckBasePoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_base_neck_side_point",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height base neck side point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height of the base of the neck side point",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightBaseNeckSidePoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_shoulder_point",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height shoulder point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The height of the shoulder point",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightShoulderPoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_nipple_point",
|
2014-05-24 18:50:40 +02:00
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
2014-12-04 18:55:49 +01:00
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height nipple point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height nipple point", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightNipplePoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_back_angle_axilla",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height back angle axilla", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height back angle axilla",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightBackAngleAxilla_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_scapular_point",
|
2014-05-24 18:50:40 +02:00
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
2014-12-04 18:55:49 +01:00
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height scapular point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height scapular point", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightScapularPoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_under_buttock_folds",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height under buttock folds", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height under buttock folds",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightUnderButtockFolds_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hips_excluding_protruding_abdomen",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hips excluding protruding abdomen",
|
|
|
|
|
"Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Hips excluding protruding abdomen",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(hipsExcludingProtrudingAbdomen_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "girth_foot_instep",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Girth foot instep", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Girth foot instep", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(girthFootInstep_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "side_waist_to_floor",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Side waist to floor", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the side waist to floor",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(sideWaistToFloor_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_waist_to_floor",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front waist to floor", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the front waist to floor",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontWaistToFloor_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "arc_through_groin_area",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Arc through groin area", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Arc through groin area", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(arcThroughGroinArea_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_to_plane_seat",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist to plane seat", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the plane seat",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistToPlaneSeat_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_radial_point",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to radial point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the side of "
|
|
|
|
|
"the radial point", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToRadialPoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_third_finger",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to third finger", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from the base of the neck side point to the "
|
|
|
|
|
"end of the third finger", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToThirdFinger_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_first_line_chest_circumference",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to first line chest circumference",
|
|
|
|
|
"Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the side of "
|
|
|
|
|
"the first line in front of chest circumference", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToFirstLineChestCircumference_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_waist_length",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front waist length", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the waist "
|
|
|
|
|
"side front (waist length in the front)", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontWaistLength_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "arc_through_shoulder_joint",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Arc through shoulder joint", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Arc through the highest point of the shoulder joint",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(arcThroughShoulderJoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_back_line_chest_circumference",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to back line chest circumference",
|
|
|
|
|
"Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the back line "
|
|
|
|
|
"of chest circumference of the first and the second based on ledge vanes",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToBackLineChestCircumference_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_to_neck_side",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist to neck side", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the back base of the "
|
|
|
|
|
"neck side point", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistToNeckSide_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "arc_length_upper_body",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Arc length upper body", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Arc length of the upper body through the base of the "
|
|
|
|
|
"neck side point", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(arcLengthUpperBody_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "chest_width",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Chest width", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Chest width", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(chestWidth_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "anteroposterior_diameter_hands",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Anteroposterior diameter hands", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Anteroposterior diameter of the hands",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(anteroposteriorDiameterHands_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_clavicular_point",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height clavicular point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Height clavicular point",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightClavicularPoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "height_armhole_slash",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Height armhole slash", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the point to the cervical level of "
|
|
|
|
|
"the posterior angle of the front armpit (underarm height oblique)",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(heightArmholeSlash_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "slash_shoulder_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Slash shoulder height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Slash shoulder height", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(slashShoulderHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_neck",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth neck", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth neck", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthNeck_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_neck_for_shirts",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth neck for shirts", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth neck for shirts",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthNeckForShirts_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_chest_first",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest first", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest first", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthChestFirst_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_chest_second",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest second", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest second",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthChestSecond_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_chest_third",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth chest third", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth chest third", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthChestThird_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_waist",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth waist", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth waist", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthWaist_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_hips_considering_protruding_abdomen",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth hips considering protruding abdomen",
|
|
|
|
|
"Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth hips considering protruding abdomen",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthHipsConsideringProtrudingAbdomen_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "half_girth_hips_excluding_protruding_abdomen",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Half girth hips excluding protruding abdomen",
|
|
|
|
|
"Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Half girth hips excluding protruding abdomen",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(halfGirthHipsExcludingProtrudingAbdomen_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "girth_knee_flexed_feet",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Girth knee flexed feet", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Girth knee flexed feet", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(girthKneeFlexedFeet_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_transverse_diameter",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck transverse diameter", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Neck transverse diameter",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckTransverseDiameter_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "front_slash_shoulder_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Front slash shoulder height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Front slash shoulder height",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(frontSlashShoulderHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_front_waist_line",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to front waist line", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the base of the neck to the waist "
|
|
|
|
|
"line front", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToFrontWaistLine_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "hand_vertical_diameter",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Hand vertical diameter", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Hand vertical diameter", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(handVerticalDiameter_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_knee_point",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to knee point", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from neck to knee point",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToKneePoint_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "waist_to_knee",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Waist to knee", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "The distance from the waist to the knee",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(waistToKnee_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "shoulder_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Shoulder height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Shoulder height", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(shoulderHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "head_height",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Head height", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Head height", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(headHeight_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "body_position",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Body position", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Body position", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(bodyPosition_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "arc_behind_shoulder_girdle",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Arc behind shoulder girdle", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Arc behind the shoulder girdle",
|
|
|
|
|
"Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(arcBehindShoulderGirdle_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "neck_to_neck_base",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Neck to neck base", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Distance from neck point to point on the base of the "
|
|
|
|
|
"neck side neck girth measurement line", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(neckToNeckBase_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "depth_waist_first",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Depth waist first", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Depth waist first", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(depthWaistFirst_M, m, g, d);
|
2014-05-24 18:50:40 +02:00
|
|
|
|
//=================================================================================================================
|
2014-12-04 18:55:49 +01:00
|
|
|
|
m = QmuTranslation::translate("Measurements", "depth_waist_second",
|
|
|
|
|
"Short measurement name. Don't use math symbols in name!!!!");
|
|
|
|
|
g = QmuTranslation::translate("MeasurementsFullNames", "Depth waist second", "Full measurement name");
|
|
|
|
|
d = QmuTranslation::translate("MeasurementsDescriptions", "Depth waist second", "Full measurement description");
|
2014-09-16 21:08:48 +02:00
|
|
|
|
InitMeasurement(depthWaistSecond_M, m, g, d);
|
2014-05-13 10:08:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitVariables()
|
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
variables.insert(line_, QmuTranslation::translate("Variables", "Line_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(angleLine_, QmuTranslation::translate("Variables", "AngleLine_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(arc_, QmuTranslation::translate("Variables", "Arc_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(spl_, QmuTranslation::translate("Variables", "Spl_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(splPath, QmuTranslation::translate("Variables", "SplPath",
|
2015-05-31 11:17:09 +02:00
|
|
|
|
"Do not add symbol _ to the end of name"));
|
2015-06-02 15:53:19 +02:00
|
|
|
|
variables.insert(radiusArc_, QmuTranslation::translate("Variables", "RadiusArc_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(angle1Arc_, QmuTranslation::translate("Variables", "Angle1Arc_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(angle2Arc_, QmuTranslation::translate("Variables", "Angle2Arc_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(angle1Spl_, QmuTranslation::translate("Variables", "Angle1Spl_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(angle2Spl_, QmuTranslation::translate("Variables", "Angle2Spl_", "Left symbol _ in name"));
|
|
|
|
|
variables.insert(angle1SplPath, QmuTranslation::translate("Variables", "Angle1SplPath",
|
|
|
|
|
"Do not add symbol _ to the end of name"));
|
|
|
|
|
variables.insert(angle2SplPath, QmuTranslation::translate("Variables", "Angle2SplPath",
|
|
|
|
|
"Do not add symbol _ to the end of name"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitFunctions()
|
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
functions.insert(sin_F, QmuTranslation::translate("Functions", "sin", "sine function"));
|
|
|
|
|
functions.insert(cos_F, QmuTranslation::translate("Functions", "cos", "cosine function"));
|
|
|
|
|
functions.insert(tan_F, QmuTranslation::translate("Functions", "tan", "tangens function"));
|
|
|
|
|
functions.insert(asin_F, QmuTranslation::translate("Functions", "asin", "arcus sine function"));
|
|
|
|
|
functions.insert(acos_F, QmuTranslation::translate("Functions", "acos", "arcus cosine function"));
|
|
|
|
|
functions.insert(atan_F, QmuTranslation::translate("Functions", "atan", "arcus tangens function"));
|
|
|
|
|
functions.insert(sinh_F, QmuTranslation::translate("Functions", "sinh", "hyperbolic sine function"));
|
|
|
|
|
functions.insert(cosh_F, QmuTranslation::translate("Functions", "cosh", "hyperbolic cosine"));
|
|
|
|
|
functions.insert(tanh_F, QmuTranslation::translate("Functions", "tanh", "hyperbolic tangens function"));
|
|
|
|
|
functions.insert(asinh_F, QmuTranslation::translate("Functions", "asinh", "hyperbolic arcus sine function"));
|
|
|
|
|
functions.insert(acosh_F, QmuTranslation::translate("Functions", "acosh", "hyperbolic arcus tangens function"));
|
|
|
|
|
functions.insert(atanh_F, QmuTranslation::translate("Functions", "atanh", "hyperbolic arcur tangens function"));
|
|
|
|
|
functions.insert(log2_F, QmuTranslation::translate("Functions", "log2", "logarithm to the base 2"));
|
|
|
|
|
functions.insert(log10_F, QmuTranslation::translate("Functions", "log10", "logarithm to the base 10"));
|
|
|
|
|
functions.insert(log_F, QmuTranslation::translate("Functions", "log", "logarithm to the base 10"));
|
|
|
|
|
functions.insert(ln_F, QmuTranslation::translate("Functions", "ln", "logarithm to base e (2.71828...)"));
|
|
|
|
|
functions.insert(exp_F, QmuTranslation::translate("Functions", "exp", "e raised to the power of x"));
|
|
|
|
|
functions.insert(sqrt_F, QmuTranslation::translate("Functions", "sqrt", "square root of a value"));
|
|
|
|
|
functions.insert(sign_F, QmuTranslation::translate("Functions", "sign", "sign function -1 if x<0; 1 if x>0"));
|
|
|
|
|
functions.insert(rint_F, QmuTranslation::translate("Functions", "rint", "round to nearest integer"));
|
|
|
|
|
functions.insert(abs_F, QmuTranslation::translate("Functions", "abs", "absolute value"));
|
|
|
|
|
functions.insert(min_F, QmuTranslation::translate("Functions", "min", "min of all arguments"));
|
|
|
|
|
functions.insert(max_F, QmuTranslation::translate("Functions", "max", "max of all arguments"));
|
|
|
|
|
functions.insert(sum_F, QmuTranslation::translate("Functions", "sum", "sum of all arguments"));
|
|
|
|
|
functions.insert(avg_F, QmuTranslation::translate("Functions", "avg", "mean value of all arguments"));
|
2015-05-14 18:19:23 +02:00
|
|
|
|
functions.insert(fmod_F, QmuTranslation::translate("Functions", "fmod",
|
|
|
|
|
"Returns the floating-point remainder of numer/denom (rounded towards zero)"));
|
2014-05-13 10:08:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 20:11:13 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-05-23 09:14:21 +02:00
|
|
|
|
void VApplication::InitPostfixOperators()
|
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
postfixOperators.insert(cm_Oprt, QmuTranslation::translate("PostfixOperators", "cm", "centimeter"));
|
|
|
|
|
postfixOperators.insert(mm_Oprt, QmuTranslation::translate("PostfixOperators", "mm", "millimeter"));
|
|
|
|
|
postfixOperators.insert(in_Oprt, QmuTranslation::translate("PostfixOperators", "in", "inch"));
|
2014-05-23 09:14:21 +02:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-18 11:30:33 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::InitSTDescriptions()
|
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
stDescriptions.insert("0", QmuTranslation::translate("STDescriptions",
|
2014-09-18 11:30:33 +02:00
|
|
|
|
"Standard figures of men 1st group, chest 100 cm",
|
|
|
|
|
"Standard table description"));
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 20:11:13 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::MeasurementsFromUser translate measurement to internal look.
|
|
|
|
|
* @param newFormula [in|out] expression to translate
|
|
|
|
|
* @param position token position
|
|
|
|
|
* @param token token to translate
|
|
|
|
|
* @param bias hold change of length between translated and origin token string
|
|
|
|
|
* @return true if was found measurement with same name.
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bool VApplication::MeasurementsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
QMap<QString, QmuTranslation>::const_iterator i = measurements.constBegin();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
while (i != measurements.constEnd())
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (token == i.value().translate())
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, token.length(), i.key());
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bias = token.length() - i.key().length();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::VariablesFromUser translate variable to internal look.
|
|
|
|
|
* @param newFormula [in|out] expression to translate
|
|
|
|
|
* @param position token position
|
|
|
|
|
* @param token token to translate
|
|
|
|
|
* @param bias hold change of length between translated and origin token string
|
|
|
|
|
* @return true if was found variable with same name.
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bool VApplication::VariablesFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
QMap<QString, QmuTranslation>::const_iterator i = variables.constBegin();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
while (i != variables.constEnd())
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (token.indexOf( i.value().translate() ) == 0)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, i.value().translate().length(), i.key());
|
2014-05-27 16:58:25 +02:00
|
|
|
|
QString newToken = token;
|
|
|
|
|
newToken.replace(0, i.value().translate().length(), i.key());
|
|
|
|
|
bias = token.length() - newToken.length();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::PostfixOperatorsFromUser translate postfix operator to internal look.
|
|
|
|
|
* @param newFormula [in|out] expression to translate
|
|
|
|
|
* @param position token position
|
|
|
|
|
* @param token token to translate
|
|
|
|
|
* @param bias hold change of length between translated and origin token string
|
|
|
|
|
* @return true if was found postfix operator with same name.
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bool VApplication::PostfixOperatorsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
QMap<QString, QmuTranslation>::const_iterator i = postfixOperators.constBegin();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
while (i != postfixOperators.constEnd())
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (token == i.value().translate())
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, token.length(), i.key());
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bias = token.length() - i.key().length();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::FunctionsFromUser translate function name to internal look.
|
|
|
|
|
* @param newFormula [in|out] expression to translate
|
|
|
|
|
* @param position token position
|
|
|
|
|
* @param token token to translate
|
|
|
|
|
* @param bias hold change of length between translated and origin token string
|
|
|
|
|
* @return true if was found function with same name.
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bool VApplication::FunctionsFromUser(QString &newFormula, int position, const QString &token, int &bias) const
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
QMap<QString, QmuTranslation>::const_iterator i = functions.constBegin();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
while (i != functions.constEnd())
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (token == i.value().translate())
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
|
|
|
|
newFormula.replace(position, token.length(), i.key());
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bias = token.length() - i.key().length();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::VariablesToUser translate variable name to user.
|
|
|
|
|
* @param newFormula [in|out] expression to translate
|
|
|
|
|
* @param position token position
|
|
|
|
|
* @param token token to translate
|
|
|
|
|
* @param bias hold change of length between translated and origin token string
|
|
|
|
|
* @return true if was found variable with same name.
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
bool VApplication::VariablesToUser(QString &newFormula, int position, const QString &token, int &bias) const
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-12-04 18:55:49 +01:00
|
|
|
|
QMap<QString, QmuTranslation>::const_iterator i = variables.constBegin();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
while (i != variables.constEnd())
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (token.indexOf( i.key() ) == 0)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-26 15:18:48 +02:00
|
|
|
|
newFormula.replace(position, i.key().length(), i.value().translate());
|
2014-05-27 16:58:25 +02:00
|
|
|
|
|
|
|
|
|
QString newToken = token;
|
|
|
|
|
newToken.replace(0, i.key().length(), i.value().translate());
|
|
|
|
|
bias = token.length() - newToken.length();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::CorrectionsPositions correct position tokens in expression after token translation.
|
|
|
|
|
*
|
|
|
|
|
* Because translated string can have different length compare to original need make correction after each translation.
|
|
|
|
|
* If bias = 0 correction will not happens.
|
|
|
|
|
*
|
|
|
|
|
* @param position position currecnt token in expression
|
|
|
|
|
* @param bias difference between original token length and translated
|
|
|
|
|
* @param tokens all tokens
|
|
|
|
|
* @param numbers all numbers
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
void VApplication::CorrectionsPositions(int position, int bias, QMap<int, QString> &tokens,
|
|
|
|
|
QMap<int, QString> &numbers)
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (bias == 0)
|
2014-05-27 16:58:25 +02:00
|
|
|
|
{
|
2015-02-08 14:43:30 +01:00
|
|
|
|
return;// Nothing to correct;
|
2014-05-27 16:58:25 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BiasTokens(position, bias, tokens);
|
|
|
|
|
BiasTokens(position, bias, numbers);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::BiasTokens change position for each token that have position more then "position".
|
|
|
|
|
* @param position token position
|
|
|
|
|
* @param bias difference between original token length and translated
|
|
|
|
|
* @param tokens all tokens
|
|
|
|
|
*/
|
2014-05-27 16:58:25 +02:00
|
|
|
|
void VApplication::BiasTokens(int position, int bias, QMap<int, QString> &tokens) const
|
|
|
|
|
{
|
|
|
|
|
QMap<int, QString> newTokens;
|
|
|
|
|
QMap<int, QString>::const_iterator i = tokens.constBegin();
|
|
|
|
|
while (i != tokens.constEnd())
|
|
|
|
|
{
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (i.key()<= position)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{ // Tokens before position "position" did not change his positions.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
newTokens.insert(i.key(), i.value());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
newTokens.insert(i.key()-bias, i.value());
|
|
|
|
|
}
|
|
|
|
|
++i;
|
|
|
|
|
}
|
|
|
|
|
tokens = newTokens;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-12 09:22:29 +02:00
|
|
|
|
void VApplication::setPatternUnit(const Unit &patternUnit)
|
2014-03-26 05:39:07 +01:00
|
|
|
|
{
|
|
|
|
|
_patternUnit = patternUnit;
|
|
|
|
|
InitLineWidth();
|
|
|
|
|
}
|
2014-05-16 12:00:33 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-05-26 15:18:48 +02:00
|
|
|
|
QString VApplication::VarToUser(const QString &var) const
|
2014-05-16 12:00:33 +02:00
|
|
|
|
{
|
2014-05-26 15:18:48 +02:00
|
|
|
|
if (measurements.contains(var))
|
|
|
|
|
{
|
|
|
|
|
return measurements.value(var).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (functions.contains(var))
|
|
|
|
|
{
|
|
|
|
|
return functions.value(var).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (postfixOperators.contains(var))
|
|
|
|
|
{
|
|
|
|
|
return postfixOperators.value(var).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString newVar = var;
|
2014-05-27 16:58:25 +02:00
|
|
|
|
int bias = 0;
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (VariablesToUser(newVar, 0, var, bias))
|
2014-05-26 15:18:48 +02:00
|
|
|
|
{
|
|
|
|
|
return newVar;
|
|
|
|
|
}
|
|
|
|
|
return newVar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::VarFromUser(const QString &var) const
|
|
|
|
|
{
|
|
|
|
|
QString newVar = var;
|
2014-05-27 16:58:25 +02:00
|
|
|
|
int bias = 0;
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (MeasurementsFromUser(newVar, 0, var, bias))
|
2014-05-26 15:18:48 +02:00
|
|
|
|
{
|
|
|
|
|
return newVar;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (VariablesFromUser(newVar, 0, var, bias))
|
2014-05-26 15:18:48 +02:00
|
|
|
|
{
|
|
|
|
|
return newVar;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (PostfixOperatorsFromUser(newVar, 0, var, bias))
|
2014-05-26 15:18:48 +02:00
|
|
|
|
{
|
|
|
|
|
return newVar;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (FunctionsFromUser(newVar, 0, var, bias))
|
2014-05-26 15:18:48 +02:00
|
|
|
|
{
|
|
|
|
|
return newVar;
|
|
|
|
|
}
|
|
|
|
|
return newVar;
|
2014-05-16 12:00:33 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::GuiText(const QString &measurement) const
|
|
|
|
|
{
|
|
|
|
|
return guiTexts.value(measurement).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::Description(const QString &measurement) const
|
|
|
|
|
{
|
|
|
|
|
return descriptions.value(measurement).translate();
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-23 20:11:13 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-04-15 14:44:57 +02:00
|
|
|
|
// cppcheck-suppress unusedFunction
|
2014-05-23 20:11:13 +02:00
|
|
|
|
QString VApplication::PostfixOperator(const QString &name) const
|
|
|
|
|
{
|
|
|
|
|
return postfixOperators.value(name).translate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::FormulaFromUser replace all known tokens in formula to internal look. Also change decimal
|
|
|
|
|
* separator in numbers.
|
|
|
|
|
* @param formula expression that need translate
|
|
|
|
|
* @return translated expression
|
|
|
|
|
*/
|
2014-05-23 20:11:13 +02:00
|
|
|
|
QString VApplication::FormulaFromUser(const QString &formula)
|
|
|
|
|
{
|
2015-04-29 18:35:38 +02:00
|
|
|
|
if (formula.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
return formula;
|
|
|
|
|
}
|
2015-02-08 14:43:30 +01:00
|
|
|
|
QString newFormula = formula;// Local copy for making changes
|
2014-05-23 20:11:13 +02:00
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
Calculator *cal = new Calculator(formula);// Eval formula
|
|
|
|
|
QMap<int, QString> tokens = cal->GetTokens();// Tokens (variables, measurements)
|
|
|
|
|
QMap<int, QString> numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
|
2014-05-30 10:32:40 +02:00
|
|
|
|
delete cal;
|
2014-05-23 20:11:13 +02:00
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
QList<int> tKeys = tokens.keys();// Take all tokens positions
|
2014-05-27 16:58:25 +02:00
|
|
|
|
QList<QString> tValues = tokens.values();
|
|
|
|
|
for (int i = 0; i < tKeys.size(); ++i)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
int bias = 0;
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (MeasurementsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (VariablesFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (PostfixOperatorsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (FunctionsFromUser(newFormula, tKeys.at(i), tValues.at(i), bias))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
QLocale loc = QLocale::system(); // User locale
|
2014-11-22 17:15:47 +01:00
|
|
|
|
if (loc != QLocale(QLocale::C) && getSettings()->GetOsSeparator())
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// User want use Os separator
|
|
|
|
|
QList<int> nKeys = numbers.keys();// Positions for all numbers in expression
|
2014-05-27 16:58:25 +02:00
|
|
|
|
QList<QString> nValues = numbers.values();
|
2014-05-30 10:32:40 +02:00
|
|
|
|
for (int i = 0; i < nKeys.size(); ++i)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2015-02-08 14:43:30 +01:00
|
|
|
|
loc = QLocale::system();// From system locale
|
2014-05-23 20:11:13 +02:00
|
|
|
|
bool ok = false;
|
2015-02-05 12:56:51 +01:00
|
|
|
|
const qreal d = loc.toDouble(nValues.at(i), &ok);
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (ok == false)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
qDebug()<<"Can't convert to double token"<<nValues.at(i);
|
2015-02-08 14:43:30 +01:00
|
|
|
|
continue;//Leave with out translation
|
2014-05-23 20:11:13 +02:00
|
|
|
|
}
|
2015-02-05 12:56:51 +01:00
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
loc = QLocale(QLocale::C);// To internal locale
|
|
|
|
|
const QString dStr = loc.toString(d);// Internal look for number
|
2015-02-05 12:56:51 +01:00
|
|
|
|
newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr);
|
|
|
|
|
const int bias = nValues.at(i).length() - dStr.length();
|
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated number has different length than original. Position next tokens need to be corrected.
|
2015-02-05 12:56:51 +01:00
|
|
|
|
CorrectionsPositions(nKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
nKeys = numbers.keys();
|
|
|
|
|
nValues = numbers.values();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newFormula;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-02-08 14:43:30 +01:00
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::FormulaToUser replace all known tokens in formula to user look. Also change decimal
|
|
|
|
|
* separator in numbers.
|
|
|
|
|
* @param formula expression that need translate
|
|
|
|
|
* @return translated expression
|
|
|
|
|
*/
|
2014-05-23 20:11:13 +02:00
|
|
|
|
QString VApplication::FormulaToUser(const QString &formula)
|
|
|
|
|
{
|
2015-04-29 18:35:38 +02:00
|
|
|
|
if (formula.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
return formula;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
QString newFormula = formula;// Local copy for making changes
|
2014-05-23 20:11:13 +02:00
|
|
|
|
|
|
|
|
|
QMap<int, QString> tokens;
|
|
|
|
|
QMap<int, QString> numbers;
|
|
|
|
|
try
|
|
|
|
|
{
|
2015-02-08 14:43:30 +01:00
|
|
|
|
Calculator *cal = new Calculator(formula, false);// Eval formula
|
|
|
|
|
tokens = cal->GetTokens();// Tokens (variables, measurements)
|
|
|
|
|
numbers = cal->GetNumbers();// All numbers in expression for changing decimal separator
|
2014-05-30 10:32:40 +02:00
|
|
|
|
delete cal;
|
2014-05-23 20:11:13 +02:00
|
|
|
|
}
|
|
|
|
|
catch (qmu::QmuParserError &e)
|
|
|
|
|
{
|
|
|
|
|
qDebug() << "\nMath parser error:\n"
|
|
|
|
|
<< "--------------------------------------\n"
|
|
|
|
|
<< "Message: " << e.GetMsg() << "\n"
|
|
|
|
|
<< "Expression: " << e.GetExpr() << "\n"
|
|
|
|
|
<< "--------------------------------------";
|
|
|
|
|
return newFormula;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-27 16:58:25 +02:00
|
|
|
|
QList<int> tKeys = tokens.keys();
|
|
|
|
|
QList<QString> tValues = tokens.values();
|
|
|
|
|
for (int i = 0; i < tKeys.size(); ++i)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (measurements.contains(tValues.at(i)))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
newFormula.replace(tKeys.at(i), tValues.at(i).length(), measurements.value(tValues.at(i)).translate());
|
|
|
|
|
int bias = tValues.at(i).length() - measurements.value(tValues.at(i)).translate().length();
|
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (functions.contains(tValues.at(i)))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
newFormula.replace(tKeys.at(i), tValues.at(i).length(), functions.value(tValues.at(i)).translate());
|
|
|
|
|
int bias = tValues.at(i).length() - functions.value(tValues.at(i)).translate().length();
|
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (postfixOperators.contains(tValues.at(i)))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
newFormula.replace(tKeys.at(i), tValues.at(i).length(), postfixOperators.value(tValues.at(i)).translate());
|
|
|
|
|
int bias = tValues.at(i).length() - postfixOperators.value(tValues.at(i)).translate().length();
|
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-27 16:58:25 +02:00
|
|
|
|
int bias = 0;
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (VariablesToUser(newFormula, tKeys.at(i), tValues.at(i), bias))
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated token has different length than original. Position next tokens need to be corrected.
|
2014-05-27 16:58:25 +02:00
|
|
|
|
CorrectionsPositions(tKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
tKeys = tokens.keys();
|
|
|
|
|
tValues = tokens.values();
|
|
|
|
|
}
|
2014-05-23 20:11:13 +02:00
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
QLocale loc = QLocale::system();// User locale
|
2014-11-22 17:15:47 +01:00
|
|
|
|
if (loc != QLocale::C && getSettings()->GetOsSeparator())
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// User want use Os separator
|
|
|
|
|
QList<int> nKeys = numbers.keys();// Positions for all numbers in expression
|
2014-05-27 16:58:25 +02:00
|
|
|
|
QList<QString> nValues = numbers.values();
|
2014-05-30 10:32:40 +02:00
|
|
|
|
for (int i = 0; i < nKeys.size(); ++i)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2015-02-08 14:43:30 +01:00
|
|
|
|
loc = QLocale(QLocale::C);// From pattern locale
|
2014-05-23 20:11:13 +02:00
|
|
|
|
bool ok = false;
|
2015-02-05 12:56:51 +01:00
|
|
|
|
const qreal d = loc.toDouble(nValues.at(i), &ok);
|
2014-06-16 19:18:36 +02:00
|
|
|
|
if (ok == false)
|
2014-05-23 20:11:13 +02:00
|
|
|
|
{
|
2014-05-27 16:58:25 +02:00
|
|
|
|
qDebug()<<"Can't convert to double token"<<nValues.at(i);
|
2015-02-08 14:43:30 +01:00
|
|
|
|
continue;//Leave with out translation
|
2014-05-23 20:11:13 +02:00
|
|
|
|
}
|
2014-05-27 16:58:25 +02:00
|
|
|
|
|
2015-02-08 14:43:30 +01:00
|
|
|
|
loc = QLocale::system();// To user locale
|
|
|
|
|
const QString dStr = loc.toString(d);// Number string in user locale
|
2015-02-05 12:56:51 +01:00
|
|
|
|
newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr);
|
|
|
|
|
const int bias = nValues.at(i).length() - dStr.length();
|
|
|
|
|
if (bias != 0)
|
2015-02-08 14:43:30 +01:00
|
|
|
|
{// Translated number has different length than original. Position next tokens need to be corrected.
|
2015-02-05 12:56:51 +01:00
|
|
|
|
CorrectionsPositions(nKeys.at(i), bias, tokens, numbers);
|
|
|
|
|
nKeys = numbers.keys();
|
|
|
|
|
nValues = numbers.values();
|
2014-05-23 20:11:13 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newFormula;
|
|
|
|
|
}
|
2014-07-08 12:59:50 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QWidget *VApplication::getMainWindow() const
|
|
|
|
|
{
|
|
|
|
|
return mainWindow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::setMainWindow(QWidget *value)
|
|
|
|
|
{
|
|
|
|
|
SCASSERT(value != nullptr)
|
|
|
|
|
mainWindow = value;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-08 13:26:13 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
bool VApplication::getOpeningPattern() const
|
|
|
|
|
{
|
|
|
|
|
return openingPattern;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::setOpeningPattern()
|
|
|
|
|
{
|
|
|
|
|
openingPattern = !openingPattern;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-10 11:36:46 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::OpenSettings get acsses to application settings.
|
|
|
|
|
*
|
|
|
|
|
* Because we can create object in constructor we open file separately.
|
|
|
|
|
*/
|
|
|
|
|
void VApplication::OpenSettings()
|
|
|
|
|
{
|
2014-11-22 17:15:47 +01:00
|
|
|
|
settings = new VSettings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
2014-07-10 11:36:46 +02:00
|
|
|
|
QApplication::applicationName(), this);
|
|
|
|
|
}
|
2014-07-08 13:26:13 +02:00
|
|
|
|
|
2014-07-10 11:36:46 +02:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
/**
|
|
|
|
|
* @brief VApplication::getSettings hide settings constructor.
|
|
|
|
|
* @return pointer to class for acssesing to settings in ini file.
|
|
|
|
|
*/
|
2014-11-22 17:15:47 +01:00
|
|
|
|
VSettings *VApplication::getSettings()
|
2014-07-10 11:36:46 +02:00
|
|
|
|
{
|
|
|
|
|
SCASSERT(settings != nullptr);
|
|
|
|
|
return settings;
|
|
|
|
|
}
|
2014-07-15 15:51:15 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-05-12 17:15:10 +02:00
|
|
|
|
QGraphicsScene *VApplication::getCurrentScene() const
|
2014-07-15 15:51:15 +02:00
|
|
|
|
{
|
|
|
|
|
SCASSERT(currentScene != nullptr);
|
|
|
|
|
return currentScene;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-05-12 17:15:10 +02:00
|
|
|
|
void VApplication::setCurrentScene(QGraphicsScene *value)
|
2014-07-15 15:51:15 +02:00
|
|
|
|
{
|
|
|
|
|
currentScene = value;
|
|
|
|
|
}
|
2014-09-08 13:02:14 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::setOverrideCursor(const QString &pixmapPath, int hotX, int hotY)
|
|
|
|
|
{
|
|
|
|
|
#ifndef QT_NO_CURSOR
|
|
|
|
|
QPixmap oldPixmap;
|
|
|
|
|
if (QCursor *oldCursor = QGuiApplication::overrideCursor())
|
|
|
|
|
{
|
|
|
|
|
oldPixmap = oldCursor->pixmap();
|
|
|
|
|
}
|
|
|
|
|
QPixmap newPixmap(pixmapPath);
|
|
|
|
|
|
|
|
|
|
QImage oldImage = oldPixmap.toImage();
|
|
|
|
|
QImage newImage = newPixmap.toImage();
|
|
|
|
|
|
|
|
|
|
if (oldImage != newImage )
|
|
|
|
|
{
|
|
|
|
|
QApplication::setOverrideCursor(QCursor(newPixmap, hotX, hotY));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-09-11 18:52:02 +02:00
|
|
|
|
void VApplication::restoreOverrideCursor(const QString &pixmapPath)
|
2014-09-08 13:02:14 +02:00
|
|
|
|
{
|
|
|
|
|
#ifndef QT_NO_CURSOR
|
|
|
|
|
QPixmap oldPixmap;
|
|
|
|
|
if (QCursor *oldCursor = QGuiApplication::overrideCursor())
|
|
|
|
|
{
|
|
|
|
|
oldPixmap = oldCursor->pixmap();
|
|
|
|
|
}
|
|
|
|
|
QPixmap newPixmap(pixmapPath);
|
|
|
|
|
|
|
|
|
|
QImage oldImage = oldPixmap.toImage();
|
|
|
|
|
QImage newImage = newPixmap.toImage();
|
|
|
|
|
|
|
|
|
|
if (oldImage == newImage )
|
|
|
|
|
{
|
|
|
|
|
QApplication::restoreOverrideCursor();
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2014-09-09 15:11:50 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QStringList VApplication::LabelLanguages()
|
|
|
|
|
{
|
2014-10-17 22:26:30 +02:00
|
|
|
|
QStringList list = QStringList() << "de" // German
|
|
|
|
|
<< "en" // English
|
|
|
|
|
<< "fr" // French
|
|
|
|
|
<< "ru" // Russian
|
|
|
|
|
<< "uk" // Ukrainian
|
|
|
|
|
<< "hr" // Croatian
|
|
|
|
|
<< "sr" // Serbian
|
|
|
|
|
<< "bs"; // Bosnian
|
2014-09-09 15:11:50 +02:00
|
|
|
|
return list;
|
|
|
|
|
}
|
2014-09-18 11:30:33 +02:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::STDescription(const QString &id) const
|
|
|
|
|
{
|
|
|
|
|
if (stDescriptions.contains(id))
|
|
|
|
|
{
|
|
|
|
|
return stDescriptions.value(id).translate();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-11-20 22:01:00 +01:00
|
|
|
|
qDebug()<<"Unknown id number. Got"<<id;
|
2014-09-18 11:30:33 +02:00
|
|
|
|
}
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
2014-10-23 15:53:46 +02:00
|
|
|
|
|
2014-11-20 13:18:43 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::StartLogging()
|
|
|
|
|
{
|
2015-04-02 16:01:05 +02:00
|
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
|
|
|
|
|
|
|
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
|
|
|
|
|
// Qt < 5.2 didn't feature categorized logging
|
|
|
|
|
// Do nothing
|
|
|
|
|
#else
|
2014-11-26 17:54:17 +01:00
|
|
|
|
// In Qt 5.2 need manualy enable debug information for categories. This work
|
|
|
|
|
// because Qt doesn't provide debug information for categories itself. And in this
|
|
|
|
|
// case will show our messages. Another situation with Qt 5.3 that has many debug
|
|
|
|
|
// messages itself. We don't need this information and can turn on later if need.
|
|
|
|
|
// But here Qt already show our debug messages without enabling.
|
2014-11-20 18:52:51 +01:00
|
|
|
|
QLoggingCategory::setFilterRules("*.debug=true\n");
|
2015-04-02 16:01:05 +02:00
|
|
|
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
|
|
|
|
|
|
|
|
|
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
|
2014-11-20 18:52:51 +01:00
|
|
|
|
|
2014-11-28 14:49:06 +01:00
|
|
|
|
CreateLogDir();
|
|
|
|
|
BeginLogging();
|
|
|
|
|
ClearOldLogs();
|
2014-11-29 13:12:43 +01:00
|
|
|
|
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
|
|
|
|
ClearOldReports();
|
|
|
|
|
#endif // defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
2014-11-20 13:18:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QTextStream *VApplication::LogFile()
|
|
|
|
|
{
|
|
|
|
|
return out;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-15 16:52:27 +01:00
|
|
|
|
#if defined(Q_OS_WIN) && defined(Q_CC_GNU)
|
2014-11-29 13:12:43 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::ClearOldReports() const
|
|
|
|
|
{
|
|
|
|
|
const QString reportsDir = QString("%1/reports").arg(qApp->applicationDirPath());
|
|
|
|
|
QDir reports(reportsDir);
|
|
|
|
|
if (reports.exists())
|
|
|
|
|
{
|
|
|
|
|
QStringList filters{"*.log", "*.RPT"};
|
|
|
|
|
QDir logsDir(reportsDir);
|
|
|
|
|
logsDir.setNameFilters(filters);
|
|
|
|
|
logsDir.setCurrent(reportsDir);
|
|
|
|
|
|
|
|
|
|
const QStringList allFiles = logsDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
|
|
|
|
|
if (allFiles.isEmpty() == false)
|
|
|
|
|
{
|
|
|
|
|
const QDateTime now = QDateTime::currentDateTime();
|
|
|
|
|
for (int i = 0; i < allFiles.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
QFileInfo info(allFiles.at(i));
|
|
|
|
|
if (info.created().daysTo(now) > 30)
|
|
|
|
|
{
|
|
|
|
|
QFile(allFiles.at(i)).remove();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-30 16:30:47 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::GatherLogs() const
|
|
|
|
|
{
|
|
|
|
|
QTextStream *out = nullptr;
|
|
|
|
|
QFile *log = new QFile(QString("%1/valentina.log").arg(LogDirPath()));
|
|
|
|
|
if (log->open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
|
|
|
|
{
|
|
|
|
|
out = new QTextStream(log);
|
|
|
|
|
|
|
|
|
|
QStringList filters{"*.log"};
|
|
|
|
|
QDir logsDir(LogDirPath());
|
|
|
|
|
logsDir.setNameFilters(filters);
|
|
|
|
|
logsDir.setCurrent(LogDirPath());
|
|
|
|
|
|
|
|
|
|
const QStringList allFiles = logsDir.entryList(QDir::NoDotAndDotDot | QDir::Files);
|
|
|
|
|
if (allFiles.isEmpty() == false)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < allFiles.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
QFileInfo info(allFiles.at(i));
|
|
|
|
|
if (info.fileName() == "valentina.log")
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
QLockFile *logLock = new QLockFile(info.absoluteFilePath()+".lock");
|
|
|
|
|
logLock->setStaleLockTime(0);
|
2015-01-26 16:02:57 +01:00
|
|
|
|
if (TryLock(logLock))
|
2014-11-30 16:30:47 +01:00
|
|
|
|
{
|
|
|
|
|
*out <<"--------------------------" << endl;
|
|
|
|
|
QFile logFile(info.absoluteFilePath());
|
|
|
|
|
if (logFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
|
|
|
|
{
|
|
|
|
|
QTextStream in(&logFile);
|
|
|
|
|
while (!in.atEnd())
|
|
|
|
|
{
|
|
|
|
|
*out << in.readLine() << endl;
|
|
|
|
|
}
|
|
|
|
|
logFile.close();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*out << "Log file error:" + logFile.errorString() << endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-12-25 16:50:46 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*out << "Could not lock" << info.absoluteFilePath() << ".";
|
|
|
|
|
}
|
2014-11-30 16:30:47 +01:00
|
|
|
|
delete logLock;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*out << "Could not find logs.";
|
|
|
|
|
}
|
|
|
|
|
log->close();
|
|
|
|
|
}
|
|
|
|
|
delete out;
|
|
|
|
|
delete log;
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-15 16:52:27 +01:00
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Catch exception and create report. Use if program build with Mingw compiler.
|
|
|
|
|
// See more about catcher https://github.com/jrfonseca/drmingw/blob/master/README.md
|
|
|
|
|
void VApplication::DrMingw()
|
|
|
|
|
{
|
|
|
|
|
QFile drmingw("exchndl.dll");
|
2015-03-02 18:11:43 +01:00
|
|
|
|
if (drmingw.exists())
|
2014-11-15 16:52:27 +01:00
|
|
|
|
{// If don't want create reports just delete exchndl.dll from installer
|
|
|
|
|
LoadLibrary(L"exchndl.dll");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::CollectReports() const
|
|
|
|
|
{
|
|
|
|
|
// Seek file "binary_name.RPT"
|
|
|
|
|
const QString reportName = QString("%1/%2.RPT").arg(applicationDirPath())
|
|
|
|
|
.arg(QFileInfo(arguments().at(0)).baseName());
|
|
|
|
|
QFile reportFile(reportName);
|
|
|
|
|
if (reportFile.exists())
|
|
|
|
|
{ // Hooray we have found crash
|
|
|
|
|
if (settings == nullptr)
|
|
|
|
|
{
|
|
|
|
|
return;// Settings was not opened.
|
|
|
|
|
}
|
|
|
|
|
|
2014-11-22 17:15:47 +01:00
|
|
|
|
if (settings->GetSendReportState())
|
2014-11-15 16:52:27 +01:00
|
|
|
|
{ // Try send report
|
|
|
|
|
// Remove gist.json file before close app.
|
|
|
|
|
connect(this, &VApplication::aboutToQuit, this, &VApplication::CleanGist, Qt::UniqueConnection);
|
|
|
|
|
SendReport(reportName);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ // Just collect report to /reports directory
|
|
|
|
|
CollectReport(reportName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::CollectReport(const QString &reportName) const
|
|
|
|
|
{
|
|
|
|
|
const QString reportsDir = QString("%1/reports").arg(qApp->applicationDirPath());
|
|
|
|
|
QDir reports(reportsDir);
|
|
|
|
|
if (reports.exists() == false)
|
|
|
|
|
{
|
|
|
|
|
reports.mkpath("."); // Create directory for reports if need
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QDateTime now = QDateTime::currentDateTime();
|
2014-11-20 13:18:43 +01:00
|
|
|
|
const QString timestamp = now.toString(QLatin1String("yyyy.MM.dd-hh_mm_ss"));
|
|
|
|
|
QString filename = QString("%1/reports/crash-%2.RPT").arg(qApp->applicationDirPath()).arg(timestamp);
|
2014-11-15 16:52:27 +01:00
|
|
|
|
|
|
|
|
|
QFile reportFile(reportName);
|
|
|
|
|
reportFile.copy(filename); // Collect new crash
|
|
|
|
|
reportFile.remove(); // Clear after yourself
|
2014-11-20 13:18:43 +01:00
|
|
|
|
|
|
|
|
|
filename = QString("%1/reports/log-%2.log").arg(qApp->applicationDirPath()).arg(timestamp);
|
2014-11-30 16:30:47 +01:00
|
|
|
|
GatherLogs();
|
|
|
|
|
QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
|
2014-11-20 13:18:43 +01:00
|
|
|
|
logFile.copy(filename); // Collect log
|
2014-11-15 16:52:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::CleanGist() const
|
|
|
|
|
{
|
|
|
|
|
QFile gistFile(GistFileName);
|
|
|
|
|
if (gistFile.exists())
|
|
|
|
|
{
|
|
|
|
|
gistFile.remove();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
void VApplication::SendReport(const QString &reportName) const
|
|
|
|
|
{
|
|
|
|
|
QString content;
|
|
|
|
|
QFile reportFile(reportName);
|
2014-11-20 13:18:43 +01:00
|
|
|
|
if (reportFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
2014-11-15 16:52:27 +01:00
|
|
|
|
{
|
2014-11-20 13:18:43 +01:00
|
|
|
|
content = ReadFileForSending(reportFile);
|
|
|
|
|
reportFile.close();
|
2014-11-15 16:52:27 +01:00
|
|
|
|
}
|
2014-11-20 13:18:43 +01:00
|
|
|
|
else
|
2014-11-15 16:52:27 +01:00
|
|
|
|
{
|
2014-11-26 18:02:34 +01:00
|
|
|
|
content = "RPT file error:" + reportFile.errorString() + "\r\n";
|
2014-11-15 16:52:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Additional information
|
|
|
|
|
content.append(QString("-------------------------------")+"\r\n");
|
|
|
|
|
content.append(QString("Version:%1").arg(APP_VERSION)+"\r\n");
|
2015-02-18 11:17:56 +01:00
|
|
|
|
content.append(QString("Build revision:%1").arg(BUILD_REVISION)+"\r\n");
|
2014-11-15 16:52:27 +01:00
|
|
|
|
content.append(QString("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)+"\r\n");
|
|
|
|
|
content.append(QString("Built on %3 at %4").arg(__DATE__).arg(__TIME__)+"\r\n");
|
2015-02-18 14:29:44 +01:00
|
|
|
|
content.append(QString("Web site:http://www.valentina-project.org/ ")+"\r\n");
|
2014-11-20 13:18:43 +01:00
|
|
|
|
content.append("\r\n");
|
2014-11-15 16:52:27 +01:00
|
|
|
|
|
|
|
|
|
// Creating json with report
|
|
|
|
|
// Example:
|
|
|
|
|
//{
|
|
|
|
|
// "description":"Crash report",
|
|
|
|
|
// "public":"true",
|
|
|
|
|
// "files":{
|
2014-11-20 13:18:43 +01:00
|
|
|
|
// "valentina.RPT":{
|
2014-11-15 16:52:27 +01:00
|
|
|
|
// "content":"Report text here"
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
// Useful to know when crash was created
|
|
|
|
|
const QDateTime now = QDateTime::currentDateTime();
|
|
|
|
|
const QString timestamp = now.toString(QLatin1String("yyyy/MM/dd hh:mm:ss:zzz"));
|
|
|
|
|
const QString report = QString("Crash report was created %2").arg(timestamp);
|
|
|
|
|
|
|
|
|
|
QJsonObject reportObject;
|
|
|
|
|
reportObject.insert(QStringLiteral("description"), QJsonValue(report));
|
|
|
|
|
reportObject.insert(QStringLiteral("public"), QJsonValue(QString("true")));
|
|
|
|
|
|
2014-11-26 18:02:34 +01:00
|
|
|
|
content.append(QString("\r\n-------------------------------\r\n"));
|
2014-11-20 13:18:43 +01:00
|
|
|
|
content.append(QString("Log:")+"\r\n");
|
|
|
|
|
|
2014-11-30 16:30:47 +01:00
|
|
|
|
GatherLogs();
|
|
|
|
|
QFile logFile(QString("%1/valentina.log").arg(LogDirPath()));
|
2014-11-20 13:18:43 +01:00
|
|
|
|
if (logFile.open(QIODevice::ReadOnly | QIODevice::Text))
|
|
|
|
|
{
|
2014-12-27 20:12:45 +01:00
|
|
|
|
const QString logContent = ReadFileForSending(logFile);
|
|
|
|
|
if (logContent.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
content.append("Log file is empty.");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
content.append(logContent);
|
|
|
|
|
}
|
2014-11-20 13:18:43 +01:00
|
|
|
|
logFile.close();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-11-26 18:02:34 +01:00
|
|
|
|
content.append("\r\n Log file error:" + logFile.errorString() + "\r\n");
|
2014-11-20 13:18:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString contentSection = QStringLiteral("content");
|
2014-11-15 16:52:27 +01:00
|
|
|
|
QJsonObject contentObject;
|
2014-11-20 13:18:43 +01:00
|
|
|
|
contentObject.insert(contentSection, QJsonValue(content));
|
2014-11-15 16:52:27 +01:00
|
|
|
|
|
2014-11-20 13:18:43 +01:00
|
|
|
|
const QString filesSection = QStringLiteral("files");
|
2014-11-15 16:52:27 +01:00
|
|
|
|
QJsonObject fileObject;
|
|
|
|
|
fileObject.insert(QFileInfo(reportName).fileName(), QJsonValue(contentObject));
|
2014-11-20 13:18:43 +01:00
|
|
|
|
reportObject.insert(filesSection, QJsonValue(fileObject));
|
2014-11-15 16:52:27 +01:00
|
|
|
|
|
|
|
|
|
QFile gistFile(GistFileName);
|
|
|
|
|
if (!gistFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
|
|
|
|
{
|
|
|
|
|
qDebug("Couldn't open gist file.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Save data to file
|
|
|
|
|
QJsonDocument saveRep(reportObject);
|
|
|
|
|
gistFile.write(saveRep.toJson());
|
|
|
|
|
gistFile.close();
|
|
|
|
|
|
2015-02-22 19:46:08 +01:00
|
|
|
|
const QString curl = QString("%1/curl.exe").arg(qApp->applicationDirPath());
|
|
|
|
|
QFile curlFile(curl);
|
2014-11-15 16:52:27 +01:00
|
|
|
|
if (curlFile.exists())
|
|
|
|
|
{// Trying send report
|
2015-02-22 19:46:08 +01:00
|
|
|
|
// Change token if need
|
2015-03-23 14:03:12 +01:00
|
|
|
|
const QStringList token = QStringList()<<"78"<<"5e"<<"02"<<"bd"<<"41"<<"e9"<<"6a"<<"63"<<"ab"<<"18"<<"09"<<"2f"
|
|
|
|
|
<<"13"<<"cf"<<"48"<<"b4"<<"75"<<"6a"<<"42"<<"39";
|
2015-02-22 19:46:08 +01:00
|
|
|
|
|
|
|
|
|
const QString arg = QString("curl.exe -k -H \"Authorization: bearer ")+token.join("")+
|
|
|
|
|
QString("\" -H \"Accept: application/json\" -H \"Content-type: application/json\" -X POST "
|
|
|
|
|
"--data @gist.json https://api.github.com/gists");
|
2014-11-15 16:52:27 +01:00
|
|
|
|
QProcess::startDetached(arg);
|
|
|
|
|
reportFile.remove();// Clear after yourself
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{// We can not send than just collect
|
|
|
|
|
CollectReport(reportName);
|
|
|
|
|
}
|
2015-02-22 19:46:08 +01:00
|
|
|
|
curlFile.close();
|
2014-11-15 16:52:27 +01:00
|
|
|
|
}
|
2014-11-20 13:18:43 +01:00
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
QString VApplication::ReadFileForSending(QFile &file) const
|
|
|
|
|
{
|
|
|
|
|
QString content;
|
|
|
|
|
QTextStream in(&file);
|
|
|
|
|
while (!in.atEnd())
|
|
|
|
|
{
|
|
|
|
|
content.append(in.readLine()+"\r\n");// Windows end of line
|
|
|
|
|
}
|
|
|
|
|
return content;
|
|
|
|
|
}
|
2014-11-15 16:52:27 +01:00
|
|
|
|
#endif //defined(Q_OS_WIN) && defined(Q_CC_GNU)
|