Author: titmuss
Date: Tue Jan 22 13:59:46 2008
New Revision: 1573

URL: http://svn.slimdevices.com?rev=1573&root=Jive&view=rev
Log:
 [EMAIL PROTECTED] (orig r1557):  blblack | 2008-01-22 21:39:30 +0000
 Added SetupSN applet in adv prefs, with checkbox to switch to SN beta
 Rest of code updated to retreive the SN hostname to use for connections
 as well as strings displayed to the user from jnt:getSNHostname(), which
 varies based on the SN Beta pref.
 
 

Added:
    trunk/jive/src/pkg/jive/share/applets/SetupSN/
    trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNApplet.lua
    trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNMeta.lua
    trunk/jive/src/pkg/jive/share/applets/SetupSN/strings.txt
Modified:
    trunk/   (props changed)
    trunk/jive/src/pkg/jive/Makefile.am
    
trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
    trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt
    trunk/jive/src/pkg/jive/share/jive/net/NetworkThread.lua
    trunk/jive/src/pkg/jive/share/jive/slim/SlimServers.lua

Propchange: trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Tue Jan 22 13:59:46 2008
@@ -1,3 +1,3 @@
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1556
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1557
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: trunk/jive/src/pkg/jive/Makefile.am
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/Makefile.am?rev=1573&root=Jive&r1=1572&r2=1573&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/Makefile.am (original)
+++ trunk/jive/src/pkg/jive/Makefile.am Tue Jan 22 13:59:46 2008
@@ -264,6 +264,12 @@
        share/applets/InfoBrowser/InfoBrowserApplet.lua \
        share/applets/InfoBrowser/InfoBrowserMeta.lua \
        share/applets/InfoBrowser/strings.txt
+
+applets_SetupSNdir = $(datadir)/jive/applets/SetupSN
+dist_applets_SetupSN_DATA = \
+       share/applets/SetupSN/SetupSNApplet.lua \
+       share/applets/SetupSN/SetupSNMeta.lua \
+       share/applets/SetupSN/strings.txt
 
 applets_nowplayingdir = $(pkgdatadir)/applets/NowPlaying
 dist_applets_nowplaying_DATA = \

Added: trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNApplet.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNApplet.lua?rev=1573&root=Jive&view=auto
==============================================================================
--- trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNApplet.lua (added)
+++ trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNApplet.lua Tue Jan 22 
13:59:46 2008
@@ -1,0 +1,54 @@
+
+-- stuff we use
+local oo                     = require("loop.simple")
+local string                 = require("string")
+
+local Applet                 = require("jive.Applet")
+local Checkbox               = require("jive.ui.Checkbox")
+local SimpleMenu             = require("jive.ui.SimpleMenu")
+local Window                 = require("jive.ui.Window")
+
+local log                    = 
require("jive.utils.log").logger("applets.setup")
+
+module(...)
+oo.class(_M, Applet)
+
+function settingsShow(self, menuItem)
+       local window = Window("window", menuItem.text, 'settingstitle')
+       local menu = SimpleMenu("menu", {
+               {
+                       text = self:string("SN_BETA_ENABLE"),
+                       icon = Checkbox("checkbox",
+                                       function(_, isSelected)
+                                               if isSelected then
+                                                       
self:getSettings()["use_sn_beta"] = true
+                                                       self:storeSettings()
+                                               else
+                                                       
self:getSettings()["use_sn_beta"] = false
+                                                       self:storeSettings()
+                                               end
+                                       end,
+                                       self:getSettings()["use_sn_beta"]
+                               )
+               },
+       })
+
+       window:addWidget(menu)
+
+       self.window = window
+       self.menu = menu
+
+       self:tieAndShowWindow(window)
+       return window
+end
+
+--[[
+
+=head1 LICENSE
+
+Copyright 2007 Logitech. All Rights Reserved.
+
+This file is subject to the Logitech Public Source License Version 1.0. Please 
see the LICENCE file for details.
+
+=cut
+--]]

Added: trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNMeta.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNMeta.lua?rev=1573&root=Jive&view=auto
==============================================================================
--- trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNMeta.lua (added)
+++ trunk/jive/src/pkg/jive/share/applets/SetupSN/SetupSNMeta.lua Tue Jan 22 
13:59:46 2008
@@ -1,0 +1,59 @@
+
+local oo            = require("loop.simple")
+
+local AppletMeta    = require("jive.AppletMeta")
+local jul           = require("jive.utils.log")
+
+local appletManager = appletManager
+local jiveMain      = jiveMain
+
+local jnt           = jnt
+local pairs         = pairs
+
+module(...)
+oo.class(_M, AppletMeta)
+
+
+function jiveVersion(meta)
+       return 1, 1
+end
+
+function defaultSettings(meta)
+       return {
+               use_sn_beta = false,
+       }
+end
+
+function registerApplet(meta)
+
+       local settings = meta:getSettings()
+       for k,v in pairs(settings) do
+               if k == "use_sn_beta" then
+                       jnt:setSNBeta(v)
+                       if(v) then
+                               jiveMain:addItem({
+                                       id = 'snBetaIndicator',
+                                       node = 'home',
+                                       text = "* SN BETA *",
+                                       weight = 100,
+                                       titleStyle = 'settings'
+                               })
+                       end
+               end
+       end
+
+       jiveMain:addItem(meta:menuItem('appletSetupSN', 'advancedSettings', 
"ADVSET_SQUEEZENETWORK", function(applet, ...) applet:settingsShow(...) end))
+end
+
+
+--[[
+
+=head1 LICENSE
+
+Copyright 2007 Logitech. All Rights Reserved.
+
+This file is subject to the Logitech Public Source License Version 1.0. Please 
see the LICENCE file for details.
+
+=cut
+--]]
+

Added: trunk/jive/src/pkg/jive/share/applets/SetupSN/strings.txt
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/applets/SetupSN/strings.txt?rev=1573&root=Jive&view=auto
==============================================================================
--- trunk/jive/src/pkg/jive/share/applets/SetupSN/strings.txt (added)
+++ trunk/jive/src/pkg/jive/share/applets/SetupSN/strings.txt Tue Jan 22 
13:59:46 2008
@@ -1,0 +1,20 @@
+#
+# The two letter codes are defined by ISO 639-1
+# http://en.wikipedia.org/wiki/List_of_ISO_639_codes
+
+ADVSET_SQUEEZENETWORK
+       DE      SqueezeNetwork
+       EN      SqueezeNetwork
+       ES      SqueezeNetwork
+       FR      SqueezeNetwork
+       IT      SqueezeNetwork
+       NL      SqueezeNetwork
+
+SN_BETA_ENABLE
+       DE      SN Beta aktivieren
+       EN      Enable SN Beta
+       ES      Activar SN Beta
+       FR      Activer SN Beta
+       IT      Attiva SN Beta
+       NL      SN Beta inschakelen
+

Modified: 
trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua?rev=1573&root=Jive&r1=1572&r2=1573&view=diff
==============================================================================
--- 
trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
 (original)
+++ 
trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/SqueezeNetworkPINApplet.lua
 Tue Jan 22 13:59:46 2008
@@ -73,7 +73,7 @@
                end
        } )
 
-       local help = Textarea("help", self:string("SQUEEZENETWORK_PIN_HELP"))
+       local help = Textarea("help", self:string("SQUEEZENETWORK_PIN_HELP", 
jnt:getSNHostname()))
        window:addWidget(help)
        window:addWidget(menu)
 

Modified: trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt?rev=1573&root=Jive&r1=1572&r2=1573&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt 
(original)
+++ trunk/jive/src/pkg/jive/share/applets/SqueezeNetworkPIN/strings.txt Tue Jan 
22 13:59:46 2008
@@ -15,12 +15,12 @@
        NL      Speler-PIN: %s
 
 SQUEEZENETWORK_PIN_HELP
-       DE      Gehen Sie zu\nwww.squeezenetwork.com\nund geben Sie Ihre PIN 
ein, um eine Verbindung zum Konto herzustellen. Drücken Sie anschließend die 
mittlere Taste.
-       EN      Visit\nwww.squeezenetwork.com\nand enter your PIN to connect to 
your account.  Press the center button after you have entered your PIN.
-       ES      Visite\nwww.squeezenetwork.com\ne introduzca el PIN para 
conectarse a si cuenta. Cuando haya introducido el PIN, pulse el botón central.
-       FR      Rendez-vous sur\nwww.squeezenetwork.com\net spécifiez votre 
code PIN pour accéder à votre compte. Appuyez sur le bouton central une fois 
que vous avez spécifié le code PIN.
-       IT      Visitare il sito Web\nwww.squeezenetwork.com\ne immettere il 
PIN per accedere all'account. Premere il pulsante centrale dopo avere immesso 
il PIN.
-       NL      Ga naar\nwww.squeezenetwork.com\nen voer je pincode in om naar 
je account te gaan. Druk op de middelste knop nadat je je pincode hebt 
ingevoerd.
+       DE      Gehen Sie zu\n%s\nund geben Sie Ihre PIN ein, um eine 
Verbindung zum Konto herzustellen. Drücken Sie anschließend die mittlere 
Taste.
+       EN      Visit\n%s\nand enter your PIN to connect to your account.  
Press the center button after you have entered your PIN.
+       ES      Visite\n%s\ne introduzca el PIN para conectarse a si cuenta. 
Cuando haya introducido el PIN, pulse el botón central.
+       FR      Rendez-vous sur\n%s\net spécifiez votre code PIN pour accéder 
à votre compte. Appuyez sur le bouton central une fois que vous avez 
spécifié le code PIN.
+       IT      Visitare il sito Web\n%s\ne immettere il PIN per accedere 
all'account. Premere il pulsante centrale dopo avere immesso il PIN.
+       NL      Ga naar\n%s\nen voer je pincode in om naar je account te gaan. 
Druk op de middelste knop nadat je je pincode hebt ingevoerd.
 
 SQUEEZENETWORK_NOT_LINKED
        DE      Ihre PIN konnte nicht bestätigt werden. Haben Sie sie auf der 
Website eingegeben?

Modified: trunk/jive/src/pkg/jive/share/jive/net/NetworkThread.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/jive/net/NetworkThread.lua?rev=1573&root=Jive&r1=1572&r2=1573&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/jive/net/NetworkThread.lua (original)
+++ trunk/jive/src/pkg/jive/share/jive/net/NetworkThread.lua Tue Jan 22 
13:59:46 2008
@@ -278,6 +278,51 @@
 
 --[[
 
+=head2 getSNBeta()
+
+Boolean, indicates whether we're using the SqueezeNetwork
+Beta server (as opposed to production)
+
+=cut
+--]]
+function getSNBeta(self)
+       return self.use_sn_beta
+end
+
+--[[
+
+=head2 setSNBeta(use_sn_beta)
+
+Set the use_sn_beta flag in jnt.  This is only to be
+called once by the SetupSN applet's Meta, and affects
+the output of getSNBeta() and getSNHostname()
+
+--]]
+function setSNBeta(self, use_sn_beta)
+       if use_sn_beta then
+               self.use_sn_beta = true
+               self.sn_hostname = "www.beta.squeezenetwork.com"
+       else
+               self.use_sn_beta = false
+               self.sn_hostname = "www.squeezenetwork.com"
+       end
+end
+
+--[[
+
+=head2 getSNHostname()
+
+Retreive the hostname to be used to connect to SqueezeNetwork,
+which is affected by the use_sn_beta (getSNBeta()) flag.
+
+=cut
+--]]
+function getSNHostname(self)
+       return self.sn_hostname
+end
+
+--[[
+
 =head2 __init()
 
 Creates a new NetworkThread. The thread starts immediately.

Modified: trunk/jive/src/pkg/jive/share/jive/slim/SlimServers.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/jive/slim/SlimServers.lua?rev=1573&root=Jive&r1=1572&r2=1573&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/jive/slim/SlimServers.lua (original)
+++ trunk/jive/src/pkg/jive/share/jive/slim/SlimServers.lua Tue Jan 22 13:59:46 
2008
@@ -248,7 +248,7 @@
        end
 
        -- Special case Squeezenetwork
-       _cacheServer(self, "www.squeezenetwork.com", 9000, "SqueezeNetwork")
+       _cacheServer(self, self.jnt:getSNHostname(), 9000, "SqueezeNetwork")
 
        -- Remove SqueezeCenters that have not been seen for a while
        _cacheCleanup(self)

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to