* src/plugins/SoundGen.py: Window management. Replaces soundgen.py.

* src/plugins/soundgen.py: Remove from CVS.
* src/plugins/soundex.glade: Define event handler.
* src/plugins/RelCalc.py: Window management.
* src/plugins/relcalc.glade: Define event handler.
* src/plugins/Makefile.am: Ship SoundGen.py instead of soundgen.py.
* src/plugins/Verify.py: Window management.
* src/plugins/verify.glade: Define event handler.


svn: r3154
This commit is contained in:
Alex Roitman 2004-05-11 01:51:56 +00:00
parent 2fea4c06a2
commit 33e69e8d45
9 changed files with 179 additions and 151 deletions

View File

@ -12,6 +12,15 @@
* src/plugins/merge.glade: Define event handlers.
* src/plugins/ChangeTypes.py: Convert to db.
* src/plugins/SoundGen.py: Window management. Replaces soundgen.py.
* src/plugins/soundgen.py: Remove from CVS.
* src/plugins/soundex.glade: Define event handler.
* src/plugins/RelCalc.py: Window management.
* src/plugins/relcalc.glade: Define event handler.
* src/plugins/Makefile.am: Ship SoundGen.py instead of soundgen.py.
* src/plugins/Verify.py: Window management.
* src/plugins/verify.glade: Define event handler.
2004-05-09 Don Allingham <donaldallingham@users.sourceforge.net>
* src/DbPrompter.py: added a .grdb if not specified.

View File

@ -32,7 +32,7 @@ pkgpython_PYTHON = \
ReadNative.py\
RelCalc.py\
ReorderIds.py\
soundgen.py\
SoundGen.py\
Summary.py\
TimeLine.py\
Verify.py\

View File

@ -237,6 +237,7 @@ class Merge:
def show(self):
top = gtk.glade.XML(self.glade_file,"mergelist","gramps")
self.window = top.get_widget("mergelist")
self.win_show_key = self.window
Utils.set_titles(self.window, top.get_widget('title'),
_('Potential Merges'))
@ -265,15 +266,15 @@ class Merge:
self.window.destroy()
def add_show_to_menu(self):
self.parent.child_windows[self.win_key] = self
self.parent_menu_item = gtk.MenuItem(_('Potential Merges'))
self.parent_menu_item.connect("activate",self.present_show)
self.parent_menu_item.show()
self.parent.winsmenu.append(self.parent_menu_item)
self.show_parent.child_windows[self.win_show_key] = self.window
self.show_parent_menu_item = gtk.MenuItem(_('Potential Merges'))
self.show_parent_menu_item.connect("activate",self.present_show)
self.show_parent_menu_item.show()
self.parent.winsmenu.append(self.show_parent_menu_item)
def remove_show_from_menu(self):
del self.parent.child_windows[self.win_key]
self.parent_menu_item.destroy()
del self.parent.child_windows[self.win_show_key]
self.show_parent_menu_item.destroy()
def present_show(self,obj):
self.window.present()

View File

@ -53,8 +53,8 @@ from gettext import gettext as _
#
#
#-------------------------------------------------------------------------
def runTool(database,person,callback):
RelCalc(database,person)
def runTool(database,person,callback,parent=None):
RelCalc(database,person,parent)
#-------------------------------------------------------------------------
#
@ -66,11 +66,13 @@ class RelCalc:
Relationship calculator class.
"""
def __init__(self,database,person):
def __init__(self,database,person,parent):
self.person = person
self.db = database
self.RelClass = Plugins.relationship_class
self.relationship = self.RelClass(database)
self.parent = parent
self.win_key = self
base = os.path.dirname(__file__)
glade_file = "%s/relcalc.glade" % base
@ -78,7 +80,8 @@ class RelCalc:
name = self.person.get_primary_name().get_regular_name()
Utils.set_titles(self.glade.get_widget('relcalc'),
self.window = self.glade.get_widget('relcalc')
Utils.set_titles(self.window,
self.glade.get_widget('title'),
_('Relationship to %s') % name,
_('Relationship calculator'))
@ -100,10 +103,35 @@ class RelCalc:
self.clist.connect_model()
self.glade.signal_autoconnect({
"on_close_clicked" : Utils.destroy_passed_object,
"on_close_clicked" : self.close,
"on_delete_event" : self.on_delete_event,
"on_apply_clicked" : self.on_apply_clicked
})
self.add_itself_to_menu()
self.window.show()
def on_delete_event(self,obj,b):
self.remove_itself_from_menu()
def close(self,obj):
self.remove_itself_from_menu()
self.window.destroy()
def add_itself_to_menu(self):
self.parent.child_windows[self.win_key] = self
self.parent_menu_item = gtk.MenuItem(_('Relationship calculator tool'))
self.parent_menu_item.connect("activate",self.present)
self.parent_menu_item.show()
self.parent.winsmenu.append(self.parent_menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.parent_menu_item.destroy()
def present(self,obj):
self.window.present()
def on_apply_clicked(self,obj):
model,iter = self.clist.get_selected()
if not iter:

View File

@ -37,23 +37,27 @@ from gettext import gettext as _
#
#
#-------------------------------------------------------------------------
def runTool(database,active_person,callback):
SoundGen(database,active_person)
def runTool(database,active_person,callback,parent=None):
SoundGen(database,active_person,parent)
class SoundGen:
def __init__(self,database,active_person):
def __init__(self,database,active_person,parent):
self.db = database
self.parent = parent
self.win_key = self
base = os.path.dirname(__file__)
glade_file = base + os.sep + "soundex.glade"
self.glade = gtk.glade.XML(glade_file,"soundEx","gramps")
self.glade.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"destroy_passed_object" : self.close,
"on_delete_event" : self.on_delete_event,
})
Utils.set_titles(self.glade.get_widget('soundEx'),
self.window = self.glade.get_widget("soundEx")
Utils.set_titles(self.window,
self.glade.get_widget('title'),
_('SoundEx code generator'))
@ -84,7 +88,30 @@ class SoundGen:
else:
self.name.set_text("")
self.glade.get_widget("soundEx").show()
self.window.show()
self.add_itself_to_menu()
self.window.show()
def on_delete_event(self,obj,b):
self.remove_itself_from_menu()
def close(self,obj):
self.remove_itself_from_menu()
self.window.destroy()
def add_itself_to_menu(self):
self.parent.child_windows[self.win_key] = self
self.parent_menu_item = gtk.MenuItem(_('SoundEx code generator tool'))
self.parent_menu_item.connect("activate",self.present)
self.parent_menu_item.show()
self.parent.winsmenu.append(self.parent_menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.parent_menu_item.destroy()
def present(self,obj):
self.window.present()
def on_apply_clicked(self,obj):
try:

View File

@ -57,30 +57,57 @@ import Gregorian
from gettext import gettext as _
def runTool(database,active_person,callback):
Verify(database,active_person)
def runTool(database,active_person,callback,parent=None):
Verify(database,active_person,parent)
#-------------------------------------------------------------------------
#
#
#-------------------------------------------------------------------------
class Verify:
def __init__(self,database,active_person):
def __init__(self,database,active_person,parent):
self.db = database
self.parent = parent
self.win_key = self
base = os.path.dirname(__file__)
self.glade_file = base + os.sep + "verify.glade"
self.top = gtk.glade.XML(self.glade_file,"verify_settings","gramps")
self.top.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"on_verify_ok_clicked" : self.on_apply_clicked
"destroy_passed_object" : self.close,
"on_verify_delete_event" : self.on_delete_event,
"on_verify_ok_clicked" : self.on_apply_clicked
})
Utils.set_titles(self.top.get_widget('verify_settings'),
self.window = self.top.get_widget('verify_settings')
Utils.set_titles(self.window,
self.top.get_widget('title'),
_('Database Verify'))
self.add_itself_to_menu()
self.window.show()
def on_delete_event(self,obj,b):
self.remove_itself_from_menu()
def close(self,obj):
self.remove_itself_from_menu()
self.window.destroy()
def add_itself_to_menu(self):
self.parent.child_windows[self.win_key] = self
self.parent_menu_item = gtk.MenuItem(_('Database Verify'))
self.parent_menu_item.connect("activate",self.present)
self.parent_menu_item.show()
self.parent.winsmenu.append(self.parent_menu_item)
def remove_itself_from_menu(self):
del self.parent.child_windows[self.win_key]
self.parent_menu_item.destroy()
def present(self,obj):
self.window.present()
def get_year(self,event_id):
"""
@ -435,14 +462,39 @@ class Verify:
_('Database Verify'))
top.signal_autoconnect({
"destroy_passed_object" : Utils.destroy_passed_object,
"destroy_passed_object" : self.close_result,
"on_result_delete_event" : self.on_result_delete_event,
})
topwin = top.get_widget("verify_result")
self.topwin = top.get_widget("verify_result")
self.win_result_key = self.topwin
textwindow = top.get_widget("textwindow")
textwindow.get_buffer().set_text(text)
topwin.show()
self.add_result_to_menu()
self.topwin.show()
def on_result_delete_event(self,obj,b):
self.remove_result_from_menu()
def close_result(self,obj):
self.remove_result_from_menu()
self.topwin.destroy()
def add_result_to_menu(self):
self.parent.child_windows[self.win_result_key] = self.topwin
self.result_parent_menu_item = gtk.MenuItem(_('Database Verify results'))
self.result_parent_menu_item.connect("activate",self.present_result)
self.result_parent_menu_item.show()
self.parent.winsmenu.append(self.result_parent_menu_item)
def remove_result_from_menu(self):
del self.parent.child_windows[self.win_result_key]
self.result_parent_menu_item.destroy()
def present_result(self,obj):
self.topwin.present()
#-------------------------------------------------------------------------
#
#

View File

@ -13,7 +13,13 @@
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<signal name="delete_event" handler="on_delete_event" last_modification_time="Tue, 11 May 2004 00:39:37 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
@ -34,6 +40,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_close_clicked" object="relcalc"/>
</widget>
@ -117,6 +124,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">True</property>

View File

@ -11,7 +11,13 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<signal name="delete_event" handler="on_delete_event" last_modification_time="Tue, 11 May 2004 00:26:15 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
@ -33,6 +39,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="destroy_passed_object" object="soundEx"/>
</widget>

View File

@ -4,129 +4,6 @@
<glade-interface>
<requires lib="gnome"/>
<widget class="GtkDialog" id="verify_result_old">
<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">500</property>
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">30</property>
<child>
<widget class="GtkButton" id="button3">
<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="verify_result"/>
</widget>
</child>
</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="GtkVBox" id="vbox1">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">6</property>
</widget>
<packing>
<property name="padding">8</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<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="textwindow">
<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>
<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="verify_settings">
<property name="visible">True</property>
<property name="title" translatable="yes"></property>
@ -135,6 +12,12 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_verify_delete_event" last_modification_time="Tue, 11 May 2004 01:43:35 GMT"/>
<child>
<widget class="GtkVBox" id="vbox2">
@ -903,6 +786,7 @@
<property name="label" translatable="yes">Estimate missing dates</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@ -945,6 +829,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="destroy_passed_object" object="verify_settings"/>
</widget>
</child>
@ -957,6 +842,7 @@
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_verify_ok_clicked" object="verify_settings"/>
</widget>
</child>
@ -981,6 +867,12 @@
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="delete_event" handler="on_result_delete_event" last_modification_time="Tue, 11 May 2004 01:43:50 GMT"/>
<child>
<widget class="GtkVBox" id="vbox4">
@ -1030,6 +922,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</property>
@ -1071,6 +965,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="destroy_passed_object" object="verify_result" last_modification_time="Tue, 15 Apr 2003 05:40:26 GMT"/>
</widget>
</child>