2007-06-25 Don Allingham <don@gramps-project.org>
* src/DisplayTabs/_AddrEmbedList.py: pylint * src/DisplayTabs/_AddressModel.py: pylint * src/DisplayTabs/_WebModel.py: pylint svn: r8670
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2007-06-25 Don Allingham <don@gramps-project.org>
|
||||||
|
* src/DisplayTabs/_AddrEmbedList.py: pylint
|
||||||
|
* src/DisplayTabs/_AddressModel.py: pylint
|
||||||
|
* src/DisplayTabs/_WebModel.py: pylint
|
||||||
|
|
||||||
2007-06-25 Alex Roitman <shura@gramps-project.org>
|
2007-06-25 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/GrampsDb/_GrampsBSDDB.py (commit_base): Rename method.
|
* src/GrampsDb/_GrampsBSDDB.py (commit_base): Rename method.
|
||||||
* src/GrampsDb/_GrampsDBDir.py (commit_base): Rename method.
|
* src/GrampsDb/_GrampsDBDir.py (commit_base): Rename method.
|
||||||
|
@@ -20,6 +20,10 @@
|
|||||||
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
|
"""
|
||||||
|
Address List display tab
|
||||||
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Python classes
|
# Python classes
|
||||||
@@ -44,6 +48,10 @@ from _EmbeddedList import EmbeddedList
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class AddrEmbedList(EmbeddedList):
|
class AddrEmbedList(EmbeddedList):
|
||||||
|
"""
|
||||||
|
Address List display tab for edit dialogs. Derives from the EmbeddedList
|
||||||
|
class.
|
||||||
|
"""
|
||||||
|
|
||||||
_HANDLE_COL = 5
|
_HANDLE_COL = 5
|
||||||
_DND_TYPE = DdTargets.ADDRESS
|
_DND_TYPE = DdTargets.ADDRESS
|
||||||
@@ -62,15 +70,30 @@ class AddrEmbedList(EmbeddedList):
|
|||||||
_('Addresses'), AddressModel)
|
_('Addresses'), AddressModel)
|
||||||
|
|
||||||
def get_icon_name(self):
|
def get_icon_name(self):
|
||||||
|
"""
|
||||||
|
Returns the stock-id icon name associated with the display tab
|
||||||
|
"""
|
||||||
return 'gramps-address'
|
return 'gramps-address'
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
|
"""
|
||||||
|
Returns the data associated with display tab
|
||||||
|
"""
|
||||||
return self.data
|
return self.data
|
||||||
|
|
||||||
def column_order(self):
|
def column_order(self):
|
||||||
|
"""
|
||||||
|
Returns the column order of the columns in the display tab.
|
||||||
|
"""
|
||||||
return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4))
|
return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4))
|
||||||
|
|
||||||
def add_button_clicked(self, obj):
|
def add_button_clicked(self, obj):
|
||||||
|
"""
|
||||||
|
Called with the Add button is clicked. Creates a new Address instance
|
||||||
|
and calls the EditAddress editor with the new address. If the window
|
||||||
|
already exists (Errors.WindowActiveError), we ignore it. This prevents
|
||||||
|
the dialog from coming up twice on the same object.
|
||||||
|
"""
|
||||||
addr = RelLib.Address()
|
addr = RelLib.Address()
|
||||||
try:
|
try:
|
||||||
from Editors import EditAddress
|
from Editors import EditAddress
|
||||||
@@ -78,13 +101,22 @@ class AddrEmbedList(EmbeddedList):
|
|||||||
EditAddress(self.dbstate, self.uistate, self.track,
|
EditAddress(self.dbstate, self.uistate, self.track,
|
||||||
addr, self.add_callback)
|
addr, self.add_callback)
|
||||||
except Errors.WindowActiveError:
|
except Errors.WindowActiveError:
|
||||||
pass
|
return
|
||||||
|
|
||||||
def add_callback(self, name):
|
def add_callback(self, name):
|
||||||
|
"""
|
||||||
|
Called to update the screen when a new address is added
|
||||||
|
"""
|
||||||
self.get_data().append(name)
|
self.get_data().append(name)
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
|
||||||
def edit_button_clicked(self, obj):
|
def edit_button_clicked(self, obj):
|
||||||
|
"""
|
||||||
|
Called with the Edit button is clicked. Gets the selected Address instance
|
||||||
|
and calls the EditAddress editor with the address. If the window
|
||||||
|
already exists (Errors.WindowActiveError), we ignore it. This prevents
|
||||||
|
the dialog from coming up twice on the same object.
|
||||||
|
"""
|
||||||
addr = self.get_selected()
|
addr = self.get_selected()
|
||||||
if addr:
|
if addr:
|
||||||
try:
|
try:
|
||||||
@@ -93,7 +125,10 @@ class AddrEmbedList(EmbeddedList):
|
|||||||
EditAddress(self.dbstate, self.uistate, self.track,
|
EditAddress(self.dbstate, self.uistate, self.track,
|
||||||
addr, self.edit_callback)
|
addr, self.edit_callback)
|
||||||
except Errors.WindowActiveError:
|
except Errors.WindowActiveError:
|
||||||
pass
|
return
|
||||||
|
|
||||||
def edit_callback(self, name):
|
def edit_callback(self, name):
|
||||||
|
"""
|
||||||
|
Called to update the screen when the address changes
|
||||||
|
"""
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
@@ -20,6 +20,10 @@
|
|||||||
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
|
"""
|
||||||
|
The TreeModel for the Address list in the Address Tab.
|
||||||
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GTK libraries
|
# GTK libraries
|
||||||
@@ -40,10 +44,16 @@ import DateHandler
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class AddressModel(gtk.ListStore):
|
class AddressModel(gtk.ListStore):
|
||||||
|
"""
|
||||||
|
AddressModel derives from the ListStore, defining te items in the list
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, obj_list, db):
|
def __init__(self, obj_list, dbase):
|
||||||
|
"""
|
||||||
|
AddressModel derives from the ListStore, defining te items in the list
|
||||||
|
"""
|
||||||
gtk.ListStore.__init__(self, str, str, str, str, str, object)
|
gtk.ListStore.__init__(self, str, str, str, str, str, object)
|
||||||
self.db = db
|
self.db = dbase
|
||||||
for obj in obj_list:
|
for obj in obj_list:
|
||||||
self.append(row=[
|
self.append(row=[
|
||||||
DateHandler.get_date(obj),
|
DateHandler.get_date(obj),
|
||||||
|
@@ -20,6 +20,10 @@
|
|||||||
|
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
|
"""
|
||||||
|
The TreeModel for the URL list in the Url Tab.
|
||||||
|
"""
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GTK libraries
|
# GTK libraries
|
||||||
@@ -27,22 +31,18 @@
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# GRAMPS classes
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# WebModel
|
# WebModel
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class WebModel(gtk.ListStore):
|
class WebModel(gtk.ListStore):
|
||||||
|
"""
|
||||||
|
WebModel derives from the ListStore, defining te items in the list
|
||||||
|
"""
|
||||||
|
def __init__(self, obj_list, dbase):
|
||||||
|
|
||||||
def __init__(self, obj_list, db):
|
|
||||||
gtk.ListStore.__init__(self, str, str, str, object)
|
gtk.ListStore.__init__(self, str, str, str, object)
|
||||||
self.db = db
|
self.db = dbase
|
||||||
for obj in obj_list:
|
for obj in obj_list:
|
||||||
self.append(row=[str(obj.type), obj.path, obj.desc, obj])
|
self.append(row=[str(obj.type), obj.path, obj.desc, obj])
|
||||||
|
Reference in New Issue
Block a user