Apply fixes for the ui jobs.

- Localization
- Mutual exclusion (ExclusiveJobGroup), only one UI job can run at a time, and background processing is stopped
- m_range not used for finalization anymore
- stop_jobs called before Window is closed
This commit is contained in:
tamasmeszaros 2019-06-18 16:24:30 +02:00
parent d60ecb3788
commit 468516aa31
3 changed files with 224 additions and 133 deletions

View file

@ -5,6 +5,7 @@
#include <mutex> // for std::lock_guard
#include <functional> // for std::function
#include <utility> // for std::forward
#include <algorithm>
namespace Slic3r {
@ -182,6 +183,14 @@ public:
inline bool empty() const { return size() == 0; }
};
template<class C> bool all_of(const C &container) {
return std::all_of(container.begin(),
container.end(),
[](const typename C::value_type &v) {
return static_cast<bool>(v);
});
}
}
#endif // MTUTILS_HPP