Graphical output format can be selected, RelDataBase renamed to GrampsDB
svn: r788
This commit is contained in:
parent
f28b883186
commit
daf542039b
@ -137,8 +137,9 @@ attr_name = ""
|
|||||||
status_bar = 0
|
status_bar = 0
|
||||||
toolbar = 2
|
toolbar = 2
|
||||||
calendar = 0
|
calendar = 0
|
||||||
paper_preference = None
|
paper_preference = ""
|
||||||
output_preference = None
|
output_preference = ""
|
||||||
|
goutput_preference = ""
|
||||||
lastnamegen = None
|
lastnamegen = None
|
||||||
report_dir = "./"
|
report_dir = "./"
|
||||||
web_dir = "./"
|
web_dir = "./"
|
||||||
@ -212,6 +213,7 @@ def loadConfig(call):
|
|||||||
global _callback
|
global _callback
|
||||||
global paper_preference
|
global paper_preference
|
||||||
global output_preference
|
global output_preference
|
||||||
|
global goutput_preference
|
||||||
global lastnamegen
|
global lastnamegen
|
||||||
global report_dir
|
global report_dir
|
||||||
global web_dir
|
global web_dir
|
||||||
@ -254,6 +256,7 @@ def loadConfig(call):
|
|||||||
dateEntry = get_int("/gramps/config/dateEntry")
|
dateEntry = get_int("/gramps/config/dateEntry")
|
||||||
paper_preference = get_string("/gramps/config/paperPreference")
|
paper_preference = get_string("/gramps/config/paperPreference")
|
||||||
output_preference = get_string("/gramps/config/outputPreference")
|
output_preference = get_string("/gramps/config/outputPreference")
|
||||||
|
goutput_preference = get_string("/gramps/config/goutputPreference")
|
||||||
lastnamegen = get_int("/gramps/config/surnameGuessing")
|
lastnamegen = get_int("/gramps/config/surnameGuessing")
|
||||||
_name_format = get_int("/gramps/config/nameFormat")
|
_name_format = get_int("/gramps/config/nameFormat")
|
||||||
|
|
||||||
@ -298,7 +301,10 @@ def loadConfig(call):
|
|||||||
paper_preference = "Letter"
|
paper_preference = "Letter"
|
||||||
|
|
||||||
if output_preference == None:
|
if output_preference == None:
|
||||||
output_preference = "OpenOffice"
|
output_preference = ""
|
||||||
|
|
||||||
|
if goutput_preference == None:
|
||||||
|
goutput_preference = ""
|
||||||
|
|
||||||
if iprefix == None:
|
if iprefix == None:
|
||||||
iprefix = "I"
|
iprefix = "I"
|
||||||
@ -571,6 +577,7 @@ class GrampsPreferences:
|
|||||||
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.ofmt = self.top.get_widget("output_format")
|
||||||
|
self.gfmt = self.top.get_widget("graphical_format")
|
||||||
|
|
||||||
self.build_tree()
|
self.build_tree()
|
||||||
self.build()
|
self.build()
|
||||||
@ -688,8 +695,6 @@ class GrampsPreferences:
|
|||||||
lastnamegen_obj.set_menu(menu)
|
lastnamegen_obj.set_menu(menu)
|
||||||
|
|
||||||
menu = gtk.GtkMenu()
|
menu = gtk.GtkMenu()
|
||||||
choice = 0
|
|
||||||
|
|
||||||
choice = 0
|
choice = 0
|
||||||
index = 0
|
index = 0
|
||||||
for name in Plugins.get_text_doc_list():
|
for name in Plugins.get_text_doc_list():
|
||||||
@ -704,6 +709,21 @@ class GrampsPreferences:
|
|||||||
menu.set_active(choice)
|
menu.set_active(choice)
|
||||||
self.ofmt.set_menu(menu)
|
self.ofmt.set_menu(menu)
|
||||||
|
|
||||||
|
menu = gtk.GtkMenu()
|
||||||
|
choice = 0
|
||||||
|
index = 0
|
||||||
|
for name in Plugins.get_draw_doc_list():
|
||||||
|
if name == goutput_preference:
|
||||||
|
choice = index
|
||||||
|
item = gtk.GtkMenuItem(name)
|
||||||
|
item.set_data(DATA,name)
|
||||||
|
item.connect("activate", self.on_format_toggled)
|
||||||
|
item.show()
|
||||||
|
menu.append(item)
|
||||||
|
index = index + 1
|
||||||
|
menu.set_active(choice)
|
||||||
|
self.gfmt.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()
|
||||||
for index in range(0,len(_date_format_list)):
|
for index in range(0,len(_date_format_list)):
|
||||||
@ -884,6 +904,7 @@ class GrampsPreferences:
|
|||||||
global hide_altnames
|
global hide_altnames
|
||||||
global paper_preference
|
global paper_preference
|
||||||
global output_preference
|
global output_preference
|
||||||
|
global goutput_preference
|
||||||
global show_detail
|
global show_detail
|
||||||
global report_dir
|
global report_dir
|
||||||
global web_dir
|
global web_dir
|
||||||
@ -911,7 +932,8 @@ class GrampsPreferences:
|
|||||||
index_visible = self.top.get_widget("show_child_id").get_active()
|
index_visible = self.top.get_widget("show_child_id").get_active()
|
||||||
hide_altnames = self.top.get_widget("display_altnames").get_active()
|
hide_altnames = self.top.get_widget("display_altnames").get_active()
|
||||||
paper_obj = self.top.get_widget("paper_size").get_menu().get_active()
|
paper_obj = self.top.get_widget("paper_size").get_menu().get_active()
|
||||||
output_obj = self.top.get_widget("output_format").get_menu().get_active()
|
output_obj = self.ofmt.get_menu().get_active()
|
||||||
|
goutput_obj = self.gfmt.get_menu().get_active()
|
||||||
|
|
||||||
if self.top.get_widget("stat1").get_active():
|
if self.top.get_widget("stat1").get_active():
|
||||||
status_bar = 0
|
status_bar = 0
|
||||||
@ -957,6 +979,7 @@ class GrampsPreferences:
|
|||||||
|
|
||||||
paper_preference = paper_obj.get_data(DATA)
|
paper_preference = paper_obj.get_data(DATA)
|
||||||
output_preference = output_obj.get_data(DATA)
|
output_preference = output_obj.get_data(DATA)
|
||||||
|
goutput_preference = goutput_obj.get_data(DATA)
|
||||||
|
|
||||||
set_bool("/gramps/config/UseTabs",usetabs)
|
set_bool("/gramps/config/UseTabs",usetabs)
|
||||||
set_bool("/gramps/config/UseLDS",uselds)
|
set_bool("/gramps/config/UseLDS",uselds)
|
||||||
@ -978,6 +1001,7 @@ class GrampsPreferences:
|
|||||||
set_string("/gramps/config/DisplayAttrName",attr_name)
|
set_string("/gramps/config/DisplayAttrName",attr_name)
|
||||||
set_string("/gramps/config/paperPreference",paper_preference)
|
set_string("/gramps/config/paperPreference",paper_preference)
|
||||||
set_string("/gramps/config/outputPreference",output_preference)
|
set_string("/gramps/config/outputPreference",output_preference)
|
||||||
|
set_string("/gramps/config/goutputPreference",goutput_preference)
|
||||||
set_bool("/gramps/config/autoLoad",autoload)
|
set_bool("/gramps/config/autoLoad",autoload)
|
||||||
set_int("/gramps/config/autoSaveInterval",autosave_int)
|
set_int("/gramps/config/autoSaveInterval",autosave_int)
|
||||||
|
|
||||||
|
@ -506,6 +506,19 @@ def get_text_doc_list():
|
|||||||
l.append(item[0])
|
l.append(item[0])
|
||||||
return l
|
return l
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# get_draw_doc_list
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
def get_draw_doc_list():
|
||||||
|
|
||||||
|
l = []
|
||||||
|
_drawdoc.sort()
|
||||||
|
for item in _drawdoc:
|
||||||
|
l.append(item[0])
|
||||||
|
return l
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# get_draw_doc_menu
|
# get_draw_doc_menu
|
||||||
@ -523,7 +536,7 @@ def get_draw_doc_menu(main_menu,callback=None,obj=None):
|
|||||||
menuitem.connect("activate",callback)
|
menuitem.connect("activate",callback)
|
||||||
menuitem.show()
|
menuitem.show()
|
||||||
myMenu.append(menuitem)
|
myMenu.append(menuitem)
|
||||||
if name == Config.output_preference:
|
if name == Config.goutput_preference:
|
||||||
myMenu.set_active(index)
|
myMenu.set_active(index)
|
||||||
if callback:
|
if callback:
|
||||||
callback(menuitem)
|
callback(menuitem)
|
||||||
|
@ -205,7 +205,7 @@ if __name__ == "__main__":
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
database = RelDataBase()
|
database = GrampsDB()
|
||||||
t1 = time.time()
|
t1 = time.time()
|
||||||
if len(sys.argv) > 2:
|
if len(sys.argv) > 2:
|
||||||
profile.run('loadData(database, sys.argv[1])')
|
profile.run('loadData(database, sys.argv[1])')
|
||||||
|
@ -1636,11 +1636,11 @@ class SourceRef:
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class RelDataBase:
|
class GrampsDB:
|
||||||
"""Gramps database object"""
|
"""Gramps database object"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""creates a new RelDataBase"""
|
"""creates a new GrampsDB"""
|
||||||
self.iprefix = "I%d"
|
self.iprefix = "I%d"
|
||||||
self.sprefix = "S%d"
|
self.sprefix = "S%d"
|
||||||
self.oprefix = "O%d"
|
self.oprefix = "O%d"
|
||||||
@ -1683,7 +1683,7 @@ class RelDataBase:
|
|||||||
self.fprefix = val + "%d"
|
self.fprefix = val + "%d"
|
||||||
|
|
||||||
def new(self):
|
def new(self):
|
||||||
"""initializes the RelDataBase to empty values"""
|
"""initializes the GrampsDB to empty values"""
|
||||||
|
|
||||||
# eliminate memory reference cycles for 1.5.2 garbage collection
|
# eliminate memory reference cycles for 1.5.2 garbage collection
|
||||||
for f in self.familyMap.values():
|
for f in self.familyMap.values():
|
||||||
|
@ -2029,7 +2029,7 @@ def main(arg):
|
|||||||
msg = _("You are running GRAMPS as the 'root' user.\nThis account is not meant for normal application use.")
|
msg = _("You are running GRAMPS as the 'root' user.\nThis account is not meant for normal application use.")
|
||||||
gnome.ui.GnomeWarningDialog(msg)
|
gnome.ui.GnomeWarningDialog(msg)
|
||||||
|
|
||||||
database = RelDataBase()
|
database = GrampsDB()
|
||||||
|
|
||||||
Plugins.load_plugins(const.docgenDir)
|
Plugins.load_plugins(const.docgenDir)
|
||||||
Plugins.load_plugins(os.path.expanduser("~/.gramps/docgen"))
|
Plugins.load_plugins(os.path.expanduser("~/.gramps/docgen"))
|
||||||
|
@ -2214,8 +2214,8 @@
|
|||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkTable</class>
|
<class>GtkTable</class>
|
||||||
<name>table8</name>
|
<name>graphical_format</name>
|
||||||
<rows>4</rows>
|
<rows>5</rows>
|
||||||
<columns>3</columns>
|
<columns>3</columns>
|
||||||
<homogeneous>False</homogeneous>
|
<homogeneous>False</homogeneous>
|
||||||
<row_spacing>0</row_spacing>
|
<row_spacing>0</row_spacing>
|
||||||
@ -2224,7 +2224,7 @@
|
|||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<name>label26</name>
|
<name>label26</name>
|
||||||
<label>Preferred Output Format</label>
|
<label>Preferred Text Format</label>
|
||||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
<wrap>False</wrap>
|
<wrap>False</wrap>
|
||||||
<xalign>1</xalign>
|
<xalign>1</xalign>
|
||||||
@ -2260,8 +2260,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>0</left_attach>
|
<left_attach>0</left_attach>
|
||||||
<right_attach>1</right_attach>
|
<right_attach>1</right_attach>
|
||||||
<top_attach>1</top_attach>
|
<top_attach>2</top_attach>
|
||||||
<bottom_attach>2</bottom_attach>
|
<bottom_attach>3</bottom_attach>
|
||||||
<xpad>5</xpad>
|
<xpad>5</xpad>
|
||||||
<ypad>5</ypad>
|
<ypad>5</ypad>
|
||||||
<xexpand>False</xexpand>
|
<xexpand>False</xexpand>
|
||||||
@ -2286,8 +2286,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>0</left_attach>
|
<left_attach>0</left_attach>
|
||||||
<right_attach>1</right_attach>
|
<right_attach>1</right_attach>
|
||||||
<top_attach>2</top_attach>
|
<top_attach>3</top_attach>
|
||||||
<bottom_attach>3</bottom_attach>
|
<bottom_attach>4</bottom_attach>
|
||||||
<xpad>5</xpad>
|
<xpad>5</xpad>
|
||||||
<ypad>5</ypad>
|
<ypad>5</ypad>
|
||||||
<xexpand>False</xexpand>
|
<xexpand>False</xexpand>
|
||||||
@ -2312,8 +2312,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>0</left_attach>
|
<left_attach>0</left_attach>
|
||||||
<right_attach>1</right_attach>
|
<right_attach>1</right_attach>
|
||||||
<top_attach>3</top_attach>
|
<top_attach>4</top_attach>
|
||||||
<bottom_attach>4</bottom_attach>
|
<bottom_attach>5</bottom_attach>
|
||||||
<xpad>5</xpad>
|
<xpad>5</xpad>
|
||||||
<ypad>5</ypad>
|
<ypad>5</ypad>
|
||||||
<xexpand>False</xexpand>
|
<xexpand>False</xexpand>
|
||||||
@ -2336,8 +2336,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>1</left_attach>
|
<left_attach>1</left_attach>
|
||||||
<right_attach>3</right_attach>
|
<right_attach>3</right_attach>
|
||||||
<top_attach>2</top_attach>
|
<top_attach>3</top_attach>
|
||||||
<bottom_attach>3</bottom_attach>
|
<bottom_attach>4</bottom_attach>
|
||||||
<xpad>5</xpad>
|
<xpad>5</xpad>
|
||||||
<ypad>5</ypad>
|
<ypad>5</ypad>
|
||||||
<xexpand>True</xexpand>
|
<xexpand>True</xexpand>
|
||||||
@ -2378,8 +2378,8 @@
|
|||||||
<child>
|
<child>
|
||||||
<left_attach>1</left_attach>
|
<left_attach>1</left_attach>
|
||||||
<right_attach>3</right_attach>
|
<right_attach>3</right_attach>
|
||||||
<top_attach>3</top_attach>
|
<top_attach>4</top_attach>
|
||||||
<bottom_attach>4</bottom_attach>
|
<bottom_attach>5</bottom_attach>
|
||||||
<xpad>5</xpad>
|
<xpad>5</xpad>
|
||||||
<ypad>5</ypad>
|
<ypad>5</ypad>
|
||||||
<xexpand>True</xexpand>
|
<xexpand>True</xexpand>
|
||||||
@ -2438,6 +2438,55 @@
|
|||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<items>Letter
|
<items>Letter
|
||||||
A4
|
A4
|
||||||
|
</items>
|
||||||
|
<initial_choice>0</initial_choice>
|
||||||
|
<child>
|
||||||
|
<left_attach>1</left_attach>
|
||||||
|
<right_attach>2</right_attach>
|
||||||
|
<top_attach>2</top_attach>
|
||||||
|
<bottom_attach>3</bottom_attach>
|
||||||
|
<xpad>5</xpad>
|
||||||
|
<ypad>5</ypad>
|
||||||
|
<xexpand>False</xexpand>
|
||||||
|
<yexpand>False</yexpand>
|
||||||
|
<xshrink>False</xshrink>
|
||||||
|
<yshrink>False</yshrink>
|
||||||
|
<xfill>True</xfill>
|
||||||
|
<yfill>False</yfill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkLabel</class>
|
||||||
|
<name>label100</name>
|
||||||
|
<label>Preferred Graphical Format</label>
|
||||||
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
|
<wrap>False</wrap>
|
||||||
|
<xalign>1</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>0</xpad>
|
||||||
|
<ypad>0</ypad>
|
||||||
|
<child>
|
||||||
|
<left_attach>0</left_attach>
|
||||||
|
<right_attach>1</right_attach>
|
||||||
|
<top_attach>1</top_attach>
|
||||||
|
<bottom_attach>2</bottom_attach>
|
||||||
|
<xpad>5</xpad>
|
||||||
|
<ypad>5</ypad>
|
||||||
|
<xexpand>False</xexpand>
|
||||||
|
<yexpand>False</yexpand>
|
||||||
|
<xshrink>False</xshrink>
|
||||||
|
<yshrink>False</yshrink>
|
||||||
|
<xfill>True</xfill>
|
||||||
|
<yfill>False</yfill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkOptionMenu</class>
|
||||||
|
<name>graphical_format</name>
|
||||||
|
<can_focus>True</can_focus>
|
||||||
|
<items>
|
||||||
</items>
|
</items>
|
||||||
<initial_choice>0</initial_choice>
|
<initial_choice>0</initial_choice>
|
||||||
<child>
|
<child>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user