locig: refresh after edit project

* implemented saving project settings force-refreshes the project if something has changed.
* when nothing has changed while editing the project settings, the project is not refreshed anymore.
* new project window is cleared now before it is displayed.
This commit is contained in:
malte_langkabel
2016-01-18 10:59:32 +01:00
parent 3852bb7e5c
commit 743f91e882
11 changed files with 78 additions and 45 deletions
@@ -6,8 +6,9 @@
class MessageLoadProject: public Message<MessageLoadProject>
{
public:
MessageLoadProject(const std::string& filePath)
MessageLoadProject(const std::string& filePath, bool forceRefresh)
: projectSettingsFilePath(filePath)
, forceRefresh(forceRefresh)
{
}
@@ -18,10 +19,11 @@ public:
virtual void print(std::ostream& os) const
{
os << projectSettingsFilePath;
os << projectSettingsFilePath << ", forceRefresh: " << std::boolalpha << forceRefresh;
}
const std::string projectSettingsFilePath;
const bool forceRefresh;
};
#endif // MESSAGE_LOAD_PROJECT_H
+7
View File
@@ -1,6 +1,7 @@
#ifndef UTILITY_H
#define UTILITY_H
#include <algorithm>
#include <deque>
#include <set>
#include <time.h>
@@ -35,6 +36,12 @@ namespace utility
template<typename T>
std::vector<std::string> toStrings(const std::vector<T>& d);
template<typename T>
bool isPermutation(const std::vector<T>& a, const std::vector<T>& b)
{
return std::is_permutation(a.begin(), a.end(), b.begin());
}
bool intersectionPoint(Vec2f a1, Vec2f b1, Vec2f a2, Vec2f b2, Vec2f* i);
size_t digits(size_t n);