2015-12-27 19:06:08 +03:00
|
|
|
namespace LAview.Desktop {
|
|
|
|
|
2016-01-27 00:52:15 +03:00
|
|
|
public class AppSettings {
|
|
|
|
Settings settings;
|
2015-12-27 19:06:08 +03:00
|
|
|
|
2016-01-27 00:52:15 +03:00
|
|
|
string _pdf_save_path;
|
|
|
|
public string pdf_save_path {
|
|
|
|
get { return _pdf_save_path; }
|
|
|
|
set {
|
|
|
|
if (settings != null) settings.set_string ("pdf-save-path", value);
|
|
|
|
_pdf_save_path = value;
|
|
|
|
}
|
|
|
|
default = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
public AppSettings () throws Error {
|
2015-12-27 19:06:08 +03:00
|
|
|
SettingsSchemaSource sss = new SettingsSchemaSource.from_directory (AppDirs.settings_dir, null, false);
|
2016-01-27 00:52:15 +03:00
|
|
|
SettingsSchema schema = sss.lookup ("ws.backbone.laview.desktop-"+Config.VERSION_MAJOR.to_string(), false);
|
|
|
|
if (schema == null) {
|
|
|
|
stderr.printf ("ID not found.\n");
|
2016-02-29 23:04:59 +03:00
|
|
|
throw new IOError.NOT_FOUND (_("File ")+AppDirs.settings_dir+"/gschemas.compiled"+_(" not found"));
|
2016-01-27 00:52:15 +03:00
|
|
|
}
|
|
|
|
settings = new Settings.full (schema, null, null);
|
2015-12-27 19:06:08 +03:00
|
|
|
|
2016-01-27 00:52:15 +03:00
|
|
|
_pdf_save_path = settings.get_string("pdf-save-path");
|
|
|
|
settings.changed["pdf-save-path"].connect (() => {
|
|
|
|
_pdf_save_path = settings.get_string("pdf-save-path");
|
|
|
|
});
|
2015-12-27 19:06:08 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|