1
0
Fork 0
LAview.Data-Example/src/laview-core/data-plugins/Settings.vala

35 lines
1.1 KiB
Vala
Raw Normal View History

Squashed commit of the following: commit ccf7c4f373fdcc10924ac2b6f0befa83361b2df3 Author: Kolan Sh <backbone@backbone.ws> Date: Tue May 8 19:27:07 2018 +0300 Fix GSchema with custom plugins directories. + Separate Settings.vala. commit 8928e10ee295897199fb6161d439b156b1a59822 Author: Kolan Sh <backbone@backbone.ws> Date: Mon Apr 30 17:35:45 2018 +0300 URLs, captions fixed. commit bdaa3d451aed30cc0fbfdbeeaa0364c4e2f74d1d Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 18:54:36 2018 +0300 PreferenceDialog: composed->apply. commit f684d9058679c5b58fc92c25e0e4f07fbe79e097 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 18:47:01 2018 +0300 Translations updated. commit d17fcdb0294eec5b1ec0aa9ccfaeaf3e85f69bab Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 18:38:18 2018 +0300 win32: menu url links fxd. commit 75e53c2e7574376a06689a1ac791354be0553a02 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 17:14:10 2018 +0300 GObject-Plugin: Different load methods: load_modules(), load_modules_depth2(). commit 04c512b36f82c8a0b84bfd93343269d3533f0b29 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 15:03:22 2018 +0300 Spare Plugin, Core keywords removed from identifiers. commit cc0edbab094e97648dd1425b81579b7b0e2ade43 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 10:26:54 2018 +0300 Valadoc fixes. commit 1ace70831fd65b3f4f80fa748c5c9489b79382e6 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 17:23:30 2018 +0300 spare code removed commit ae35b77787c0441247582be5fbfb12a8bb1dfa63 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 16:48:32 2018 +0300 DataExampleDialog->DataExample.PreferencesDialog commit db1e427c98058e2222eaf5e4cff4883d4a86e18d Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 16:23:17 2018 +0300 UI file updated. commit 71e07e82e291e38940e44c2423e2877934561d17 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 15:01:54 2018 +0300 Conflicting AppDirs fxd. commit 473abfa1e322b4516b69f972e6907ec8ef91da96 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 10:18:20 2018 +0300 Plugin.{Data,Object}.preferences(): show preferences window. commit 13f5cf753fc5262e09549fd3626e76eaa19073b5 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Apr 26 16:39:05 2018 +0300 PluginData.preferences() added. commit 62bd6e311eae7059362e60646fb0e032520858c9 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Mar 29 10:51:43 2018 +0300 submodules URLs updated. commit eab83e0bd99b93e855c6ad964062bf205bf2902e Author: Kolan Sh <backbone@backbone.ws> Date: Tue Feb 13 23:26:39 2018 +0300 lib != lib64, lib != lib32 commit 66035c1fe2ee0b2e392d963d92451244f12b2749 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Dec 19 08:53:21 2017 +0300 Module cmake/backbone updated: Check BinPkgModules for empty value. commit 263efa0d35e0ba5d193b1c530f6d71adb40e165a Author: Kolan Sh <backbone@backbone.ws> Date: Sat Feb 18 18:12:05 2017 +0300 Backbone's submodules urls fixed. commit fa8fb4098a69f4b06ad22b4b61b040b75d8620d5 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:19:50 2016 +0300 Valadoc fxd. commit 4fc1ba8d29dbab1596ec744bb2e7ac151c50a9c8 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:16:30 2016 +0300 util/backbone submodule udpated: valadoc commit 46df962282804b7fd6df5e45b150a63e9f986ba9 Author: Kolan Sh <backbone@backbone.ws> Date: Wed Dec 7 18:58:41 2016 +0300 cmake/backbone submodule updated: Override NSIS.InstallOptions only if needed. commit 819855fd7f5cbe8894f58a74d46daccf4a883714 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Sep 2 18:47:29 2016 +0300 cmake/backbone submodule updated: dlls regresion fxd. commit 24f8dd82e25ee479e720f756cac8e5dd3fe6eb6f Author: Kolan Sh <backbone@backbone.ws> Date: Tue Aug 9 18:21:37 2016 +0300 cmake/backbone submodule: get_library_path(): uninitialized hCurrentModuleInstance + make it static. commit 889d605f374a8b1e7fe03ac90b910ecbc30f92fc Author: Kolan Sh <backbone@backbone.ws> Date: Tue Jun 21 16:14:07 2016 +0300 Homepage menu link added. commit 262dac3925bf03ff6051a7165e88a8728cc72559 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Nov 14 12:50:05 2015 +0300
2018-06-18 12:10:10 +03:00
namespace LAview.DataExample {
public class AppSettings : Object {
Settings settings;
2018-10-17 11:16:25 +03:00
string _greeting = "lyx";
Squashed commit of the following: commit ccf7c4f373fdcc10924ac2b6f0befa83361b2df3 Author: Kolan Sh <backbone@backbone.ws> Date: Tue May 8 19:27:07 2018 +0300 Fix GSchema with custom plugins directories. + Separate Settings.vala. commit 8928e10ee295897199fb6161d439b156b1a59822 Author: Kolan Sh <backbone@backbone.ws> Date: Mon Apr 30 17:35:45 2018 +0300 URLs, captions fixed. commit bdaa3d451aed30cc0fbfdbeeaa0364c4e2f74d1d Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 18:54:36 2018 +0300 PreferenceDialog: composed->apply. commit f684d9058679c5b58fc92c25e0e4f07fbe79e097 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 18:47:01 2018 +0300 Translations updated. commit d17fcdb0294eec5b1ec0aa9ccfaeaf3e85f69bab Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 18:38:18 2018 +0300 win32: menu url links fxd. commit 75e53c2e7574376a06689a1ac791354be0553a02 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 17:14:10 2018 +0300 GObject-Plugin: Different load methods: load_modules(), load_modules_depth2(). commit 04c512b36f82c8a0b84bfd93343269d3533f0b29 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 15:03:22 2018 +0300 Spare Plugin, Core keywords removed from identifiers. commit cc0edbab094e97648dd1425b81579b7b0e2ade43 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Apr 28 10:26:54 2018 +0300 Valadoc fixes. commit 1ace70831fd65b3f4f80fa748c5c9489b79382e6 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 17:23:30 2018 +0300 spare code removed commit ae35b77787c0441247582be5fbfb12a8bb1dfa63 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 16:48:32 2018 +0300 DataExampleDialog->DataExample.PreferencesDialog commit db1e427c98058e2222eaf5e4cff4883d4a86e18d Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 16:23:17 2018 +0300 UI file updated. commit 71e07e82e291e38940e44c2423e2877934561d17 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 15:01:54 2018 +0300 Conflicting AppDirs fxd. commit 473abfa1e322b4516b69f972e6907ec8ef91da96 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Apr 27 10:18:20 2018 +0300 Plugin.{Data,Object}.preferences(): show preferences window. commit 13f5cf753fc5262e09549fd3626e76eaa19073b5 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Apr 26 16:39:05 2018 +0300 PluginData.preferences() added. commit 62bd6e311eae7059362e60646fb0e032520858c9 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Mar 29 10:51:43 2018 +0300 submodules URLs updated. commit eab83e0bd99b93e855c6ad964062bf205bf2902e Author: Kolan Sh <backbone@backbone.ws> Date: Tue Feb 13 23:26:39 2018 +0300 lib != lib64, lib != lib32 commit 66035c1fe2ee0b2e392d963d92451244f12b2749 Author: Kolan Sh <backbone@backbone.ws> Date: Tue Dec 19 08:53:21 2017 +0300 Module cmake/backbone updated: Check BinPkgModules for empty value. commit 263efa0d35e0ba5d193b1c530f6d71adb40e165a Author: Kolan Sh <backbone@backbone.ws> Date: Sat Feb 18 18:12:05 2017 +0300 Backbone's submodules urls fixed. commit fa8fb4098a69f4b06ad22b4b61b040b75d8620d5 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:19:50 2016 +0300 Valadoc fxd. commit 4fc1ba8d29dbab1596ec744bb2e7ac151c50a9c8 Author: Kolan Sh <backbone@backbone.ws> Date: Thu Dec 8 04:16:30 2016 +0300 util/backbone submodule udpated: valadoc commit 46df962282804b7fd6df5e45b150a63e9f986ba9 Author: Kolan Sh <backbone@backbone.ws> Date: Wed Dec 7 18:58:41 2016 +0300 cmake/backbone submodule updated: Override NSIS.InstallOptions only if needed. commit 819855fd7f5cbe8894f58a74d46daccf4a883714 Author: Kolan Sh <backbone@backbone.ws> Date: Fri Sep 2 18:47:29 2016 +0300 cmake/backbone submodule updated: dlls regresion fxd. commit 24f8dd82e25ee479e720f756cac8e5dd3fe6eb6f Author: Kolan Sh <backbone@backbone.ws> Date: Tue Aug 9 18:21:37 2016 +0300 cmake/backbone submodule: get_library_path(): uninitialized hCurrentModuleInstance + make it static. commit 889d605f374a8b1e7fe03ac90b910ecbc30f92fc Author: Kolan Sh <backbone@backbone.ws> Date: Tue Jun 21 16:14:07 2016 +0300 Homepage menu link added. commit 262dac3925bf03ff6051a7165e88a8728cc72559 Author: Kolan Sh <backbone@backbone.ws> Date: Sat Nov 14 12:50:05 2015 +0300
2018-06-18 12:10:10 +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.data-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");
});
}
}
}