Beispiel #1
0
    def __init__(self, dbstate, uistate, namespace):
        self.signal_map = {
            'tag-add': self._tag_add,
            'tag-delete': self._tag_delete,
            'tag-update': self._tag_update,
            'tag-rebuild': self._tag_rebuild
        }
        DbGUIElement.__init__(self, dbstate.db)

        self.position = 1
        self.vbox = gtk.VBox()
        self.table = gtk.Table(4, 11)
        self.vbox.pack_start(self.table, False, False)
        self.table.set_border_width(6)
        self.table.set_row_spacings(6)
        self.table.set_col_spacing(0, 6)
        self.table.set_col_spacing(1, 6)
        self.apply_btn = gtk.Button(stock=gtk.STOCK_FIND)
        self.clear_btn = gtk.Button()

        self._init_interface()
        uistate.connect('filters-changed', self.on_filters_changed)
        dbstate.connect('database-changed', self._db_changed)
        self.uistate = uistate
        self.dbstate = dbstate
        self.namespace = namespace
        self.__tag_list = []
        self._tag_rebuild()
 def __init__(self, dbstate, uistate, track, obj):
     self.obj = obj
     EmbeddedList.__init__(self, dbstate, uistate, track, 
                           _('_Repositories'), RepoRefModel, 
                           share_button=True, move_buttons=True)
     DbGUIElement.__init__(self, dbstate.db)
     self.callman.register_handles({'repository': [rref.ref for rref 
                                                       in self.obj]})
 def __init__(self, dbstate, uistate, track, data, callertitle=None):
     self.data = data
     self.callertitle = callertitle
     EmbeddedList.__init__(self,
                           dbstate,
                           uistate,
                           track,
                           _("_Source Citations"),
                           CitationRefModel,
                           share_button=True,
                           move_buttons=True)
     DbGUIElement.__init__(self, dbstate.db)
     self.callman.register_handles({'citation': self.data})
Beispiel #4
0
    def __init__(self, title, pdata, dbstate, uistate):
        self.title = title
        self.pdata = pdata
        self.dbstate = dbstate
        self.uistate = uistate
        self.action_list = []
        self.action_toggle_list = []
        self.action_toolmenu_list = []
        self.action_toolmenu = {} #easy access to toolmenuaction and proxies
        self.action_group = None
        self.additional_action_groups = []
        self.additional_uis = []
        self.ui_def = '''<ui>
          <menubar name="MenuBar">
            <menu action="ViewMenu">
              <placeholder name="Bars">
                <menuitem action="Sidebar"/>
                <menuitem action="Bottombar"/>
              </placeholder>
            </menu>
          </menubar>
        </ui>'''
        self.dirty = True
        self.active = False
        self._dirty_on_change_inactive = True
        self.func_list = {}
        
        if isinstance(self.pdata.category, tuple):
            self.category, self.translated_category = self.pdata.category
        else:
            raise AttributeError("View category must be (name, translated-name)")
        self.ident = self.category + '_' + self.pdata.id

        self.dbstate.connect('no-database', self.disable_action_group)
        self.dbstate.connect('database-changed', self.enable_action_group)
        self.uistate.window.connect("key-press-event", self.key_press_handler)
        
        self.model = None
        self.selection = None
        self.handle_col = 0
        
        self._config = None
        self.init_config()

        self.filter_class = None
        self.top = None
        self.sidebar = None
        self.bottombar = None

        DbGUIElement.__init__(self, dbstate.db)
Beispiel #5
0
    def __init__(self, dbstate, uistate, track, media_list, update=None):
        self.iconlist = gtk.IconView()
        ButtonTab.__init__(self, dbstate, uistate, track, _('_Gallery'), True)
        DbGUIElement.__init__(self, dbstate.db)
        self.track_ref_for_deletion("iconlist")
        self.media_list = media_list
        self.callman.register_handles(
            {'media': [mref.ref for mref in self.media_list]})
        self.update = update

        self._set_dnd()

        self.rebuild()
        self.show_all()
Beispiel #6
0
 def __init__(self,
              dbstate,
              uistate,
              track,
              obj,
              build_model=EventRefModel):
     self.obj = obj
     self._groups = []
     self._data = []
     DbGUIElement.__init__(self, dbstate.db)
     GroupEmbeddedList.__init__(self,
                                dbstate,
                                uistate,
                                track,
                                _('_Events'),
                                build_model,
                                share_button=True,
                                move_buttons=True)
Beispiel #7
0
 def __init__(self,
              dbstate,
              uistate,
              track,
              data,
              callertitle=None,
              notetype=None):
     self.data = data
     self.callertitle = callertitle
     self.notetype = notetype
     EmbeddedList.__init__(self,
                           dbstate,
                           uistate,
                           track,
                           _("_Notes"),
                           NoteModel,
                           share_button=True,
                           move_buttons=True)
     DbGUIElement.__init__(self, dbstate.db)
     self.callman.register_handles({'note': self.data})
Beispiel #8
0
    def __init__(self, uistate, dbstate):
        self.signal_map = {
            'tag-add': self._tag_add,
            'tag-delete': self._tag_delete,
            'tag-update': self._tag_update,
            'tag-rebuild': self._tag_rebuild
        }
        DbGUIElement.__init__(self, dbstate.db)

        self.db = dbstate.db
        self.uistate = uistate

        self.tag_id = None
        self.tag_ui = None
        self.tag_action = None
        self.__tag_list = []

        dbstate.connect('database-changed', self._db_changed)

        self._build_tag_menu()
Beispiel #9
0
    def __init__(self, state, uistate, track, source, source_ref, update):
        self.db = state.db
        self.dbstate = state
        self.uistate = uistate
        self.source_ref = source_ref
        self.source = source
        self.source_added = False
        self.update = update
        self.warn_box = None
        self.__tabs = []

        ManagedWindow.ManagedWindow.__init__(self, uistate, track, source_ref)
        DbGUIElement.__init__(self, self.db)

        self._local_init()
        self._set_size()
        self._create_tabbed_pages()
        self._setup_fields()
        self._connect_signals()
        self.show()
        self._post_init()
Beispiel #10
0
    def __init__(self, state, uistate, track, obj, callback=None):
        """Create an edit window.  Associates a person with the window."""

        self.obj = obj
        self.old_obj = obj.serialize()
        self.dbstate = state
        self.uistate = uistate
        self.db = state.db
        self.callback = callback
        self.__tabs = []

        ManagedWindow.ManagedWindow.__init__(self, uistate, track, obj)
        DbGUIElement.__init__(self, self.db)

        self._local_init()
        self._set_size()

        self._create_tabbed_pages()
        self._setup_fields()
        self._connect_signals()
        self.show()
        self._post_init()
Beispiel #11
0
    def __init__(self, state, uistate, track, obj, get_from_handle, 
                 get_from_gramps_id, callback=None):
        """
        Create an edit window.  
        
        Associate a person with the window.
        
        """
        self.dp  = DateHandler.parser
        self.dd  = DateHandler.displayer
        self.name_displayer  = name_displayer
        self.obj = obj
        self.dbstate = state
        self.uistate = uistate
        self.db = state.db
        self.callback = callback
        self.ok_button = None
        self.get_from_handle = get_from_handle
        self.get_from_gramps_id = get_from_gramps_id
        self.contexteventbox = None
        self.__tabs = []

        ManagedWindow.ManagedWindow.__init__(self, uistate, track, obj)
        DbGUIElement.__init__(self, self.db)

        self._local_init()
        self._set_size()
        self._create_tabbed_pages()
        self._setup_fields()
        self._connect_signals()
        #if the database is changed, all info shown is invalid and the window
        # should close
        self.dbstate_connect_key = self.dbstate.connect('database-changed', 
                                   self._do_close)
        self.show()
        self._post_init()
Beispiel #12
0
 def __init__(self, gui, nav_group=0):
     Gramplet.__init__(self, gui, nav_group)
     DbGUIElement.__init__(self, self.dbstate.db)