Moved NameDisplay into BasicUtils.

svn: r8197
This commit is contained in:
Richard Taylor 2007-02-20 20:56:48 +00:00
parent 5cdb7b7336
commit 70e12c490e
56 changed files with 72 additions and 62 deletions

View File

@ -38,7 +38,13 @@ import re
#
#-------------------------------------------------------------------------
from RelLib import Name
import Config
try:
import Config
WITH_GRAMPS_CONFIG=True
except ImportError:
WITH_GRAMPS_CONFIG=False
#-------------------------------------------------------------------------
#
@ -93,13 +99,17 @@ class NameDisplay:
]
def __init__(self):
global WITH_GRAMP_CONFIG
self.name_formats = {}
self.set_name_format(self.STANDARD_FORMATS)
self.default_format = Config.get(Config.NAME_FORMAT)
if self.default_format == 0:
self.default_format = Name.LNFN
Config.set(Config.NAME_FORMAT,self.default_format)
if WITH_GRAMPS_CONFIG:
self.default_format = Config.get(Config.NAME_FORMAT)
if self.default_format == 0:
self.default_format = Name.LNFN
Config.set(Config.NAME_FORMAT,self.default_format)
else:
self.default_format = 1
self.set_default_format(self.default_format)

View File

@ -54,7 +54,7 @@ import gtk
#
#-------------------------------------------------------------------------
import GrampsDisplay
import NameDisplay
from BasicUtils import NameDisplay
import ListModel
import Utils

View File

@ -51,7 +51,7 @@ except:
#-------------------------------------------------------------------------
import RelLib
import PageView
import NameDisplay
from BasicUtils import NameDisplay
import Utils
import DateHandler
import ImgManip
@ -949,7 +949,7 @@ class PedigreeView(PageView.PersonNavView):
# Add navigation arrows
if lst[0]:
#l = gtk.Button("")
#l = gtk.Button("‚óÄ")
l=gtk.Button()
l.add(gtk.Arrow(gtk.ARROW_LEFT, gtk.SHADOW_IN))
childlist = find_children(self.dbstate.db,lst[0][0])
@ -960,7 +960,7 @@ class PedigreeView(PageView.PersonNavView):
l.set_sensitive(False)
ymid = int(math.floor(ymax/2))
table_widget.attach(l,0,1,ymid,ymid+1,0,0,0,0)
#l = gtk.Button("")
#l = gtk.Button("‚ñ∂")
l = gtk.Button()
l.add(gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_IN))
if lst[1]:

View File

@ -53,7 +53,7 @@ from gtk.gdk import ACTION_COPY, BUTTON1_MASK
import RelLib
from DisplayModels import PeopleModel
import PageView
import NameDisplay
from BasicUtils import NameDisplay
import Utils
import QuestionDialog
import TreeTips

View File

@ -48,7 +48,7 @@ import gtk
#-------------------------------------------------------------------------
import RelLib
import PageView
import NameDisplay
from BasicUtils import NameDisplay
import DateHandler
import ImgManip
import Config

View File

@ -43,7 +43,7 @@ import gtk
import const
import ToolTips
import GrampsLocale
import NameDisplay
from BasicUtils import NameDisplay
import RelLib
from _BaseModel import BaseModel

View File

@ -60,7 +60,7 @@ import gtk
#-------------------------------------------------------------------------
import const
from RelLib import *
import NameDisplay
from BasicUtils import NameDisplay
import DateHandler
import ToolTips
import GrampsLocale

View File

@ -51,7 +51,7 @@ import gtk
#-------------------------------------------------------------------------
import GrampsDb
import Config
import NameDisplay
from BasicUtils import NameDisplay
import const
import ManagedWindow

View File

@ -35,7 +35,7 @@ from gettext import gettext as _
# GRAMPS classes
#
#-------------------------------------------------------------------------
import NameDisplay
from BasicUtils import NameDisplay
import Utils
#-------------------------------------------------------------------------

View File

@ -33,7 +33,7 @@ import gtk
#
#-------------------------------------------------------------------------
import DateHandler
import NameDisplay
from BasicUtils import NameDisplay
import Utils
#-------------------------------------------------------------------------

View File

@ -32,7 +32,7 @@ import gtk
# GRAMPS classes
#
#-------------------------------------------------------------------------
import NameDisplay
from BasicUtils import NameDisplay
#-------------------------------------------------------------------------
#

View File

@ -32,7 +32,7 @@ import gtk
# GRAMPS classes
#
#-------------------------------------------------------------------------
import NameDisplay
from BasicUtils import NameDisplay
#-------------------------------------------------------------------------
#

View File

@ -50,7 +50,7 @@ import gtk
#-------------------------------------------------------------------------
import const
import Utils
import NameDisplay
from BasicUtils import NameDisplay
import RelLib
import Config
import Errors

View File

@ -50,7 +50,7 @@ import gtk.glade
import const
import Config
import RelLib
import NameDisplay
from BasicUtils import NameDisplay
import LdsUtils
from _EditSecondary import EditSecondary

View File

@ -42,7 +42,7 @@ import gtk.glade
import const
import Config
import Utils
import NameDisplay
from BasicUtils import NameDisplay
from _EditSecondary import EditSecondary
from DisplayTabs import SourceEmbedList,NoteTab

View File

@ -53,7 +53,7 @@ import Utils
import Mime
import RelLib
import GrampsWidgets
import NameDisplay
from BasicUtils import NameDisplay
import Errors
from GrampsDb import set_birth_death_index

View File

@ -46,7 +46,7 @@ import gtk.glade
#-------------------------------------------------------------------------
import const
import Config
import NameDisplay
from BasicUtils import NameDisplay
from _EditSecondary import EditSecondary
from DisplayTabs import SourceEmbedList, NoteTab

View File

@ -24,7 +24,7 @@ from gettext import gettext as _
import ManagedWindow
import DateHandler
import NameDisplay
from BasicUtils import NameDisplay
import Config
import GrampsDisplay
from QuestionDialog import SaveDialog

View File

@ -60,7 +60,7 @@ import RelLib
from Filters import Rules
import AutoComp
from Selectors import selector_factory
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
import Utils
import ManagedWindow

View File

@ -56,7 +56,7 @@ import gtk
#-------------------------------------------------------------------------
import const
import ManagedWindow
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
import Utils
#-------------------------------------------------------------------------

View File

@ -41,7 +41,7 @@ import gtk
#-------------------------------------------------------------------------
import Config
import DateHandler
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
from RelLib import Name
import ManagedWindow
from GrampsWidgets import *

View File

@ -113,7 +113,7 @@ LOG = logging.getLogger(".GedcomImport")
#-------------------------------------------------------------------------
import Errors
import RelLib
import NameDisplay
from BasicUtils import NameDisplay
import Utils
import Mime
import LdsUtils

View File

@ -41,7 +41,7 @@ from GrampsDb._GrampsBSDDB import GrampsBSDDB
from QuestionDialog import ErrorDialog
from Errors import HandleError
from BasicUtils import UpdateCallback
import NameDisplay
from BasicUtils import NameDisplay
#-------------------------------------------------------------------------
#

View File

@ -51,7 +51,7 @@ import RelLib
import const
import Utils
import DateHandler
import NameDisplay
from BasicUtils import NameDisplay
from GrampsDb._GrampsDbConst import \
PERSON_KEY,FAMILY_KEY,SOURCE_KEY,EVENT_KEY,\
MEDIA_KEY,PLACE_KEY,REPOSITORY_KEY

View File

@ -54,7 +54,7 @@ import _GedcomInfo as GedcomInfo
import Errors
import ansel_utf8
import Utils
import NameDisplay
from BasicUtils import NameDisplay
from QuestionDialog import *
from BasicUtils import UpdateCallback

View File

@ -43,7 +43,7 @@ import pango
#-------------------------------------------------------------------------
import RelLib
from ReportBase import ReportUtils
import NameDisplay
from BasicUtils import NameDisplay
import const
import DateHandler
import QuestionDialog

View File

@ -35,7 +35,7 @@ __revision__ = "$Revision$"
#
#-------------------------------------------------------------------
import gtk
import NameDisplay
from BasicUtils import NameDisplay
DISABLED = -1

View File

@ -28,7 +28,7 @@ import gtk
import gobject
from RelLib import Person
from NameDisplay import displayer
from BasicUtils.NameDisplay import displayer
display_name = displayer.display
from _ObjectFrameBase import ObjectFrameBase

View File

@ -27,7 +27,7 @@ import gobject
from TreeViews import PersonTreeView
import NameDisplay
from BasicUtils import NameDisplay
from _TreeFrameBase import TreeFrameBase

View File

@ -214,7 +214,7 @@ class BookMarkView(PageView):
self.dbstate, self.uistate, bookmarks, self.goto_handle)
def add_bookmark(self, obj):
import NameDisplay
from BasicUtils import NameDisplay
if self.dbstate.active:
self.bookmarks.add(self.dbstate.active.get_handle())

View File

@ -43,7 +43,7 @@ log = logging.getLogger(".")
import const
import Utils
from Filters import CustomFilters
import NameDisplay
from BasicUtils import NameDisplay
import Errors
from _Options import *

View File

@ -25,7 +25,7 @@ from gettext import gettext as _
import const
import gtk
import NameDisplay
from BasicUtils import NameDisplay
import ListModel
import ManagedWindow

View File

@ -40,7 +40,7 @@ import gtk
# gramps modules
#
#-------------------------------------------------------------------------
import NameDisplay
from BasicUtils import NameDisplay
import BaseDoc
import Utils

View File

@ -24,7 +24,7 @@ import logging
log = logging.getLogger(".")
import PluginUtils
import NameDisplay
from BasicUtils import NameDisplay
import Utils
import BaseDoc
from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK

View File

@ -42,7 +42,7 @@ import cStringIO
#------------------------------------------------------------------------
import DateHandler
import RelLib
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
from QuestionDialog import WarningDialog
import BaseDoc

View File

@ -40,7 +40,7 @@ import locale
#
#-------------------------------------------------------------------------
from RelLib import Date
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
#-------------------------------------------------------------------------
#

View File

@ -41,7 +41,7 @@ __version__ = "$Revision$"
#
#------------------------------------------------------------------------
import NameDisplay
from BasicUtils import NameDisplay
import DateHandler
import RelLib

View File

@ -7,7 +7,7 @@ import gtk
from Models import \
PersonTreeModel, PersonListModel, PersonFilterModel
from NameDisplay import displayer
from BasicUtils.NameDisplay import displayer
from RelLib import Event
import DateHandler
import Utils

View File

@ -46,7 +46,7 @@ import gtk
#
#-------------------------------------------------------------------------
import Mime
import NameDisplay
from BasicUtils import NameDisplay
import RelLib
import Errors
from QuestionDialog import WarningDialog

View File

@ -73,7 +73,7 @@ import Navigation
import TipOfDay
import Bookmarks
import RecentFiles
import NameDisplay
from BasicUtils import NameDisplay
import GrampsWidgets
import UndoHistory
from DbLoader import DbLoader

View File

@ -47,7 +47,7 @@ from SubstKeywords import SubstKeywords
from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
import NameDisplay
from BasicUtils import NameDisplay
pt2cm = ReportUtils.pt2cm
cm2pt = ReportUtils.cm2pt

View File

@ -40,7 +40,7 @@ from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc
import NameDisplay
from BasicUtils import NameDisplay
from RelLib import ChildRefType

View File

@ -49,7 +49,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \
import BaseDoc
import RelLib
from DateHandler import displayer as _dd
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
#------------------------------------------------------------------------
#

View File

@ -61,7 +61,7 @@ import ManagedWindow
from PluginUtils import Tool, register_tool
from QuestionDialog import OkDialog, MissingMediaDialog
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
#-------------------------------------------------------------------------
#

View File

@ -49,7 +49,7 @@ pt2cm = ReportUtils.pt2cm
import BaseDoc
from SubstKeywords import SubstKeywords
import Errors
import NameDisplay
from BasicUtils import NameDisplay
#------------------------------------------------------------------------
#

View File

@ -43,7 +43,7 @@ import gtk.glade
# GRAMPS modules
#
#------------------------------------------------------------------------
import NameDisplay
from BasicUtils import NameDisplay
from PluginUtils import Tool, register_tool
import GrampsDisplay
import ManagedWindow

View File

@ -49,7 +49,7 @@ from ReportBase import Report, ReportOptions, ReportUtils, \
pt2cm = ReportUtils.pt2cm
cm2pt = ReportUtils.cm2pt
from SubstKeywords import SubstKeywords
import NameDisplay
from BasicUtils import NameDisplay
#------------------------------------------------------------------------
#

View File

@ -42,7 +42,7 @@ import BaseDoc
import Errors
import Sort
from QuestionDialog import ErrorDialog
import NameDisplay
from BasicUtils import NameDisplay
import DateHandler
#------------------------------------------------------------------------

View File

@ -52,7 +52,7 @@ import BaseDoc
import Utils
import DateHandler
from QuestionDialog import ErrorDialog
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
#------------------------------------------------------------------------
#

View File

@ -52,7 +52,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \
import BaseDoc
import const
import DateHandler
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
from QuestionDialog import ErrorDialog
#------------------------------------------------------------------------

View File

@ -42,7 +42,7 @@ import BaseDoc
import DateHandler
import Utils
from TransUtils import sgettext as _
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
#------------------------------------------------------------------------
#

View File

@ -46,7 +46,7 @@ import gtk.glade
import RelLib
import Utils
import soundex
import NameDisplay
from BasicUtils import NameDisplay
import ListModel
import Errors
from Merge import PersonCompare

View File

@ -49,7 +49,7 @@ import DateHandler
from PluginUtils import register_report
from ReportBase import Report, ReportUtils, ReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
from QuestionDialog import WarningDialog
#------------------------------------------------------------------------

View File

@ -75,7 +75,7 @@ import Utils
import ImgManip
import GrampsLocale
from QuestionDialog import ErrorDialog, WarningDialog
from NameDisplay import displayer as _nd
from BasicUtils.NameDisplay import displayer as _nd
from DateHandler import displayer as _dd
#------------------------------------------------------------------------

View File

@ -43,7 +43,7 @@ import gtk.glade
#
#-------------------------------------------------------------------------
import RelLib
import NameDisplay
from BasicUtils import NameDisplay
import ManagedWindow
import ListModel
import DateHandler

View File

@ -51,7 +51,7 @@ import BaseDoc
from Filters import GenericFilter, Rules
import Sort
from QuestionDialog import ErrorDialog
import NameDisplay
from BasicUtils import NameDisplay
#------------------------------------------------------------------------
#