Skip to content

Commit

Permalink
Add results screen
Browse files Browse the repository at this point in the history
  • Loading branch information
elParaguayo committed Aug 6, 2016
1 parent c61158f commit 6baa5cf
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 325 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.bbclivefootballscores"
name="BBC Football Scores"
version="0.3.1"
version="0.4.0"
provider-name="elParaguayo">
<requires>
<import addon="xbmc.addon" version="12.0.0"/>
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v0.4.0 Lots of things to test
- Add notification timeout fix
- Add option to display goalscorer (experimental)
- Add option to display bookings (experimental)
- Add ticker option
- Fix import error (as reported in forum)

v0.3.0 Release Candidate 2
- Removes deprecated methods
- Fixes issue where script fails if installed to different folder
Expand Down
15 changes: 12 additions & 3 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ def checkMatch(match):
else:
yellow = None

Notify(u"YELLOW!{0}".format(yellow if yellow else u""), str(match), IMG_GOAL, timeout=NOTIFY_TIME)
Notify(u"YELLOW!{0}".format(yellow if yellow else u""),
str(match),
IMG_YELLOW,
timeout=NOTIFY_TIME)
debug(u"Yellow Card: %s" % (unicode(match)))

if match.redcard:
Expand All @@ -220,7 +223,10 @@ def checkMatch(match):
else:
red = None

Notify(u"RED!{0}".format(red if red else u""), str(match), IMG_GOAL, timeout=NOTIFY_TIME)
Notify(u"RED!{0}".format(red if red else u""),
str(match),
IMG_RED,
timeout=NOTIFY_TIME)
debug(u"Red Card: %s" % (unicode(match)))

# Has there been a goal?
Expand All @@ -234,7 +240,10 @@ def checkMatch(match):
else:
scorer = None

Notify(u"GOAL!{0}".format(scorer if scorer else u""), str(match), IMG_GOAL, timeout=NOTIFY_TIME)
Notify(u"GOAL!{0}".format(scorer if scorer else u""),
str(match),
IMG_GOAL,
timeout=NOTIFY_TIME)
debug(u"GOAL: %s" % (unicode(match)))


Expand Down
11 changes: 11 additions & 0 deletions helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from resources.lib.settings import selectLeagues, toggleNotification
from resources.lib.league_tables import XBMCLeagueTable
from resources.lib.live_scores_detail import XBMCLiveScoresDetail
from resources.lib.results import XBMCResults
from resources.lib.utils import closeAddonSettings
from resources.lib.menu import FootballHelperMenu
from resources.lib.ticker import TickerOverlay
Expand Down Expand Up @@ -148,6 +149,16 @@ def ToggleTicker():
# and display it!
xlsd.start()

elif params.get("mode") == "results":
# Close addon setting window (if open)
closeAddonSettings()

# Create an instance of the XBMC League Table
xr = XBMCResults()

# and display it!
xr.start()

elif params.get("mode") == "toggleticker":

ToggleTicker()
15 changes: 15 additions & 0 deletions resources/language/English/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ msgctxt "#32081"
msgid "Show additional match detail..."
msgstr ""

msgctxt "#32082"
msgid "Show results..."
msgstr ""

msgctxt "#32083"
msgid "Show fixtures..."
msgstr ""

## SETTINGS CATEGORIES

Expand Down Expand Up @@ -144,3 +151,11 @@ msgstr ""
msgctxt "#32111"
msgid "Getting league table data"
msgstr ""

msgctxt "#32112"
msgid "Results"
msgstr ""

msgctxt "#32113"
msgid "Getting results data"
msgstr ""
11 changes: 9 additions & 2 deletions resources/lib/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def show(self):
self.mdbutton = Button("Show Match Detail")
self.window.placeControl(self.mdbutton, 1, 0, columnspan = 2)

# ITEM 3 - MATCH DETAIL
self.resbutton = Button("Show Results")
self.window.placeControl(self.resbutton, 2, 0, columnspan = 2)

# CLOSE BUTTON

self.clbutton = Button("Close")
Expand All @@ -64,14 +68,17 @@ def show(self):
self.window.connect(self.clbutton, lambda: self.window.close())
self.window.connect(self.ltbutton, lambda: self.open("leaguetable"))
self.window.connect(self.mdbutton, lambda: self.open("matchdetail"))
self.window.connect(self.resbutton, lambda: self.open("results"))

self.window.setFocus(self.ltbutton)

# Handle navigation to make user experience better
self.ltbutton.controlDown(self.mdbutton)
self.mdbutton.controlUp(self.ltbutton)
self.mdbutton.controlDown(self.clbutton)
self.clbutton.controlUp(self.mdbutton)
self.mdbutton.controlDown(self.resbutton)
self.resbutton.controlDown(self.clbutton)
self.resbutton.controlUp(self.mdbutton)
self.clbutton.controlUp(self.resbutton)
# self.leaguelist.controlLeft(self.leaguebutton)
# self.leaguelist.controlRight(self.closebutton)
# self.closebutton.controlUp(self.leaguelist)
Expand Down
1 change: 1 addition & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<category label="32091">
<setting id="dummy1" label="32080" type="action" action="RunScript(service.bbclivefootballscores, mode=leaguetable)" />
<setting id="dummy2" label="32081" type="action" action="RunScript(service.bbclivefootballscores, mode=matchdetail)" />
<setting id="dummy3" label="32082" type="action" action="RunScript(service.bbclivefootballscores, mode=results)" />
</category>
</settings>
Loading

0 comments on commit 6baa5cf

Please sign in to comment.