diff --git a/ChangeLog.txt b/ChangeLog.txt index 6487ad056..f5207d641 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -37,6 +37,7 @@ - Fix grainline position on layout. - [#719] Valentina crashes when unite pieces. - Fixed Valentina crash. Used way to avoid Qt's bug QTBUG-61213. +- Fixed behaviour on Windows. Valentina asks about synchronization measurements twice. # Version 0.5.0 May 9, 2017 - [#581] User can now filter input lists by keyword in function wizard. diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 62d58f6a5..620c07ca8 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -184,10 +184,12 @@ MainWindow::MainWindow(QWidget *parent) connect(watcher, &QFileSystemWatcher::fileChanged, this, &MainWindow::MeasurementsChanged); connect(qApp, &QApplication::focusChanged, this, [this](QWidget *old, QWidget *now) { + static bool asking = false; if (old == nullptr && isAncestorOf(now) == true) {// focus IN - if (mChanges && not mChangesAsked) + if (not asking && mChanges && not mChangesAsked) { + asking = true; mChangesAsked = true; const auto answer = QMessageBox::question(this, tr("Measurements"), tr("Measurements were changed. Do you want to sync measurements now?"), @@ -196,6 +198,7 @@ MainWindow::MainWindow(QWidget *parent) { SyncMeasurements(); } + asking = false; } }