Author: titmuss
Date: Mon Aug 18 03:59:50 2008
New Revision: 2865
URL: http://svn.slimdevices.com?rev=2865&root=Jive&view=rev
Log:
[EMAIL PROTECTED] (orig r2864): titmuss | 2008-08-18 11:58:43 +0100
Bug: N/A
Description:
Missing select skin applet.
Added:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinApplet.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
Modified:
7.4/trunk/ (props changed)
Propchange: 7.4/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Mon Aug 18 03:59:50 2008
@@ -2,7 +2,7 @@
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/branches/discovery-refactor:2596
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2847
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2855
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:2860
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:2864
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378
Added:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinApplet.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinApplet.lua?rev=2865&root=Jive&view=auto
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinApplet.lua
(added)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinApplet.lua
Mon Aug 18 03:59:50 2008
@@ -1,0 +1,95 @@
+
+--[[
+=head1 NAME
+
+applets.SelectSkin.SelectSkinApplet - An applet to select different
SqueezePlay skins
+
+=head1 DESCRIPTION
+
+This applet allows the SqueezePlay skin to be selected.
+
+=head1 FUNCTIONS
+
+Applet related methods are described in L<jive.Applet>.
+SelectSkinApplet overrides the following methods:
+
+=cut
+--]]
+
+
+-- stuff we use
+local pairs = pairs
+
+local table = require("table")
+
+local oo = require("loop.simple")
+local logging = require("logging")
+
+local Applet = require("jive.Applet")
+local RadioButton = require("jive.ui.RadioButton")
+local RadioGroup = require("jive.ui.RadioGroup")
+local SimpleMenu = require("jive.ui.SimpleMenu")
+local Window = require("jive.ui.Window")
+local Framework = require("jive.ui.Framework")
+local jul = require("jive.utils.log")
+
+local JiveMain = jiveMain
+local log = jul.logger("applets.browser")
+
+
+module(..., Framework.constants)
+oo.class(_M, Applet)
+
+
+function selectSkin(self, menuItem)
+ local window = Window("window", menuItem.text, 'settingstitle')
+ local menu = SimpleMenu("menu")
+ menu:setComparator(menu.itemComparatorAlpha)
+
+ local group = RadioGroup()
+
+ -- add skins
+ local selectedSkin = JiveMain:getSelectedSkin()
+ for appletName, name in JiveMain:skinIterator() do
+ menu:addItem({
+ text = name,
+ icon = RadioButton(
+ "radio",
+ group,
+ function()
+ JiveMain:setSelectedSkin(appletName)
+
+ self:getSettings().skin = appletName
+ self.changed = true
+ end,
+ appletName == selectedSkin
+ )
+ })
+ end
+
+ window:addWidget(menu)
+
+ window:addListener(EVENT_WINDOW_POP,
+ function()
+ if self.changed then
+ self:storeSettings()
+ end
+ end
+ )
+
+ 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:
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
URL:
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua?rev=2865&root=Jive&view=auto
==============================================================================
---
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
(added)
+++
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
Mon Aug 18 03:59:50 2008
@@ -1,0 +1,75 @@
+
+--[[
+=head1 NAME
+
+applets.SelectSkin.SelectSkinMeta - Select SqueezePlay skin
+
+=head1 DESCRIPTION
+
+See L<applets.SelectSkin.SelectSkinApplet>.
+
+=head1 FUNCTIONS
+
+See L<jive.AppletMeta> for a description of standard applet meta functions.
+
+=cut
+--]]
+
+
+local oo = require("loop.simple")
+
+local AppletMeta = require("jive.AppletMeta")
+
+local log = require("jive.utils.log").logger("applets.browser")
+
+local appletManager = appletManager
+local jiveMain = jiveMain
+
+
+module(...)
+oo.class(_M, AppletMeta)
+
+
+function jiveVersion(meta)
+ return 1, 1
+end
+
+
+function defaultSettings(meta)
+ return {
+ skin = "DefaultSkin",
+ }
+end
+
+
+function registerApplet(meta)
+ jiveMain:addItem(meta:menuItem('appletSelectSkin', 'settings',
'SELECT_SKIN', function(applet, ...) applet:selectSkin(...) end))
+end
+
+
+function configureApplet(meta)
+ local skin = meta:getSettings().skin
+ jiveMain:setSelectedSkin(skin)
+
+ local skins = 0
+ for s in jiveMain:skinIterator() do
+ skins = skins + 1
+ end
+
+ if skins <= 1 then
+ jiveMain:removeItemById('appletSelectSkin')
+ 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
+--]]
+
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins