Changeset - d5692ab6bc2a
[Not reviewed]
default
0 2 0
Drew Perttula - 13 years ago 2012-06-10 05:57:15
drewp@bigasterisk.com
fix quit and ctrl-q by using kill -9
Ignore-this: db0474f9352cc297bf2e596ac42aee1c
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
bin/curvecalc
Show inline comments
 
@@ -12,13 +12,13 @@ todo: curveview should preserve more obj
 
from __future__ import division
 

	
 
from twisted.internet import gtk2reactor
 
gtk2reactor.install()
 
from twisted.internet import reactor
 

	
 
import time, textwrap, os, optparse, urllib2, gtk, gobject, linecache
 
import time, textwrap, os, optparse, urllib2, gtk, gobject, linecache, signal
 
import louie as dispatcher 
 
from twisted.python.util import sibpath
 
from rdflib import URIRef
 
from rdflib import Graph
 
import rdflib
 
import logging
 
@@ -48,13 +48,14 @@ class Main(object):
 
    def __init__(self, graph, opts, song, curveset, subterms, music):
 
        self.graph = graph
 
        self.music = music
 
        wtree = gtk.Builder()
 
        wtree.add_from_file(sibpath(__file__, "../light9/curvecalc/curvecalc.glade"))
 
        mainwin = wtree.get_object("MainWindow")
 
        mainwin.connect("destroy", gtk.main_quit)
 
        
 
        mainwin.connect("destroy", self.onQuit)
 
        wtree.connect_signals(self)
 
        mainwin.show_all()
 

	
 
        mainwin.connect("delete-event", lambda *args: reactor.crash())
 
        mainwin.set_title("curvecalc - %s" % graph.label(song))
 
        
 
@@ -100,12 +101,18 @@ class Main(object):
 
                    print "reload failed:", e
 
            reactor.callLater(1, refreshCurveView)
 
        refreshCurveView()       
 
        
 
        self.makeStatusLines(wtree.get_object("status"))
 

	
 
    def onQuit(self, *args):
 
        reactor.crash()
 
        # there's a hang after this, maybe in sem_wait in two
 
        # threads. I don't know whose they are.
 
        os.kill(os.getpid(), signal.SIGKILL)
 

	
 
    def onSeeCurrentTime(self, item):
 
        dispatcher.send("see time")
 

	
 
    def onSeeTimeUntilEnd(self, item):
 
        dispatcher.send("see time until end")
 

	
light9/curvecalc/curvecalc.glade
Show inline comments
 
@@ -38,12 +38,14 @@
 
                        <property name="label">gtk-quit</property>
 
                        <property name="visible">True</property>
 
                        <property name="can_focus">False</property>
 
                        <property name="use_action_appearance">False</property>
 
                        <property name="use_underline">True</property>
 
                        <property name="use_stock">True</property>
 
                        <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
 
                        <signal name="activate" handler="onQuit" swapped="no"/>
 
                      </object>
 
                    </child>
 
                  </object>
 
                </child>
 
              </object>
 
            </child>
0 comments (0 inline, 0 general)