From 1641e16f508d1301535a77eabb20f9e9b212d4fa Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Aug 2015 18:39:02 +0300 Subject: [PATCH] Trying to fix conflicts --HG-- branch : develop --- src/app/core/vapplication.cpp | 14 +++++++----- src/app/core/vapplication.h | 4 ++++ src/app/main.cpp | 5 ++++- src/app/mainwindow.cpp | 42 +++++++++++++++++------------------ src/app/mainwindow.h | 2 ++ src/app/mainwindowsnogui.cpp | 4 +++- src/libs/vmisc/def.h | 2 +- 7 files changed, 43 insertions(+), 30 deletions(-) diff --git a/src/app/core/vapplication.cpp b/src/app/core/vapplication.cpp index 095ec4a3a..3e5aee6b2 100644 --- a/src/app/core/vapplication.cpp +++ b/src/app/core/vapplication.cpp @@ -50,11 +50,6 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) -# include -#endif -#include - Q_LOGGING_CATEGORY(vApp, "v.application") //--------------------------------------------------------------------------------------------------------------------- @@ -287,7 +282,8 @@ bool VApplication::notify(QObject *receiver, QEvent *event) } catch (std::exception& e) { - qCritical() << "Exception thrown:" << e.what(); + qCDebug(vApp, "Critical error! Exception thrown: %s", e.what()); + abort(); } return false; } @@ -338,6 +334,12 @@ QString VApplication::translationsPath() const const QString trPath = QStringLiteral("/translations"); #ifdef Q_OS_WIN return QApplication::applicationDirPath() + trPath; +#elif defined(Q_OS_MAC) + QDir dirBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + trPath); + if (dirBundle.exists()) + return tape; + } + } #else #ifdef QT_DEBUG return QApplication::applicationDirPath() + trPath; diff --git a/src/app/core/vapplication.h b/src/app/core/vapplication.h index ec3d1a19e..61f624e30 100644 --- a/src/app/core/vapplication.h +++ b/src/app/core/vapplication.h @@ -88,6 +88,10 @@ public: #endif // defined(Q_OS_WIN) && defined(Q_CC_GNU) bool static CheckGUI(); + virtual void OpenSettings() Q_DECL_OVERRIDE; + VSettings *ValentinaSettings(); + + const VCommandLinePtr CommandLine() const; private slots: diff --git a/src/app/main.cpp b/src/app/main.cpp index 9b05f5828..b1e26a258 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -28,9 +28,12 @@ #include "mainwindow.h" #include "core/vapplication.h" -#include #include // 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[]) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 7ca0a96e7..aa0e09064 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -3058,27 +3058,6 @@ void MainWindow::ReopenFilesAfterCrash(QStringList &args) } } -//--------------------------------------------------------------------------------------------------------------------- -void MainWindow::DoExport(const VCommandLinePtr &expParams) -{ - auto settings = expParams->DefaultGenerator(); - - const QHash *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) { @@ -3190,3 +3169,24 @@ void MainWindow::ZoomFirstShow() ActionDraw(true); ui->view->ZoomFitBest(); } + +//--------------------------------------------------------------------------------------------------------------------- +void MainWindow::DoExport(const VCommandLinePtr &expParams) +{ + auto settings = expParams->DefaultGenerator(); + + const QHash *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); +} diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h index 7e39c52c9..f76e31b77 100644 --- a/src/app/mainwindow.h +++ b/src/app/mainwindow.h @@ -30,6 +30,8 @@ #define MAINWINDOW_H #include "mainwindowsnogui.h" +#include "../vpatterndb/vcontainer.h" +#include "../vobj/vobjpaintdevice.h" #include "../libs/vwidgets/vmaingraphicsview.h" #include "../libs/vtools/dialogs/tooldialogs.h" #include "dialogs/dialogs.h" diff --git a/src/app/mainwindowsnogui.cpp b/src/app/mainwindowsnogui.cpp index 8edcdf6e6..a69d2e551 100644 --- a/src/app/mainwindowsnogui.cpp +++ b/src/app/mainwindowsnogui.cpp @@ -30,9 +30,11 @@ #include "core/vapplication.h" #include "../libs/vpatterndb/vcontainer.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 "../libs/vlayout/vposter.h" #include "dialogs/dialoglayoutsettings.h" diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index a01bc8c22..c3385c897 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -38,7 +38,7 @@ enum class NodeDetail : char { Contour, Modeling }; 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 Source : char { FromGui, FromFile, FromTool };