Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/slic3r/Utils/PresetUpdater.hpp')
-rw-r--r--src/slic3r/Utils/PresetUpdater.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/slic3r/Utils/PresetUpdater.hpp b/src/slic3r/Utils/PresetUpdater.hpp
new file mode 100644
index 000000000..6a53cca81
--- /dev/null
+++ b/src/slic3r/Utils/PresetUpdater.hpp
@@ -0,0 +1,42 @@
+#ifndef slic3r_PresetUpdate_hpp_
+#define slic3r_PresetUpdate_hpp_
+
+#include <memory>
+#include <vector>
+
+namespace Slic3r {
+
+
+class AppConfig;
+class PresetBundle;
+
+class PresetUpdater
+{
+public:
+ PresetUpdater(int version_online_event);
+ PresetUpdater(PresetUpdater &&) = delete;
+ PresetUpdater(const PresetUpdater &) = delete;
+ PresetUpdater &operator=(PresetUpdater &&) = delete;
+ PresetUpdater &operator=(const PresetUpdater &) = delete;
+ ~PresetUpdater();
+
+ // If either version check or config updating is enabled, get the appropriate data in the background and cache it.
+ void sync(PresetBundle *preset_bundle);
+
+ // If version check is enabled, check if chaced online slic3r version is newer, notify if so.
+ void slic3r_update_notify();
+
+ // If updating is enabled, check if updates are available in cache, if so, ask about installation.
+ // A false return value implies Slic3r should exit due to incompatibility of configuration.
+ bool config_update() const;
+
+ // "Update" a list of bundles from resources (behaves like an online update).
+ void install_bundles_rsrc(std::vector<std::string> bundles, bool snapshot = true) const;
+private:
+ struct priv;
+ std::unique_ptr<priv> p;
+};
+
+
+}
+#endif