* src/docgen/LaTeXDoc.py: Do not register as a book format (have to

support both text and graphics).
* src/plugins/AncestorChart.py:  Minor code cleanup.
* src/plugins/BookReport.py: Add context menus to the dialog.
* src/FamilyView.py: Properly refer to gtk stock items.
* src/gramps_main.py: Likewise.


svn: r2056
This commit is contained in:
Alex Roitman 2003-08-29 03:08:02 +00:00
parent 5b3b783049
commit 18454e96b5
6 changed files with 100 additions and 40 deletions

View File

@ -1,3 +1,11 @@
2003-08-28 Alex Roitman <shura@alex.neuro.umn.edu>
* src/docgen/LaTeXDoc.py: Do not register as a book format (have to
support both text and graphics).
* src/plugins/AncestorChart.py: Minor code cleanup.
* src/plugins/BookReport.py: Add context menus to the dialog.
* src/FamilyView.py: Properly refer to gtk stock items.
* src/gramps_main.py: Likewise.
2003-08-27 Don Allingham <dallingham@users.sourceforge.net> 2003-08-27 Don Allingham <dallingham@users.sourceforge.net>
* src/FamilyView.py: don't add columns to family view items * src/FamilyView.py: don't add columns to family view items
if they have already be added. if they have already be added.

View File

@ -197,9 +197,9 @@ class FamilyView:
back_sensitivity = self.parent.hindex > 0 back_sensitivity = self.parent.hindex > 0
fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history)
entries = [ entries = [
('gtk-go-back',self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity),
('gtk-go-forward',self.parent.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity),
('gtk-home',self.parent.on_home_clicked,1), (gtk.STOCK_HOME,self.parent.on_home_clicked,1),
(_("Add Bookmark"),self.parent.on_add_bookmark_activate,1), (_("Add Bookmark"),self.parent.on_add_bookmark_activate,1),
] ]
menu = gtk.Menu() menu = gtk.Menu()
@ -219,9 +219,9 @@ class FamilyView:
back_sensitivity = self.parent.hindex > 0 back_sensitivity = self.parent.hindex > 0
fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history)
entries = [ entries = [
('gtk-go-back',self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity),
('gtk-go-forward',self.parent.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity),
('gtk-home',self.parent.on_home_clicked,1), (gtk.STOCK_HOME,self.parent.on_home_clicked,1),
] ]
menu = gtk.Menu() menu = gtk.Menu()
menu.set_title(_('People Menu')) menu.set_title(_('People Menu'))
@ -255,9 +255,9 @@ class FamilyView:
back_sensitivity = self.parent.hindex > 0 back_sensitivity = self.parent.hindex > 0
fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history)
nav_entries = [ nav_entries = [
('gtk-go-back',self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity),
('gtk-go-forward',self.parent.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity),
('gtk-home',self.parent.on_home_clicked,1), (gtk.STOCK_HOME,self.parent.on_home_clicked,1),
(None,None,0), (None,None,0),
] ]
for stock_id,callback,sensitivity in nav_entries: for stock_id,callback,sensitivity in nav_entries:
@ -307,9 +307,9 @@ class FamilyView:
back_sensitivity = self.parent.hindex > 0 back_sensitivity = self.parent.hindex > 0
fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history)
nav_entries = [ nav_entries = [
('gtk-go-back',self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity),
('gtk-go-forward',self.parent.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity),
('gtk-home',self.parent.on_home_clicked,1), (gtk.STOCK_HOME,self.parent.on_home_clicked,1),
(None,None,0), (None,None,0),
] ]
for stock_id,callback,sensitivity in nav_entries: for stock_id,callback,sensitivity in nav_entries:
@ -756,9 +756,9 @@ class FamilyView:
back_sensitivity = self.parent.hindex > 0 back_sensitivity = self.parent.hindex > 0
fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history)
nav_entries = [ nav_entries = [
('gtk-go-back',self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity),
('gtk-go-forward',self.parent.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity),
('gtk-home',self.parent.on_home_clicked,1), (gtk.STOCK_HOME,self.parent.on_home_clicked,1),
(None,None,0), (None,None,0),
] ]
for stock_id,callback,sensitivity in nav_entries: for stock_id,callback,sensitivity in nav_entries:
@ -785,9 +785,9 @@ class FamilyView:
back_sensitivity = self.parent.hindex > 0 back_sensitivity = self.parent.hindex > 0
fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history) fwd_sensitivity = self.parent.hindex + 1 < len(self.parent.history)
nav_entries = [ nav_entries = [
('gtk-go-back',self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity),
('gtk-go-forward',self.parent.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity),
('gtk-home',self.parent.on_home_clicked,1), (gtk.STOCK_HOME,self.parent.on_home_clicked,1),
(None,None,0), (None,None,0),
] ]
for stock_id,callback,sensitivity in nav_entries: for stock_id,callback,sensitivity in nav_entries:

View File

@ -1,10 +1,10 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000 Donald N. Allingham # Copyright (C) 2000-2003 Donald N. Allingham
# #
# Modifications and feature additions: # Modifications and feature additions:
# 2002 Donald A. Peterson # 2002-2003 Donald A. Peterson
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -418,12 +418,3 @@ Plugins.register_text_doc(
style=0, style=0,
ext=".tex" ext=".tex"
) )
Plugins.register_book_doc(
name=_("LaTeX"),
classref=LaTeXDoc,
table=1,
paper=1,
style=0,
ext=".tex"
)

View File

@ -629,13 +629,13 @@ class Gramps:
back_sensitivity = self.hindex > 0 back_sensitivity = self.hindex > 0
fwd_sensitivity = self.hindex + 1 < len(self.history) fwd_sensitivity = self.hindex + 1 < len(self.history)
entries = [ entries = [
('gtk-go-back',self.back_clicked,back_sensitivity), (gtk.STOCK_GO_BACK,self.back_clicked,back_sensitivity),
('gtk-go-forward',self.fwd_clicked,fwd_sensitivity), (gtk.STOCK_GO_FORWARD,self.fwd_clicked,fwd_sensitivity),
('gtk-home',self.on_home_clicked,1), (gtk.STOCK_HOME,self.on_home_clicked,1),
(_("Add Bookmark"),self.on_add_bookmark_activate,1), (_("Add Bookmark"),self.on_add_bookmark_activate,1),
(None,None,0), (None,None,0),
('gtk-add', self.add_button_clicked,1), (gtk.STOCK_ADD, self.add_button_clicked,1),
('gtk-remove', self.remove_button_clicked,1), (gtk.STOCK_REMOVE, self.remove_button_clicked,1),
(_("Edit"), self.edit_button_clicked,1), (_("Edit"), self.edit_button_clicked,1),
] ]

View File

@ -135,7 +135,6 @@ class AncestorChart:
generation = generation + 3 generation = generation + 3
if self.standalone: if self.standalone:
self.doc.close() self.doc.close()
#self.doc.close()
def calc(self): def calc(self):
""" """
@ -248,7 +247,7 @@ class AncestorChartDialog(Report.DrawReportDialog):
def get_stylesheet_savefile(self): def get_stylesheet_savefile(self):
"""Where to save user defined styles for this report.""" """Where to save user defined styles for this report."""
return "ancestor_chart.xml" return _style_file
def get_report_generations(self): def get_report_generations(self):
"""Default to 10 generations, no page breaks.""" """Default to 10 generations, no page breaks."""

View File

@ -575,8 +575,8 @@ class BookReportSelector:
self.avail_tree = self.xml.get_widget("avail_tree") self.avail_tree = self.xml.get_widget("avail_tree")
self.book_tree = self.xml.get_widget("book_tree") self.book_tree = self.xml.get_widget("book_tree")
self.avail_tree.connect('button-press-event',self.av_double_click) self.avail_tree.connect('button-press-event',self.av_button_press)
self.book_tree.connect('button-press-event',self.bk_double_click) self.book_tree.connect('button-press-event',self.bk_button_press)
title_label = self.xml.get_widget('title') title_label = self.xml.get_widget('title')
Utils.set_titles(self.top,title_label,_('Book Report')) Utils.set_titles(self.top,title_label,_('Book Report'))
@ -753,19 +753,79 @@ class BookReportSelector:
item.set_style_name(opt_dlg.style_name) item.set_style_name(opt_dlg.style_name)
self.book.set_item(row,item) self.book.set_item(row,item)
def bk_double_click(self,obj,event): def bk_button_press(self,obj,event):
""" """
Double-click on the current book selection is the same as setup. Double-click on the current book selection is the same as setup.
Right click evokes the context menu.
""" """
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
self.on_setup_clicked(obj) self.on_setup_clicked(obj)
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
self.build_bk_context_menu()
def av_double_click(self,obj,event): def av_button_press(self,obj,event):
""" """
Double-click on the available selection is the same as add. Double-click on the available selection is the same as add.
Right click evokes the context menu.
""" """
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
self.on_add_clicked(obj) self.on_add_clicked(obj)
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
self.build_av_context_menu()
def build_bk_context_menu(self):
"""Builds the menu with item-centered and book-centered options."""
store,iter = self.bk_model.get_selected()
if iter:
sensitivity = 1
else:
sensitivity = 0
entries = [
(gtk.STOCK_GO_UP, self.on_up_clicked, sensitivity),
(gtk.STOCK_GO_DOWN, self.on_down_clicked, sensitivity),
(_("Setup"), self.on_setup_clicked, sensitivity),
(gtk.STOCK_REMOVE, self.on_remove_clicked, sensitivity),
(None,None,0),
(gtk.STOCK_CLEAR, self.on_clear_clicked, 1),
(gtk.STOCK_SAVE, self.on_save_clicked, 1),
(gtk.STOCK_OPEN, self.on_open_clicked, 1),
(_("Edit"), self.on_edit_clicked,1 ),
]
menu = gtk.Menu()
menu.set_title(_('Book Menu'))
for stock_id,callback,sensitivity in entries:
item = gtk.ImageMenuItem(stock_id)
if callback:
item.connect("activate",callback)
item.set_sensitive(sensitivity)
item.show()
menu.append(item)
menu.popup(None,None,None,0,0)
def build_av_context_menu(self):
"""Builds the menu with the single Add option."""
store,iter = self.av_model.get_selected()
if iter:
sensitivity = 1
else:
sensitivity = 0
entries = [
(gtk.STOCK_ADD, self.on_add_clicked, sensitivity),
]
menu = gtk.Menu()
menu.set_title(_('Available Items Menu'))
for stock_id,callback,sensitivity in entries:
item = gtk.ImageMenuItem(stock_id)
if callback:
item.connect("activate",callback)
item.set_sensitive(sensitivity)
item.show()
menu.append(item)
menu.popup(None,None,None,0,0)
def on_book_ok_clicked(self,obj): def on_book_ok_clicked(self,obj):
""" """
@ -843,6 +903,8 @@ class BookReportDialog(Report.ReportDialog):
self.selected_style.add_style( self.selected_style.add_style(
this_style_name,style_sheet.get_style(this_style_name)) this_style_name,style_sheet.get_style(this_style_name))
print self.selected_style.get_names()
def setup_style_frame(self): pass def setup_style_frame(self): pass
def setup_report_options_frame(self): pass def setup_report_options_frame(self): pass
def setup_other_frames(self): pass def setup_other_frames(self): pass