* src/plugins.glade: Switch from GtkDialog to GtkWindow (prevents it

from always being on top under metacity). Remove extra button.
* src/Plugins.py (PluginDialog.__init__): Provide custom labels and
tooltips for reports (Generate) and tools (Run);
(ReportPlugins.__init__, ToolPlugins.__init__): call PluginDialog
with appropriate labels and tooltips.
* src/Report.py (BareReportDialog.__init__): Change button back to OK.
* src/plugins/rel_ru.py (getallancestors): Replace with existing
apply_filter from Relationship.py.
* src/gramps.glade: Correct tooltips in Family Views (make parents an
active family).


svn: r2249
This commit is contained in:
Alex Roitman 2003-10-14 02:22:14 +00:00
parent 647000c15a
commit f9107a17f4
6 changed files with 144 additions and 142 deletions

View File

@ -1,6 +1,17 @@
2003-10-13 Alex Roitman <shura@alex.neuro.umn.edu>
* configure.in, configure: Change version and release numbers.
* TODO: Remove completed items.
* src/plugins.glade: Switch from GtkDialog to GtkWindow (prevents it
from always being on top under metacity). Remove extra button.
* src/Plugins.py (PluginDialog.__init__): Provide custom labels and
tooltips for reports (Generate) and tools (Run);
(ReportPlugins.__init__, ToolPlugins.__init__): call PluginDialog
with appropriate labels and tooltips.
* src/Report.py (BareReportDialog.__init__): Change button back to OK.
* src/plugins/rel_ru.py (getallancestors): Replace with existing
apply_filter from Relationship.py.
* src/gramps.glade: Correct tooltips in Family Views (make parents an
active family).
2003-10-12 Alex Roitman <shura@alex.neuro.umn.edu>
* src/gramps_main.py (edit_button_clicked): Modify edit person call

View File

@ -17,6 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
"""
The core of the GRAMPS plugin system. This module provides tasks to load
@ -116,7 +117,7 @@ class PluginDialog:
"""Displays the dialog box that allows the user to select the
report that is desired."""
def __init__(self,db,active,list,msg,label=None):
def __init__(self,db,active,list,msg,label=None,button_label=None,tool_tip=None):
"""Display the dialog box, and build up the list of available
reports. This is used to build the selection tree on the left
hand side of the dailog box."""
@ -158,6 +159,17 @@ class PluginDialog:
self.author_email = self.dialog.get_widget("author_email")
self.statbox = self.dialog.get_widget("statbox")
self.apply_button = self.dialog.get_widget("apply")
if button_label:
self.apply_button.set_label(button_label)
else:
self.apply_button.set_label(_("_Apply"))
self.apply_button.set_use_underline(gtk.TRUE)
if tool_tip:
tt = gtk.gtk_tooltips_data_get(self.apply_button)
if tt:
tt[0].set_tip(self.apply_button,tool_tip)
self.run_tool = None
self.build_tree(list)
@ -261,7 +273,9 @@ class ReportPlugins(PluginDialog):
"""Display the dialog box, and build up the list of available
reports. This is used to build the selection tree on the left
hand side of the dailog box."""
PluginDialog.__init__(self,db,active,_reports,_("Report Selection"))
PluginDialog.__init__(self,db,active,_reports,_("Report Selection"),
_("Select a report from those available on the left."),
_("_Generate"), _("Generate selected report"))
#-------------------------------------------------------------------------
#
@ -278,7 +292,8 @@ class ToolPlugins(PluginDialog):
hand side of the dailog box."""
PluginDialog.__init__(self,db,active,_tools,_("Tool Selection"),
_("Select a tool from those available on the left."))
_("Select a tool from those available on the left."),
_("_Run"), _("Run selected tool"))
self.update = update
#-------------------------------------------------------------------------

View File

@ -214,7 +214,7 @@ class BareReportDialog:
self.window = gtk.Dialog('GRAMPS')
self.window.set_has_separator(gtk.FALSE)
self.cancel = self.window.add_button(gtk.STOCK_CANCEL,1)
self.ok = self.window.add_button(_('_Generate report'),0)
self.ok = self.window.add_button(gtk.STOCK_OK,0)
self.ok.connect('clicked',self.on_ok_clicked)
self.cancel.connect('clicked',self.on_cancel)

View File

@ -1644,7 +1644,7 @@
<child>
<widget class="GtkButton" id="ap_parents_btn">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Make the active person's family the active family</property>
<property name="tooltip" translatable="yes">Make the active person's parents the active family</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
@ -1768,7 +1768,7 @@
<child>
<widget class="GtkButton" id="sp_parents_btn">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Make the selected spouse's family the active family</property>
<property name="tooltip" translatable="yes">Make the selected spouse's parents the active family</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
@ -2575,7 +2575,7 @@
<child>
<widget class="GtkButton" id="sp_parents_btn2">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Make the selected spouse's family the active family</property>
<property name="tooltip" translatable="yes">Make the selected spouse's parents the active family</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
@ -2835,7 +2835,7 @@
<child>
<widget class="GtkButton" id="ap_parents_btn2">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Make the active person's family the active family</property>
<property name="tooltip" translatable="yes">Make the active person's parents the active family</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>

View File

@ -2,33 +2,32 @@
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<requires lib="gnome"/>
<widget class="GtkDialog" id="report">
<widget class="GtkDialog" id="plugstat">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="icon">gramps.png</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox35">
<widget class="GtkVBox" id="vbox37">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="spacing">8</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="hbuttonbox21">
<widget class="GtkHButtonBox" id="hbuttonbox22">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="button106">
<widget class="GtkButton" id="button107">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
@ -39,34 +38,6 @@
<signal name="clicked" handler="destroy_passed_object" object="report"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button105">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Perform selected action</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-apply</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_report_apply_clicked" object="report"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button104">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Perform selected action and close this dialog</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_report_ok_clicked" object="report"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -77,13 +48,109 @@
</child>
<child>
<widget class="GtkHPaned" id="hpaned2">
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="width_request">450</property>
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkWindow" id="report">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="icon">gramps.png</property>
<child>
<widget class="GtkVBox" id="vbox38">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox23">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="button108">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="destroy_passed_object" object="report"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="apply">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Perform selected action</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_report_apply_clicked" object="report"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">6</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkHPaned" id="hpaned3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="position">0</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<widget class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@ -109,13 +176,13 @@
</child>
<child>
<widget class="GtkVBox" id="vbox36">
<widget class="GtkVBox" id="vbox39">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHBox" id="hbox2">
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
@ -165,7 +232,7 @@
</child>
<child>
<widget class="GtkHSeparator" id="hseparator19">
<widget class="GtkHSeparator" id="hseparator20">
<property name="visible">True</property>
</widget>
<packing>
@ -252,7 +319,7 @@
</child>
<child>
<widget class="GtkLabel" id="label64">
<widget class="GtkLabel" id="label70">
<property name="visible">True</property>
<property name="label" translatable="yes">Author:</property>
<property name="use_underline">False</property>
@ -276,7 +343,7 @@
</child>
<child>
<widget class="GtkLabel" id="label65">
<widget class="GtkLabel" id="label71">
<property name="visible">True</property>
<property name="label" translatable="yes">Author's email:</property>
<property name="use_underline">False</property>
@ -370,86 +437,4 @@
</child>
</widget>
<widget class="GtkDialog" id="plugstat">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="icon">gramps.png</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox37">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="hbuttonbox22">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="button107">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_close_clicked" last_modification_time="Thu, 12 Sep 2002 03:21:32 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="width_request">450</property>
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="text">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

@ -31,6 +31,7 @@
import RelLib
import GrampsCfg
from Relationship import apply_filter as getallancestors
#-------------------------------------------------------------------------
#
@ -104,16 +105,6 @@ _niece_level = [
#
#
#-------------------------------------------------------------------------
def getallancestors(person,index,ancestorlist,ancestormap):
if person == None:
return
ancestorlist.append(person)
ancestormap[person.getId()] = index
family = person.getMainParents()
if family != None:
getallancestors(family.getFather(),index+1,ancestorlist,ancestormap)
getallancestors(family.getMother(),index+1,ancestorlist,ancestormap)
def get_junior_male_cousin(level,removed):
if removed > len(_junior_male_removed_level)-1 or level>len(_male_cousin_level)-1: