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:
parent
72f85f9f92
commit
f05e6c6336
|
@ -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>
|
|
@ -61,7 +61,9 @@ def init():
|
||||||
|
|
||||||
def init_page(page_name):
|
def init_page(page_name):
|
||||||
page = prefs.init_pref("ocarina.body.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)
|
num = body.page_num(child)
|
||||||
body.set_current_page(num)
|
body.set_current_page(num)
|
||||||
child.visible()
|
child.visible()
|
||||||
|
|
Loading…
Reference in New Issue