- Added db lookup for stage size
- Known issue with warnings on startup (possibly caused by Slideshow action)
This commit is contained in:
parent
e706e4c094
commit
fb95eb225e
Binary file not shown.
BIN
Spinner.pyc
BIN
Spinner.pyc
Binary file not shown.
42
gloss.py
42
gloss.py
|
@ -34,25 +34,39 @@ class MainApp:
|
|||
|
||||
self.stage = clutter.stage_get_default()
|
||||
self.stage.set_color(clutter.color_parse('Black'))
|
||||
self.stage.set_property("fullscreen", True)
|
||||
self.stage.fullscreen()
|
||||
self.stage.connect('button-press-event', self.on_button_press_event)
|
||||
self.stage.show_all()
|
||||
|
||||
#hide the cursor
|
||||
self.stage.hide_cursor()
|
||||
|
||||
#Display a loading / splash screen
|
||||
self.splashScreen = SplashScr(self.stage)
|
||||
self.splashScreen.display()
|
||||
#clutter.threads_enter()
|
||||
gobject.timeout_add(500, self.loadGloss)
|
||||
#clutter.threads_leave()
|
||||
#clutter.threads_add_timeout(500, self.loadGloss())
|
||||
|
||||
def loadGloss(self):
|
||||
#Create a master mySQL connection
|
||||
self.dbMgr = mythDB()
|
||||
if not self.dbMgr.connected:
|
||||
return
|
||||
|
||||
#Do an initial lookup for GUI size
|
||||
width = int(self.dbMgr.get_setting("GuiWidth"))
|
||||
height = int(self.dbMgr.get_setting("GuiHeight"))
|
||||
#Set stage size
|
||||
if width == 0 and height == 0:
|
||||
self.stage.fullscreen()
|
||||
self.stage.set_property("fullscreen", True)
|
||||
else:
|
||||
self.stage.set_size(width, height)
|
||||
|
||||
#now that the size is set, we can show the stage
|
||||
self.stage.show()
|
||||
#Display a loading / splash screen
|
||||
self.splashScreen = SplashScr(self.stage)
|
||||
self.splashScreen.display()
|
||||
#And create the Gloss Manager
|
||||
self.glossMgr = GlossMgr(self.stage)
|
||||
|
||||
|
||||
#loop through the args
|
||||
for arg in self.args:
|
||||
|
@ -63,29 +77,26 @@ class MainApp:
|
|||
#Update splash status msg
|
||||
self.splashScreen.set_msg("Creating menus")
|
||||
MainMenu = self.glossMgr.create_menu()
|
||||
|
||||
#Update splash status msg
|
||||
self.splashScreen.set_msg("Connecting to MythTV server")
|
||||
#Create a master mySQL connection
|
||||
self.dbMgr = mythDB()
|
||||
|
||||
if not self.dbMgr.connected:
|
||||
return
|
||||
|
||||
#Update splash status msg
|
||||
|
||||
#Load all modules
|
||||
for mods in modules:
|
||||
#print "Loading mod..."
|
||||
tempMod = mods.Module(self.glossMgr, self.dbMgr)
|
||||
title = tempMod.title
|
||||
#print title
|
||||
|
||||
self.splashScreen.set_msg("Loading "+title)
|
||||
temp_menu_item = MainMenu.addItem(title)
|
||||
temp_menu_item.add_image_from_texture(tempMod.menu_image)
|
||||
temp_menu_item.setAction(tempMod.action())
|
||||
|
||||
|
||||
self.splashScreen.remove()
|
||||
self.stage.connect('key-press-event', self.glossMgr.on_key_press_event)
|
||||
MainMenu.display()
|
||||
|
||||
MainMenu.selectFirst(True)
|
||||
|
||||
|
||||
|
@ -100,7 +111,6 @@ class MainApp:
|
|||
|
||||
|
||||
def run (self):
|
||||
self.stage.show()
|
||||
#self.timeline.start()
|
||||
clutter.main()
|
||||
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,41 @@
|
|||
|
||||
|
||||
class recorder():
|
||||
delimiter = "[]:[]"
|
||||
|
||||
def __init__(self, recorderID, socket):
|
||||
self.recorderID = recorderID
|
||||
self.socket = socket
|
||||
|
||||
def send_receive(self, strList):
|
||||
#Setup the cmd string
|
||||
cmd = ""
|
||||
for token in strList:
|
||||
cmd += token + self.delimiter
|
||||
|
||||
#Send cmd
|
||||
cmd = str(len(cmd)).ljust(8) + cmd
|
||||
self.socket.send(cmd)
|
||||
|
||||
#Receive reply
|
||||
ret = ""
|
||||
tmp = self.socket.recv(8)
|
||||
count = int(tmp)
|
||||
ret = self.socket.recv(count)
|
||||
|
||||
#print "read<--" + ret
|
||||
return ret
|
||||
|
||||
#Begin recorder commands
|
||||
#####################################################
|
||||
|
||||
def IsRecording(self):
|
||||
strList = []
|
||||
strList.append( "QUERY_RECORDER %s" % self.recorderID )
|
||||
strList.append( "IS_RECORDING" )
|
||||
|
||||
retval = boolean(self.send_receive(strList)
|
||||
|
||||
def checkChannel(self, chanID):
|
||||
strList = []
|
||||
strList.append( ")
|
|
@ -49,14 +49,14 @@ class mythDB():
|
|||
|
||||
def run_sql(self, sql):
|
||||
if not self.connected:
|
||||
print "Unable to start video, could not establish connection to SQL server"
|
||||
print "Unable to perform lookup, could not establish connection to SQL server"
|
||||
return None
|
||||
|
||||
self.cursor.execute(sql)
|
||||
# get the resultset as a tuple
|
||||
result = self.cursor.fetchall()
|
||||
return result
|
||||
|
||||
|
||||
#Gets an arbitary setting from the settings table
|
||||
def get_setting(self, setting_name):
|
||||
if not self.connected:
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue