diff --git a/src/DataViews/_FamilyList.py b/src/DataViews/_FamilyList.py index 976ed257b..40ae8427f 100644 --- a/src/DataViews/_FamilyList.py +++ b/src/DataViews/_FamilyList.py @@ -36,7 +36,6 @@ import RelLib import PageView import DisplayModels import const -import Utils import Errors from QuestionDialog import QuestionDialog, ErrorDialog diff --git a/src/DataViews/_FamilyView.py b/src/DataViews/_FamilyView.py index a33afadd8..1bf3b9f10 100644 --- a/src/DataViews/_FamilyView.py +++ b/src/DataViews/_FamilyView.py @@ -4,8 +4,6 @@ # #------------------------------------------------------------------------- from gettext import gettext as _ -import gc -import re import cgi #------------------------------------------------------------------------- @@ -13,9 +11,7 @@ import cgi # GTK/Gnome modules # #------------------------------------------------------------------------- -import gobject import gtk -import pango #------------------------------------------------------------------------- # @@ -25,12 +21,13 @@ import pango import RelLib import PageView import NameDisplay -import Utils import DateHandler import ImgManip import Config import GrampsWidgets import Errors +import GrampsDb + from PluginUtils import ReportUtils _GenderCode = { @@ -397,7 +394,6 @@ class FamilyView(PageView.PersonNavView): pname = self.place_name(phandle) else: pname = None - date_str = DateHandler.displayer.display(dobj) value = { 'date' : DateHandler.displayer.display(dobj), @@ -473,7 +469,7 @@ class FamilyView(PageView.PersonNavView): family = self.dbstate.db.get_family_from_handle(family_handle) if not family: return - self.write_label("%s:" % _('Parents'), family, True), + self.write_label("%s:" % _('Parents'), family, True) self.write_person(_('Father'), family.get_father_handle()) if self.show_details: value = self.info_string(family.get_father_handle()) @@ -609,7 +605,6 @@ class FamilyView(PageView.PersonNavView): pname = self.place_name(phandle) else: pname = None - date_str = DateHandler.displayer.display(dobj) value = { 'date' : DateHandler.displayer.display(dobj), @@ -716,7 +711,8 @@ class FamilyView(PageView.PersonNavView): family = dialog.run() if family: - person = self.dbstate.db.get_person_from_handle(self.dbstate.active.handle) + active_handle = self.dbstate.active.handle + child = self.dbstate.db.get_person_from_handle(active_handle) GrampsDb.add_child_to_family(family, child, RelLib.ChildRef(), RelLib.ChildRef()) @@ -738,14 +734,12 @@ class FamilyView(PageView.PersonNavView): def delete_family(self, obj, event, handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: - import GrampsDb GrampsDb.remove_parent_from_family(self.dbstate.db, self.dbstate.active.handle, handle) def delete_parent_family(self, obj, event, handle): if event.type == gtk.gdk.BUTTON_PRESS and event.button == 1: - import GrampsDb GrampsDb.remove_child_from_family(self.dbstate.db, self.dbstate.active.handle, handle) diff --git a/src/DataViews/_MapView.py b/src/DataViews/_MapView.py index 19bb66d8b..ef798c616 100644 --- a/src/DataViews/_MapView.py +++ b/src/DataViews/_MapView.py @@ -27,7 +27,6 @@ #------------------------------------------------------------------------- from gettext import gettext as _ import gc -import re import logging import os import math @@ -48,7 +47,6 @@ import gtk.gdk # Gramps Modules # #------------------------------------------------------------------------- -import RelLib import PageView import const diff --git a/src/DataViews/_MediaView.py b/src/DataViews/_MediaView.py index e4377d364..2bac9e808 100644 --- a/src/DataViews/_MediaView.py +++ b/src/DataViews/_MediaView.py @@ -78,7 +78,7 @@ class MediaView(PageView.ListView): def define_actions(self): PageView.ListView.define_actions(self) self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, - '_Column Editor', callback=self.column_editor), + '_Column Editor', callback=self.column_editor) def column_editor(self,obj): import ColumnOrder @@ -145,11 +145,6 @@ class MediaView(PageView.ListView): ''' - def on_double_click(self,obj,event): - handle = self.first_selected() - if handle: - media_obj = self.dbstate.db.get_object_from_handle(handle) - def add(self,obj): """Add a new media object to the media list""" import AddMedia diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 4655c6307..5d98911b6 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -119,7 +119,7 @@ class PersonView(PageView.PersonNavView): self.add_toggle_action('Filter', None, '_Filter', None, None, self.filter_toggle) self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, - '_Column Editor', callback=self.column_editor), + '_Column Editor', callback=self.column_editor) def column_editor(self,obj): import ColumnOrder diff --git a/src/DataViews/_PlaceView.py b/src/DataViews/_PlaceView.py index 6967e8304..84577320b 100644 --- a/src/DataViews/_PlaceView.py +++ b/src/DataViews/_PlaceView.py @@ -85,7 +85,7 @@ class PlaceView(PageView.ListView): def define_actions(self): PageView.ListView.define_actions(self) self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, - '_Column Editor', callback=self.column_editor), + '_Column Editor', callback=self.column_editor) def column_editor(self,obj): import ColumnOrder diff --git a/src/DataViews/_RepositoryView.py b/src/DataViews/_RepositoryView.py index a482025bc..f3b149b05 100644 --- a/src/DataViews/_RepositoryView.py +++ b/src/DataViews/_RepositoryView.py @@ -90,7 +90,7 @@ class RepositoryView(PageView.ListView): def define_actions(self): PageView.ListView.define_actions(self) self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, - '_Column Editor', callback=self.column_editor), + '_Column Editor', callback=self.column_editor) def column_editor(self,obj): import ColumnOrder diff --git a/src/DataViews/_SourceView.py b/src/DataViews/_SourceView.py index fd8efa97a..8732480a8 100644 --- a/src/DataViews/_SourceView.py +++ b/src/DataViews/_SourceView.py @@ -84,7 +84,7 @@ class SourceView(PageView.ListView): def define_actions(self): PageView.ListView.define_actions(self) self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, - '_Column Editor', callback=self.column_editor), + '_Column Editor', callback=self.column_editor) def column_editor(self,obj): import ColumnOrder diff --git a/src/Editors/_EditAttribute.py b/src/Editors/_EditAttribute.py index 3062e15b5..91807ffb1 100644 --- a/src/Editors/_EditAttribute.py +++ b/src/Editors/_EditAttribute.py @@ -77,9 +77,6 @@ class EditAttribute(EditSecondary): self.alist = data_list EditSecondary.__init__(self, state, uistate, track, attrib, callback) - def attribute_list(self): - return Utils.personal_attributes - def _local_init(self): self.top = gtk.glade.XML(const.gladeFile, "attr_edit","gramps") self.define_top_level(self.top.get_widget("attr_edit"), @@ -120,8 +117,8 @@ class EditAttribute(EditSecondary): self.obj.get_note_object())) notebook.show_all() - vbox = self.top.get_widget('vbox').pack_start(notebook,True) - + self.top.get_widget('vbox').pack_start(notebook,True) + def build_menu_names(self, attrib): if not attrib: label = _("New Attribute") @@ -162,7 +159,4 @@ class EditFamilyAttribute(EditAttribute): """ EditAttribute.__init__(self, state, uistate, track, attrib, title, data_list, callback) - - def attribute_list(self): - return Utils.family_attributes diff --git a/src/Editors/_EditEvent.py b/src/Editors/_EditEvent.py index 4e32c4c09..c238d26c7 100644 --- a/src/Editors/_EditEvent.py +++ b/src/Editors/_EditEvent.py @@ -212,7 +212,7 @@ class EditEvent(EditPrimary): if self.callback: self.callback(self.obj) - self.close(obj) + self.close() def data_has_changed(self): if self.db.readonly: diff --git a/src/Editors/_EditEventRef.py b/src/Editors/_EditEventRef.py index 88b55ab88..819d16797 100644 --- a/src/Editors/_EditEventRef.py +++ b/src/Editors/_EditEventRef.py @@ -221,9 +221,6 @@ class EditFamilyEventRef(EditEventRef): self.commit_event = self.db.commit_family_event self.add_event = self.db.add_family_event - def get_roles(self): - return Utils.event_roles - def get_custom_events(self): return [ RelLib.EventType((RelLib.EventType.CUSTOM,val)) \ for val in self.dbstate.db.get_family_event_types()] diff --git a/src/Editors/_EditLdsOrd.py b/src/Editors/_EditLdsOrd.py index 6bf46f45f..f971e02d1 100644 --- a/src/Editors/_EditLdsOrd.py +++ b/src/Editors/_EditLdsOrd.py @@ -212,7 +212,7 @@ class EditLdsOrd(EditSecondary): self.obj.get_note_object())) notebook.show_all() - vbox = self.top.get_widget('vbox').pack_start(notebook,True) + self.top.get_widget('vbox').pack_start(notebook,True) def select_parents_clicked(self, obj): from SelectFamily import SelectFamily @@ -380,7 +380,7 @@ class EditFamilyLdsOrd(EditSecondary): self.obj.get_note_object())) notebook.show_all() - vbox = self.top.get_widget('vbox').pack_start(notebook,True) + self.top.get_widget('vbox').pack_start(notebook,True) def build_menu_names(self, attrib): label = _("LDS Ordinance") diff --git a/src/Editors/_EditLocation.py b/src/Editors/_EditLocation.py index cbef36450..ca1c07448 100644 --- a/src/Editors/_EditLocation.py +++ b/src/Editors/_EditLocation.py @@ -108,5 +108,5 @@ class EditLocation(EditSecondary): def save(self,*obj): if self.callback: self.callback(self.obj) - self.close(obj) + self.close() diff --git a/src/Editors/_EditMediaRef.py b/src/Editors/_EditMediaRef.py index 50278f1f4..8c25858f7 100644 --- a/src/Editors/_EditMediaRef.py +++ b/src/Editors/_EditMediaRef.py @@ -46,7 +46,6 @@ import Utils import RelLib import Mime import ImgManip -import DisplayState import GrampsDisplay from DisplayTabs import * diff --git a/src/Editors/_EditPlace.py b/src/Editors/_EditPlace.py index 902e1d413..272b1b2e3 100644 --- a/src/Editors/_EditPlace.py +++ b/src/Editors/_EditPlace.py @@ -205,7 +205,7 @@ class EditPlace(EditPrimary): self.db.transaction_commit(trans, _("Edit Place (%s)") % self.obj.get_title()) - self.close(obj) + self.close() #------------------------------------------------------------------------- # diff --git a/src/Editors/_EditReference.py b/src/Editors/_EditReference.py index 1784fffaf..2ef01b00c 100644 --- a/src/Editors/_EditReference.py +++ b/src/Editors/_EditReference.py @@ -137,6 +137,7 @@ class EditReference(ManagedWindow.ManagedWindow): button.connect('clicked',self.close_window) def define_help_button(self,button,tag): + import GrampsDisplay button.connect('clicked', lambda x: GrampsDisplay.help(tag)) def _cleanup_on_exit(self): diff --git a/src/Editors/_EditRepoRef.py b/src/Editors/_EditRepoRef.py index 725982a68..b2c28493a 100644 --- a/src/Editors/_EditRepoRef.py +++ b/src/Editors/_EditRepoRef.py @@ -48,7 +48,6 @@ import gtk.glade import const import Utils import RelLib -import DisplayState from DisplayTabs import * from GrampsWidgets import * @@ -86,24 +85,29 @@ class EditRepoRef(EditReference): self.source_ref.get_call_number, False) self.gid = MonitoredEntry( - self.top.get_widget('gid'), self.source.set_gramps_id, - self.source.get_gramps_id,False) + self.top.get_widget('gid'), + self.source.set_gramps_id, + self.source.get_gramps_id, + False) self.title = MonitoredEntry( - self.top.get_widget('repo_name'), self.source.set_name, - self.source.get_name,False) + self.top.get_widget('repo_name'), + self.source.set_name, + self.source.get_name, + False) self.type_selector = MonitoredType( self.top.get_widget("media_type"), - self.source_ref.set_media_type, self.source_ref.get_media_type, + self.source_ref.set_media_type, + self.source_ref.get_media_type, dict(Utils.source_media_types), RelLib.RepoRef.CUSTOM) - self.media_type_selector = MonitoredType( + self.media_type_selector = MonitoredDataType( self.top.get_widget("repo_type"), - self.source.set_type, self.source.get_type, - dict(Utils.repository_types), - RelLib.Repository.CUSTOM) + self.source.set_type, + self.source.get_type + ) def _create_tabbed_pages(self): """ diff --git a/src/Editors/_EditRepository.py b/src/Editors/_EditRepository.py index 5b8cff5c7..bdd394415 100644 --- a/src/Editors/_EditRepository.py +++ b/src/Editors/_EditRepository.py @@ -126,13 +126,12 @@ class EditRepository(EditPrimary): trans = self.db.transaction_begin() if self.obj.get_handle() == None: - handle = self.db.add_repository(self.obj,trans) + self.db.add_repository(self.obj,trans) else: self.db.commit_repository(self.obj,trans) - handle = self.obj.get_handle() msg = _("Edit Repository (%s)") % self.obj.get_name() self.db.transaction_commit(trans,msg) - self.close(obj) + self.close() class DelRepositoryQuery: def __init__(self,repository,db,sources): diff --git a/src/Editors/_EditSource.py b/src/Editors/_EditSource.py index 61c6c90c5..f6c99aad9 100644 --- a/src/Editors/_EditSource.py +++ b/src/Editors/_EditSource.py @@ -152,6 +152,8 @@ class EditSource(EditPrimary): def save(self,*obj): if self.object_is_empty(): + from QuestionDialog import ErrorDialog + ErrorDialog(_("Cannot save source"), _("No data exists for this source. Please " "enter data or cancel the edit.")) @@ -164,7 +166,7 @@ class EditSource(EditPrimary): self.db.commit_source(self.obj,trans) self.db.transaction_commit(trans, _("Edit Source (%s)") % self.obj.get_title()) - self.close(obj) + self.close() class DelSrcQuery: def __init__(self,source,db,the_lists): diff --git a/src/Editors/_EditUrl.py b/src/Editors/_EditUrl.py index 34dec3175..3760aecf8 100644 --- a/src/Editors/_EditUrl.py +++ b/src/Editors/_EditUrl.py @@ -42,7 +42,6 @@ import gtk.glade #------------------------------------------------------------------------- import const import Utils -import RelLib from _EditSecondary import EditSecondary from GrampsWidgets import * diff --git a/src/ManagedWindow.py b/src/ManagedWindow.py index a08d6bf37..1efde2772 100644 --- a/src/ManagedWindow.py +++ b/src/ManagedWindow.py @@ -331,7 +331,7 @@ class ManagedWindow: self.window.set_transient_for(self.parent_window) self.window.show() - def close(self,obj=None,obj2=None): + def close(self): """ Close itself. diff --git a/src/PluginUtils/Makefile.am b/src/PluginUtils/Makefile.am index 2a15ccfe0..e214369e0 100644 --- a/src/PluginUtils/Makefile.am +++ b/src/PluginUtils/Makefile.am @@ -15,6 +15,7 @@ pkgdata_PYTHON = \ _StyleEditor.py\ _PluginMgr.py\ _PaperMenu.py\ + _PluginStatus.py\ _Plugins.py pkgpyexecdir = @pkgpyexecdir@/PluginUtils