wm_tweaks.py set title less often

Only set the title once when a song is loaded, using a default argument
if no title is provided.
This commit is contained in:
Bryan Schumaker 2010-11-02 17:03:57 -04:00
parent db939b57a5
commit 101e833690
1 changed files with 5 additions and 5 deletions

View File

@ -6,22 +6,22 @@ lib_find_id = libsaria.collection.lib_find_id
lib_get_attr = libsaria.collection.lib_get_attr
invite = libsaria.event.invite
def reset(*args):
ocarina.set_window_icon("images/ocarina.png")
ocarina.set_window_title(ocarina.__vers__)
def tweak_icon(file):
if file != None:
ocarina.set_window_icon(file)
else:
ocarina.set_window_icon("images/ocarina.png")
def tweak_title(filepath):
if filepath != None:
id = lib_find_id(filepath)
title = lib_get_attr(id, "title")
ocarina.set_window_title(title)
else:
title = ocarina.__vers__
ocarina.set_window_title(title)
def start():
invite("PRELOAD", reset)
invite("POSTLOAD", tweak_title)
invite("POSTGETART", tweak_icon)