comparison bin/curvecalc @ 856:a59d0f4563cc

starting curvecalc editchoice Ignore-this: 3885f61f6addba30ea997cc471fd39a9
author drewp@bigasterisk.com
date Wed, 05 Jun 2013 23:39:44 +0000
parents dacbb278d91d
children 4fe5612db2ed
comparison
equal deleted inserted replaced
855:222b9fee8fcb 856:a59d0f4563cc
33 from light9.curvecalc.subterm import savekey, graphPathForSubterms 33 from light9.curvecalc.subterm import savekey, graphPathForSubterms
34 from light9.curvecalc.subtermview import add_one_subterm 34 from light9.curvecalc.subtermview import add_one_subterm
35 from light9.curvecalc.output import Output 35 from light9.curvecalc.output import Output
36 from light9.gtkpyconsole import togglePyConsole 36 from light9.gtkpyconsole import togglePyConsole
37 from light9.rdfdb.syncedgraph import SyncedGraph 37 from light9.rdfdb.syncedgraph import SyncedGraph
38 from light9.editchoicegtk import EditChoice
39 from light9.observable import Observable
38 40
39 class SubtermExists(ValueError): 41 class SubtermExists(ValueError):
40 pass 42 pass
41 43
42 class Main(object): 44 class Main(object):
57 self.refreshTheme() 59 self.refreshTheme()
58 mainwin.show_all() 60 mainwin.show_all()
59 61
60 mainwin.connect("delete-event", lambda *args: reactor.crash()) 62 mainwin.connect("delete-event", lambda *args: reactor.crash())
61 def updateTitle(): 63 def updateTitle():
62 # song will soon be a lookup on this curvecalc session
63 mainwin.set_title("curvecalc - %s" % 64 mainwin.set_title("curvecalc - %s" %
64 graph.label( 65 graph.label(
65 graph.value(session, L9['currentSong']))) 66 graph.value(session, L9['currentSong'])))
66 graph.addHandler(updateTitle) 67 graph.addHandler(updateTitle)
67 mainwin.parse_geometry("1x1-0+0") 68 mainwin.parse_geometry("1x1-0+0")
68 69
69 # this is the only one i found that would set the size right, 70 # this is the only one i found that would set the size right,
70 # but it's a minimum size, which i don't really want 71 # but it's a minimum size, which i don't really want
71 mainwin.set_size_request(1678, 922) 72 mainwin.set_size_request(1678, 922)
72 73
73 74 songChoice = Observable(None) # to be connected with the session song
75
76 def setSong():
77 songChoice(graph.value(session, L9['currentSong']))
78 graph.addHandler(setSong)
79
80 ec = EditChoice(graph, songChoice, label="Editing song:")
81 wtree.get_object("currentSongEditChoice").add(ec)
82 ec.show()
83
74 wtree.get_object("subterms").connect("add", self.onSubtermChildAdded) 84 wtree.get_object("subterms").connect("add", self.onSubtermChildAdded)
75 graph.addHandler(self.add_subterms_for_song) 85 graph.addHandler(self.add_subterms_for_song)
76 self.refreshCurveView() 86 self.refreshCurveView()
77 87
78 self.makeStatusLines(wtree.get_object("status")) 88 self.makeStatusLines(wtree.get_object("status"))