From 9872e9a1a3ad00c7d2ed26d56199fcc63e94cca8 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Tue, 1 Apr 2014 00:36:02 +0200 Subject: [PATCH] Update WebUI to enable/disable Growl notifications --- data/interfaces/default/config.html | 37 +++++++++++++++++++++++++++++ headphones/webserve.py | 10 +++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 486f79f7..0d06f0da 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -528,6 +528,23 @@
+
+

Growl

+
+ +
+
+
+ +
+
+ +
+
+ +
+
+

Prowl

@@ -1177,6 +1194,26 @@ } }); + if ($("#growl").is(":checked")) + { + $("#growloptions").show(); + } + else + { + $("#growloptions").hide(); + } + + $("#growl").click(function(){ + if ($("#growl").is(":checked")) + { + $("#growloptions").slideDown(); + } + else + { + $("#growloptions").slideUp(); + } + }); + if ($("#prowl").is(":checked")) { $("#prowloptions").show(); diff --git a/headphones/webserve.py b/headphones/webserve.py index ca8ad578..e35cc097 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -931,6 +931,10 @@ class WebInterface(object): "encoderquality": headphones.ENCODERQUALITY, "encoderlossless": checked(headphones.ENCODERLOSSLESS), "delete_lossless_files": checked(headphones.DELETE_LOSSLESS_FILES), + "growl_enabled": checked(headphones.GROWL_ENABLED), + "growl_onsnatch": checked(headphones.GROWL_ONSNATCH), + "growl_host": headphones.GROWL_HOST, + "growl_password": headphones.GROWL_PASSWORD, "prowl_enabled": checked(headphones.PROWL_ENABLED), "prowl_onsnatch": checked(headphones.PROWL_ONSNATCH), "prowl_keys": headphones.PROWL_KEYS, @@ -1010,7 +1014,7 @@ class WebInterface(object): destination_dir=None, lossless_destination_dir=None, folder_format=None, file_format=None, file_underscores=0, include_extras=0, single=0, ep=0, compilation=0, soundtrack=0, live=0, remix=0, spokenword=0, audiobook=0, autowant_upcoming=False, autowant_all=False, keep_torrent_files=False, interface=None, log_dir=None, cache_dir=None, music_encoder=0, encoder=None, xldprofile=None, bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0, - delete_lossless_files=0, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None, + delete_lossless_files=0, growl_enabled=0, growl_onsnatch=0, growl_host=None, growl_password=None, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None, xbmc_update=0, xbmc_notify=0, nma_enabled=False, nma_apikey=None, nma_priority=0, nma_onsnatch=0, pushalot_enabled=False, pushalot_apikey=None, pushalot_onsnatch=0, synoindex_enabled=False, pushover_enabled=0, pushover_onsnatch=0, pushover_keys=None, pushover_priority=0, pushbullet_enabled=0, pushbullet_onsnatch=0, pushbullet_apikey=None, pushbullet_deviceid=None, twitter_enabled=0, twitter_onsnatch=0, mirror=None, customhost=None, customport=None, customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, preferred_bitrate_allow_lossless=0, cache_sizemb=None, @@ -1124,6 +1128,10 @@ class WebInterface(object): headphones.ENCODERQUALITY = int(encoderquality) headphones.ENCODERLOSSLESS = int(encoderlossless) headphones.DELETE_LOSSLESS_FILES = int(delete_lossless_files) + headphones.GROWL_ENABLED = growl_enabled + headphones.GROWL_ONSNATCH = growl_onsnatch + headphones.GROWL_HOST = growl_host + headphones.GROWL_PASSWORD = growl_password headphones.PROWL_ENABLED = prowl_enabled headphones.PROWL_ONSNATCH = prowl_onsnatch headphones.PROWL_KEYS = prowl_keys