01:
02:
03:
04:
05:
06:
07:
08:
09: reloadables=[]
10:
11:
12:
13: import gtk,gobject
14: from timesheet import guiview
15:
16:
17:
18:
19: from timesheet import entriesview as view
20: from timesheet import Entries,entriesmod as modeller,entriescon as controller
21:
22:
23:
24: populate=controller.populate
25:
26:
27:
28:
29: view.listview.set_model(Entries.model)
30:
31:
32:
33: gtk.quit_add(0,lambda *x: controller.on_save(*x))
34: gobject.timeout_add(60000,lambda *x: controller.on_save(*x))
35:
36: guiview.widgets.signal_autoconnect({
37: "on_save1_activate": lambda *x: controller.on_save(*x),
38: "on_undo1_activate": lambda *x: modeller.on_do(Entries.history.undo),
39: "on_redo1_activate": lambda *x: modeller.on_do(Entries.history.redo),
40: "on_delete1_activate": lambda *x: controller.on_delete(*x),
41: })
42:
43:
44:
45: view.commentbox.connect("key-press-event",
46: lambda *x: controller.on_box_key_press(*x)
47: )
48: view.commentbox.connect("changed",
49: lambda *x: controller.on_commentbox_changed(*x)
50: )
51: view.enterbutton.connect("clicked",lambda *x: controller.on_button_clicked(*x))
52: view.listview.connect("cursor-changed",
53: lambda *x: controller.on_view_cursor_changed(*x)
54: )
55:
56: for (col,subcol,field) in view.visiblefields:
57: view.renderer[col][subcol].connect("editing-started",
58: lambda *x: controller.grab_column(None),
59: )
60: view.renderer[col][subcol].connect("edited",
61: lambda *x: controller.on_view_cell_edited(*x),
62: col,field,
63: )
64:
65: for (col,subcol,field) in view.visibletoggles:
66: assert col==2
67: view.renderer[2][subcol].connect("toggled",
68: lambda *x: controller.on_view_cell_toggled(*x),
69: field,
70: )
71:
72:
73:
74:
75: reloadables+=[controller]
76:
77:
78:
79: view.listview.show()
80:
81:
PyScore
A badly written regatta scoring programme in Python and PyGtk.
register
relational
standing
tabulate
timesheet
treemodel
utility
Copyright 2004, M.E.J.Draisey
This file is part of pyscore.
pyscore is free software; you can redistribute it and/or modify it under
the terms of the GNU General
Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
pyscore is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with pyscore; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Formatted with
GNU source-highlight:
http:// www.gnu.org/ software/ src-highlite