diff --git a/cinnamon-dynamic-wallpaper@TobiZog/extension.js b/cinnamon-dynamic-wallpaper@TobiZog/extension.js index 1183b28..443c0bd 100644 --- a/cinnamon-dynamic-wallpaper@TobiZog/extension.js +++ b/cinnamon-dynamic-wallpaper@TobiZog/extension.js @@ -16,6 +16,8 @@ const APPNAME = "Cinnamon Dynamic Wallpaper" const MessageTray = imports.ui.messageTray; const St = imports.gi.St; const Main = imports.ui.main; +const Util = imports.misc.util; +const Settings = imports.ui.settings; /********** Global Variables **********/ @@ -38,7 +40,7 @@ CinnamonDynamicWallpaperExtension.prototype = { * @param {string} uuid Universally Unique Identifier */ _init: function(uuid) { - // todo + this.settings = new Settings.AppletSettings(this, uuid); // Display the welcome notification on activation this.showNotification( @@ -85,6 +87,24 @@ CinnamonDynamicWallpaperExtension.prototype = { // Display it source.notify(notification); }, + + + /** + * Callback for settings-schema + * Opens the external heic-importer window + */ + configCustomImageSet: function() { + // todo + }, + + + /** + * Callback for settings-schema + * Opens the browser and navigate to the URL of the respository + */ + openRepoWebsite: function() { + Util.spawnCommandLine("xdg-open https://github.com/TobiZog/cinnamon-dynamic-wallpaper"); + } } diff --git a/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json b/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json new file mode 100644 index 0000000..7e40fa9 --- /dev/null +++ b/cinnamon-dynamic-wallpaper@TobiZog/settings-schema.json @@ -0,0 +1,123 @@ +{ + "layout": { + "type": "layout", + "pages": [ + "pg_config", + "pg_about" + ], + "pg_config": { + "type": "page", + "title": "Configuration", + "sections": [ + "sec_image_set", + "sec_location" + ] + }, + "pg_about": { + "type": "page", + "title": "About", + "sections": [ + "sec_project", + "sec_github" + ] + }, + "sec_image_set": { + "type": "section", + "title": "Image set", + "keys": [ + "sw_template_enabled", + "rg_choose_template", + "btn_config_custom_image_set" + ] + }, + "sec_location": { + "type": "section", + "title": "Location estimation", + "keys": [ + "sw_auto_location", + "sc_location_refresh_time", + "etr_latitude", + "etr_longitude" + ] + }, + "sec_project": { + "type": "section", + "title": "About the project", + "keys": [ + "lb_about", + "lb_author" + ] + }, + "sec_github": { + "type": "section", + "title": "Source Code on GitHub", + "keys": [ + "lb_repository", + "btn_open_repository" + ] + } + }, + "sw_template_enabled": { + "type": "switch", + "default": true, + "description": "Use a included image set" + }, + "rg_choose_template": { + "type": "radiogroup", + "default": "", + "description": "Choose a set of images", + "options": { + "": "" + }, + "dependency": "sw_template_enabled" + }, + "btn_config_custom_image_set": { + "type": "button", + "description": "Create your own image set from images", + "callback": "configCustomImageSet", + "dependency": "!sw_template_enabled" + }, + "sw_auto_location": { + "type": "switch", + "default": true, + "description": "Estimate coordinates via network" + }, + "sc_location_refresh_time": { + "type": "scale", + "default": 15, + "min": 5, + "max": 60, + "step": 5, + "description": "Interval time to refresh the location via network (min)", + "dependency": "sw_auto_location" + }, + "etr_latitude": { + "type": "entry", + "default": "", + "description": "Latitude", + "dependency": "!sw_auto_location" + }, + "etr_longitude": { + "type": "entry", + "default": "", + "description": "Longitude", + "dependency": "!sw_auto_location" + }, + "lb_about": { + "type": "label", + "description": "Based on a location, this extension calculates the periods of a day and switch the background image of your Cinnamon desktop. The extension offers the choice between a set of predownloaded wallpapers or to select a custom set of images." + }, + "lb_author": { + "type": "label", + "description": "Developed by TobiZog" + }, + "lb_repository": { + "type": "label", + "description": "This project is Open Source. You can visit the whole source code of this extension on GitHub" + }, + "btn_open_repository": { + "type": "button", + "description": "Open the Repository", + "callback": "openRepoWebsite" + } +} \ No newline at end of file