Trying to fix conflicts

--HG--
branch : develop
This commit is contained in:
Alex 2015-08-27 18:39:02 +03:00
parent 166946df92
commit 1641e16f50
7 changed files with 43 additions and 30 deletions

View File

@ -50,11 +50,6 @@
#include <QDateTime> #include <QDateTime>
#include <iostream> #include <iostream>
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
# include <QLockFile>
#endif
#include <QtXmlPatterns>
Q_LOGGING_CATEGORY(vApp, "v.application") Q_LOGGING_CATEGORY(vApp, "v.application")
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -287,7 +282,8 @@ bool VApplication::notify(QObject *receiver, QEvent *event)
} }
catch (std::exception& e) catch (std::exception& e)
{ {
qCritical() << "Exception thrown:" << e.what(); qCDebug(vApp, "Critical error! Exception thrown: %s", e.what());
abort();
} }
return false; return false;
} }
@ -338,6 +334,12 @@ QString VApplication::translationsPath() const
const QString trPath = QStringLiteral("/translations"); const QString trPath = QStringLiteral("/translations");
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
return QApplication::applicationDirPath() + trPath; return QApplication::applicationDirPath() + trPath;
#elif defined(Q_OS_MAC)
QDir dirBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + trPath);
if (dirBundle.exists())
return tape;
}
}
#else #else
#ifdef QT_DEBUG #ifdef QT_DEBUG
return QApplication::applicationDirPath() + trPath; return QApplication::applicationDirPath() + trPath;

View File

@ -88,6 +88,10 @@ public:
#endif // defined(Q_OS_WIN) && defined(Q_CC_GNU) #endif // defined(Q_OS_WIN) && defined(Q_CC_GNU)
bool static CheckGUI(); bool static CheckGUI();
virtual void OpenSettings() Q_DECL_OVERRIDE;
VSettings *ValentinaSettings();
const VCommandLinePtr CommandLine() const; const VCommandLinePtr CommandLine() const;
private slots: private slots:

View File

@ -28,9 +28,12 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "core/vapplication.h" #include "core/vapplication.h"
#include <iostream>
#include <QMessageBox> // For QT_REQUIRE_VERSION #include <QMessageBox> // For QT_REQUIRE_VERSION
// Lock producing random attribute order in XML
// https://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml
extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int main(int argc, char *argv[]) int main(int argc, char *argv[])

View File

@ -3058,27 +3058,6 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args)
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DoExport(const VCommandLinePtr &expParams)
{
auto settings = expParams->DefaultGenerator();
const QHash<quint32, VDetail> *details = pattern->DataDetails();
if(not qApp->getOpeningPattern())
{
if (details->count() == 0)
{
AppAbort(tr("You can't export empty scene."));
return;
}
}
PrepareDetailsForLayout(details);
LayoutSettings(*settings.get());
DialogSaveLayout dialog(scenes.size(), expParams->OptExportPath(), this);
dialog.SelectFormate(expParams->OptExportType());
ExportLayout(dialog);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString MainWindow::CheckPathToMeasurements(const QString &path, const MeasurementsType &patternType) QString MainWindow::CheckPathToMeasurements(const QString &path, const MeasurementsType &patternType)
{ {
@ -3190,3 +3169,24 @@ void MainWindow::ZoomFirstShow()
ActionDraw(true); ActionDraw(true);
ui->view->ZoomFitBest(); ui->view->ZoomFitBest();
} }
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::DoExport(const VCommandLinePtr &expParams)
{
auto settings = expParams->DefaultGenerator();
const QHash<quint32, VDetail> *details = pattern->DataDetails();
if(not qApp->getOpeningPattern())
{
if (details->count() == 0)
{
AppAbort(tr("You can't export empty scene."));
return;
}
}
PrepareDetailsForLayout(details);
LayoutSettings(*settings.get());
DialogSaveLayout dialog(scenes.size(), expParams->OptExportPath(), this);
dialog.SelectFormate(expParams->OptExportType());
ExportLayout(dialog);
}

View File

@ -30,6 +30,8 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include "mainwindowsnogui.h" #include "mainwindowsnogui.h"
#include "../vpatterndb/vcontainer.h"
#include "../vobj/vobjpaintdevice.h"
#include "../libs/vwidgets/vmaingraphicsview.h" #include "../libs/vwidgets/vmaingraphicsview.h"
#include "../libs/vtools/dialogs/tooldialogs.h" #include "../libs/vtools/dialogs/tooldialogs.h"
#include "dialogs/dialogs.h" #include "dialogs/dialogs.h"

View File

@ -30,9 +30,11 @@
#include "core/vapplication.h" #include "core/vapplication.h"
#include "../libs/vpatterndb/vcontainer.h" #include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vobj/vobjpaintdevice.h" #include "../libs/vobj/vobjpaintdevice.h"
#include "../libs/vpatterndb/vcontainer.h"
#include "../libs/vobj/vobjpaintdevice.h"
#include "../libs/vlayout/vposter.h"
#include "dialogs/dialoglayoutprogress.h" #include "dialogs/dialoglayoutprogress.h"
#include "../libs/vlayout/vposter.h"
#include "dialogs/dialoglayoutsettings.h" #include "dialogs/dialoglayoutsettings.h"

View File

@ -38,7 +38,7 @@
enum class NodeDetail : char { Contour, Modeling }; enum class NodeDetail : char { Contour, Modeling };
enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown }; enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown };
enum class MeasurementsType : char { Standard, Individual }; enum class MeasurementsType : char { Standard, Individual , Unknown};
enum class Unit : char { Mm = 0, Cm, Inch, Px, LAST_UNIT_DO_NOT_USE}; enum class Unit : char { Mm = 0, Cm, Inch, Px, LAST_UNIT_DO_NOT_USE};
enum class Source : char { FromGui, FromFile, FromTool }; enum class Source : char { FromGui, FromFile, FromTool };