Output format preferences in config dialog is now dynamic

svn: r787
This commit is contained in:
Don Allingham 2002-02-21 06:09:20 +00:00
parent 8bc2e4813d
commit f28b883186
6 changed files with 24 additions and 19 deletions

View File

@ -28,6 +28,7 @@ import string
import os import os
import PaperMenu import PaperMenu
import Plugins
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -569,6 +570,8 @@ class GrampsPreferences:
self.apply = self.top.get_widget("apply") self.apply = self.top.get_widget("apply")
self.tree = self.top.get_widget("tree") self.tree = self.top.get_widget("tree")
self.panel = self.top.get_widget("panel") self.panel = self.top.get_widget("panel")
self.ofmt = self.top.get_widget("output_format")
self.build_tree() self.build_tree()
self.build() self.build()
self.build_ext() self.build_ext()
@ -684,13 +687,12 @@ class GrampsPreferences:
menu.set_active(lastnamegen) menu.set_active(lastnamegen)
lastnamegen_obj.set_menu(menu) lastnamegen_obj.set_menu(menu)
output_obj = self.top.get_widget("output_format")
menu = gtk.GtkMenu() menu = gtk.GtkMenu()
choice = 0 choice = 0
choice = 0 choice = 0
index = 0 index = 0
for name in const.output_formats: for name in Plugins.get_text_doc_list():
if name == output_preference: if name == output_preference:
choice = index choice = index
item = gtk.GtkMenuItem(name) item = gtk.GtkMenuItem(name)
@ -700,7 +702,7 @@ class GrampsPreferences:
menu.append(item) menu.append(item)
index = index + 1 index = index + 1
menu.set_active(choice) menu.set_active(choice)
output_obj.set_menu(menu) self.ofmt.set_menu(menu)
date_option = self.top.get_widget("date_format") date_option = self.top.get_widget("date_format")
date_menu = gtk.GtkMenu() date_menu = gtk.GtkMenu()

View File

@ -276,7 +276,7 @@ def load_plugins(dir):
a = __import__(plugin) a = __import__(plugin)
_success.append(a) _success.append(a)
except: except:
print _("Note: failed to load the plugin module: %s") % plugin print _("Note: %s support could not be loaded") % plugin
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -493,6 +493,19 @@ def get_text_doc_menu(main_menu,tables,callback,obj=None):
index = index + 1 index = index + 1
main_menu.set_menu(myMenu) main_menu.set_menu(myMenu)
#-------------------------------------------------------------------------
#
# get_text_doc_menu
#
#-------------------------------------------------------------------------
def get_text_doc_list():
l = []
_textdoc.sort()
for item in _textdoc:
l.append(item[0])
return l
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# get_draw_doc_menu # get_draw_doc_menu

View File

@ -373,11 +373,11 @@ class ReportDialog:
this report. This menu will be generated based upon the type this report. This menu will be generated based upon the type
of document (text, draw, graph, etc. - a subclass), whether or of document (text, draw, graph, etc. - a subclass), whether or
not the document requires table support, etc.""" not the document requires table support, etc."""
assert 0, _("The make_doc_menu function must be overridden.") assert 0, "The make_doc_menu function must be overridden."
def make_document(self): def make_document(self):
"""Create a document of the type selected by the user.""" """Create a document of the type selected by the user."""
assert 0, _("The make_document function must be overridden.") assert 0, "The make_document function must be overridden."
def doc_type_changed(self, obj): def doc_type_changed(self, obj):
"""This routine is called when the user selects a new file """This routine is called when the user selects a new file
@ -850,7 +850,7 @@ class ReportDialog:
routine should either write the data directly to the file, or routine should either write the data directly to the file, or
better yet, should create a subclass of a Report that will better yet, should create a subclass of a Report that will
write the data to a file.""" write the data to a file."""
assert 0, _("The make_report function must be overridden.") assert 0, "The make_report function must be overridden."
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #

View File

@ -110,13 +110,6 @@ unknown = _("unknown")
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
output_formats = [
"OpenOffice",
"AbiWord",
"PDF",
"HTML"
]
childRelations = { childRelations = {
_("Birth") : "Birth", _("Birth") : "Birth",
_("Adopted") : "Adopted", _("Adopted") : "Adopted",

View File

@ -824,7 +824,7 @@
<handler>on_apply_filter_clicked</handler> <handler>on_apply_filter_clicked</handler>
<last_modification_time>Thu, 06 Sep 2001 23:02:43 GMT</last_modification_time> <last_modification_time>Thu, 06 Sep 2001 23:02:43 GMT</last_modification_time>
</signal> </signal>
<editable>False</editable> <editable>True</editable>
<text_visible>True</text_visible> <text_visible>True</text_visible>
<text_max_length>0</text_max_length> <text_max_length>0</text_max_length>
<text></text> <text></text>

View File

@ -2413,10 +2413,7 @@
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>output_format</name> <name>output_format</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items>OpenOffice <items>
HTML
PDF
AbiWord
</items> </items>
<initial_choice>0</initial_choice> <initial_choice>0</initial_choice>
<child> <child>