Ejemplo n.º 1
0
 def __init__(self, dbstate, uistate, track, obj, refmodel, callback=None):
     self.obj = obj
     EmbeddedList.__init__(self, dbstate, uistate, track, _('_References'),
                           refmodel)
     self._callback = callback
     self.connectid = self.model.connect('row-inserted', self.update_label)
     self.track_ref_for_deletion("model")
Ejemplo n.º 2
0
 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]})
Ejemplo n.º 3
0
 def __init__(self, dbstate, uistate, track, data):
     self.data = data
     EmbeddedList.__init__(self,
                           dbstate,
                           uistate,
                           track,
                           _('_Addresses'),
                           AddressModel,
                           move_buttons=True)
Ejemplo n.º 4
0
    def build_columns(self):
        EmbeddedList.build_columns(self)

        # Need to add attributes to renderers
        # and connect renderers to the 'edited' signal
        for colno in range(len(self.columns)):
            for renderer in self.columns[colno].get_cell_renderers():
                renderer.set_property('editable', not self.dbstate.db.readonly)
                renderer.connect('edited',self.edit_inline,colno)
Ejemplo n.º 5
0
 def __init__(self, dbstate, uistate, track, data):
     self.data = data
     EmbeddedList.__init__(self,
                           dbstate,
                           uistate,
                           track,
                           _('Alternate _Locations'),
                           LocationModel,
                           move_buttons=True)
Ejemplo n.º 6
0
 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})
Ejemplo n.º 7
0
 def __init__(self,
              dbstate,
              uistate,
              track,
              name,
              build_model,
              share_button=False,
              move_buttons=False,
              jump_button=False):
     """
     Create a new list, using the passed build_model to populate the list.
     """
     EmbeddedList.__init__(self, dbstate, uistate, track, name, build_model,
                           share_button, move_buttons, jump_button)
     #connect click on the first column
     self.columns[0].connect('clicked', self.groupcol_click)
     for col in self.columns[1:]:
         col.connect('clicked', self.col_click)
     self.dbsort = True
Ejemplo n.º 8
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})
Ejemplo n.º 9
0
    def __init__(self,
                 dbstate,
                 uistate,
                 track,
                 name,
                 on_change=None,
                 top_label=_('<b>Multiple Surnames</b>')):
        self.obj = name
        self.on_change = on_change
        self.curr_col = -1
        self.curr_cellr = None
        self.curr_celle = None

        EmbeddedList.__init__(self,
                              dbstate,
                              uistate,
                              track,
                              _('Family Surnames'),
                              SurnameModel,
                              move_buttons=True,
                              top_label=top_label)
Ejemplo n.º 10
0
 def key_pressed(self, obj, event):
     """
     Handles the key being pressed. 
     Here we make sure tab moves to next or previous value in row on TAB
     """
     if not EmbeddedList.key_pressed(self, obj, event):
         if event.type == gtk.gdk.KEY_PRESS and event.keyval in (_TAB, ):
             if not (event.state &
                     (gtk.gdk.SHIFT_MASK | gtk.gdk.CONTROL_MASK)):
                 return self.next_cell()
             elif (event.state &
                   (gtk.gdk.SHIFT_MASK | gtk.gdk.CONTROL_MASK)):
                 return self.prev_cell()
             else:
                 return
         else:
             return
     return True
Ejemplo n.º 11
0
    def build_columns(self):
        #first the standard text columns with normal method
        EmbeddedList.build_columns(self)

        # Need to add attributes to renderers
        # and connect renderers to the 'edited' signal
        for colno in range(len(self.columns)):
            for renderer in self.columns[colno].get_cell_renderers():
                renderer.set_property('editable', not self.dbstate.db.readonly)
                renderer.connect('editing_started', self.on_edit_start, colno)
                renderer.connect('edited', self.on_edit_inline,
                                 self.column_order()[colno][1])

        # now we add the two special columns
        # combobox for type
        colno = len(self.columns)
        name = self._column_combo[0]
        renderer = gtk.CellRendererCombo()
        renderer.set_property('ellipsize', pango.ELLIPSIZE_END)
        # set up the comboentry editable
        no = NameOriginType()
        self.cmborig = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING)
        self.cmborigmap = no.get_map().copy()
        keys = sorted(self.cmborigmap, self.by_value)
        for key in keys:
            if key != no.get_custom():
                self.cmborig.append(row=[key, self.cmborigmap[key]])
        additional = self.dbstate.db.get_origin_types()
        if additional:
            for type in additional:
                if type:
                    self.cmborig.append(row=[no.get_custom(), type])
        renderer.set_property("model", self.cmborig)
        renderer.set_property("text-column", 1)
        renderer.set_property('editable', not self.dbstate.db.readonly)

        renderer.connect('editing_started', self.on_edit_start_cmb, colno)
        renderer.connect('edited', self.on_orig_edited, self._column_combo[3])
        # add to treeview
        column = gtk.TreeViewColumn(name, renderer, text=self._column_combo[3])
        column.set_resizable(True)
        column.set_sort_column_id(self._column_combo[1])
        column.set_min_width(self._column_combo[2])
        column.set_expand(True)
        self.columns.append(column)
        self.tree.append_column(column)
        # toggle box for primary
        colno += 1
        name = self._column_toggle[0]
        renderer = gtk.CellRendererToggle()
        renderer.set_property('activatable', True)
        renderer.set_property('radio', True)
        renderer.connect('toggled', self.on_prim_toggled,
                         self._column_toggle[3])
        # add to treeview
        column = gtk.TreeViewColumn(name,
                                    renderer,
                                    active=self._column_toggle[3])
        column.set_resizable(False)
        column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
        column.set_alignment(0.5)
        column.set_sort_column_id(self._column_toggle[1])
        column.set_min_width(self._column_toggle[2])
        self.columns.append(column)
        self.tree.append_column(column)
Ejemplo n.º 12
0
 def __init__(self, dbstate, uistate, track, obj):
     self.obj = obj
     
     EmbeddedList.__init__(self, dbstate, uistate, track, _('_Data'), 
                           DataModel, move_buttons=False)
Ejemplo n.º 13
0
 def __init__(self, dbstate, uistate, track, data):
     self.data = data
     EmbeddedList.__init__(self, dbstate, uistate, track, 
                           _('_Associations'), PersonRefModel, 
                           move_buttons=True)
Ejemplo n.º 14
0
 def __init__(self, dbstate, uistate, track, data):
     self.data = data
     EmbeddedList.__init__(self, dbstate, uistate, track, _('_LDS'), 
                           LdsModel, move_buttons=True)