* src/docgen/KwordDoc.py: Remove unused latin_utf8 import.
* src/plugins/FilterEditor.py: Convert to new API. * src/plugins/DesBrowse.py: Convert to new API. svn: r5258
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2005-09-30 Alex Roitman <shura@gramps-project.org>
|
||||
* src/docgen/KwordDoc.py: Remove unused latin_utf8 import.
|
||||
* src/plugins/FilterEditor.py: Convert to new API.
|
||||
* src/plugins/DesBrowse.py: Convert to new API.
|
||||
|
||||
2005-09-29 Don Allingham <don@gramps-project.org>
|
||||
* src/docgen/AbiWord2Doc.py: fix latin encoding issues
|
||||
* src/docgen/KwordDoc.py: fix latin encoding issues
|
||||
|
@ -21,7 +21,6 @@
|
||||
# $Id$
|
||||
|
||||
import BaseDoc
|
||||
from latin_utf8 import latin_to_utf8
|
||||
|
||||
import time
|
||||
import cStringIO
|
||||
|
@ -37,6 +37,7 @@ from gettext import gettext as _
|
||||
#------------------------------------------------------------------------
|
||||
import Utils
|
||||
import NameDisplay
|
||||
import Tool
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -53,17 +54,12 @@ from gnome import help_display
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
def runTool(database,person,callback,parent=None):
|
||||
try:
|
||||
DesBrowse(database,person,callback,parent)
|
||||
except:
|
||||
import DisplayTrace
|
||||
DisplayTrace.DisplayTrace()
|
||||
class DesBrowse(Tool.Tool):
|
||||
|
||||
def __init__(self,db,person,options_class,name,callback=None,parent=None):
|
||||
Tool.Tool.__init__(self,db,person,options_class,name)
|
||||
|
||||
class DesBrowse:
|
||||
def __init__(self,database,person,callback,parent):
|
||||
self.active = person
|
||||
self.db = database
|
||||
self.callback = callback
|
||||
self.parent = parent
|
||||
self.win_key = self
|
||||
@ -153,6 +149,19 @@ class DesBrowse:
|
||||
self.callback(epo,val)
|
||||
self.make_new_model()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class DesBrowseOptions(Tool.ToolOptions):
|
||||
"""
|
||||
Defines options and provides handling interface.
|
||||
"""
|
||||
|
||||
def __init__(self,name,person_id=None):
|
||||
Tool.ToolOptions.__init__(self,name,person_id)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
@ -161,10 +170,13 @@ class DesBrowse:
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
runTool,
|
||||
_("Interactive descendant browser"),
|
||||
category=_("Analysis and Exploration"),
|
||||
name = 'dbrowse',
|
||||
category = Tool.TOOL_ANAL,
|
||||
tool_class = DesBrowse,
|
||||
options_class = DesBrowseOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Interactive descendant browser"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "dallingham@users.sourceforge.net",
|
||||
description=_("Provides a browsable hierarchy based on the active person"),
|
||||
author_name="Donald N. Allingham",
|
||||
author_email="dallingham@users.sourceforge.net"
|
||||
)
|
||||
|
@ -53,7 +53,13 @@ import AutoComp
|
||||
import ListModel
|
||||
import Utils
|
||||
import SelectPerson
|
||||
import Tool
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Constants
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_name2list = {
|
||||
_('Personal event:') : const.personal_events,
|
||||
_('Family event:') : const.family_events,
|
||||
@ -916,16 +922,35 @@ class ShowResults:
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def CustomFilterEditor(database,person,callback,parent=None):
|
||||
FilterEditor(const.custom_filters,database,parent)
|
||||
class CustomFilterEditor(Tool.Tool):
|
||||
def __init__(self,db,person,options_class,name,callback=None,parent=None):
|
||||
Tool.Tool.__init__(self,db,person,options_class,name)
|
||||
|
||||
FilterEditor(const.custom_filters,db,parent)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def SystemFilterEditor(database,person,callback,parent=None):
|
||||
FilterEditor(const.system_filters,database,parent)
|
||||
class SystemFilterEditor(Tool.Tool):
|
||||
def __init__(self,db,person,options_class,name,callback=None,parent=None):
|
||||
Tool.Tool.__init__(self,db,person,options_class,name)
|
||||
|
||||
FilterEditor(const.system_filters,database,parent)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
class FilterEditorOptions(Tool.ToolOptions):
|
||||
"""
|
||||
Defines options and provides handling interface.
|
||||
"""
|
||||
|
||||
def __init__(self,name,person_id=None):
|
||||
Tool.ToolOptions.__init__(self,name,person_id)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -935,9 +960,15 @@ def SystemFilterEditor(database,person,callback,parent=None):
|
||||
from PluginMgr import register_tool
|
||||
|
||||
register_tool(
|
||||
CustomFilterEditor,
|
||||
_("Custom Filter Editor"),
|
||||
category=_("Utilities"),
|
||||
name = 'sfilted',
|
||||
category = Tool.TOOL_UTILS,
|
||||
tool_class = CustomFilterEditor,
|
||||
options_class = FilterEditorOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("Custom Filter Editor"),
|
||||
status = _("Beta"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "dallingham@users.sourceforge.net",
|
||||
description=_("The Custom Filter Editor builds custom "
|
||||
"filters that can be used to select people "
|
||||
"included in reports, exports, and other utilities.")
|
||||
@ -948,9 +979,15 @@ if ((os.path.exists(const.system_filters) and
|
||||
(os.path.exists(os.path.dirname(const.system_filters)) and
|
||||
os.access(os.path.dirname(const.system_filters), os.W_OK))):
|
||||
register_tool(
|
||||
SystemFilterEditor,
|
||||
_("System Filter Editor"),
|
||||
category=_("Utilities"),
|
||||
name = 'sfilted',
|
||||
category = Tool.TOOL_UTILS,
|
||||
tool_class = SystemFilterEditor,
|
||||
options_class = FilterEditorOptions,
|
||||
modes = Tool.MODE_GUI,
|
||||
translated_name = _("System Filter Editor"),
|
||||
status = _("Beta"),
|
||||
author_name = "Donald N. Allingham",
|
||||
author_email = "dallingham@users.sourceforge.net",
|
||||
description=_("The System Filter Editor builds custom "
|
||||
"filters that can be used by anyone on the system "
|
||||
"to select people included in reports, exports, "
|
||||
|
Reference in New Issue
Block a user