Пример #1
0
 def define_actions(self):
     """
     Define menu actions.
     """
     PageView.define_actions(self)
     self.bookmark_actions()
     self.navigation_actions()
Пример #2
0
 def disable_action_group(self):
     """
     Normally, this would not be overridden from the base class. However, 
     in this case, we have additional action groups that need to be
     handled correctly.
     """
     PageView.disable_action_group(self)
     
     self.fwd_action.set_visible(False)
     self.back_action.set_visible(False)
Пример #3
0
 def set_inactive(self):
     """
     Called when the page becomes inactive (not displayed).
     """
     if self.active:
         PageView.set_inactive(self)
         self.bookmarks.undisplay()
         hobj = self.get_history()
         hobj.disconnect(self.active_signal)
         hobj.disconnect(self.mru_signal)
         self.mru_disable()
Пример #4
0
 def set_active(self):
     """
     Called when the page becomes active (displayed).
     """
     PageView.set_active(self)
     self.bookmarks.display()
     
     hobj = self.get_history()
     self.active_signal = hobj.connect('active-changed', self.goto_active)
     self.mru_signal = hobj.connect('mru-changed', self.update_mru_menu)
     self.update_mru_menu(hobj.mru)
         
     self.goto_active(None)
Пример #5
0
 def enable_action_group(self, obj):
     """
     Normally, this would not be overridden from the base class. However, 
     in this case, we have additional action groups that need to be
     handled correctly.
     """
     PageView.enable_action_group(self, obj)
     
     self.fwd_action.set_visible(True)
     self.back_action.set_visible(True)
     hobj = self.get_history()
     self.fwd_action.set_sensitive(not hobj.at_end())
     self.back_action.set_sensitive(not hobj.at_front())
Пример #6
0
    def __init__(self, title, pdata, state, uistate, bookmarks, bm_type, nav_group):
        PageView.__init__(self, title, pdata, state, uistate)
        self.bookmarks = bm_type(self.dbstate, self.uistate, bookmarks,
                                 self.change_active)

        self.fwd_action = None
        self.back_action = None
        self.book_action = None
        self.other_action = None
        self.active_signal = None
        self.mru_signal = None
        self.nav_group = nav_group
        self.mru_active = DISABLED

        self.uistate.register(state, self.navigation_type(), self.nav_group)
Пример #7
0
 def on_delete(self):
     """
     Save the column widths when the view is shutdown.
     """
     widths = self.get_column_widths()
     order = self._config.get('columns.rank')
     size = self._config.get('columns.size')
     vis = self._config.get('columns.visible')
     newsize = []
     index = 0
     for val, size in zip(order, size):
         if val in vis:
             size = widths[index]
             index += 1
         newsize.append(size)
     self._config.set('columns.size', newsize)
     PageView.on_delete(self)
Пример #8
0
 def __init__(self, pdata, dbstate, uistate):
     """
     Create a GrampletView, with the current dbstate and uistate
     """
     PageView.__init__(self, _('Gramplets'), pdata, dbstate, uistate)
     self.ui_def = '''<ui>