forked from openlp/openlp
Merged in lp:~raoul-snyman/openlp/bitsandbobs
bzr-revno: 671
This commit is contained in:
commit
2054d38cae
23
openlp.pyw
23
openlp.pyw
@ -133,8 +133,16 @@ def main():
|
||||
# Set up command line options.
|
||||
usage = u'Usage: %prog [options] [qt-options]'
|
||||
parser = OptionParser(usage=usage)
|
||||
parser.add_option("-d", "--debug", dest="debug",
|
||||
action="store_true", help="set logging to DEBUG level")
|
||||
parser.add_option("-l", "--log-level", dest="loglevel",
|
||||
default="info", metavar="LEVEL",
|
||||
help="Set logging to LEVEL level. Valid values are "
|
||||
"\"debug\", \"info\", \"warning\".")
|
||||
parser.add_option("-p", "--portable", dest="portable",
|
||||
action="store_true",
|
||||
help="Specify if this should be run as a portable app, "
|
||||
"off a USB flash drive.")
|
||||
parser.add_option("-s", "--style", dest="style",
|
||||
help="Set the Qt4 style (passed directly to Qt4).")
|
||||
# Set up logging
|
||||
filename = u'openlp.log'
|
||||
logfile = RotatingFileHandler(filename, maxBytes=200000, backupCount=5)
|
||||
@ -144,14 +152,21 @@ def main():
|
||||
logging.addLevelName(15, u'Timer')
|
||||
# Parse command line options and deal with them.
|
||||
(options, args) = parser.parse_args()
|
||||
if options.debug:
|
||||
qt_args = []
|
||||
if options.loglevel.lower() in ['d', 'debug']:
|
||||
log.setLevel(logging.DEBUG)
|
||||
elif options.loglevel.lower() in ['w', 'warning']:
|
||||
log.setLevel(logging.WARNING)
|
||||
else:
|
||||
log.setLevel(logging.INFO)
|
||||
if options.style:
|
||||
qt_args.extend(['-style', options.style])
|
||||
# Throw the rest of the arguments at Qt, just in case.
|
||||
qt_args.extend(args)
|
||||
# Initialise the resources
|
||||
qInitResources()
|
||||
# Now create and actually run the application.
|
||||
app = OpenLP(sys.argv)
|
||||
app = OpenLP(qt_args)
|
||||
sys.exit(app.run())
|
||||
|
||||
if __name__ == u'__main__':
|
||||
|
@ -129,16 +129,16 @@ class EventReceiver(QtCore.QObject):
|
||||
|
||||
class Receiver():
|
||||
"""
|
||||
Class to allow events to be passed from different parts of the
|
||||
system. This is a static wrapper around the ``EventReceiver``
|
||||
class. As there is only one instance of it in the system the QT
|
||||
signal/slot architecture can send messages across the system.
|
||||
Class to allow events to be passed from different parts of the system. This
|
||||
is a static wrapper around the ``EventReceiver`` class. As there is only
|
||||
one instance of it in the system the Qt4 signal/slot architecture can send
|
||||
messages across the system.
|
||||
|
||||
To send a message:
|
||||
``Receiver().send_message(u'<<Message ID>>', data)``
|
||||
``Receiver.send_message(u'<<Message ID>>', data)``
|
||||
|
||||
To receive a Message
|
||||
``QtCore.QObject.connect(Receiver().get_receiver(), QtCore.SIGNAL(u'<<Message ID>>'), <<ACTION>>)``
|
||||
``QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'<<Message ID>>'), <<ACTION>>)``
|
||||
"""
|
||||
eventreceiver = EventReceiver()
|
||||
|
||||
|
@ -46,7 +46,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
self.log.debug(u'Init done')
|
||||
|
||||
def addToolbarButton(self, title, icon, tooltip=None, slot=None,
|
||||
objectname=None):
|
||||
checkable=False):
|
||||
"""
|
||||
A method to help developers easily add a button to the toolbar.
|
||||
|
||||
@ -69,14 +69,19 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
"""
|
||||
ButtonIcon = buildIcon(icon)
|
||||
if ButtonIcon:
|
||||
if slot:
|
||||
if slot and not checkable:
|
||||
ToolbarButton = self.addAction(ButtonIcon, title, slot)
|
||||
else:
|
||||
ToolbarButton = self.addAction(ButtonIcon, title)
|
||||
if tooltip:
|
||||
ToolbarButton.setToolTip(tooltip)
|
||||
if checkable:
|
||||
ToolbarButton.setCheckable(True)
|
||||
QtCore.QObject.connect(ToolbarButton,
|
||||
QtCore.SIGNAL(u'toggled(bool)'), slot)
|
||||
self.icons[title] = ButtonIcon
|
||||
self.actions[title] = ToolbarButton
|
||||
return ToolbarButton
|
||||
|
||||
def addToolbarSeparator(self, handle):
|
||||
"""
|
||||
|
@ -47,16 +47,16 @@ class DisplayWidget(QtGui.QWidget):
|
||||
if type(event) == QtGui.QKeyEvent:
|
||||
#here accept the event and do something
|
||||
if event.key() == QtCore.Qt.Key_Up:
|
||||
Receiver().send_message(u'live_slidecontroller_previous')
|
||||
Receiver.send_message(u'live_slidecontroller_previous')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Down:
|
||||
Receiver().send_message(u'live_slidecontroller_next')
|
||||
Receiver.send_message(u'live_slidecontroller_next')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_PageUp:
|
||||
Receiver().send_message(u'live_slidecontroller_first')
|
||||
Receiver.send_message(u'live_slidecontroller_first')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_PageDown:
|
||||
Receiver().send_message(u'live_slidecontroller_last')
|
||||
Receiver.send_message(u'live_slidecontroller_last')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Escape:
|
||||
self.resetDisplay()
|
||||
@ -110,8 +110,6 @@ class MainDisplay(DisplayWidget):
|
||||
self.timer_id = 0
|
||||
self.firstTime = True
|
||||
self.mediaLoaded = False
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'live_slide_blank'), self.blankDisplay)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'alert_text'), self.displayAlert)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
@ -207,19 +205,17 @@ class MainDisplay(DisplayWidget):
|
||||
# def aa(self):
|
||||
# self.setWindowOpacity(1)
|
||||
|
||||
def blankDisplay(self):
|
||||
if not self.displayBlank:
|
||||
def blankDisplay(self, blanked=True):
|
||||
if blanked:
|
||||
self.displayBlank = True
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame))
|
||||
else:
|
||||
self.displayBlank = False
|
||||
if self.frame:
|
||||
self.frameView(self.frame)
|
||||
if self.parent.LiveController.blackPushButton.isChecked() != \
|
||||
self.displayBlank:
|
||||
self.parent.LiveController.blackPushButton.setChecked(
|
||||
self.displayBlank)
|
||||
self.parent.generalConfig.set_config(u'Screen Blank',self.displayBlank)
|
||||
if blanked != self.parent.LiveController.blankButton.isChecked():
|
||||
self.parent.LiveController.blankButton.setChecked(self.displayBlank)
|
||||
self.parent.generalConfig.set_config(u'Screen Blank', self.displayBlank)
|
||||
|
||||
def displayAlert(self, text=u''):
|
||||
"""
|
||||
|
@ -595,7 +595,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
item, count = self.findServiceItem()
|
||||
if self.serviceItems[item][u'data'].editEnabled:
|
||||
self.remoteEditTriggered = True
|
||||
Receiver().send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' %
|
||||
Receiver.send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' %
|
||||
self.serviceItems[item][u'data'].editId )
|
||||
|
||||
def onRemoteEditClear(self):
|
||||
@ -662,7 +662,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
self.serviceItems.insert(newpos, serviceItem)
|
||||
self.repaintServiceList(endpos, startCount)
|
||||
else:
|
||||
Receiver().send_message(u'%s_add_service_item' % plugin)
|
||||
Receiver.send_message(u'%s_add_service_item' % plugin)
|
||||
|
||||
def updateThemeList(self, theme_list):
|
||||
"""
|
||||
|
@ -67,7 +67,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||
def accept(self):
|
||||
for tab_index in range(0, self.SettingsTabWidget.count()):
|
||||
self.SettingsTabWidget.widget(tab_index).save()
|
||||
Receiver().send_message(u'config_updated')
|
||||
Receiver.send_message(u'config_updated')
|
||||
return QtGui.QDialog.accept(self)
|
||||
|
||||
def postSetUp(self):
|
||||
|
@ -158,8 +158,11 @@ class SlideController(QtGui.QWidget):
|
||||
self.trUtf8(u'Move to last'), self.onSlideSelectedLast)
|
||||
if self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.blackPushButton = self.Toolbar.addPushButton(
|
||||
u':/slides/slide_close.png')
|
||||
self.blankButton = self.Toolbar.addToolbarButton(
|
||||
u'Blank Screen', u':/slides/slide_close.png',
|
||||
self.trUtf8(u'Blank Screen'), self.onBlankScreen, True)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'live_slide_blank'), self.onBlankDisplay)
|
||||
if not self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.Toolbar.addToolbarButton(
|
||||
@ -196,7 +199,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName("volumeSlider")
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Audio Volume', self.volumeSlider)
|
||||
self.ControllerLayout.addWidget(self.Mediabar)
|
||||
@ -264,11 +267,11 @@ class SlideController(QtGui.QWidget):
|
||||
QtCore.QObject.connect(self.PreviewListWidget,
|
||||
QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
|
||||
if isLive:
|
||||
QtCore.QObject.connect(self.blackPushButton,
|
||||
QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen)
|
||||
#QtCore.QObject.connect(self.blackPushButton,
|
||||
# QtCore.SIGNAL(u'clicked(bool)'), self.onBlankScreen)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
|
||||
Receiver().send_message(u'request_spin_delay')
|
||||
Receiver.send_message(u'request_spin_delay')
|
||||
if isLive:
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
else:
|
||||
@ -401,7 +404,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.enableToolBar(item)
|
||||
if item.isCommand():
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
Receiver.send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title'], self.isLive])
|
||||
else:
|
||||
@ -434,7 +437,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.enableToolBar(item)
|
||||
if item.isCommand():
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
Receiver.send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title'], slideno, self.isLive])
|
||||
else:
|
||||
@ -487,7 +490,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.PreviewListWidget.setFocus()
|
||||
log.log(15, u'Display Rendering took %4s' % (time.time() - before))
|
||||
if self.serviceitem.audit and self.isLive:
|
||||
Receiver().send_message(u'songusage_live', self.serviceitem.audit)
|
||||
Receiver.send_message(u'songusage_live', self.serviceitem.audit)
|
||||
log.debug(u'displayServiceManagerItems End')
|
||||
|
||||
#Screen event methods
|
||||
@ -496,23 +499,26 @@ class SlideController(QtGui.QWidget):
|
||||
Go to the first slide.
|
||||
"""
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_first'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_first'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
self.PreviewListWidget.selectRow(0)
|
||||
self.onSlideSelected()
|
||||
|
||||
def onBlankDisplay(self):
|
||||
self.blankButton.setChecked(self.parent.mainDisplay.displayBlank)
|
||||
|
||||
def onBlankScreen(self, blanked):
|
||||
"""
|
||||
Blank the screen.
|
||||
"""
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
if blanked:
|
||||
Receiver().send_message(u'%s_blank'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_blank'% self.commandItem.name.lower())
|
||||
else:
|
||||
Receiver().send_message(u'%s_unblank'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_unblank'% self.commandItem.name.lower())
|
||||
else:
|
||||
self.parent.mainDisplay.blankDisplay()
|
||||
self.parent.mainDisplay.blankDisplay(blanked)
|
||||
|
||||
def onSlideSelected(self):
|
||||
"""
|
||||
@ -523,7 +529,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.row = 0
|
||||
if row > -1 and row < self.PreviewListWidget.rowCount():
|
||||
if self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
|
||||
Receiver.send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
|
||||
if self.isLive:
|
||||
self.updatePreview()
|
||||
else:
|
||||
@ -568,7 +574,7 @@ class SlideController(QtGui.QWidget):
|
||||
Go to the next slide.
|
||||
"""
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_next'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_next'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
row = self.PreviewListWidget.currentRow() + 1
|
||||
@ -582,7 +588,7 @@ class SlideController(QtGui.QWidget):
|
||||
Go to the previous slide.
|
||||
"""
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(
|
||||
Receiver.send_message(
|
||||
u'%s_previous'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
@ -597,7 +603,7 @@ class SlideController(QtGui.QWidget):
|
||||
Go to the last slide.
|
||||
"""
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_last'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_last'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1)
|
||||
@ -626,7 +632,7 @@ class SlideController(QtGui.QWidget):
|
||||
|
||||
def onEditSong(self):
|
||||
self.songEdit = True
|
||||
Receiver().send_message(u'%s_edit' % self.commandItem.name, u'P:%s' %
|
||||
Receiver.send_message(u'%s_edit' % self.commandItem.name, u'P:%s' %
|
||||
self.commandItem.editId )
|
||||
|
||||
def onGoLive(self):
|
||||
@ -647,13 +653,13 @@ class SlideController(QtGui.QWidget):
|
||||
|
||||
def onMediaPause(self):
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_pause'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_pause'% self.commandItem.name.lower())
|
||||
else:
|
||||
self.mediaObject.pause()
|
||||
|
||||
def onMediaPlay(self):
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive)
|
||||
Receiver.send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive)
|
||||
else:
|
||||
self.SlidePreview.hide()
|
||||
self.video.show()
|
||||
@ -661,7 +667,7 @@ class SlideController(QtGui.QWidget):
|
||||
|
||||
def onMediaStop(self):
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
|
||||
Receiver.send_message(u'%s_stop'% self.commandItem.name.lower())
|
||||
else:
|
||||
self.mediaObject.stop()
|
||||
self.video.hide()
|
||||
|
@ -145,7 +145,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
name = u'%s (%s)' % (self.global_theme, self.trUtf8(u'default'))
|
||||
self.ThemeListWidget.item(count).setText(name)
|
||||
self.config.set_config(u'theme global theme', self.global_theme)
|
||||
Receiver().send_message(
|
||||
Receiver.send_message(
|
||||
u'update_global_theme', self.global_theme)
|
||||
self.pushThemes()
|
||||
|
||||
@ -267,7 +267,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
self.pushThemes()
|
||||
|
||||
def pushThemes(self):
|
||||
Receiver().send_message(u'update_themes', self.getThemes())
|
||||
Receiver.send_message(u'update_themes', self.getThemes() )
|
||||
|
||||
def getThemes(self):
|
||||
return self.themelist
|
||||
|
@ -135,10 +135,10 @@ class ThemesTab(SettingsTab):
|
||||
def save(self):
|
||||
self.config.set_config(u'theme global style', self.global_style )
|
||||
self.config.set_config(u'theme global theme',self.global_theme)
|
||||
Receiver().send_message(u'update_global_theme', self.global_theme )
|
||||
Receiver.send_message(u'update_global_theme', self.global_theme )
|
||||
|
||||
def postSetUp(self):
|
||||
Receiver().send_message(u'update_global_theme', self.global_theme )
|
||||
Receiver.send_message(u'update_global_theme', self.global_theme )
|
||||
|
||||
def onSongLevelButtonPressed(self):
|
||||
self.global_style = u'Song'
|
||||
|
@ -199,9 +199,9 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog):
|
||||
def onCancelButtonClicked(self):
|
||||
# tell import to stop
|
||||
self.message = self.trUtf8(u'Bible import stopped')
|
||||
Receiver().send_message(u'stop_import')
|
||||
Receiver.send_message(u'stop_import')
|
||||
# tell bibleplugin to reload the bibles
|
||||
Receiver().send_message(u'pre_load_bibles')
|
||||
Receiver.send_message(u'pre_load_bibles')
|
||||
self.close()
|
||||
|
||||
def onImportButtonClicked(self):
|
||||
@ -220,7 +220,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog):
|
||||
self.MessageLabel.setText(message)
|
||||
self.ProgressBar.setValue(self.barmax)
|
||||
# tell bibleplugin to reload the bibles
|
||||
Receiver().send_message(u'pre_load_bibles')
|
||||
Receiver.send_message(u'pre_load_bibles')
|
||||
QtGui.QMessageBox.information(self,
|
||||
self.trUtf8(u'Information'), self.trUtf8(message))
|
||||
|
||||
|
@ -40,7 +40,7 @@ class BibleCSVImpl(BibleCommon):
|
||||
"""
|
||||
self.bibledb = bibledb
|
||||
self.loadbible = True
|
||||
QtCore.QObject.connect(Receiver().get_receiver(),
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
|
||||
|
||||
def stop_import(self):
|
||||
@ -66,7 +66,7 @@ class BibleCSVImpl(BibleCommon):
|
||||
count += 1
|
||||
#Flush the screen events
|
||||
if count % 3 == 0:
|
||||
Receiver().send_message(u'process_events')
|
||||
Receiver.send_message(u'process_events')
|
||||
count = 0
|
||||
except:
|
||||
log.exception(u'Loading books from file failed')
|
||||
@ -97,7 +97,7 @@ class BibleCSVImpl(BibleCommon):
|
||||
count += 1
|
||||
#Every x verses repaint the screen
|
||||
if count % 3 == 0:
|
||||
Receiver().send_message(u'process_events')
|
||||
Receiver.send_message(u'process_events')
|
||||
count = 0
|
||||
except:
|
||||
log.exception(u'Loading verses from file failed')
|
||||
|
@ -74,7 +74,7 @@ class BibleOSISImpl():
|
||||
self.loadbible = False
|
||||
if fbibles:
|
||||
fbibles.close()
|
||||
QtCore.QObject.connect(Receiver().get_receiver(),
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'openlpstopimport'), self.stop_import)
|
||||
|
||||
def stop_import(self):
|
||||
@ -173,13 +173,13 @@ class BibleOSISImpl():
|
||||
testament)
|
||||
dialogobject.incrementProgressBar(
|
||||
self.booksOfBible[p[0]])
|
||||
Receiver().send_message(u'process_events')
|
||||
Receiver.send_message(u'process_events')
|
||||
count = 0
|
||||
self.bibledb.add_verse(book.id, p[1], p[2], text)
|
||||
count += 1
|
||||
#Every 3 verses repaint the screen
|
||||
if count % 3 == 0:
|
||||
Receiver().send_message(u'process_events')
|
||||
Receiver.send_message(u'process_events')
|
||||
count = 0
|
||||
except:
|
||||
log.exception(u'Loading bible from OSIS file failed')
|
||||
|
@ -54,7 +54,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
# place to store the search results
|
||||
self.search_results = {}
|
||||
QtCore.QObject.connect(Receiver().get_receiver(),
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
@ -284,7 +284,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
def setQuickMessage(self, text):
|
||||
self.QuickMessage.setText(text)
|
||||
self.AdvancedMessage.setText(text)
|
||||
Receiver().send_message(u'process_events')
|
||||
Receiver.send_message(u'process_events')
|
||||
#minor delay to get the events processed
|
||||
time.sleep(0.1)
|
||||
|
||||
|
@ -82,7 +82,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
log.debug(u'onPreview')
|
||||
if button.text() == unicode(self.trUtf8(u'Save && Preview')) \
|
||||
and self.saveCustom():
|
||||
Receiver().send_message(u'preview_custom')
|
||||
Receiver.send_message(u'preview_custom')
|
||||
|
||||
def initialise(self):
|
||||
self.editAll = False
|
||||
@ -130,13 +130,13 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
self.previewButton.setVisible(True)
|
||||
|
||||
def closePressed(self):
|
||||
Receiver().send_message(u'remote_edit_clear')
|
||||
Receiver.send_message(u'remote_edit_clear')
|
||||
self.close()
|
||||
|
||||
def accept(self):
|
||||
log.debug(u'accept')
|
||||
if self.saveCustom():
|
||||
Receiver().send_message(u'load_custom_list')
|
||||
Receiver.send_message(u'load_custom_list')
|
||||
self.close()
|
||||
|
||||
def saveCustom(self):
|
||||
|
@ -74,7 +74,7 @@ class ImageTab(SettingsTab):
|
||||
|
||||
def save(self):
|
||||
self.config.set_config(u'loop delay', self.loop_delay)
|
||||
Receiver().send_message(u'update_spin_delay', self.loop_delay)
|
||||
Receiver.send_message(u'update_spin_delay', self.loop_delay)
|
||||
|
||||
def postSetUp(self):
|
||||
Receiver().send_message(u'update_spin_delay', self.loop_delay)
|
||||
Receiver.send_message(u'update_spin_delay', self.loop_delay)
|
||||
|
@ -77,7 +77,7 @@ class MessageListener(object):
|
||||
self.controller.load_presentation(file)
|
||||
if self.is_live:
|
||||
self.controller.start_presentation()
|
||||
Receiver().send_message(u'live_slide_hide')
|
||||
Receiver.send_message(u'live_slide_hide')
|
||||
self.controller.slidenumber = 0
|
||||
self.timer.start()
|
||||
|
||||
@ -89,7 +89,7 @@ class MessageListener(object):
|
||||
self.controller.start_presentation()
|
||||
if self.controller.slidenumber > 1:
|
||||
self.controller.goto_slide(self.controller.slidenumber)
|
||||
|
||||
|
||||
def slide(self, message):
|
||||
if not self.is_live:
|
||||
return
|
||||
@ -143,7 +143,7 @@ class MessageListener(object):
|
||||
Based on the handler passed at startup triggers slide show to shut down
|
||||
"""
|
||||
if self.is_live:
|
||||
Receiver().send_message(u'live_slide_show')
|
||||
Receiver.send_message(u'live_slide_show')
|
||||
self.controller.close_presentation()
|
||||
self.controller.slidenumber = 0
|
||||
self.timer.stop()
|
||||
@ -155,13 +155,13 @@ class MessageListener(object):
|
||||
return
|
||||
if not self.controller.is_active():
|
||||
return
|
||||
self.controller.blank_screen()
|
||||
self.controller.blank_screen()
|
||||
|
||||
def unblank(self):
|
||||
if not self.is_live:
|
||||
return
|
||||
self.activate()
|
||||
self.controller.unblank_screen()
|
||||
self.controller.unblank_screen()
|
||||
|
||||
def decodeMessage(self, message):
|
||||
"""
|
||||
|
@ -50,25 +50,25 @@ class PresentationController(object):
|
||||
|
||||
``name``
|
||||
The name that appears in the options and the media manager
|
||||
|
||||
|
||||
``enabled``
|
||||
The controller is enabled
|
||||
|
||||
``available``
|
||||
The controller is available on this machine. Set by init via
|
||||
call to check_available
|
||||
|
||||
|
||||
``plugin``
|
||||
The presentationplugin object
|
||||
|
||||
**Hook Functions**
|
||||
|
||||
|
||||
``kill()``
|
||||
Called at system exit to clean up any running presentations
|
||||
|
||||
``check_available()``
|
||||
Returns True if presentation application is installed/can run on this machine
|
||||
|
||||
|
||||
``presentation_deleted()``
|
||||
Deletes presentation specific files, e.g. thumbnails
|
||||
|
||||
@ -83,7 +83,7 @@ class PresentationController(object):
|
||||
|
||||
``is_active()``
|
||||
Returns True if a presentation is currently running
|
||||
|
||||
|
||||
``blank_screen()``
|
||||
Blanks the screen, making it black.
|
||||
|
||||
@ -118,7 +118,7 @@ class PresentationController(object):
|
||||
global log
|
||||
log = logging.getLogger(u'PresentationController')
|
||||
log.info(u'loaded')
|
||||
|
||||
|
||||
def __init__(self, plugin=None, name=u'PresentationController'):
|
||||
"""
|
||||
This is the constructor for the presentationcontroller object.
|
||||
@ -163,7 +163,7 @@ class PresentationController(object):
|
||||
"""
|
||||
self.store_filename(presentation)
|
||||
shutil.rmtree(self.thumbnailpath)
|
||||
|
||||
|
||||
def start_process(self):
|
||||
"""
|
||||
Loads a running version of the presentation application in the background.
|
||||
@ -229,7 +229,7 @@ class PresentationController(object):
|
||||
Returns true if a presentation is loaded
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def blank_screen(self):
|
||||
"""
|
||||
Blanks the screen, making it black.
|
||||
@ -311,5 +311,5 @@ class PresentationController(object):
|
||||
prefix = u'live'
|
||||
else:
|
||||
prefix = u'preview'
|
||||
Receiver().send_message(u'%s_slidecontroller_change' % prefix,
|
||||
Receiver.send_message(u'%s_slidecontroller_change' % prefix,
|
||||
self.slidenumber - 1)
|
||||
|
@ -73,9 +73,9 @@ class RemotesPlugin(Plugin):
|
||||
pos = datagram.find(u':')
|
||||
event = unicode(datagram[:pos].lower())
|
||||
if event == u'alert':
|
||||
Receiver().send_message(u'alert_text', unicode(datagram[pos + 1:]))
|
||||
Receiver.send_message(u'alert_text', unicode(datagram[pos + 1:]))
|
||||
if event == u'next_slide':
|
||||
Receiver().send_message(u'live_slide_next')
|
||||
Receiver.send_message(u'live_slide_next')
|
||||
|
||||
def about(self):
|
||||
about_text = self.trUtf8(u'<b>Remote Plugin</b><br>This plugin '
|
||||
|
@ -404,16 +404,16 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
log.debug(u'onPreview')
|
||||
if button.text() == unicode(self.trUtf8(u'Save && Preview')) \
|
||||
and self.saveSong():
|
||||
Receiver().send_message(u'preview_song')
|
||||
Receiver.send_message(u'preview_song')
|
||||
|
||||
def closePressed(self):
|
||||
Receiver().send_message(u'remote_edit_clear')
|
||||
Receiver.send_message(u'remote_edit_clear')
|
||||
self.close()
|
||||
|
||||
def accept(self):
|
||||
log.debug(u'accept')
|
||||
if self.saveSong():
|
||||
Receiver().send_message(u'load_song_list')
|
||||
Receiver.send_message(u'load_song_list')
|
||||
self.close()
|
||||
|
||||
def saveSong(self):
|
||||
|
Loading…
Reference in New Issue
Block a user