2006-05-04 Alex Roitman <shura@gramps-project.org>
* src/SelectObject.py: Convert to managed window. * src/SelectEvent.py: Convert to managed window. * src/SelectSource.py: Convert to managed window. * src/DisplayTabs.py: Properly call selectors. svn: r6543
This commit is contained in:
parent
33490899c4
commit
d9eb5cb555
@ -1,3 +1,9 @@
|
|||||||
|
2006-05-04 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* src/SelectObject.py: Convert to managed window.
|
||||||
|
* src/SelectEvent.py: Convert to managed window.
|
||||||
|
* src/SelectSource.py: Convert to managed window.
|
||||||
|
* src/DisplayTabs.py: Properly call selectors.
|
||||||
|
|
||||||
2006-05-03 Alex Roitman <shura@gramps-project.org>
|
2006-05-03 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/DisplayTabs.py (NoteTab.build_interface): Add spacing to
|
* src/DisplayTabs.py (NoteTab.build_interface): Add spacing to
|
||||||
radiobuttons.
|
radiobuttons.
|
||||||
|
@ -689,7 +689,8 @@ class EventEmbedList(EmbeddedList):
|
|||||||
def share_button_clicked(self, obj):
|
def share_button_clicked(self, obj):
|
||||||
import SelectEvent
|
import SelectEvent
|
||||||
|
|
||||||
sel = SelectEvent.SelectEvent(self.dbstate.db, "Event Select")
|
sel = SelectEvent.SelectEvent(self.dbstate,self.uistate,self.track,
|
||||||
|
_("Select event"))
|
||||||
event = sel.run()
|
event = sel.run()
|
||||||
if event:
|
if event:
|
||||||
try:
|
try:
|
||||||
@ -1663,7 +1664,8 @@ class GalleryTab(ButtonTab):
|
|||||||
"""
|
"""
|
||||||
import SelectObject
|
import SelectObject
|
||||||
|
|
||||||
sel = SelectObject.SelectObject(self.dbstate.db, _("Select media"))
|
sel = SelectObject.SelectObject(self.dbstate,self.uistate,self.track,
|
||||||
|
_("Select media"))
|
||||||
src = sel.run()
|
src = sel.run()
|
||||||
if src:
|
if src:
|
||||||
sref = RelLib.MediaRef()
|
sref = RelLib.MediaRef()
|
||||||
@ -1750,7 +1752,8 @@ class SourceEmbedList(EmbeddedList):
|
|||||||
def share_button_clicked(self, obj):
|
def share_button_clicked(self, obj):
|
||||||
import SelectSource
|
import SelectSource
|
||||||
|
|
||||||
sel = SelectSource.SelectSource(self.dbstate.db, "Source Select")
|
sel = SelectSource.SelectSource(self.dbstate,self.uistate,self.track,
|
||||||
|
_("Select source"))
|
||||||
src = sel.run()
|
src = sel.run()
|
||||||
if src:
|
if src:
|
||||||
try:
|
try:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003-2005 Donald N. Allingham
|
# Copyright (C) 2003-2006 Donald N. Allingham
|
||||||
#
|
#
|
||||||
# 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
|
||||||
@ -47,33 +47,36 @@ import gtk.glade
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import const
|
import const
|
||||||
import Utils
|
|
||||||
import ListModel
|
import ListModel
|
||||||
import DateHandler
|
import DateHandler
|
||||||
|
import ManagedWindow
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# SelectEvent
|
# SelectEvent
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class SelectEvent:
|
class SelectEvent(ManagedWindow.ManagedWindow):
|
||||||
"""
|
"""
|
||||||
Selects an event from the list of available events
|
Selects an event from the list of available events
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, database, title, parent_window=None):
|
def __init__(self, dbstate, uistate, track, title):
|
||||||
"""
|
"""
|
||||||
Create an Event Selector, allowing the user to select on of the
|
Create an Event Selector, allowing the user to select on of the
|
||||||
events in the event list.
|
events in the event list.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.db = database
|
self.title = title
|
||||||
|
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
||||||
|
|
||||||
|
self.db = dbstate.db
|
||||||
self.glade = gtk.glade.XML(const.gladeFile, "select_person", "gramps")
|
self.glade = gtk.glade.XML(const.gladeFile, "select_person", "gramps")
|
||||||
self.top = self.glade.get_widget('select_person')
|
window = self.glade.get_widget('select_person')
|
||||||
title_label = self.glade.get_widget('title')
|
title_label = self.glade.get_widget('title')
|
||||||
self.elist = self.glade.get_widget('plist')
|
self.elist = self.glade.get_widget('plist')
|
||||||
|
|
||||||
Utils.set_titles(self.top, title_label, title)
|
self.set_window(window, title_label, self.title)
|
||||||
|
|
||||||
titles = [(_('Description'), 4, 250), (_('ID'), 1, 75),
|
titles = [(_('Description'), 4, 250), (_('ID'), 1, 75),
|
||||||
(_('Type'), 2, 75), (_('Date'), 3, 150), ('', 4, 0) ]
|
(_('Type'), 2, 75), (_('Date'), 3, 150), ('', 4, 0) ]
|
||||||
@ -82,10 +85,10 @@ class SelectEvent:
|
|||||||
self.model = ListModel.ListModel(self.elist, titles)
|
self.model = ListModel.ListModel(self.elist, titles)
|
||||||
|
|
||||||
self.redraw()
|
self.redraw()
|
||||||
self.top.show()
|
self.show()
|
||||||
|
|
||||||
if parent_window:
|
def build_menu_names(self,obj):
|
||||||
self.top.set_transient_for(parent_window)
|
return (self.title, None)
|
||||||
|
|
||||||
def redraw(self):
|
def redraw(self):
|
||||||
"""
|
"""
|
||||||
@ -110,7 +113,7 @@ class SelectEvent:
|
|||||||
Runs te dialog, returning None if the event was not selected,
|
Runs te dialog, returning None if the event was not selected,
|
||||||
or the event that was selected.
|
or the event that was selected.
|
||||||
"""
|
"""
|
||||||
val = self.top.run()
|
val = self.window.run()
|
||||||
|
|
||||||
if val == gtk.RESPONSE_OK:
|
if val == gtk.RESPONSE_OK:
|
||||||
store, node = self.model.get_selected()
|
store, node = self.model.get_selected()
|
||||||
@ -120,8 +123,8 @@ class SelectEvent:
|
|||||||
return_value = self.db.get_event_from_handle(handle)
|
return_value = self.db.get_event_from_handle(handle)
|
||||||
else:
|
else:
|
||||||
return_value = None
|
return_value = None
|
||||||
self.top.destroy()
|
self.close()
|
||||||
return return_value
|
return return_value
|
||||||
else:
|
else:
|
||||||
self.top.destroy()
|
self.close()
|
||||||
return None
|
return None
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003-2004 Donald N. Allingham
|
# Copyright (C) 2003-2006 Donald N. Allingham
|
||||||
#
|
#
|
||||||
# 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
|
||||||
@ -55,27 +55,29 @@ import gtk.gdk
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import const
|
import const
|
||||||
import Utils
|
|
||||||
import ListModel
|
import ListModel
|
||||||
import ImgManip
|
import ImgManip
|
||||||
import Mime
|
import Mime
|
||||||
|
import ManagedWindow
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# SelectPerson
|
# SelectPerson
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class SelectObject:
|
class SelectObject(ManagedWindow.ManagedWindow):
|
||||||
|
|
||||||
def __init__(self,db,title):
|
def __init__(self, dbstate, uistate, track, title):
|
||||||
|
self.title = title
|
||||||
|
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
||||||
|
|
||||||
self.db = db
|
self.db = dbstate.db
|
||||||
self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps")
|
self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps")
|
||||||
self.top = self.glade.get_widget('select_person')
|
window = self.glade.get_widget('select_person')
|
||||||
title_label = self.glade.get_widget('object_title')
|
title_label = self.glade.get_widget('object_title')
|
||||||
self.object_tree = self.glade.get_widget('plist')
|
self.object_tree = self.glade.get_widget('plist')
|
||||||
|
|
||||||
Utils.set_titles(self.top,title_label,title)
|
self.set_window(window,title_label,self.title)
|
||||||
|
|
||||||
titles = [
|
titles = [
|
||||||
(_('Preview'),0,50,ListModel.IMAGE),
|
(_('Preview'),0,50,ListModel.IMAGE),
|
||||||
@ -91,7 +93,10 @@ class SelectObject:
|
|||||||
self.selection = self.object_tree.get_selection()
|
self.selection = self.object_tree.get_selection()
|
||||||
|
|
||||||
self.redraw()
|
self.redraw()
|
||||||
self.top.show()
|
self.show()
|
||||||
|
|
||||||
|
def build_menu_names(self,obj):
|
||||||
|
return (self.title, None)
|
||||||
|
|
||||||
def redraw(self):
|
def redraw(self):
|
||||||
self.object_model.clear()
|
self.object_model.clear()
|
||||||
@ -109,7 +114,7 @@ class SelectObject:
|
|||||||
self.object_model.connect_model()
|
self.object_model.connect_model()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
val = self.top.run()
|
val = self.window.run()
|
||||||
|
|
||||||
if val == gtk.RESPONSE_OK:
|
if val == gtk.RESPONSE_OK:
|
||||||
store,node = self.object_model.get_selected()
|
store,node = self.object_model.get_selected()
|
||||||
@ -119,10 +124,10 @@ class SelectObject:
|
|||||||
return_value = self.db.get_object_from_handle(handle)
|
return_value = self.db.get_object_from_handle(handle)
|
||||||
else:
|
else:
|
||||||
return_value = None
|
return_value = None
|
||||||
self.top.destroy()
|
self.close()
|
||||||
gc.collect()
|
gc.collect()
|
||||||
return return_value
|
return return_value
|
||||||
else:
|
else:
|
||||||
self.top.destroy()
|
self.close()
|
||||||
gc.collect()
|
gc.collect()
|
||||||
return None
|
return None
|
||||||
|
@ -42,7 +42,6 @@ import pango
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import const
|
import const
|
||||||
import Utils
|
|
||||||
import PeopleModel
|
import PeopleModel
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003-2005 Donald N. Allingham
|
# Copyright (C) 2003-2006 Donald N. Allingham
|
||||||
#
|
#
|
||||||
# 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
|
||||||
@ -42,25 +42,27 @@ import gtk.glade
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import const
|
import const
|
||||||
import Utils
|
|
||||||
import ListModel
|
import ListModel
|
||||||
|
import ManagedWindow
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# SelectEvent
|
# SelectEvent
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class SelectSource:
|
class SelectSource(ManagedWindow.ManagedWindow):
|
||||||
|
|
||||||
def __init__(self,db,title,parent_window=None):
|
def __init__(self, dbstate, uistate, track, title):
|
||||||
|
self.title = title
|
||||||
|
ManagedWindow.ManagedWindow.__init__(self, uistate, track, self)
|
||||||
|
|
||||||
self.db = db
|
self.db = dbstate.db
|
||||||
self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps")
|
self.glade = gtk.glade.XML(const.gladeFile,"select_person","gramps")
|
||||||
self.top = self.glade.get_widget('select_person')
|
window = self.glade.get_widget('select_person')
|
||||||
title_label = self.glade.get_widget('title')
|
title_label = self.glade.get_widget('title')
|
||||||
self.elist = self.glade.get_widget('plist')
|
self.elist = self.glade.get_widget('plist')
|
||||||
|
|
||||||
Utils.set_titles(self.top,title_label,title)
|
self.set_window(window,title_label,self.title)
|
||||||
|
|
||||||
titles = [(_('Title'),4,350), (_('ID'),1,50), ('',0,0)]
|
titles = [(_('Title'),4,350), (_('ID'),1,50), ('',0,0)]
|
||||||
self.ncols = len(titles)
|
self.ncols = len(titles)
|
||||||
@ -68,10 +70,10 @@ class SelectSource:
|
|||||||
self.model = ListModel.ListModel(self.elist,titles)
|
self.model = ListModel.ListModel(self.elist,titles)
|
||||||
|
|
||||||
self.redraw()
|
self.redraw()
|
||||||
self.top.show()
|
self.show()
|
||||||
|
|
||||||
if parent_window:
|
def build_menu_names(self,obj):
|
||||||
self.top.set_transient_for(parent_window)
|
return (self.title, None)
|
||||||
|
|
||||||
def redraw(self):
|
def redraw(self):
|
||||||
self.model.clear()
|
self.model.clear()
|
||||||
@ -85,7 +87,7 @@ class SelectSource:
|
|||||||
self.model.connect_model()
|
self.model.connect_model()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
val = self.top.run()
|
val = self.window.run()
|
||||||
|
|
||||||
if val == gtk.RESPONSE_OK:
|
if val == gtk.RESPONSE_OK:
|
||||||
store,node = self.model.get_selected()
|
store,node = self.model.get_selected()
|
||||||
@ -95,8 +97,8 @@ class SelectSource:
|
|||||||
return_value = self.db.get_source_from_handle(handle)
|
return_value = self.db.get_source_from_handle(handle)
|
||||||
else:
|
else:
|
||||||
return_value = None
|
return_value = None
|
||||||
self.top.destroy()
|
self.close()
|
||||||
return return_value
|
return return_value
|
||||||
else:
|
else:
|
||||||
self.top.destroy()
|
self.close()
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user