The branch, eden-pre has been updated
via cd71935181a953a2383624358c7fb9866cea12dd (commit)
from b097396511eb587bf9144fc4516a1bf65db8e98c (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=cd71935181a953a2383624358c7fb9866cea12dd
commit cd71935181a953a2383624358c7fb9866cea12dd
Author: ronie <[email protected]>
Date: Sun Dec 4 01:26:10 2011 +0100
[script.favourites] -v3.2.1
use select dialog with id 6
diff --git a/script.favourites/addon.xml b/script.favourites/addon.xml
index 52937d6..37324a6 100644
--- a/script.favourites/addon.xml
+++ b/script.favourites/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.favourites" name="Favourites script" version="3.1.0"
provider-name="CF2009, ronie, `Black">
+<addon id="script.favourites" name="Favourites script" version="3.2.1"
provider-name="CF2009, ronie, `Black">
<requires>
<import addon="xbmc.python" version="2.0"/>
</requires>
diff --git a/script.favourites/changelog.txt b/script.favourites/changelog.txt
index 419bd01..e5b4630 100644
--- a/script.favourites/changelog.txt
+++ b/script.favourites/changelog.txt
@@ -1,3 +1,15 @@
+v3.2.1
+- use select dialog with id 6
+- added french translation
+- bugfixes
+
+
+v3.2.0
+- added readme
+- added french localization (thanks to Rififi77)
+- select dialog now uses id 6
+- fixed escape problems with paths on Windows
+
v3.1.0
- added clear setting
diff --git a/script.favourites/default.py b/script.favourites/default.py
index 682f4e8..e7aecc8 100644
--- a/script.favourites/default.py
+++ b/script.favourites/default.py
@@ -78,51 +78,82 @@ class Main:
count = count+1
# Else show select dialog
else:
- self.favList = [__language__(451)]
- self.favProperties = []
- for favourite in self.favourites:
- fav_path = favourite.childNodes [ 0 ].nodeValue
- fav_play = False
- # add return
- if 'RunScript' not in fav_path:
- fav_path = fav_path.rstrip(')')
- fav_path = fav_path + ',return)'
+ MyDialog(self.favourites, self.PROPERTY)
+
+class MainGui( xbmcgui.WindowXMLDialog ):
+ def __init__( self, *args, **kwargs ):
+ xbmcgui.WindowXMLDialog.__init__( self )
+ self.listing = kwargs.get( "listing" )
+ self.property = kwargs.get( "property" )
+
+ def onInit(self):
+ try:
+ self.fav_list = self.getControl(6)
+ self.getControl(3).setVisible(False)
+ except:
+ print_exc()
+ self.fav_list = self.getControl(3)
+
+ self.getControl(5).setVisible(False)
+ self.getControl(1).setLabel(xbmc.getLocalizedString(1036))
+
+ self.fav_list.addItem( xbmcgui.ListItem( __language__(451) ) )
+
+ for favourite in self.listing :
+ listitem = xbmcgui.ListItem( favourite.attributes[ 'name'
].nodeValue )
+ try:
+ listitem.setIconImage( favourite.attributes[ 'thumb'
].nodeValue )
+ listitem.setProperty( "Icon", favourite.attributes[ 'thumb'
].nodeValue )
+ except: pass
+ fav_path = favourite.childNodes [ 0 ].nodeValue
+ if 'RunScript' not in fav_path:
+ fav_path = fav_path.rstrip(')')
+ fav_path = fav_path + ',return)'
+ listitem.setProperty( "Path", fav_path )
+ self.fav_list.addItem( listitem )
+ self.setFocus(self.fav_list)
+
+ def onAction(self, action):
+ if action in ( 9, 10, 92, 216, 247, 257, 275, 61467, 61448, ):
+ self.close()
+
+ def onClick(self, controlID):
+ log( "### control: %s" % controlID )
+ if controlID == 6 or controlID == 3:
+ num = self.fav_list.getSelectedPosition()
+ log( "### position: %s" % num )
+ if num > 0:
+ fav_path = self.fav_list.getSelectedItem().getProperty( "Path"
)
if 'playlists/music' in fav_path or 'playlists/video' in
fav_path:
- fav_play = True
- self.favList.append(favourite.attributes[ 'name' ].nodeValue)
- try: fav_thumb = favourite.attributes[ 'thumb' ].nodeValue
- except: fav_thumb = ""
- self.favProperties.append([fav_path, fav_thumb, fav_play])
- self._show_dialog()
-
- def _show_dialog(self):
- if len(self.favList) > 0:
- dialog = xbmcgui.Dialog()
- try: retIndex = dialog.select(xbmc.getLocalizedString(1036),
self.favList)
- except: retIndex = -1
- if retIndex > 0:
- fav_path = self.favProperties[retIndex-1][0]
- if (self.favProperties[retIndex-1][2]):
- retBool = dialog.yesno(xbmc.getLocalizedString(559),
__language__(450))
+ retBool =
xbmcgui.Dialog().yesno(xbmc.getLocalizedString(559), __language__(450))
if retBool:
if 'playlists/music' in fav_path:
fav_path = fav_path.replace(
'ActivateWindow(10502,', 'PlayMedia(' )
else:
- fav_path = fav_path.replace(
'ActivateWindow(10025,', 'PlayMedia(' )
- # sleep to ensure smooth open/close animations
- xbmc.sleep(300)
- xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' % (
self.PROPERTY, "Path", ), fav_path.encode('utf-8'), ) )
- xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' % (
self.PROPERTY, "Label", ), self.favList[retIndex].encode('utf-8'), ) )
- xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' % (
self.PROPERTY, "Icon", ), self.favProperties[retIndex-1][1].encode('utf-8'), ) )
- elif retIndex == 0:
- # sleep to ensure smooth open/close animations
+ fav_path = fav_path.replace(
'ActivateWindow(10025,', 'PlayMedia(' )
+ xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' % (
self.property, "Path", ), fav_path.encode('string-escape'), ) )
+ xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' % (
self.property, "Label", ), self.fav_list.getSelectedItem().getLabel(), ) )
+ fav_icon = self.fav_list.getSelectedItem().getProperty( "Icon"
)
+ if fav_icon:
+ xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' %
( self.property, "Icon", ), fav_icon, ) )
xbmc.sleep(300)
- xbmc.executebuiltin( 'Skin.Reset(%s)' % '%s.%s' % (
self.PROPERTY, "Path", ) )
- xbmc.executebuiltin( 'Skin.Reset(%s)' % '%s.%s' % (
self.PROPERTY, "Label", ) )
- xbmc.executebuiltin( 'Skin.Reset(%s)' % '%s.%s' % (
self.PROPERTY, "Icon", ) )
+ self.close()
+ else:
+ xbmc.executebuiltin( 'Skin.Reset(%s)' % '%s.%s' % (
self.property, "Path", ) )
+ xbmc.executebuiltin( 'Skin.Reset(%s)' % '%s.%s' % (
self.property, "Label", ) )
+ xbmc.executebuiltin( 'Skin.Reset(%s)' % '%s.%s' % (
self.property, "Icon", ) )
+ xbmc.sleep(300)
+ self.close()
+ def onFocus(self, controlID):
+ pass
+
+def MyDialog(fav_list, property):
+ w = MainGui( "DialogSelect.xml", __cwd__, listing=fav_list,
property=property )
+ w.doModal()
+ del w
if ( __name__ == "__main__" ):
- log('script version %s started' % __addonversion__)
- Main()
+ log('script version %s started' % __addonversion__)
+ Main()
log('script stopped')
-----------------------------------------------------------------------
Summary of changes:
script.favourites/README.txt | 26 +++++
script.favourites/addon.xml | 2 +-
script.favourites/changelog.txt | 12 ++
script.favourites/default.py | 107 +++++++++++++-------
.../resources/language/French/strings.xml | 5 +
5 files changed, 113 insertions(+), 39 deletions(-)
create mode 100644 script.favourites/README.txt
create mode 100644 script.favourites/resources/language/French/strings.xml
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons