* src/DisplayTabs.py: connect new EditSourceRef editor
* src/EditSourceRef.py: update data on save * src/gramps.glade: hide src_edit_ref by default * src/plugins/Makefile.am: Calendar.py and holidays.xml svn: r5964
This commit is contained in:
parent
1f6ab62684
commit
ac5d9287bd
@ -1,3 +1,9 @@
|
|||||||
|
2006-02-19 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/DisplayTabs.py: connect new EditSourceRef editor
|
||||||
|
* src/EditSourceRef.py: update data on save
|
||||||
|
* src/gramps.glade: hide src_edit_ref by default
|
||||||
|
* src/plugins/Makefile.am: Calendar.py and holidays.xml
|
||||||
|
|
||||||
2006-02-18 Don Allingham <don@gramps-project.org>
|
2006-02-18 Don Allingham <don@gramps-project.org>
|
||||||
* src/DisplayModels.py: display date properly
|
* src/DisplayModels.py: display date properly
|
||||||
* src/DisplayTabs.py: fix create_buttons default value
|
* src/DisplayTabs.py: fix create_buttons default value
|
||||||
|
@ -218,7 +218,7 @@ class ButtonTab(GrampsTab):
|
|||||||
self.tooltips = gtk.Tooltips()
|
self.tooltips = gtk.Tooltips()
|
||||||
self.create_buttons(share_button)
|
self.create_buttons(share_button)
|
||||||
|
|
||||||
def create_buttons(self,share_button=None):
|
def create_buttons(self,share_button=False):
|
||||||
"""
|
"""
|
||||||
Creates a button box consisting of three buttons, one for Add,
|
Creates a button box consisting of three buttons, one for Add,
|
||||||
one for Edit, and one for Delete. This button box is then appended
|
one for Edit, and one for Delete. This button box is then appended
|
||||||
@ -678,7 +678,7 @@ class SourceBackRefList(EmbeddedList):
|
|||||||
self.label.set_text("<b>%s</b>" % self.tab_name)
|
self.label.set_text("<b>%s</b>" % self.tab_name)
|
||||||
self.label.set_use_markup(True)
|
self.label.set_use_markup(True)
|
||||||
|
|
||||||
def create_buttons(self):
|
def create_buttons(self,share=False):
|
||||||
self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked)
|
self.edit_btn = SimpleButton(gtk.STOCK_EDIT, self.edit_button_clicked)
|
||||||
|
|
||||||
vbox = gtk.VBox()
|
vbox = gtk.VBox()
|
||||||
@ -1231,12 +1231,13 @@ class SourceEmbedList(EmbeddedList):
|
|||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
|
||||||
def edit_button_clicked(self,obj):
|
def edit_button_clicked(self,obj):
|
||||||
from Sources import SourceEditor
|
from EditSourceRef import EditSourceRef
|
||||||
|
|
||||||
sref = self.get_selected()
|
sref = self.get_selected()
|
||||||
|
src = self.dbstate.db.get_source_from_handle(sref.ref)
|
||||||
if sref:
|
if sref:
|
||||||
SourceEditor(self.dbstate, self.uistate, self.track, sref,
|
EditSourceRef(self.dbstate, self.uistate, self.track,
|
||||||
self.edit_callback)
|
src, sref, self.edit_callback)
|
||||||
|
|
||||||
def edit_callback(self,name):
|
def edit_callback(self,name):
|
||||||
self.changed = True
|
self.changed = True
|
||||||
@ -1454,7 +1455,6 @@ class EventRefModel(gtk.ListStore):
|
|||||||
|
|
||||||
def column_date(self,event_ref):
|
def column_date(self,event_ref):
|
||||||
event = self.db.get_event_from_handle(event_ref.ref)
|
event = self.db.get_event_from_handle(event_ref.ref)
|
||||||
print event, DateHandler.get_date(event)
|
|
||||||
return DateHandler.get_date(event)
|
return DateHandler.get_date(event)
|
||||||
|
|
||||||
def column_place(self,event_ref):
|
def column_place(self,event_ref):
|
||||||
|
@ -88,56 +88,86 @@ class EditSourceRef(DisplayState.ManagedWindow):
|
|||||||
|
|
||||||
self.ref_note_field = self.top.get_widget('eer_ref_note')
|
self.ref_note_field = self.top.get_widget('eer_ref_note')
|
||||||
self.role_combo = self.top.get_widget('eer_role_combo')
|
self.role_combo = self.top.get_widget('eer_role_combo')
|
||||||
self.date_field = self.top.get_widget("eer_date")
|
self.date_field = self.top.get_widget("date")
|
||||||
self.place_field = self.top.get_widget("eer_place")
|
|
||||||
self.cause_field = self.top.get_widget("eer_cause")
|
|
||||||
self.ev_note_field = self.top.get_widget("eer_ev_note")
|
|
||||||
self.type_combo = self.top.get_widget("eer_type_combo")
|
|
||||||
self.general_label = self.top.get_widget("eer_general_tab")
|
|
||||||
self.ok = self.top.get_widget('ok')
|
self.ok = self.top.get_widget('ok')
|
||||||
self.expander = self.top.get_widget("src_expander")
|
self.expander = self.top.get_widget("src_expander")
|
||||||
self.warning = self.top.get_widget("warn_box")
|
self.warning = self.top.get_widget("warn_box")
|
||||||
self.notebook = self.top.get_widget('notebook')
|
self.notebook_src = self.top.get_widget('notebook_src')
|
||||||
|
self.notebook_ref = self.top.get_widget('notebook_ref')
|
||||||
|
|
||||||
|
self.expander.set_expanded(True)
|
||||||
|
|
||||||
|
if self.source.handle:
|
||||||
|
self.warning.show_all()
|
||||||
|
else:
|
||||||
|
self.warning.hide()
|
||||||
|
|
||||||
if self.source:
|
if self.source:
|
||||||
self.source_added = False
|
self.source_added = False
|
||||||
if self.source_ref:
|
|
||||||
self.expander.set_expanded(False)
|
|
||||||
self.warning.show_all()
|
|
||||||
else:
|
else:
|
||||||
self.source = RelLib.Source()
|
self.source = RelLib.Source()
|
||||||
self.source.set_handle(self.db.create_id())
|
self.source.set_handle(self.db.create_id())
|
||||||
self.source_added = True
|
self.source_added = True
|
||||||
self.expander.set_expanded(True)
|
|
||||||
self.warning.hide()
|
|
||||||
|
|
||||||
if not self.source_ref:
|
if not self.source_ref:
|
||||||
self.source_ref = RelLib.SourceRef()
|
self.source_ref = RelLib.SourceRef()
|
||||||
self.source_ref.set_reference_handle(self.source.get_handle())
|
self.source_ref.set_reference_handle(self.source.get_handle())
|
||||||
|
|
||||||
self.privacy = PrivacyButton(self.top.get_widget('privacy'),
|
|
||||||
self.source_ref)
|
|
||||||
|
|
||||||
self.volume = MonitoredEntry(self.top.get_widget("volume"),
|
|
||||||
self.source.set_volume,
|
|
||||||
self.source.get_volume, False)
|
|
||||||
|
|
||||||
Utils.set_titles(self.window, self.top.get_widget('source_title'),
|
Utils.set_titles(self.window, self.top.get_widget('source_title'),
|
||||||
self.title)
|
self.title)
|
||||||
|
|
||||||
|
self.date = self.source_ref.get_date_object()
|
||||||
self.date_check = DateEdit.DateEdit(
|
self.date_check = DateEdit.DateEdit(
|
||||||
self.date, self.date_field,
|
self.source_ref.date, self.date_field,
|
||||||
self.top.get_widget("date_stat"), self.window)
|
self.top.get_widget("date_stat"), self.window)
|
||||||
|
|
||||||
self.date_field.set_text(_dd.display(self.date))
|
self.date_field.set_text(_dd.display(self.date))
|
||||||
|
|
||||||
self._create_tabbed_pages()
|
self._create_tabbed_pages()
|
||||||
|
self._setup_fields()
|
||||||
|
self._connect_signals()
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
def _add_page(self,page):
|
def _connect_signals(self):
|
||||||
self.notebook.insert_page(page)
|
self.top.get_widget('ok').connect('clicked',self.ok_clicked)
|
||||||
self.notebook.set_tab_label(page,page.get_tab_widget())
|
self.top.get_widget('cancel').connect('clicked',self.cancel_clicked)
|
||||||
|
|
||||||
|
def _setup_fields(self):
|
||||||
|
self.privacy = PrivacyButton(
|
||||||
|
self.top.get_widget('privacy'), self.source_ref)
|
||||||
|
|
||||||
|
self.volume = MonitoredEntry(
|
||||||
|
self.top.get_widget("volume"), self.source_ref.set_page,
|
||||||
|
self.source_ref.get_page, False)
|
||||||
|
|
||||||
|
self.gid = MonitoredEntry(
|
||||||
|
self.top.get_widget('gid'), self.source.set_gramps_id,
|
||||||
|
self.source.get_gramps_id,False)
|
||||||
|
|
||||||
|
self.title = MonitoredEntry(
|
||||||
|
self.top.get_widget('title'), self.source.set_title,
|
||||||
|
self.source.get_title,False)
|
||||||
|
|
||||||
|
self.abbrev = MonitoredEntry(
|
||||||
|
self.top.get_widget('abbrev'), self.source.set_abbreviation,
|
||||||
|
self.source.get_abbreviation,False)
|
||||||
|
|
||||||
|
self.author = MonitoredEntry(
|
||||||
|
self.top.get_widget('author'), self.source.set_author,
|
||||||
|
self.source.get_author,False)
|
||||||
|
|
||||||
|
self.pubinfo = MonitoredEntry(
|
||||||
|
self.top.get_widget('pub_info'), self.source.set_publication_info,
|
||||||
|
self.source.get_publication_info,False)
|
||||||
|
|
||||||
|
def _add_source_page(self,page):
|
||||||
|
self.notebook_src.insert_page(page)
|
||||||
|
self.notebook_src.set_tab_label(page,page.get_tab_widget())
|
||||||
|
return page
|
||||||
|
|
||||||
|
def _add_ref_page(self,page):
|
||||||
|
self.notebook_ref.insert_page(page)
|
||||||
|
self.notebook_ref.set_tab_label(page,page.get_tab_widget())
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def _create_tabbed_pages(self):
|
def _create_tabbed_pages(self):
|
||||||
@ -146,16 +176,19 @@ class EditSourceRef(DisplayState.ManagedWindow):
|
|||||||
window.
|
window.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
self.note_tab = self._add_source_page(NoteTab(
|
||||||
self.srcref_list = self._add_page(SourceEmbedList(
|
|
||||||
self.state,self.uistate, self.track,
|
|
||||||
self.source.source_list))
|
|
||||||
self.note_tab = self._add_page(NoteTab(
|
|
||||||
self.state, self.uistate, self.track,
|
self.state, self.uistate, self.track,
|
||||||
self.source.get_note_object()))
|
self.source.get_note_object()))
|
||||||
self.gallery_tab = self._add_page(GalleryTab(
|
self.gallery_tab = self._add_source_page(GalleryTab(
|
||||||
self.state, self.uistate, self.track,
|
self.state, self.uistate, self.track,
|
||||||
self.source.get_media_list()))
|
self.source.get_media_list()))
|
||||||
|
self.srcref_list = self._add_source_page(SourceBackRefList(
|
||||||
|
self.state,self.uistate, self.track,
|
||||||
|
self.db.find_backlink_handles(self.source.handle)))
|
||||||
|
|
||||||
|
self.comment_tab = self._add_ref_page(NoteTab(
|
||||||
|
self.state, self.uistate, self.track,
|
||||||
|
self.source_ref.get_note_object(),_('Comments')))
|
||||||
|
|
||||||
def build_menu_names(self,sourceref):
|
def build_menu_names(self,sourceref):
|
||||||
if self.source:
|
if self.source:
|
||||||
@ -174,12 +207,11 @@ class EditSourceRef(DisplayState.ManagedWindow):
|
|||||||
def on_help_clicked(self,obj):
|
def on_help_clicked(self,obj):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def on_ok_clicked(self,obj):
|
def ok_clicked(self,obj):
|
||||||
|
|
||||||
# first, save source if changed
|
# first, save source if changed
|
||||||
etype = self.type_selector.get_values()
|
# etype = self.type_selector.get_values()
|
||||||
eplace_obj = get_place(self.place_field,self.pmap,self.db)
|
# self.update_source(etype,self.date,eplace_obj)
|
||||||
self.update_source(etype,self.date,eplace_obj)
|
|
||||||
|
|
||||||
trans = self.db.transaction_begin()
|
trans = self.db.transaction_begin()
|
||||||
self.db.commit_source(self.source,trans)
|
self.db.commit_source(self.source,trans)
|
||||||
@ -187,28 +219,11 @@ class EditSourceRef(DisplayState.ManagedWindow):
|
|||||||
self.db.transaction_commit(trans,_("Add Source"))
|
self.db.transaction_commit(trans,_("Add Source"))
|
||||||
else:
|
else:
|
||||||
self.db.transaction_commit(trans,_("Modify Source"))
|
self.db.transaction_commit(trans,_("Modify Source"))
|
||||||
|
|
||||||
# then, set properties of the source_ref
|
|
||||||
self.source_ref.set_role(self.role_selector.get_values())
|
|
||||||
self.source_ref.set_privacy(self.ref_privacy.get_active())
|
|
||||||
self.close(None)
|
self.close(None)
|
||||||
|
|
||||||
if self.update:
|
if self.update:
|
||||||
self.update((self.source_ref,self.source))
|
self.update((self.source_ref,self.source))
|
||||||
|
|
||||||
def update_source(self,the_type,date,place):
|
def cancel_clicked(self,obj):
|
||||||
if place:
|
self.close()
|
||||||
if self.source.get_place_handle() != place.get_handle():
|
|
||||||
self.source.set_place_handle(place.get_handle())
|
|
||||||
else:
|
|
||||||
if self.source.get_place_handle():
|
|
||||||
self.source.set_place_handle("")
|
|
||||||
|
|
||||||
if self.source.get_type() != the_type:
|
|
||||||
self.source.set_type(the_type)
|
|
||||||
|
|
||||||
dobj = self.source.get_date_object()
|
|
||||||
|
|
||||||
if not dobj.is_equal(date):
|
|
||||||
self.source.set_date_object(date)
|
|
||||||
|
|
||||||
|
@ -17484,7 +17484,6 @@ Given name, Family name</property>
|
|||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget class="GtkDialog" id="source_ref_edit">
|
<widget class="GtkDialog" id="source_ref_edit">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="title" translatable="yes"></property>
|
<property name="title" translatable="yes"></property>
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||||
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
|
||||||
|
@ -11,6 +11,7 @@ pkgdata_PYTHON = \
|
|||||||
AncestorReport.py\
|
AncestorReport.py\
|
||||||
Ancestors.py\
|
Ancestors.py\
|
||||||
BookReport.py\
|
BookReport.py\
|
||||||
|
Calendar.py \
|
||||||
ChangeTypes.py\
|
ChangeTypes.py\
|
||||||
ChangeNames.py\
|
ChangeNames.py\
|
||||||
Check.py\
|
Check.py\
|
||||||
@ -94,7 +95,10 @@ GLADEFILES = \
|
|||||||
GRAPHICS = \
|
GRAPHICS = \
|
||||||
stock_link.png
|
stock_link.png
|
||||||
|
|
||||||
dist_pkgdata_DATA = $(GLADEFILES) $(GRAPHICS)
|
DATAFILES = \
|
||||||
|
holidays.xml
|
||||||
|
|
||||||
|
dist_pkgdata_DATA = $(GLADEFILES) $(GRAPHICS) $(DATAFILES)
|
||||||
|
|
||||||
GRAMPS_PY_MODPATH = "../:../docgen"
|
GRAMPS_PY_MODPATH = "../:../docgen"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user