The branch, dharma-pre has been updated
via 83026eb1d25e0a68e0eee6392964c696e4479bd8 (commit)
from 844b74e6a060fbd0768e18371402a300bdc2219a (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=83026eb1d25e0a68e0eee6392964c696e4479bd8
commit 83026eb1d25e0a68e0eee6392964c696e4479bd8
Author: Zeljko Ametovic <[email protected]>
Date: Tue Oct 26 14:35:10 2010 +0400
[script.xbmc.subtitles] -v2.0.2
2.0.2
- fixed: os.mkdir() to os.makedirs(), it failed creating tmp folder. thx
beenje!
2.0.1
- updated xml window to have services in separate list, purely cosmetics.
backward compatible with old xml
diff --git a/script.xbmc.subtitles/addon.xml b/script.xbmc.subtitles/addon.xml
index d469b00..8ad99ba 100644
--- a/script.xbmc.subtitles/addon.xml
+++ b/script.xbmc.subtitles/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmc.subtitles"
name="XBMC Subtitles"
- version="2.0.0"
+ version="2.0.2"
provider-name="Amet">
<requires>
<import addon="xbmc.python" version="1.0"/>
diff --git a/script.xbmc.subtitles/changelog.txt
b/script.xbmc.subtitles/changelog.txt
index 6619016..04ba4ab 100644
--- a/script.xbmc.subtitles/changelog.txt
+++ b/script.xbmc.subtitles/changelog.txt
@@ -1,3 +1,9 @@
+2.0.2
+- fixed: os.mkdir() to os.makedirs(), it failed creating tmp folder. thx
beenje!
+
+2.0.1
+- updated xml window to have services in separate list, purely cosmetics.
backward compatible with old xml
+
2.0.0
- added: new service Subdivx.com, Spanish subs only. Thanks to Enric Godes.
- updated: use .getAddonInfo('path') instead of os.getcwd()
diff --git a/script.xbmc.subtitles/resources/language/English/strings.xml
b/script.xbmc.subtitles/resources/language/English/strings.xml
index 9ec48aa..bef9d44 100644
--- a/script.xbmc.subtitles/resources/language/English/strings.xml
+++ b/script.xbmc.subtitles/resources/language/English/strings.xml
@@ -78,7 +78,8 @@
<string id="756">Login failed. Please verify your settings at the addon
Configuration</string>
<string id="757">Server requires you to rewrite code from image</string>
<string id="758">Please take look at notification area</string>
- <string id="759">Enter code of image in notification area</string>
+ <string id="759">Enter code of image in notification area</string>
+ <string id="760">Available Services</string>
<!--
* Script Settings
-->
diff --git a/script.xbmc.subtitles/resources/lib/gui.py
b/script.xbmc.subtitles/resources/lib/gui.py
index 760d7d9..5c91942 100644
--- a/script.xbmc.subtitles/resources/lib/gui.py
+++ b/script.xbmc.subtitles/resources/lib/gui.py
@@ -17,6 +17,7 @@ __cwd__ = sys.modules[ "__main__" ].__cwd__
STATUS_LABEL = 100
LOADING_IMAGE = 110
SUBTITLES_LIST = 120
+SERVICES_LIST = 150
SERVICE_DIR = os.path.join(__cwd__, "resources", "lib", "services")
EXIT_SCRIPT = ( 9, 10, 247, 275, 61467, )
@@ -33,6 +34,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
temp = False
rar = False
+ self.newWindow = True
movieFullPath = urllib.unquote(xbmc.Player().getPlayingFile())
path = __settings__.getSetting( "subfolder" ) == "true" # True
for movie folder
sub_folder = xbmc.translatePath(__settings__.getSetting(
"subfolderpath" ))
@@ -139,7 +141,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
if not self.tmp_sub_dir.endswith(':') and not
os.path.exists(self.tmp_sub_dir):
- os.mkdir(self.tmp_sub_dir)
+ os.makedirs(self.tmp_sub_dir)
else:
self.rem_files(self.tmp_sub_dir)
@@ -211,6 +213,13 @@ class GUI( xbmcgui.WindowXMLDialog ):
log( __name__ ,"Subtitle Folder: [%s]" % self.sub_folder)
log( __name__ ,"Languages: [%s] [%s] [%s]" % (self.language_1,
self.language_2, self.language_3,))
log( __name__ ,"Parent Folder Search: [%s]" % self.parsearch)
+
+ try:
+ self.list_services()
+ except:
+ self.newWindow = False
+ self.list_services()
+
try:
self.Search_Subtitles()
except:
@@ -272,10 +281,16 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.getControl( STATUS_LABEL ).setLabel( msg )
else:
self.getControl( STATUS_LABEL ).setLabel( "No Subtitles Found!" )
- self.list_services()
+ if self.newWindow:
+ self.setFocusId( SERVICES_LIST )
+ self.getControl( SERVICES_LIST ).selectItem( 0 )
+ else:
+ self.list_services()
+ self.setFocusId( SUBTITLES_LIST )
+ self.getControl( SUBTITLES_LIST ).selectItem( 0 )
else:
- self.list_services()
+ if not self.newWindow: self.list_services()
subscounter = 0
for item in self.subtitles_list:
listitem = xbmcgui.ListItem( label=item["language_name"],
label2=item["filename"], iconImage=item["rating"],
thumbnailImage=item["language_flag"] )
@@ -289,9 +304,8 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.getControl( STATUS_LABEL ).setLabel( '%i %s '"' %s '"'' %
(len ( self.subtitles_list ), _( 744 ), self.file_name,) )
- self.setFocus( self.getControl( SUBTITLES_LIST ) )
- self.getControl( SUBTITLES_LIST ).selectItem( 0 )
-
+ self.setFocusId( SUBTITLES_LIST )
+ self.getControl( SUBTITLES_LIST ).selectItem( 0 )
###-------------------------- Download Subtitles -------------################
def Download_Subtitles( self, pos ):
@@ -324,7 +338,11 @@ class GUI( xbmcgui.WindowXMLDialog ):
exts = [".srt", ".sub", ".txt", ".smi", ".ssa", ".ass" ]
if len(files) < 1 :
self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
- self.list_services()
+ if self.newWindow:
+ self.setFocusId( SERVICES_LIST )
+ self.getControl( SERVICES_LIST ).selectItem( 0 )
+ else:
+ self.list_services()
else :
self.getControl( STATUS_LABEL ).setLabel( _( 652 ) )
un.extract( zip_subs, self.tmp_sub_dir )
@@ -351,13 +369,18 @@ class GUI( xbmcgui.WindowXMLDialog ):
subtitle_file, file_path =
self.create_name(zip_entry,sub_filename,subtitle_lang)
subtitle_set,file_path = self.copy_files(
subtitle_file, file_path )
- #self.rem_files((xbmc.translatePath(self.tmp_sub_dir))) # we dont want
to clean now as there might be temporary subs activated. we clean on startup
if subtitle_set :
xbmc.Player().setSubtitles(file_path)
self.exit_script()
else:
self.getControl( STATUS_LABEL ).setLabel( _( 654 ) )
- self.list_services()
+ if self.newWindow:
+ self.setFocusId( SERVICES_LIST )
+ self.getControl( SERVICES_LIST ).selectItem( 0 )
+ else:
+ self.list_services()
+ self.setFocusId( SUBTITLES_LIST )
+ self.getControl( SUBTITLES_LIST ).selectItem( 0 )
###-------------------------- Create name -------------################
@@ -397,35 +420,48 @@ class GUI( xbmcgui.WindowXMLDialog ):
def list_services( self ):
- service_list = self.service_list
- if self.shufle == 0:
- service_list.reverse()
- self.shufle = 1
- else:
- self.shufle = 0
-
- self.getControl( SUBTITLES_LIST ).reset()
- label = ""
self.list = []
-
- for serv in service_list:
- if serv != self.service:
- label2 = "[COLOR=FF%s]%s%s[/COLOR]" %(self.label_colour,_( 610
), serv,)
- listitem = xbmcgui.ListItem( label,label2 )
- self.list.append(serv)
- self.getControl( SUBTITLES_LIST ).addItem( listitem )
- if self.mansearch :
- label2 = "[COLOR=FF00FF00]%s[/COLOR]" % ( _( 612 ) )
- listitem = xbmcgui.ListItem( label,label2 )
- self.list.append("Man")
- self.getControl( SUBTITLES_LIST ).addItem( listitem )
-
- if self.parsearch :
- label2 = "[COLOR=FF00FF00]%s[/COLOR]" % ( _( 747 ) )
- listitem = xbmcgui.ListItem( label,label2 )
- self.list.append("Par")
- self.getControl( SUBTITLES_LIST ).addItem( listitem )
+ if self.newWindow:
+ for serv in self.service_list:
+ listitem = xbmcgui.ListItem( serv )
+ self.list.append(serv)
+ listitem.setProperty( "man", "false" )
+ self.getControl( SERVICES_LIST ).addItem( listitem )
+
+ if self.mansearch :
+ listitem = xbmcgui.ListItem( _( 612 ) )
+ listitem.setProperty( "man", "true" )
+ self.list.append("Man")
+ self.getControl( SERVICES_LIST ).addItem( listitem )
+
+ if self.parsearch :
+ listitem = xbmcgui.ListItem( _( 747 ) )
+ listitem.setProperty( "man", "true" )
+ self.list.append("Par")
+ self.getControl( SERVICES_LIST ).addItem( listitem )
+ else:
+ self.getControl( SUBTITLES_LIST ).reset()
+ label = ""
+
+ for serv in self.service_list:
+ if serv != self.service:
+ label2 = "[COLOR=FF%s]%s%s[/COLOR]" %(self.label_colour,_(
610 ), serv,)
+ listitem = xbmcgui.ListItem( label,label2 )
+ self.list.append(serv)
+ self.getControl( SUBTITLES_LIST ).addItem( listitem )
+
+ if self.mansearch :
+ label2 = "[COLOR=FF00FF00]%s[/COLOR]" % ( _( 612 ) )
+ listitem = xbmcgui.ListItem( label,label2 )
+ self.list.append("Man")
+ self.getControl( SUBTITLES_LIST ).addItem( listitem )
+
+ if self.parsearch :
+ label2 = "[COLOR=FF00FF00]%s[/COLOR]" % ( _( 747 ) )
+ listitem = xbmcgui.ListItem( label,label2 )
+ self.list.append("Par")
+ self.getControl( SUBTITLES_LIST ).addItem( listitem )
###-------------------------- Manual search Keyboard
-------------################
@@ -463,19 +499,35 @@ class GUI( xbmcgui.WindowXMLDialog ):
def onClick( self, controlId ):
- selection = str(self.list[self.getControl( SUBTITLES_LIST
).getSelectedPosition()])
- log( __name__ ,"In 'On click' selected : [%s]" % (selection, ) )
- if selection.isdigit():
- log( __name__ , "Selected : [%s]" % (selection, ) )
- self.Download_Subtitles( int(selection) )
+ if controlId == 120:
+ if self.newWindow:
+ self.Download_Subtitles( self.getControl( SUBTITLES_LIST
).getSelectedPosition() )
else:
- if selection == "Man":
- self.keyboard(False)
- elif selection == "Par":
- self.keyboard(True)
- else:
- self.service = selection
- self.Search_Subtitles()
+ selection = str(self.list[self.getControl( SUBTITLES_LIST
).getSelectedPosition()])
+ log( __name__ ,"In 'On click' selected : [%s]" % (selection, ) )
+ if selection.isdigit():
+ log( __name__ , "Selected : [%s]" % (selection, ) )
+ self.Download_Subtitles( int(selection) )
+ else:
+ if selection == "Man":
+ self.keyboard(False)
+ elif selection == "Par":
+ self.keyboard(True)
+ else:
+ self.service = selection
+ self.Search_Subtitles()
+
+ elif controlId == 150:
+ selection = str(self.list[self.getControl( SERVICES_LIST
).getSelectedPosition()])
+ log( __name__ ,"In 'On click' selected : [%s]" % (selection, ) )
+ self.setFocusId( 120 )
+ if selection == "Man":
+ self.keyboard(False)
+ elif selection == "Par":
+ self.keyboard(True)
+ else:
+ self.service = selection
+ self.Search_Subtitles()
###-------------------------- Remove temp files -------------################
@@ -503,6 +555,17 @@ class GUI( xbmcgui.WindowXMLDialog ):
def onFocus( self, controlId ):
self.controlId = controlId
+ if self.newWindow:
+ try:
+ if controlId == 8999:
+ self.setFocusId( 150 )
+ self.getControl( 8999 ).setVisible( False )
+ else:
+ self.getControl( 8999 ).setVisible( True )
+ except:
+ pass
+
+
###-------------------------- "Esc" , "Back" button
-------------################
diff --git
a/script.xbmc.subtitles/resources/skins/Default/720p/script-XBMC-Subtitles-main.xml
b/script.xbmc.subtitles/resources/skins/Default/720p/script-XBMC-Subtitles-main.xml
index f258c16..8166e46 100644
---
a/script.xbmc.subtitles/resources/skins/Default/720p/script-XBMC-Subtitles-main.xml
+++
b/script.xbmc.subtitles/resources/skins/Default/720p/script-XBMC-Subtitles-main.xml
@@ -14,6 +14,22 @@
<effect type="fade" start="100" end="0" time="300" />
</animation>
<controls>
+ <control type="button" id="8999">
+ <description>Fake button for mouse control</description>
+ <posx>1270</posx>
+ <posy>0</posy>
+ <width>265</width>
+ <height>720</height>
+ <label>-</label>
+ <font>-</font>
+ <texturenofocus>-</texturenofocus>
+ <texturefocus>-</texturefocus>
+ <visible>true</visible>
+ </control>
+ <control type="group" id="250">
+ <animation type="Conditional" condition="Control.HasFocus(150)"
reversible="true">
+ <effect type="slide" end="-100,0" time="200" />
+ </animation>
<control type="image">
<description>background image</description>
<posx>200</posx>
@@ -47,31 +63,31 @@
<shadowcolor>AA000000</shadowcolor>
</control>
<control type="group" id="111">
- <control type="grouplist">
- <posx>525</posx>
- <posy>16</posy>
- <width>305</width>
- <height>40</height>
- <align>right</align>
- <orientation>horizontal</orientation>
- <itemgap>5</itemgap>
- <control type="image">
- <width>40</width>
- <height>40</height>
- <texture>default_icon_info.png</texture>
- </control>
- <control type="label">
- <description>notification</description>
- <width min="10" max="260">auto</width>
- <height>40</height>
- <font>font13</font>
- <textcolor>FFFFFFFF</textcolor>
- <label>$LOCALIZE[SCRIPT655]</label>
- <aligny>center</aligny>
- <wrapmultiline>true</wrapmultiline>
- </control>
- </control>
- </control>
+ <control type="grouplist">
+ <posx>525</posx>
+ <posy>16</posy>
+ <width>305</width>
+ <height>40</height>
+ <align>right</align>
+ <orientation>horizontal</orientation>
+ <itemgap>5</itemgap>
+ <control type="image">
+ <width>40</width>
+ <height>40</height>
+
<texture>default_icon_info.png</texture>
+ </control>
+ <control type="label">
+
<description>notification</description>
+ <width min="10"
max="260">auto</width>
+ <height>40</height>
+ <font>font13</font>
+ <textcolor>FFFFFFFF</textcolor>
+
<label>$LOCALIZE[SCRIPT655]</label>
+ <aligny>center</aligny>
+
<wrapmultiline>true</wrapmultiline>
+ </control>
+ </control>
+ </control>
<control type="image">
<description>separator</description>
<posx>50</posx>
@@ -109,8 +125,8 @@
<posy>190</posy>
<width>780</width>
<height>370</height>
- <onleft>121</onleft>
- <onright>121</onright>
+ <onleft>150</onleft>
+ <onright>150</onright>
<onup>120</onup>
<ondown>120</ondown>
<viewtype label="535">list</viewtype>
@@ -235,6 +251,131 @@
<texture>info_window_icon_rating_star_$INFO[ListItem.ActualIcon].png</texture>
</control>
</focusedlayout>
+ </control>
+ </control>
+ <control type="group" id="250">
+ <animation type="Focus" reversible="false">
+ <effect type="slide" end="-300,0" time="400" />
+ </animation>
+ <control type="image">
+ <description>background image</description>
+ <posx>1300</posx>
+ <posy>130</posy>
+ <width>250</width>
+ <height>460</height>
+ <texture
border="20,20,20,20">default-panel.png</texture>
+ </control>
+ <control type="label">
+ <description>XBMC Subtitles label</description>
+ <posx>1305</posx>
+ <posy>150</posy>
+ <width>240</width>
+ <height>20</height>
+ <label>[B]$LOCALIZE[SCRIPT760][/B]</label>
+ <font>font12</font>
+ <align>center</align>
+ <textcolor>FF009CFF</textcolor>
+ <shadowcolor>AA000000</shadowcolor>
+ </control>
+ <control type="image">
+ <description>separator</description>
+ <posx>1300</posx>
+ <posy>185</posy>
+ <width>240</width>
+ <height>1</height>
+ <texture>default-separatorOSD.png</texture>
+ <colordiffuse>DDFFFFFF</colordiffuse>
+ </control>
+ <control type="list" id="150">
+ <posx>1300</posx>
+ <posy>190</posy>
+ <width>250</width>
+ <height>364</height>
+ <onleft>120</onleft>
+ <onright>120</onright>
+ <onup>150</onup>
+ <ondown>150</ondown>
+ <viewtype label="535">list</viewtype>
+ <scrolltime>200</scrolltime>
+ <itemlayout width="400" height="36">
+ <control type="image">
+ <posx>0</posx>
+ <posy>38</posy>
+ <width>230</width>
+ <height>38</height>
+
<texture>default-list-nofocus.png</texture>
+ </control>
+ <control type="label">
+ <posx>40</posx>
+ <posy>0</posy>
+ <width>230</width>
+ <height>38</height>
+ <font>font18</font>
+ <aligny>center</aligny>
+ <textcolor>white</textcolor>
+
<selectedcolor>green</selectedcolor>
+ <align>left</align>
+ <info>ListItem.Label</info>
+
<visible>!ListItem.property(man)</visible>
+ </control>
+ <control type="label">
+ <posx>40</posx>
+ <posy>0</posy>
+ <width>230</width>
+ <height>38</height>
+ <font>font10</font>
+ <aligny>center</aligny>
+ <textcolor>FF009CFF</textcolor>
+
<selectedcolor>green</selectedcolor>
+ <align>left</align>
+ <info>ListItem.Label</info>
+
<visible>ListItem.property(man)</visible>
+ </control>
+ </itemlayout>
+ <focusedlayout width="400" height="36">
+ <control type="image">
+ <posx>0</posx>
+ <posy>38</posy>
+ <width>230</width>
+ <height>38</height>
+
<texture>default-list-nofocus.png</texture>
+ </control>
+ <control type="image">
+ <posx>10</posx>
+ <posy>0</posy>
+ <width>230</width>
+ <height>38</height>
+
<texture>default-list-focus.png</texture>
+
<visible>Control.HasFocus(150)</visible>
+ </control>
+ <control type="label">
+ <posx>40</posx>
+ <posy>0</posy>
+ <width>230</width>
+ <height>38</height>
+ <font>font18</font>
+ <aligny>center</aligny>
+ <textcolor>white</textcolor>
+
<selectedcolor>green</selectedcolor>
+ <align>left</align>
+ <info>ListItem.Label</info>
+
<visible>!ListItem.property(man)</visible>
+ </control>
+ <control type="label">
+ <posx>40</posx>
+ <posy>0</posy>
+ <width>230</width>
+ <height>38</height>
+ <font>font10</font>
+ <aligny>center</aligny>
+ <textcolor>FF009CFF</textcolor>
+
<selectedcolor>green</selectedcolor>
+ <align>left</align>
+ <info>ListItem.Label</info>
+
<visible>ListItem.property(man)</visible>
+ </control>
+ </focusedlayout>
+ </control>
</control>
<control type="spincontrol" id="121">
<description>Next page button</description>
-----------------------------------------------------------------------
Summary of changes:
script.xbmc.subtitles/addon.xml | 2 +-
script.xbmc.subtitles/changelog.txt | 6 +
.../resources/language/English/strings.xml | 3 +-
script.xbmc.subtitles/resources/lib/gui.py | 159 +++++++++++-----
.../Default/720p/script-XBMC-Subtitles-main.xml | 195 +++++++++++++++++---
5 files changed, 288 insertions(+), 77 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons