Prevent warning message in expander navigation plugin

This commit is contained in:
Nick Hall 2014-04-21 22:19:22 +01:00
parent b3edd2fa5f
commit b7fcc9dc6f
2 changed files with 3 additions and 6 deletions

View File

@ -276,7 +276,8 @@ class Navigator(object):
if old_page != -1:
self.pages[old_page][1].inactive()
self.pages[index][1].active(self.active_cat, self.active_view)
self.pages[index][1].view_changed(self.active_cat, self.active_view)
if self.active_view is not None:
self.pages[index][1].view_changed(self.active_cat, self.active_view)
self.title_label.set_text(self.pages[index][0])
def cb_close_clicked(self, button):

View File

@ -111,11 +111,7 @@ class ExpanderSidebar(BaseSidebar):
if cat_num is not None:
self.expanders[cat_num].set_expanded(True)
# Set new button as selected
try:
button_num = self.lookup[(cat_num, view_num)]
except KeyError as err:
logging.warning("Key Error retrieving button number: %s" % str(err))
button_num = 0
button_num = self.lookup.get((cat_num, view_num))
self.__handlers_block()
for index, button in enumerate(self.buttons):
if index == button_num: