8061: FeatureRequest: Add citation in citationtreeview: automatically select source
This commit is contained in:
parent
3c1671d09f
commit
2630bebae0
@ -420,19 +420,15 @@ class CitationTreeView(ListView):
|
|||||||
citation = self.dbstate.db.get_citation_from_handle(handle)
|
citation = self.dbstate.db.get_citation_from_handle(handle)
|
||||||
if (not source and not citation) or (source and citation):
|
if (not source and not citation) or (source and citation):
|
||||||
raise ValueError("selection must be either source or citation")
|
raise ValueError("selection must be either source or citation")
|
||||||
if source:
|
if not source:
|
||||||
try:
|
source = self.dbstate.db.get_source_from_handle(citation.get_reference_handle())
|
||||||
EditCitation(self.dbstate, self.uistate, [],
|
try:
|
||||||
Citation(), source)
|
EditCitation(self.dbstate, self.uistate, [],
|
||||||
except WindowActiveError:
|
Citation(), source)
|
||||||
from gramps.gui.dialog import WarningDialog
|
except WindowActiveError:
|
||||||
WarningDialog(_("Cannot share this reference"),
|
from gramps.gui.dialog import WarningDialog
|
||||||
self.__blocked_text())
|
WarningDialog(_("Cannot share this reference"),
|
||||||
else:
|
self.__blocked_text())
|
||||||
msg = _("Cannot add citation.")
|
|
||||||
msg2 = _("In order to add a citation to an existing source, "
|
|
||||||
" you must select a source.")
|
|
||||||
ErrorDialog(msg, msg2)
|
|
||||||
#
|
#
|
||||||
def remove(self, obj):
|
def remove(self, obj):
|
||||||
self.remove_selected_objects()
|
self.remove_selected_objects()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user