Merge branch 'xbmc-svn'
Conflicts: default.py
19
LICENSE.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2010 Correl J. Roush
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
11
README.md
|
@ -14,8 +14,13 @@ Currently, Transmission-XBMC supports viewing, adding, removing, starting and st
|
|||
Installation
|
||||
------------
|
||||
|
||||
This script is intended for XBMC version 9.11. For more recent builds, check out the `xbmc-svn` branch.
|
||||
This script is intended for svn builds of XBMC. For the stable 9.11 release, check out the `master` branch.
|
||||
|
||||
To install, place the Transmission-XBMC folder in your XBMC scripts directory (usually `${HOME}/.xbmc/scripts`)
|
||||
To install, place the Transmission-XBMC folder in your XBMC plugins directory (usually `${HOME}/.xbmc/plugins`)
|
||||
|
||||
If your transmission daemon is running on a machine other than localhost, using a port other than 9091, or requires authentication, you will have to change the script settings before running it.
|
||||
If your transmission daemon is running on a machine other than localhost, using a port other than 9091, or requires authentication, you will have to change the plugin settings before running it.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Transmission-XBMC is licensed under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.html).
|
||||
|
|
16
addon.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="script.transmission"
|
||||
name="Transmission"
|
||||
version="0.5.1"
|
||||
provider-name="Correl Roush">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="1.0"/>
|
||||
</requires>
|
||||
<extension point="xbmc.python.script"
|
||||
library="default.py" />
|
||||
<extension point="xbmc.addon.metadata">
|
||||
<summary lang="en">A client for the popular Transmission BitTorrent application</summary>
|
||||
<description>Currently, Transmission-XBMC supports viewing, adding, removing, starting and stopping torrents. More advanced features may be added in future releases.</description>
|
||||
<platform>all</platform>
|
||||
</extension>
|
||||
</addon>
|
5
changelog.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
Version 0.5.1
|
||||
* Cleaned up for inclusion in the XBMC addon repository
|
||||
* Added Korean language support (submitted by kmp93 on the XBMC forum)
|
||||
Version 0.5.0
|
||||
* Initial release
|
13
default.py
|
@ -1,27 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2010 Correl J. Roush
|
||||
|
||||
import os
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
|
||||
import xbmcaddon
|
||||
__scriptname__ = "Transmission-XBMC"
|
||||
__author__ = "Correl Roush <correl@gmail.com>"
|
||||
__url__ = "http://github.com/correl/Transmission-XBMC"
|
||||
__svn_url__ = ""
|
||||
__credits__ = ""
|
||||
__version__ = "0.5.0"
|
||||
__XBMC_Revision__ = "22240"
|
||||
__version__ = "0.5.1"
|
||||
__XBMC_Revision__ = "30377"
|
||||
|
||||
BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( os.getcwd(), 'resources', 'lib' ) )
|
||||
sys.path.append (BASE_RESOURCE_PATH)
|
||||
|
||||
__language__ = xbmc.Language(os.getcwd()).getLocalizedString
|
||||
__settings__ = xbmcaddon.Addon(id='script.transmission')
|
||||
|
||||
__language__ = __settings__.getLocalizedString
|
||||
|
||||
KEY_BUTTON_BACK = 275
|
||||
KEY_KEYBOARD_ESC = 61467
|
||||
|
||||
if __name__ == '__main__':
|
||||
from gui import TransmissionGUI
|
||||
w = TransmissionGUI("script-Transmission-main.xml",os.getcwd() ,"default")
|
||||
w = TransmissionGUI("script-Transmission-main.xml",os.getcwd() ,"Default")
|
||||
w.doModal()
|
||||
del w
|
||||
|
|
BIN
default.tbn
Before Width: | Height: | Size: 43 KiB |
BIN
icon.png
Normal file
After Width: | Height: | Size: 25 KiB |
20
resources/language/Korean/strings.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<strings>
|
||||
<string id="0">Transmission</string>
|
||||
|
||||
<!-- Buttons -->
|
||||
<string id="101">추가</string>
|
||||
<string id="102">삭제</string>
|
||||
<string id="103">일시정지</string>
|
||||
<string id="104">시작</string>
|
||||
<string id="105">전체 일시정지</string>
|
||||
<string id="106">전체 시작</string>
|
||||
<string id="107">나가기</string>
|
||||
|
||||
<!-- Settings -->
|
||||
<string id="1000">RPC 설정</string>
|
||||
<string id="1001">호스트</string>
|
||||
<string id="1002">포트</string>
|
||||
<string id="1003">유저네임</string>
|
||||
<string id="1004">패스워드</string>
|
||||
</strings>
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2010 Correl J. Roush
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
@ -10,11 +11,14 @@ from basictypes.bytes import Bytes
|
|||
from repeater import Repeater
|
||||
|
||||
_ = sys.modules[ "__main__" ].__language__
|
||||
__settings__ = xbmc.Settings(path=os.getcwd())
|
||||
__settings__ = sys.modules[ "__main__" ].__settings__
|
||||
|
||||
KEY_BUTTON_BACK = 275
|
||||
KEY_KEYBOARD_ESC = 61467
|
||||
|
||||
EXIT_SCRIPT = ( 6, 10, 247, 275, 61467, 216, 257, 61448, )
|
||||
CANCEL_DIALOG = EXIT_SCRIPT + ( 216, 257, 61448, )
|
||||
|
||||
class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
||||
def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0):
|
||||
params = {
|
||||
|
@ -70,11 +74,16 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
list.reset()
|
||||
for id, item in self.list.iteritems():
|
||||
list.addItem(item)
|
||||
def onAction(self, action):
|
||||
buttonCode = action.getButtonCode()
|
||||
actionID = action.getId()
|
||||
if (buttonCode == KEY_BUTTON_BACK or buttonCode == KEY_KEYBOARD_ESC):
|
||||
self.shutDown()
|
||||
# def onAction(self, action):
|
||||
# buttonCode = action.getButtonCode()
|
||||
# actionID = action.getId()
|
||||
# if (buttonCode == KEY_BUTTON_BACK or buttonCode == KEY_KEYBOARD_ESC):
|
||||
# self.shutDown()
|
||||
|
||||
def exit_script( self, restart=False ):
|
||||
self.shutDown()
|
||||
#self.close()
|
||||
|
||||
def onClick(self, controlID):
|
||||
list = self.getControl(20)
|
||||
if (controlID == 11):
|
||||
|
@ -119,6 +128,12 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
|
|||
def onFocus(self, controlID):
|
||||
pass
|
||||
|
||||
def onAction( self, action ):
|
||||
print str(action.getButtonCode())
|
||||
if ( action.getButtonCode() in CANCEL_DIALOG ):
|
||||
print str(action.getButtonCode())
|
||||
self.exit_script()
|
||||
|
||||
class TorrentInfoGUI(xbmcgui.WindowXMLDialog):
|
||||
def __init__(self, strXMLname, strFallbackPath, strDefaultName, bforeFallback=0):
|
||||
self.torrent_id = None
|
||||
|
@ -135,4 +150,7 @@ class TorrentInfoGUI(xbmcgui.WindowXMLDialog):
|
|||
def onClick(self, controlID):
|
||||
pass
|
||||
def onFocus(self, controlID):
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2010 Correl J. Roush
|
||||
|
||||
import threading
|
||||
import time
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<settings>
|
||||
<setting type="lsep" label="1000" />
|
||||
<setting id="rpc_host" type="text" label="1001" default="localhost" />
|
||||
<setting id="rpc_port" type="integer" label="1002" default="9091" />
|
||||
<setting id="rpc_port" type="number" label="1002" default="9091" />
|
||||
<setting id="rpc_user" type="text" label="1003" default="" />
|
||||
<setting id="rpc_password" type="text" option="hidden" label="1004" default="" />
|
||||
</settings>
|
||||
</settings>
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
<defaultcontrol>20</defaultcontrol>
|
||||
<coordinates>
|
||||
<system>1</system>
|
||||
<posx>20</posx>
|
||||
<posy>20</posy>
|
||||
<posx>120</posx>
|
||||
<posy>70</posy>
|
||||
</coordinates>
|
||||
<controls>
|
||||
<control type="image">
|
||||
<description>backdrop</description>
|
||||
<posx>-20</posx>
|
||||
<posy>-20</posy>
|
||||
<width>720</width>
|
||||
<width>1000</width>
|
||||
<height>576</height>
|
||||
<texture>black.png</texture>
|
||||
</control>
|
||||
<control type="image">
|
||||
<posx>-10</posx>
|
||||
<posy>-8</posy>
|
||||
<width>700</width>
|
||||
<width>980</width>
|
||||
<height>560</height>
|
||||
<texture>transmission-main.png</texture>
|
||||
<animation effect="fade" time="200">WindowOpen</animation>
|
||||
|
@ -28,7 +28,7 @@
|
|||
<description>textarea</description>
|
||||
<posx>0</posx>
|
||||
<posy>0</posy>
|
||||
<width>700</width>
|
||||
<width>980</width>
|
||||
<visible>true</visible>
|
||||
<label>Transmission</label>
|
||||
<font>font11</font>
|
||||
|
@ -44,20 +44,21 @@
|
|||
<posx>0</posx>
|
||||
<posy>0</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
<label>SCRIPT101</label>
|
||||
<onright>20</onright>
|
||||
<ondown>12</ondown>
|
||||
<onup>17</onup>
|
||||
</control>
|
||||
<control type="button" id="12">
|
||||
<description>Remove torrent</description>
|
||||
<posx>0</posx>
|
||||
<posy>70</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
|
@ -71,7 +72,7 @@
|
|||
<posx>0</posx>
|
||||
<posy>150</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
|
@ -85,7 +86,7 @@
|
|||
<posx>0</posx>
|
||||
<posy>220</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
|
@ -99,7 +100,7 @@
|
|||
<posx>0</posx>
|
||||
<posy>300</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
|
@ -113,7 +114,7 @@
|
|||
<posx>0</posx>
|
||||
<posy>370</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
|
@ -127,13 +128,14 @@
|
|||
<posx>0</posx>
|
||||
<posy>450</posy>
|
||||
<height>70</height>
|
||||
<width>70</width>
|
||||
<width>110</width>
|
||||
<align>center</align>
|
||||
<aligny>top</aligny>
|
||||
<textoffsety>45</textoffsety>
|
||||
<label>SCRIPT107</label>
|
||||
<onright>20</onright>
|
||||
<onup>16</onup>
|
||||
<ondown>11</ondown>
|
||||
</control>
|
||||
</control>
|
||||
<!--
|
||||
|
@ -147,33 +149,34 @@
|
|||
-->
|
||||
<control type="list" id="20">
|
||||
<description>Torrent list</description>
|
||||
<posx>90</posx>
|
||||
<posx>135</posx>
|
||||
<posy>35</posy>
|
||||
<width>560</width>
|
||||
<width>800</width>
|
||||
<height>500</height>
|
||||
<viewtype label="Torrent List">list</viewtype>
|
||||
<orientation>vertical</orientation>
|
||||
<visible>true</visible>
|
||||
<onleft>11</onleft>
|
||||
<onright>17</onright>
|
||||
<itemlayout width="560" height="70">
|
||||
<control type="image">
|
||||
<posx>0</posx>
|
||||
<posy>0</posy>
|
||||
<width>610</width>
|
||||
<width>800</width>
|
||||
<height>70</height>
|
||||
<texture>list-bg.png</texture>
|
||||
</control>
|
||||
<control type="label">
|
||||
<posx>10</posx>
|
||||
<posy>0</posy>
|
||||
<width>640</width>
|
||||
<width>790</width>
|
||||
<height>20</height>
|
||||
<info>ListItem.label</info>
|
||||
</control>
|
||||
<control type="label">
|
||||
<posx>15</posx>
|
||||
<posy>20</posy>
|
||||
<width>635</width>
|
||||
<width>785</width>
|
||||
<height>20</height>
|
||||
<info>ListItem.label2</info>
|
||||
</control>
|
||||
|
@ -182,7 +185,7 @@
|
|||
<control type="image">
|
||||
<posx>0</posx>
|
||||
<posy>0</posy>
|
||||
<width>610</width>
|
||||
<width>800</width>
|
||||
<height>70</height>
|
||||
<visible>Control.HasFocus(20)</visible>
|
||||
<texture border="5">list-bg-selected.png</texture>
|
||||
|
@ -190,7 +193,7 @@
|
|||
<control type="image">
|
||||
<posx>0</posx>
|
||||
<posy>0</posy>
|
||||
<width>610</width>
|
||||
<width>800</width>
|
||||
<height>70</height>
|
||||
<visible>!Control.HasFocus(20)</visible>
|
||||
<texture border="5">list-bg-selected-nofocus.png</texture>
|
||||
|
@ -198,7 +201,7 @@
|
|||
<control type="label">
|
||||
<posx>10</posx>
|
||||
<posy>0</posy>
|
||||
<width>640</width>
|
||||
<width>870</width>
|
||||
<height>20</height>
|
||||
<info>ListItem.label</info>
|
||||
<scroll>true</scroll>
|
||||
|
@ -206,7 +209,7 @@
|
|||
<control type="label">
|
||||
<posx>15</posx>
|
||||
<posy>20</posy>
|
||||
<width>635</width>
|
||||
<width>885</width>
|
||||
<height>20</height>
|
||||
<info>ListItem.label2</info>
|
||||
</control>
|
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 554 B After Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
|
@ -1,6 +1,6 @@
|
|||
<skin>
|
||||
<defaultresolution>pal</defaultresolution>
|
||||
<defaultresolutionwide>pal</defaultresolutionwide>
|
||||
<defaultresolution>720p</defaultresolution>
|
||||
<defaultresolutionwide>720p</defaultresolutionwide>
|
||||
<version>2.1</version>
|
||||
<zoom>0</zoom>
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
|||
<skinname>default</skinname>
|
||||
<name>correl</name>
|
||||
</credits>
|
||||
</skin>
|
||||
</skin>
|
Before Width: | Height: | Size: 43 KiB |