* src/EventView.py (Module): Remove extra column.

* src/EventEdit.py (EventEditor.__init__): Remove obsolete code.


svn: r4808
This commit is contained in:
Alex Roitman 2005-06-08 16:32:13 +00:00
parent 5ae515056b
commit 399c5b61f4
3 changed files with 13 additions and 28 deletions

View File

@ -6,6 +6,9 @@
hard-code handle column. hard-code handle column.
* src/DisplayModels.py (EventModel.__init__): Switch column order. * src/DisplayModels.py (EventModel.__init__): Switch column order.
* src/EventView.py (Module): Remove extra column.
* src/EventEdit.py (EventEditor.__init__): Remove obsolete code.
2005-06-08 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-06-08 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/EventView.py (column_names): Add missing column * src/EventView.py (column_names): Add missing column
* src/RepositoryView.py (column_names): Add missing columns * src/RepositoryView.py (column_names): Add missing columns

View File

@ -81,7 +81,6 @@ def get_place(field,pmap,db):
class EventEditor: class EventEditor:
def __init__(self,event,db,parent,parent_window): def __init__(self,event,db,parent,parent_window):
#read_only, cb, def_event=None, noedit=False):
self.parent = parent self.parent = parent
self.db = db self.db = db
read_only = self.db.readonly read_only = self.db.readonly
@ -116,11 +115,7 @@ class EventEditor:
self.window = self.top.get_widget("event_edit") self.window = self.top.get_widget("event_edit")
title_label = self.top.get_widget('title') title_label = self.top.get_widget('title')
#if name == ", ":
etitle = _('Event Editor') etitle = _('Event Editor')
#else:
# etitle = _('Event Editor for %s') % name
Utils.set_titles(self.window,title_label, etitle, Utils.set_titles(self.window,title_label, etitle,
_('Event Editor')) _('Event Editor'))
@ -182,17 +177,13 @@ class EventEditor:
else: else:
defval = None defval = None
self.eventmapper = AutoComp.StandardCustomSelector( self.type_selector = AutoComp.StandardCustomSelector(
Utils.personal_events, self.event_menu, Utils.personal_events, self.event_menu,
RelLib.Event.CUSTOM, defval) RelLib.Event.CUSTOM, defval)
AutoComp.fill_entry(self.place_field,self.pmap.keys()) AutoComp.fill_entry(self.place_field,self.pmap.keys())
if event != None: if event != None:
# self.event_menu.child.set_text(transname)
# if def_placename:
# self.place_field.set_text(def_placename)
# else:
place_handle = event.get_place_handle() place_handle = event.get_place_handle()
if not place_handle: if not place_handle:
place_name = u"" place_name = u""
@ -216,17 +207,13 @@ class EventEditor:
if event.get_media_list(): if event.get_media_list():
Utils.bold_label(self.gallery_label) Utils.bold_label(self.gallery_label)
else: else:
if def_event: event = RelLib.Event()
self.event_menu.child.set_text(def_event)
if def_placename:
self.place_field.set_text(def_placename)
self.date_check = DateEdit.DateEdit(self.date, self.date_check = DateEdit.DateEdit(self.date,
self.date_field, self.date_field,
self.top.get_widget("date_stat"), self.top.get_widget("date_stat"),
self.window) self.window)
if not event:
event = RelLib.Event()
event.set_handle(Utils.create_id())
self.icon_list = self.top.get_widget("iconlist") self.icon_list = self.top.get_widget("iconlist")
self.gallery = ImageSelect.Gallery(event, self.db.commit_event, self.gallery = ImageSelect.Gallery(event, self.db.commit_event,
self.path, self.icon_list, self.path, self.icon_list,
@ -313,9 +300,7 @@ class EventEditor:
def on_event_edit_ok_clicked(self,obj): def on_event_edit_ok_clicked(self,obj):
event_data = self.eventmapper.get_values() event_data = self.type_selector.get_values()
#self.date = self.dp.parse(unicode(self.date_field.get_text()))
ecause = unicode(self.cause_field.get_text()) ecause = unicode(self.cause_field.get_text())
eplace_obj = get_place(self.place_field,self.pmap,self.db) eplace_obj = get_place(self.place_field,self.pmap,self.db)
buf = self.note_field.get_buffer() buf = self.note_field.get_buffer()
@ -336,11 +321,6 @@ class EventEditor:
# self.elist.sort() # self.elist.sort()
just_added = self.event.handle == None just_added = self.event.handle == None
# if just_added:
# self.event.set_handle(Utils.create_id())
# self.event.set_source_reference_list(self.srcreflist)
# self.event.set_type(event_data)
# just_added = True
self.update_event(event_data,self.date,eplace_obj,edesc,enote,eformat, self.update_event(event_data,self.date,eplace_obj,edesc,enote,eformat,
epriv,ecause) epriv,ecause)
@ -356,6 +336,7 @@ class EventEditor:
self.close(obj) self.close(obj)
def update_event(self,the_type,date,place,desc,note,format,priv,cause): def update_event(self,the_type,date,place,desc,note,format,priv,cause):
self.parent.lists_changed = 0
if place: if place:
if self.event.get_place_handle() != place.get_handle(): if self.event.get_place_handle() != place.get_handle():
self.event.set_place_handle(place.get_handle()) self.event.set_place_handle(place.get_handle())

View File

@ -50,7 +50,6 @@ column_names = [
_('Description'), _('Description'),
_('ID'), _('ID'),
_('Type'), _('Type'),
_('Last Change'),
_('Date'), _('Date'),
_('Place'), _('Place'),
_('Cause'), _('Cause'),
@ -240,6 +239,8 @@ class EventView:
for handle in mlist: for handle in mlist:
event = self.parent.db.get_event_from_handle(handle) event = self.parent.db.get_event_from_handle(handle)
print "0", handle
print "1", event
EventEdit.EventEditor(event, self.parent.db, self.parent, EventEdit.EventEditor(event, self.parent.db, self.parent,
self.topWindow) self.topWindow)