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

GUI_AppConfig.xsp « xsp « xs - github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 08a88883dbdf0e302d5b42868451cb8267272878 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

%module{Slic3r::XS};

%{
#include <xsinit.h>
#include "slic3r/GUI/AppConfig.hpp"
%}

%name{Slic3r::GUI::AppConfig} class AppConfig {
    AppConfig();
    ~AppConfig();

    void 					    reset();
    void 						set_defaults();

    void                        load()
        %code%{
            try {
                THIS->load();
            } catch (std::exception& e) {
                croak("Loading an application config file failed:\n%s\n", e.what());
            }
        %};
    void                        save()
        %code%{
            try {
                THIS->save();
            } catch (std::exception& e) {
                croak("Saving an application config file failed:\n%s\n", e.what());
            }
        %};
    bool						exists();
    bool                        dirty();

    std::string                 get(char *name);
    void                        set(char *name, char *value);
    bool						has(char *section);

    std::string                 get_last_dir();
    void                        update_config_dir(char *dir);
    void                        update_skein_dir(char *dir);
    std::string                 get_last_output_dir(const char *alt = "");
    void                        update_last_output_dir(char *dir);

    void                        reset_selections();
};