Set default page

During startup, we should check if the initial page exists.  If it
doesn't we will switch to the default page instead.
This commit is contained in:
Bryan Schumaker 2010-11-30 21:19:29 -05:00
parent 72f85f9f92
commit f05e6c6336
2 changed files with 25 additions and 1 deletions

22
html/web_radio.html Normal file
View File

@ -0,0 +1,22 @@
<html>
<body>
<table width=100% height=100%><tr>
<td align="center" valign="middle">
<table>
<tr>
<td align="center"> <u>Select a radio station</u> </td>
</tr>
<tr>
<td align="center"> <a href="http://www.pandora.com">Pandora</a> </td>
</tr>
<tr>
<td align="center"> <a href="http://www.grooveshark.com">Grooveshark</a> </td>
</tr>
</table>
</body>
</html>

View File

@ -61,7 +61,9 @@ def init():
def init_page(page_name):
page = prefs.init_pref("ocarina.body.page", page_name)
child = contents[page]
child = contents.get(page, None)
if child == None:
child = contents.get(page_name)
num = body.page_num(child)
body.set_current_page(num)
child.visible()