changeset 856:a59d0f4563cc

starting curvecalc editchoice Ignore-this: 3885f61f6addba30ea997cc471fd39a9
author drewp@bigasterisk.com
date Wed, 05 Jun 2013 23:39:44 +0000
parents 222b9fee8fcb
children 1bda494a8c3a
files bin/curvecalc light9/curvecalc/curvecalc.glade
diffstat 2 files changed, 41 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/bin/curvecalc	Wed Jun 05 23:39:12 2013 +0000
+++ b/bin/curvecalc	Wed Jun 05 23:39:44 2013 +0000
@@ -35,6 +35,8 @@
 from light9.curvecalc.output import Output
 from light9.gtkpyconsole import togglePyConsole
 from light9.rdfdb.syncedgraph import SyncedGraph
+from light9.editchoicegtk import EditChoice
+from light9.observable import Observable
 
 class SubtermExists(ValueError):
     pass
@@ -59,7 +61,6 @@
 
         mainwin.connect("delete-event", lambda *args: reactor.crash())
         def updateTitle():
-            # song will soon be a lookup on this curvecalc session
             mainwin.set_title("curvecalc - %s" %
                               graph.label(
                                   graph.value(session, L9['currentSong'])))
@@ -70,7 +71,16 @@
         # but it's a minimum size, which i don't really want
         mainwin.set_size_request(1678, 922)
 
+        songChoice = Observable(None) # to be connected with the session song
 
+        def setSong():
+            songChoice(graph.value(session, L9['currentSong']))
+        graph.addHandler(setSong)
+        
+        ec = EditChoice(graph, songChoice, label="Editing song:")
+        wtree.get_object("currentSongEditChoice").add(ec)
+        ec.show()
+        
         wtree.get_object("subterms").connect("add", self.onSubtermChildAdded)
         graph.addHandler(self.add_subterms_for_song)
         self.refreshCurveView()       
--- a/light9/curvecalc/curvecalc.glade	Wed Jun 05 23:39:12 2013 +0000
+++ b/light9/curvecalc/curvecalc.glade	Wed Jun 05 23:39:44 2013 +0000
@@ -296,6 +296,34 @@
           </packing>
         </child>
         <child>
+          <object class="GtkHBox" id="hbox3">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkHBox" id="currentSongEditChoice">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
           <object class="GtkVPaned" id="paned1">
             <property name="height_request">600</property>
             <property name="visible">True</property>
@@ -568,7 +596,7 @@
           <packing>
             <property name="expand">True</property>
             <property name="fill">True</property>
-            <property name="position">1</property>
+            <property name="position">2</property>
           </packing>
         </child>
         <child>
@@ -628,12 +656,9 @@
             <property name="expand">False</property>
             <property name="fill">False</property>
             <property name="padding">5</property>
-            <property name="position">2</property>
+            <property name="position">3</property>
           </packing>
         </child>
-        <child>
-          <placeholder/>
-        </child>
       </object>
     </child>
   </object>