1
0
Fork 0
LAview.Object-Example/src/laview-core/object-plugins/Settings.vala

35 lines
1.1 KiB
Vala
Raw Normal View History

Squashed commit of the following: commit d637633290c6d07d3a0552a738bb2350d5ad0daf Author: Kolan Sh <backbone@backbone.ws> Date: Tue May 8 19:26:54 2018 +0300 Fix GSchema with custom plugins directories. + Separate Settings.vala. commit c9963cd9f78502ee3d91d647fd0b02b6fef782d8 Author: Kolan Sh <backbone@backbone.ws> Date: Mon Apr 30 17:35:51 2018 +0300 URLs, captions fixed. commit ebd71aa5520416fba3f79c71430ad0e8bd006384 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 19:07:03 2018 +0300 Spare Plugin, Core keywords removed from identifiers. commit 2b72b6b0b19957c9b3884e2a08e89aaee7f232de Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 10:26:49 2018 +0300 Valadoc fixes. commit 308dee423268860fcb37ae7965d89406e6568d32 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 18:03:34 2018 +0300 ObjectExample Dialog [Preferences Button] -> Preferences Dialog. commit a846158937bf88151b3d8e1b318748650b8db043 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 17:33:33 2018 +0300 Fix UI Glade file. commit d21729d16de24ea36a884bf3bcf0141044bf87fc Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 17:28:07 2018 +0300 PreferencesDialog added commit acd8e1e6bf5b8e206eaeca2c76ba4b7f19466dbf Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 16:23:37 2018 +0300 UI file updated. commit f987024016532911e8e48e8ce3e7a68e6b471912 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 15:02:56 2018 +0300 Conflicting AppDirs fxd. commit 75f8ecc06e50ab2c76fbe912b8bc27c0b0ed5fe9 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Apr 26 16:38:55 2018 +0300 PluginObject.preferences() added. commit d0f518049f935931ac6f980ef7c6d267c63f7ac8 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Mar 29 10:52:35 2018 +0300 submodules URLs updated. commit 954073e68e7f5c13a719014b2131051944eba7b4 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Feb 13 23:27:42 2018 +0300 lib != lib64, lib != lib32 commit 16f081420846410b0cd4a7da972453e7caec75fd Author: Kolan Sh <backbone@backbone.ws> Date: Tue Dec 19 08:52:31 2017 +0300 Module cmake/backbone updated: Check BinPkgModules for empty value. commit aefe2404e6918abff1f34143934920e274f98a89 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Feb 18 18:12:45 2017 +0300 Backbone's submodules urls fixed. commit 036c79e9e30a363f5bebd55ec178887354ef20bf Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:17:13 2016 +0300 Valadoc fxd. commit 111805ad73a50c1a3ffc73d9c90a7262cd6dd04c Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:16:52 2016 +0300 util/backbone submodule udpated: valadoc commit 155b3e1a1a11cbbe30b66aa88d09734e68b36838 Author: Kolan Sh <backbone@backbone.ws> Date: Wed Dec 7 19:00:13 2016 +0300 cmake/backbone submodule updated: Override NSIS.InstallOptions only if needed. commit 37652bedfde49ac17ae30f59538bc16a2930d87e Author: Kolan Sh <backbone@backbone.ws> Date: Fri Sep 2 18:47:44 2016 +0300 cmake/backbone submodule updated: dlls regresion fxd. commit 70f6158c091303ab531154de3228e6730f998922 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Aug 9 18:22:00 2016 +0300 cmake/backbone submodule: get_library_path(): uninitialized hCurrentModuleInstance + make it static. commit 606013daef68852f81544b7eb8740148b97fae22 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Jun 21 13:32:05 2016 +0300 Show paths. commit 29817dd27b23aa7e934795ff242c70482a1667fa Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 8 03:18:56 2016 +0300 Homepage menu link added. commit 5800e4f331f62c61262bc510956c226e250f5d2d Author: Kolan Sh <backbone@backbone.ws> Date: Sat Nov 14 12:50:00 2015 +0300
2018-06-18 12:12:45 +03:00
namespace LAview.ObjectExample {
public class AppSettings : Object {
Settings settings;
2018-10-17 11:22:59 +03:00
string _greeting = "lyx";
Squashed commit of the following: commit d637633290c6d07d3a0552a738bb2350d5ad0daf Author: Kolan Sh <backbone@backbone.ws> Date: Tue May 8 19:26:54 2018 +0300 Fix GSchema with custom plugins directories. + Separate Settings.vala. commit c9963cd9f78502ee3d91d647fd0b02b6fef782d8 Author: Kolan Sh <backbone@backbone.ws> Date: Mon Apr 30 17:35:51 2018 +0300 URLs, captions fixed. commit ebd71aa5520416fba3f79c71430ad0e8bd006384 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 19:07:03 2018 +0300 Spare Plugin, Core keywords removed from identifiers. commit 2b72b6b0b19957c9b3884e2a08e89aaee7f232de Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 10:26:49 2018 +0300 Valadoc fixes. commit 308dee423268860fcb37ae7965d89406e6568d32 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 18:03:34 2018 +0300 ObjectExample Dialog [Preferences Button] -> Preferences Dialog. commit a846158937bf88151b3d8e1b318748650b8db043 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 17:33:33 2018 +0300 Fix UI Glade file. commit d21729d16de24ea36a884bf3bcf0141044bf87fc Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 17:28:07 2018 +0300 PreferencesDialog added commit acd8e1e6bf5b8e206eaeca2c76ba4b7f19466dbf Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 16:23:37 2018 +0300 UI file updated. commit f987024016532911e8e48e8ce3e7a68e6b471912 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 15:02:56 2018 +0300 Conflicting AppDirs fxd. commit 75f8ecc06e50ab2c76fbe912b8bc27c0b0ed5fe9 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Apr 26 16:38:55 2018 +0300 PluginObject.preferences() added. commit d0f518049f935931ac6f980ef7c6d267c63f7ac8 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Mar 29 10:52:35 2018 +0300 submodules URLs updated. commit 954073e68e7f5c13a719014b2131051944eba7b4 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Feb 13 23:27:42 2018 +0300 lib != lib64, lib != lib32 commit 16f081420846410b0cd4a7da972453e7caec75fd Author: Kolan Sh <backbone@backbone.ws> Date: Tue Dec 19 08:52:31 2017 +0300 Module cmake/backbone updated: Check BinPkgModules for empty value. commit aefe2404e6918abff1f34143934920e274f98a89 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Feb 18 18:12:45 2017 +0300 Backbone's submodules urls fixed. commit 036c79e9e30a363f5bebd55ec178887354ef20bf Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:17:13 2016 +0300 Valadoc fxd. commit 111805ad73a50c1a3ffc73d9c90a7262cd6dd04c Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:16:52 2016 +0300 util/backbone submodule udpated: valadoc commit 155b3e1a1a11cbbe30b66aa88d09734e68b36838 Author: Kolan Sh <backbone@backbone.ws> Date: Wed Dec 7 19:00:13 2016 +0300 cmake/backbone submodule updated: Override NSIS.InstallOptions only if needed. commit 37652bedfde49ac17ae30f59538bc16a2930d87e Author: Kolan Sh <backbone@backbone.ws> Date: Fri Sep 2 18:47:44 2016 +0300 cmake/backbone submodule updated: dlls regresion fxd. commit 70f6158c091303ab531154de3228e6730f998922 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Aug 9 18:22:00 2016 +0300 cmake/backbone submodule: get_library_path(): uninitialized hCurrentModuleInstance + make it static. commit 606013daef68852f81544b7eb8740148b97fae22 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Jun 21 13:32:05 2016 +0300 Show paths. commit 29817dd27b23aa7e934795ff242c70482a1667fa Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 8 03:18:56 2016 +0300 Homepage menu link added. commit 5800e4f331f62c61262bc510956c226e250f5d2d Author: Kolan Sh <backbone@backbone.ws> Date: Sat Nov 14 12:50:00 2015 +0300
2018-06-18 12:12:45 +03:00
public string greeting {
get { return _greeting; }
set {
if (settings != null) settings.set_string ("greeting", value);
_greeting = value;
}
}
public AppSettings () throws Error {
string schema_file = AppDirs.settings_dir+"/gschemas.compiled";
if (!File.new_for_path (schema_file).query_exists ())
throw new IOError.NOT_FOUND ("File "+schema_file+" not found");
SettingsSchemaSource sss = new SettingsSchemaSource.from_directory (AppDirs.settings_dir, null, false);
string schema_name = "ws.backbone.laview.object-example-"+Config.VERSION_MAJOR.to_string();
SettingsSchema schema = sss.lookup (schema_name, false);
if (schema == null) {
throw new IOError.NOT_FOUND ("Schema "+schema_name+" not found in "+schema_file);
}
settings = new Settings.full (schema, null, null);
_greeting = settings.get_string("greeting");
settings.changed["greeting"].connect (() => {
_greeting = settings.get_string("greeting");
});
}
}
}