45 lines
963 B
Python
45 lines
963 B
Python
import sys
|
|
import gtk
|
|
import gobject
|
|
|
|
from options import Options
|
|
from data import Data
|
|
|
|
from window import Window
|
|
|
|
gobject.threads_init()
|
|
|
|
|
|
class main:
|
|
def __init__(self,argv):
|
|
# Parse options
|
|
self.options = Options()
|
|
if ("-v" in argv) == True:
|
|
self.options.verbose = True
|
|
# Load saved data (or create new data)
|
|
self.data = Data(self.options)
|
|
#self.data.song = Song(self.quit)
|
|
self.data.quit = None
|
|
|
|
self.window = Window(self.quit,self.options,self.data)
|
|
gtk.main()
|
|
|
|
|
|
# Eventually replace "delete_event" with this
|
|
def quit(self,widgit,data):
|
|
if self.options.verbose == True:
|
|
print "Quitting..."
|
|
#print self.window.get_size()
|
|
self.data.size = self.window.get_size()
|
|
self.data.divider = self.window.contentPane.divider.get_position()
|
|
#self.window.contentPane.plistview.saveCols()
|
|
#self.data.clearSong()
|
|
self.data.dump()
|
|
#self.library.dump()
|
|
gtk.main_quit()
|
|
return False
|
|
|
|
|
|
|
|
if __name__=='__main__':main(sys.argv[1:])
|