5002: control n and p to move between categories not working
5003: A hotkey to enable/disable the navigator is needed svn: r17780
This commit is contained in:
parent
5aedcdace8
commit
df971e431d
@ -807,7 +807,7 @@ class ViewManager(CLIManager):
|
|||||||
]
|
]
|
||||||
|
|
||||||
self._file_toggle_action_list = [
|
self._file_toggle_action_list = [
|
||||||
('Navigator', None, _('_Navigator'), None, None,
|
('Navigator', None, _('_Navigator'), "<control>m", None,
|
||||||
self.navigator_toggle, self.show_navigator ),
|
self.navigator_toggle, self.show_navigator ),
|
||||||
('Toolbar', None, _('_Toolbar'), None, None, self.toolbar_toggle,
|
('Toolbar', None, _('_Toolbar'), None, None, self.toolbar_toggle,
|
||||||
self.show_toolbar ),
|
self.show_toolbar ),
|
||||||
@ -845,29 +845,39 @@ class ViewManager(CLIManager):
|
|||||||
|
|
||||||
def __next_view(self, action):
|
def __next_view(self, action):
|
||||||
"""
|
"""
|
||||||
Callback that is called when the next view action is selected.
|
Callback that is called when the next category action is selected.
|
||||||
It selects the next view as the active view. If we reach the end of
|
It selects the next category as the active category. If we reach the end,
|
||||||
the list of views, we wrap around to the first view.
|
we wrap around to the first.
|
||||||
"""
|
"""
|
||||||
current_page = self.notebook.get_current_page()
|
curpage = self.notebook.get_current_page()
|
||||||
if current_page == len(self.pages)-1:
|
#find cat and view of the current page
|
||||||
new_page = 0
|
for key in self.page_lookup:
|
||||||
|
if self.page_lookup[key] == curpage:
|
||||||
|
cat_num, view_num = key
|
||||||
|
break
|
||||||
|
#now go to next category
|
||||||
|
if cat_num >= len(self.current_views)-1:
|
||||||
|
self.goto_page(0, None)
|
||||||
else:
|
else:
|
||||||
new_page = current_page + 1
|
self.goto_page(cat_num+1, None)
|
||||||
self.notebook.set_current_page(new_page)
|
|
||||||
|
|
||||||
def __prev_view(self, action):
|
def __prev_view(self, action):
|
||||||
"""
|
"""
|
||||||
Callback that is called when the previous view action is selected.
|
Callback that is called when the previous category action is selected.
|
||||||
It selects the previous view as the active view. If we reach the
|
It selects the previous category as the active category. If we reach the
|
||||||
beginning of the list of views, we wrap around to the last view.
|
beginning of the list, we wrap around to the last.
|
||||||
"""
|
"""
|
||||||
current_page = self.notebook.get_current_page()
|
curpage = self.notebook.get_current_page()
|
||||||
if current_page == 0:
|
#find cat and view of the current page
|
||||||
new_page = len(self.pages)-1
|
for key in self.page_lookup:
|
||||||
|
if self.page_lookup[key] == curpage:
|
||||||
|
cat_num, view_num = key
|
||||||
|
break
|
||||||
|
#now go to next category
|
||||||
|
if cat_num > 0:
|
||||||
|
self.goto_page(cat_num-1, None)
|
||||||
else:
|
else:
|
||||||
new_page = current_page - 1
|
self.goto_page(len(self.current_views)-1, None)
|
||||||
self.notebook.set_current_page(new_page)
|
|
||||||
|
|
||||||
def init_interface(self):
|
def init_interface(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user