Removed FindDoc - no longer needed with the new plugin system for document generators

svn: r735
This commit is contained in:
Don Allingham 2002-01-29 02:09:29 +00:00
parent e778c05d14
commit 2f413a6059

View File

@ -1,214 +0,0 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
from TextDoc import *
from DrawDoc import *
import gtk
import Config
from intl import gettext
_ = gettext
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
_OpenOffice = _("OpenOffice")
_AbiWord = _("AbiWord")
_PDF = _("PDF")
_HTML = _("HTML")
_LATEX = _("LaTeX")
_KWord = _("KWord")
_RTF = _("RTF")
_has_tables = 1
_no_tables = 0
_paper = 1
_template = 0
_styles = 1
_no_styles = 0
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
_textdoc = []
_drawdoc = []
try:
import OpenOfficeDoc
_textdoc.append((_OpenOffice, _has_tables, _paper, _styles))
except:
import traceback
traceback.print_exc()
try:
import OpenDrawDoc
_drawdoc.append(_OpenOffice)
except:
import traceback
traceback.print_exc()
try:
import AbiWordDoc
_textdoc.append((_AbiWord, _no_tables, _paper, _styles))
except:
import traceback
traceback.print_exc()
try:
import PdfDoc
_textdoc.append((_PDF, _has_tables, _paper, _styles))
except ImportError:
pass
except:
import traceback
traceback.print_exc()
try:
import PdfDrawDoc
_drawdoc.append(_PDF)
except ImportError:
pass
except:
import traceback
traceback.print_exc()
try:
import HtmlDoc
_textdoc.append((_HTML, _has_tables, _template, _styles))
except:
import traceback
traceback.print_exc()
try:
import KwordDoc
_textdoc.append((_KWord, _no_tables, _paper, _styles))
except:
import traceback
traceback.print_exc()
try:
import RTFDoc
_textdoc.append((_RTF, _has_tables, _paper, _styles))
except:
import traceback
traceback.print_exc()
try:
import LaTeXDoc
_textdoc.append((_LATEX, _no_tables, _paper, _no_styles))
except:
import traceback
traceback.print_exc()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def get_text_doc_menu(main_menu,tables,callback,obj=None):
index = 0
myMenu = gtk.GtkMenu()
for item in _textdoc:
if tables and item[1] == 0:
continue
name = item[0]
menuitem = gtk.GtkMenuItem(name)
menuitem.set_data("name",name)
menuitem.set_data("styles",item[3])
menuitem.set_data("paper",item[2])
menuitem.set_data("obj",obj)
if callback:
menuitem.connect("activate",callback)
menuitem.show()
myMenu.append(menuitem)
if name == Config.output_preference:
myMenu.set_active(index)
callback(menuitem)
index = index + 1
main_menu.set_menu(myMenu)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def get_draw_doc_menu(main_menu,callback=None,obj=None):
index = 0
myMenu = gtk.GtkMenu()
for name in _drawdoc:
menuitem = gtk.GtkMenuItem(name)
menuitem.set_data("name",name)
menuitem.set_data("obj",obj)
if callback:
menuitem.connect("activate",callback)
menuitem.show()
myMenu.append(menuitem)
if name == Config.output_preference:
myMenu.set_active(index)
if callback:
callback(menuitem)
index = index + 1
main_menu.set_menu(myMenu)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def make_text_doc(styles,name,paper,orien,template):
if name == _OpenOffice:
return OpenOfficeDoc.OpenOfficeDoc(styles,paper,orien)
elif name == _AbiWord:
return AbiWordDoc.AbiWordDoc(styles,paper,orien)
elif name == _PDF:
return PdfDoc.PdfDoc(styles,paper,orien)
elif name == _LATEX:
return LaTeXDoc.LaTeXDoc(styles,paper,orien)
elif name == _KWord:
return KwordDoc.KwordDoc(styles,paper,orien)
elif name == _RTF:
return RTFDoc.RTFDoc(styles,paper,orien)
else:
return HtmlDoc.HtmlDoc(styles,template)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def make_draw_doc(styles,name,paper,orien):
if name == _OpenOffice:
return OpenDrawDoc.OpenDrawDoc(styles,paper,orien)
else:
return PdfDrawDoc.PdfDrawDoc(styles,paper,orien)