forked from p-e-w/plotinus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes p-e-w#4
- Loading branch information
Showing
5 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist> | ||
<schema id="com.worldwidemann.plotinus"> | ||
|
||
<key name="enabled" type="b"> | ||
<default>true</default> | ||
</key> | ||
|
||
<key name="hotkeys" type="as"> | ||
<default><![CDATA[ ["<Primary><Shift>P"] ]]></default> | ||
</key> | ||
|
||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Plotinus - A searchable command palette in every modern GTK+ application | ||
* | ||
* Copyright (c) 2016-2017 Philipp Emanuel Weidmann <[email protected]> | ||
* | ||
* Nemo vir est qui mundum non reddat meliorem. | ||
* | ||
* Released under the terms of the GNU General Public License, version 3 | ||
* (https://gnu.org/licenses/gpl.html) | ||
*/ | ||
|
||
class Plotinus.InstanceSettings : Object { | ||
|
||
private Settings base_settings; | ||
private Settings instance_settings; | ||
|
||
public InstanceSettings(string schema_id, string base_name, string instance_name) { | ||
var schema_path = "/" + schema_id.replace(".", "/") + "/"; | ||
|
||
base_settings = new Settings.with_path(schema_id, schema_path + base_name + "/"); | ||
instance_settings = new Settings.with_path(schema_id, schema_path + instance_name + "/"); | ||
} | ||
|
||
// Returns the value from instance_settings if it has been set there | ||
// and falls back to base_settings otherwise | ||
public Variant get_value(string key) { | ||
if (instance_settings.get_user_value(key) != null) { | ||
return instance_settings.get_value(key); | ||
} else { | ||
return base_settings.get_value(key); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters