Output format preferences in config dialog is now dynamic
svn: r787
This commit is contained in:
parent
8bc2e4813d
commit
f28b883186
@ -28,6 +28,7 @@ import string
|
||||
import os
|
||||
|
||||
import PaperMenu
|
||||
import Plugins
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -569,6 +570,8 @@ class GrampsPreferences:
|
||||
self.apply = self.top.get_widget("apply")
|
||||
self.tree = self.top.get_widget("tree")
|
||||
self.panel = self.top.get_widget("panel")
|
||||
self.ofmt = self.top.get_widget("output_format")
|
||||
|
||||
self.build_tree()
|
||||
self.build()
|
||||
self.build_ext()
|
||||
@ -684,13 +687,12 @@ class GrampsPreferences:
|
||||
menu.set_active(lastnamegen)
|
||||
lastnamegen_obj.set_menu(menu)
|
||||
|
||||
output_obj = self.top.get_widget("output_format")
|
||||
menu = gtk.GtkMenu()
|
||||
choice = 0
|
||||
|
||||
choice = 0
|
||||
index = 0
|
||||
for name in const.output_formats:
|
||||
for name in Plugins.get_text_doc_list():
|
||||
if name == output_preference:
|
||||
choice = index
|
||||
item = gtk.GtkMenuItem(name)
|
||||
@ -700,7 +702,7 @@ class GrampsPreferences:
|
||||
menu.append(item)
|
||||
index = index + 1
|
||||
menu.set_active(choice)
|
||||
output_obj.set_menu(menu)
|
||||
self.ofmt.set_menu(menu)
|
||||
|
||||
date_option = self.top.get_widget("date_format")
|
||||
date_menu = gtk.GtkMenu()
|
||||
|
@ -276,7 +276,7 @@ def load_plugins(dir):
|
||||
a = __import__(plugin)
|
||||
_success.append(a)
|
||||
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
|
||||
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
|
||||
|
@ -373,11 +373,11 @@ class ReportDialog:
|
||||
this report. This menu will be generated based upon the type
|
||||
of document (text, draw, graph, etc. - a subclass), whether or
|
||||
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):
|
||||
"""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):
|
||||
"""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
|
||||
better yet, should create a subclass of a Report that will
|
||||
write the data to a file."""
|
||||
assert 0, _("The make_report function must be overridden.")
|
||||
assert 0, "The make_report function must be overridden."
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -110,13 +110,6 @@ unknown = _("unknown")
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
output_formats = [
|
||||
"OpenOffice",
|
||||
"AbiWord",
|
||||
"PDF",
|
||||
"HTML"
|
||||
]
|
||||
|
||||
childRelations = {
|
||||
_("Birth") : "Birth",
|
||||
_("Adopted") : "Adopted",
|
||||
|
@ -824,7 +824,7 @@
|
||||
<handler>on_apply_filter_clicked</handler>
|
||||
<last_modification_time>Thu, 06 Sep 2001 23:02:43 GMT</last_modification_time>
|
||||
</signal>
|
||||
<editable>False</editable>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
<text></text>
|
||||
|
@ -2413,10 +2413,7 @@
|
||||
<class>GtkOptionMenu</class>
|
||||
<name>output_format</name>
|
||||
<can_focus>True</can_focus>
|
||||
<items>OpenOffice
|
||||
HTML
|
||||
PDF
|
||||
AbiWord
|
||||
<items>
|
||||
</items>
|
||||
<initial_choice>0</initial_choice>
|
||||
<child>
|
||||
|
Loading…
Reference in New Issue
Block a user