2018-03-13 12:39:57 +01:00
|
|
|
#ifndef slic3r_PresetUpdate_hpp_
|
|
|
|
|
#define slic3r_PresetUpdate_hpp_
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
2018-04-16 16:52:11 +02:00
|
|
|
#include <vector>
|
2018-03-13 12:39:57 +01:00
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppConfig;
|
|
|
|
|
class PresetBundle;
|
|
|
|
|
|
|
|
|
|
class PresetUpdater
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-09-21 01:33:41 +02:00
|
|
|
PresetUpdater();
|
2018-03-13 12:39:57 +01:00
|
|
|
PresetUpdater(PresetUpdater &&) = delete;
|
|
|
|
|
PresetUpdater(const PresetUpdater &) = delete;
|
|
|
|
|
PresetUpdater &operator=(PresetUpdater &&) = delete;
|
|
|
|
|
PresetUpdater &operator=(const PresetUpdater &) = delete;
|
|
|
|
|
~PresetUpdater();
|
|
|
|
|
|
2018-04-23 11:16:47 +02:00
|
|
|
// If either version check or config updating is enabled, get the appropriate data in the background and cache it.
|
2018-04-17 16:59:53 +02:00
|
|
|
void sync(PresetBundle *preset_bundle);
|
2018-04-23 11:16:47 +02:00
|
|
|
|
|
|
|
|
// If version check is enabled, check if chaced online slic3r version is newer, notify if so.
|
2018-04-17 16:59:53 +02:00
|
|
|
void slic3r_update_notify();
|
2018-04-23 11:16:47 +02:00
|
|
|
|
|
|
|
|
// If updating is enabled, check if updates are available in cache, if so, ask about installation.
|
2018-04-24 18:06:42 +02:00
|
|
|
// A false return value implies Slic3r should exit due to incompatibility of configuration.
|
|
|
|
|
bool config_update() const;
|
2018-04-23 11:16:47 +02:00
|
|
|
|
|
|
|
|
// "Update" a list of bundles from resources (behaves like an online update).
|
2018-04-24 18:06:42 +02:00
|
|
|
void install_bundles_rsrc(std::vector<std::string> bundles, bool snapshot = true) const;
|
2018-03-13 12:39:57 +01:00
|
|
|
private:
|
|
|
|
|
struct priv;
|
|
|
|
|
std::unique_ptr<priv> p;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endif
|