From 84c7130cc9f262f453bfb0a75d0d45a44dbf9e9d Mon Sep 17 00:00:00 2001
From: xnappo <cnappi@gmail.com>
Date: Sat, 16 May 2015 15:12:50 -0500
Subject: [PATCH] Option to suppress server connection notification

It make an error noise that I have grown to despise.
---
 resources/language/English/strings.xml | 2 ++
 resources/settings.xml                 | 2 ++
 service.py                             | 4 +++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml
index 347fb2c4..023b37d4 100644
--- a/resources/language/English/strings.xml
+++ b/resources/language/English/strings.xml
@@ -248,6 +248,7 @@
     <string id="30246">Enable Netflix style next up notification</string>
     <string id="30247">  - The number of seconds before the end to show the notification</string>
     <string id="30248">Show Emby Info dialog on play/select action</string>
+    <string id="30249">Suppress server connection message at boot</string>
     
     
 	<!-- Default views -->
@@ -265,5 +266,6 @@
     <string id="30311">Music Tracks</string>
     <string id="30312">Channels</string>  
 
+    
 
 </strings>
diff --git a/resources/settings.xml b/resources/settings.xml
index dadbd91f..80be2556 100644
--- a/resources/settings.xml
+++ b/resources/settings.xml
@@ -39,6 +39,8 @@
 	</category>
 	<category label="30022">
 		<setting id="logLevel" type="enum" label="30004" values="None|Info|Debug" default="0" />
+        <setting id="supressConnectMsg" type="bool" label="30249" default="false" visible="true" enable="true" />        
 		<setting label="30239" type="action" action="RunPlugin(plugin://plugin.video.emby?mode=reset)" />
+
 	</category>
 </settings>
diff --git a/service.py b/service.py
index 93ef1d8f..0657d3c4 100644
--- a/service.py
+++ b/service.py
@@ -195,7 +195,9 @@ class Service():
                                 break
                         self.server_online = True
                         self.logMsg("Server is online and ready.", 1)
-                        xbmcgui.Dialog().notification("Connection successful", "%s Server is online." % self.addonName, time=2000)
+                        addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
+                        if addonSettings.getSetting("supressConnectMsg")=="false":
+                            xbmcgui.Dialog().notification("Connection successful", "%s Server is online." % self.addonName, time=2000)
                         WINDOW.setProperty("Server_online", "true")
                         
                         # Server is online, proceed.