openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #13430
[Merge] lp:~trb143/openlp/bug-850254 into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bug-850254 into lp:openlp.
Requested reviews:
Raoul Snyman (raoul-snyman)
Related bugs:
Bug #850254 in OpenLP: "Web remote interface does not affect local button's state"
https://bugs.launchpad.net/openlp/+bug/850254
For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-850254/+merge/85934
This is the core changes to handle the remote events for hiding and showing screens
--
https://code.launchpad.net/~trb143/openlp/bug-850254/+merge/85934
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-12-09 12:35:18 +0000
+++ openlp/core/ui/slidecontroller.py 2011-12-15 19:01:50 +0000
@@ -95,7 +95,7 @@
u'Edit Song',
]
self.nextPreviousList = [
- u'Previous Slide',
+ u'Previous Slide',
u'Next Slide'
]
self.timer_id = 0
@@ -114,8 +114,8 @@
self.typeLabel.setText(UiStrings().Live)
self.split = 1
self.typePrefix = u'live'
- self.keypress_queue = deque()
- self.keypress_loop = False
+ self.keypress_queue = deque()
+ self.keypress_loop = False
else:
self.typeLabel.setText(UiStrings().Preview)
self.split = 0
@@ -187,7 +187,7 @@
translate('OpenLP.SlideController', 'Hide'), self.toolbar))
self.blankScreen = shortcut_action(self.hideMenu, u'blankScreen',
[QtCore.Qt.Key_Period], self.onBlankDisplay,
- u':/slides/slide_blank.png', False,
+ u':/slides/slide_blank.png', False,
unicode(UiStrings().LiveToolbar))
self.blankScreen.setText(
translate('OpenLP.SlideController', 'Blank Screen'))
@@ -412,6 +412,9 @@
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
self.receiveSpinDelay)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'slidecontroller_toggle_display'),
+ self.toggleDisplay)
self.toolbar.makeWidgetsInvisible(self.loopList)
else:
QtCore.QObject.connect(self.previewListWidget,
@@ -570,6 +573,21 @@
self.display.setVisible(False)
self.mediaController.video_stop([self])
+ def toggleDisplay(self, action):
+ """
+ Toggle the display settings triggered from remote messages.
+ """
+ if action == u'blank' or action == u'hide':
+ self.onBlankDisplay(True)
+ elif action == u'theme':
+ self.onThemeDisplay(True)
+ elif action == u'desktop':
+ self.onHideDisplay(True)
+ elif action == u'show':
+ self.onBlankDisplay(False)
+ self.onThemeDisplay(False)
+ self.onHideDisplay(False)
+
def servicePrevious(self):
"""
Live event to select the previous service item from the service manager.
@@ -618,8 +636,8 @@
self.previewSizeChanged()
self.previewDisplay.setup()
serviceItem = ServiceItem()
- self.previewDisplay.webView.setHtml(build_html(serviceItem,
- self.previewDisplay.screen, None, self.isLive, None,
+ self.previewDisplay.webView.setHtml(build_html(serviceItem,
+ self.previewDisplay.screen, None, self.isLive, None,
plugins=PluginManager.get_instance().plugins))
self.mediaController.setup_display(self.previewDisplay)
if self.serviceItem:
=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py 2011-12-14 22:39:52 +0000
+++ openlp/plugins/remotes/lib/httpserver.py 2011-12-15 19:01:50 +0000
@@ -249,7 +249,7 @@
(r'^/api/poll$', self.poll),
(r'^/api/controller/(live|preview)/(.*)$', self.controller),
(r'^/api/service/(.*)$', self.service),
- (r'^/api/display/(hide|show)$', self.display),
+ (r'^/api/display/(hide|show|blank|theme|desktop)$', self.display),
(r'^/api/alert$', self.alert),
(r'^/api/plugin/(search)$', self.pluginInfo),
(r'^/api/(.*)/search$', self.search),
@@ -401,7 +401,13 @@
u'item': self.parent.current_item._uuid \
if self.parent.current_item else u'',
u'twelve':QtCore.QSettings().value(
- u'remotes/twelve hour', QtCore.QVariant(True)).toBool()
+ u'remotes/twelve hour', QtCore.QVariant(True)).toBool(),
+ u'blank': self.parent.plugin.liveController.blankScreen.\
+ isChecked(),
+ u'theme': self.parent.plugin.liveController.themeScreen.\
+ isChecked(),
+ u'display': self.parent.plugin.liveController.desktopScreen.\
+ isChecked()
}
return HttpResponse(json.dumps({u'results': result}),
{u'Content-Type': u'application/json'})
@@ -413,8 +419,7 @@
``action``
This is the action, either ``hide`` or ``show``.
"""
- event = u'live_display_%s' % action
- Receiver.send_message(event, HideMode.Blank)
+ Receiver.send_message(u'slidecontroller_toggle_display', action)
return HttpResponse(json.dumps({u'results': {u'success': True}}),
{u'Content-Type': u'application/json'})
Follow ups