The branch, eden has been updated
via 7d452b4a53e22ff4be2aa0691e8aa05ab47754c0 (commit)
from 6e53696ec6fa8dbf3a1d7c6a045814443b519ba5 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=7d452b4a53e22ff4be2aa0691e8aa05ab47754c0
commit 7d452b4a53e22ff4be2aa0691e8aa05ab47754c0
Author: ronie <[email protected]>
Date: Wed May 30 19:22:27 2012 +0200
[script.favourites] -v3.2.3
added option to change title
diff --git a/script.favourites/README.txt b/script.favourites/README.txt
index e6d7cf1..2b49bfc 100644
--- a/script.favourites/README.txt
+++ b/script.favourites/README.txt
@@ -23,4 +23,6 @@ CustomFavourite.1.Label
CustomFavourite.1.Icon
CustomFavourite.1.Path
-NOTE: playlists attribute has no effect when property is specified. The script
will ask if a playlist should play.
\ No newline at end of file
+NOTE: playlists attribute has no effect when property is specified. The script
will ask if a playlist should play.
+
+Additionally you can pass 'changetitle=true' to the script, this will allow
the user to change the name of the favourite.
diff --git a/script.favourites/addon.xml b/script.favourites/addon.xml
index 2199457..fbdce56 100644
--- a/script.favourites/addon.xml
+++ b/script.favourites/addon.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.favourites" name="Favourites script" version="3.2.2"
provider-name="CF2009, ronie, `Black">
+<addon id="script.favourites" name="Favourites script" version="3.2.3"
provider-name="CF2009, ronie, `Black">
<requires>
<import addon="xbmc.python" version="2.0"/>
</requires>
<extension point="xbmc.python.library" library="default.py"/>
<extension point="xbmc.addon.metadata">
+ <language/>
<summary>Favourites script</summary>
<description>Fetches item from your xbmc favourites to populate
Home menu/submenu with custom buttons.</description>
<disclaimer>Needs skin support for it to be used
properly</disclaimer>
diff --git a/script.favourites/changelog.txt b/script.favourites/changelog.txt
index d5cb043..631047f 100644
--- a/script.favourites/changelog.txt
+++ b/script.favourites/changelog.txt
@@ -1,3 +1,6 @@
+v3.2.3
+- added option to change favourite label
+
v3.2.2
- added icon images for reset and playlist items
diff --git a/script.favourites/default.py b/script.favourites/default.py
index e5f4424..b6d2356 100644
--- a/script.favourites/default.py
+++ b/script.favourites/default.py
@@ -13,7 +13,7 @@ sys.path.append( os.path.join( RESOURCES_PATH, "lib" ) )
def log(txt):
message = 'script.favourites: %s' % txt
xbmc.log(msg=message, level=xbmc.LOGDEBUG)
-
+
class Main:
def __init__( self ):
self.WINDOW = xbmcgui.Window( 10000 )
@@ -23,7 +23,7 @@ class Main:
self._parse_String()
self._fetch_favourites()
self.doc.unlink()
-
+
def _parse_argv( self ):
try:
params = dict( arg.split( "=" ) for arg in sys.argv[ 1 ].split(
"&" ) )
@@ -32,6 +32,7 @@ class Main:
log( "### params: %s" % params )
self.PROPERTY = params.get( "property", "" )
self.PLAY = params.get( "playlists", False )
+ self.CHANGETITLE = params.get( "changetitle", False )
def _clear_properties( self ):
for count in range( 20 ):
@@ -63,10 +64,10 @@ class Main:
count = 0
for self.doc in self.favourites:
self.fav_path = self.doc.childNodes [ 0 ].nodeValue
- # add return
- if 'RunScript' not in self.fav_path:
- self.fav_path = self.fav_path.rstrip(')')
- self.fav_path = self.fav_path + ',return)'
+ # add return
+ if 'RunScript' not in self.fav_path:
+ self.fav_path = self.fav_path.rstrip('")')
+ self.fav_path = self.fav_path + '/",return)'
if (self.PLAY):
if 'playlists/music' in self.fav_path: self.fav_path =
self.fav_path.replace( 'ActivateWindow(10502,', 'PlayMedia(' )
if 'playlists/video' in self.fav_path: self.fav_path =
self.fav_path.replace( 'ActivateWindow(10025,', 'PlayMedia(' )
@@ -78,13 +79,14 @@ class Main:
count = count+1
# Else show select dialog
else:
- MyDialog(self.favourites, self.PROPERTY)
-
+ MyDialog(self.favourites, self.PROPERTY, self.CHANGETITLE)
+
class MainGui( xbmcgui.WindowXMLDialog ):
def __init__( self, *args, **kwargs ):
xbmcgui.WindowXMLDialog.__init__( self )
self.listing = kwargs.get( "listing" )
self.property = kwargs.get( "property" )
+ self.changetitle = kwargs.get( "changetitle" )
def onInit(self):
try:
@@ -110,7 +112,7 @@ class MainGui( xbmcgui.WindowXMLDialog ):
listitem.setIconImage( favourite.attributes[ 'thumb'
].nodeValue )
listitem.setProperty( "Icon", favourite.attributes[
'thumb' ].nodeValue )
except: pass
- if 'RunScript' not in fav_path:
+ if 'RunScript' not in fav_path:
fav_path = fav_path.rstrip(')')
fav_path = fav_path + ',return)'
listitem.setProperty( "Path", fav_path )
@@ -123,11 +125,12 @@ class MainGui( xbmcgui.WindowXMLDialog ):
def onClick(self, controlID):
log( "### control: %s" % controlID )
- if controlID == 6 or controlID == 3:
+ 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"
)
+ fav_label = self.fav_list.getSelectedItem().getLabel()
if 'playlists/music' in fav_path or 'playlists/video' in
fav_path:
retBool =
xbmcgui.Dialog().yesno(xbmc.getLocalizedString(559), __language__(450))
if retBool:
@@ -135,8 +138,13 @@ class MainGui( xbmcgui.WindowXMLDialog ):
fav_path = fav_path.replace(
'ActivateWindow(10502,', 'PlayMedia(' )
else:
fav_path = fav_path.replace(
'ActivateWindow(10025,', 'PlayMedia(' )
+ if self.changetitle:
+ keyboard = xbmc.Keyboard( fav_label,
xbmc.getLocalizedString(528), False )
+ keyboard.doModal()
+ if ( keyboard.isConfirmed() ):
+ fav_label = keyboard.getText()
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(), ) )
+ xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' % (
self.property, "Label", ), fav_label, ) )
fav_icon = self.fav_list.getSelectedItem().getProperty( "Icon"
)
if fav_icon:
xbmc.executebuiltin( 'Skin.SetString(%s,%s)' % ( '%s.%s' %
( self.property, "Icon", ), fav_icon, ) )
@@ -146,14 +154,14 @@ class MainGui( xbmcgui.WindowXMLDialog ):
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)
+ 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 )
+
+def MyDialog(fav_list, property, changetitle):
+ w = MainGui( "DialogSelect.xml", __cwd__, listing=fav_list,
property=property, changetitle=changetitle )
w.doModal()
del w
-----------------------------------------------------------------------
Summary of changes:
script.favourites/README.txt | 4 +++-
script.favourites/addon.xml | 3 ++-
script.favourites/changelog.txt | 3 +++
script.favourites/default.py | 38 +++++++++++++++++++++++---------------
4 files changed, 31 insertions(+), 17 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons