Add refresh interval as option in settings

This commit is contained in:
Raymundo Cassani 2020-05-26 12:31:08 -04:00
parent bca382d100
commit e94f511892
2 changed files with 15 additions and 0 deletions

View File

@ -26,6 +26,8 @@ MyDesklet.prototype = {
// initialize settings // initialize settings
this.settings = new Settings.DeskletSettings(this, this.metadata["uuid"], desklet_id); this.settings = new Settings.DeskletSettings(this, this.metadata["uuid"], desklet_id);
this.settings.bindProperty(Settings.BindingDirection.IN, "type", "type", this.on_setting_changed); this.settings.bindProperty(Settings.BindingDirection.IN, "type", "type", this.on_setting_changed);
this.settings.bindProperty(Settings.BindingDirection.IN, "refresh-interval", "refresh_interval", this.on_setting_changed);
// initialize desklet GUI // initialize desklet GUI
this.setupUI(); this.setupUI();

View File

@ -27,5 +27,18 @@
"type": "colorchooser", "type": "colorchooser",
"default": "rgba(50,168,82,1.0)", "default": "rgba(50,168,82,1.0)",
"description": "Line color" "description": "Line color"
},
"refresh-interval": {
"type": "spinbutton",
"default": 2,
"step": 1,
"min": 1,
"max": 30,
"units": "seconds",
"description": "Refresh interval",
"tooltip": "Increase or decrease refresh interval in seconds."
} }
} }