Skip to content

Commit 8f8255a

Browse files
committed
Touché
1 parent 5130587 commit 8f8255a

File tree

17 files changed

+51
-637
lines changed

17 files changed

+51
-637
lines changed

resources/language/English/strings.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ msgid "Simkl login"
4949
msgstr ""
5050

5151
msgctxt "#32022"
52-
msgid "Visit {} on your device and enter this code"
52+
msgid "Please visit {} on \nyour device and enter this code"
5353
msgstr ""
5454

5555
msgctxt "#32023"

resources/lib/engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class Player(xbmc.Player):
5959
def __init__(self):
6060
xbmc.Player.__init__(self)
6161

62-
@classmethod
63-
def getMediaType(self):
62+
@staticmethod
63+
def getMediaType():
6464
if xbmc.getCondVisibility('Container.Content(tvshows)'):
6565
return "show"
6666
elif xbmc.getCondVisibility('Container.Content(seasons)'):
@@ -101,7 +101,7 @@ def onPlayBackStopped(self):
101101

102102
percentage = 100 * self.getTime() / self.getTotalTime()
103103
pctconfig = int(self.addon.getSetting("scr-pct"))
104-
104+
105105
if percentage > pctconfig:
106106
bubble = __addon__.getSetting("bubble")
107107

resources/lib/interface.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/python
22
# -*- coding: UTF-8 -*-
3-
import xbmc, xbmcgui, xbmcaddon
43
import time
4+
import threading
5+
import xbmc, xbmcgui, xbmcaddon
56
tmp = time.time()
67

78
__addon__ = xbmcaddon.Addon("script.simkl")
@@ -33,12 +34,7 @@ def __init__(self, xmlFilename, scriptPath, pin, url, check_login, log,
3334
self.waiting = True
3435
self.canceled = False
3536

36-
def onInit(self):
37-
instruction = self.getControl(INSTRUCTION_ID)
38-
instruction.setLabel(
39-
getstr(32022).format("[COLOR yellow]" + self.url + "[/COLOR]"))
40-
self.getControl(PIN_LABEL).setLabel(self.pin)
41-
37+
def threaded(self):
4238
cnt = 0
4339
while self.waiting:
4440
if cnt % (self.inter+1) == 0 and cnt>1:
@@ -58,21 +54,24 @@ def onInit(self):
5854
xbmc.log("Simkl: Stop waiting")
5955
self.close()
6056

61-
def onAction(self, action):
62-
#xbmc.log("Simkl: onaction {}".format(action))
63-
if action == True: #TODO
64-
self.close()
57+
def onInit(self):
58+
instruction = self.getControl(INSTRUCTION_ID)
59+
instruction.setLabel(
60+
getstr(32022).format("[COLOR ffffbf00]" + self.url + "[/COLOR]"))
61+
self.getControl(PIN_LABEL).setLabel(self.pin)
62+
63+
t = threading.Thread(target=self.threaded)
64+
t.start()
6565

6666
def onControl(self, controlID):
67-
pass
67+
xbmc.log("Simkl: oncontrol {}".format(controlID))
6868
def onFocus(self, controlID):
6969
pass
7070

7171
def onClick(self, controlID):
7272
xbmc.log("Simkl: onclick {}".format(controlID))
7373
if controlID == CANCEL_BUTTON:
7474
self.canceled = True
75-
self.close()
7675

7776
'''
7877
class loginDialog:

resources/lib/request.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

resources/lib/simklapi.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import xbmc
1313
import interface
1414
import httplib
15-
import xbmcgui
1615

1716
__addon__ = interface.__addon__
1817
def getstr(strid): return interface.getstr(strid)
@@ -140,7 +139,6 @@ def watched(self, filename, mediatype, duration, date=time.strftime('%Y-%m-%d %H
140139
else:
141140
xbmc.log("Simkl: Filename - {}".format(filename))
142141
values = {"file":filename}
143-
xbmc.log(values)
144142
values = json.dumps(values)
145143
xbmc.log("Simkl: Query: {}".format(values))
146144
con.request("GET", "/search/file/", body=values, headers=headers)

resources/skins/Default/720p/simkl-LoginDialog.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
<control type="label">
2323
<description>Header</description>
2424
<posx>0</posx>
25-
<posy>30</posy>
25+
<posy>20</posy>
2626
<width>800</width>
2727
<height>25</height>
2828
<!-- Structure: $ADDON[script.simkl <STRID>] -->
2929
<label>SIMKL account authorization</label>
3030
<align>center</align>
3131
<aligny>center</aligny>
32-
<textcolor>FFAAAAAA</textcolor>
32+
<textcolor>FFa7a7a7</textcolor>
3333
</control>
3434
<control type="label" id="201">
3535
<description>PIN</description>
@@ -49,22 +49,27 @@
4949
<control type="label" id="202">
5050
<description>Instructions</description>
5151
<posx>0</posx>
52-
<posy>170</posy>
52+
<posy>210</posy>
5353
<width>800</width>
5454
<height>50</height>
5555
<label> Instructions </label>
56+
<font>font16</font>
5657
<align>center</align>
5758
<aligny>center</aligny>
58-
<textcolor>FFFFFFFF</textcolor>
59+
<textcolor>FFf0f0f0</textcolor>
5960
</control>
6061
<control type="button" id="203">
6162
<description>Cancel</description>
6263
<align>center</align>
6364
<posx>325</posx>
64-
<posy>320</posy>
65+
<posy>340</posy>
6566
<width>150</width>
6667
<height>30</height>
6768
<label>Cancel</label>
69+
<textcolor>FFededed</textcolor>
70+
<focusedcolor>FFededed</focusedcolor>
71+
<texturenofocus>button_nofocus.png</texturenofocus>
72+
<texturefocus>button_focus.png</texturefocus>
6873
<onclick>PreviousMenu</onclick>
6974
<!-- Not visible if using a remote (press back) -->
7075
<visible>system.getbool(input.enablemouse)</visible>
273 Bytes
Loading
239 Bytes
Loading

0 commit comments

Comments
 (0)