This commit is contained in:
Jonathan Corwin 2011-12-23 18:37:27 +00:00
commit 70ffa5b988
2 changed files with 18 additions and 3 deletions

View File

@ -30,6 +30,7 @@ and play multimedia within OpenLP.
""" """
import logging import logging
import os import os
import sys
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
@ -61,7 +62,12 @@ class Display(QtGui.QGraphicsView):
self.controller = controller self.controller = controller
self.screen = {} self.screen = {}
self.plugins = PluginManager.get_instance().plugins self.plugins = PluginManager.get_instance().plugins
self.setViewport(QtOpenGL.QGLWidget()) # FIXME: On Mac OS X (tested on 10.7) the display screen is corrupt with
# OpenGL. Only white blank screen is shown on the 2nd monitor all the
# time. We need to investigate more how to use OpenGL properly on Mac OS
# X.
if sys.platform != 'darwin':
self.setViewport(QtOpenGL.QGLWidget())
def setup(self): def setup(self):
""" """
@ -125,6 +131,11 @@ class MainDisplay(Display):
QtCore.Qt.WindowStaysOnTopHint QtCore.Qt.WindowStaysOnTopHint
if os.environ.get(u'XDG_CURRENT_DESKTOP') == u'Unity': if os.environ.get(u'XDG_CURRENT_DESKTOP') == u'Unity':
windowFlags = windowFlags | QtCore.Qt.X11BypassWindowManagerHint windowFlags = windowFlags | QtCore.Qt.X11BypassWindowManagerHint
# FIXME: QtCore.Qt.SplashScreen is workaround to make display screen
# stay always on top on Mac OS X. For details see bug 906926.
# It needs more investigation to fix it properly.
if sys.platform == 'darwin':
windowFlags = windowFlags | QtCore.Qt.SplashScreen
self.setWindowFlags(windowFlags) self.setWindowFlags(windowFlags)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
if self.isLive: if self.isLive:

View File

@ -208,7 +208,9 @@ window.OpenLP = {
}, },
showAlert: function (event) { showAlert: function (event) {
event.preventDefault(); event.preventDefault();
var text = "{\"request\": {\"text\": " + $("#alert-text").val() + "}}"; var text = "{\"request\": {\"text\": \"" +
$("#alert-text").val().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") +
"\"}}";
$.getJSON( $.getJSON(
"/api/alert", "/api/alert",
{"data": text}, {"data": text},
@ -219,7 +221,9 @@ window.OpenLP = {
}, },
search: function (event) { search: function (event) {
event.preventDefault(); event.preventDefault();
var text = "{\"request\": {\"text\": \"" + $("#search-text").val() + "\"}}"; var text = "{\"request\": {\"text\": \"" +
$("#search-text").val().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") +
"\"}}";
$.getJSON( $.getJSON(
"/api/" + $("#search-plugin").val() + "/search", "/api/" + $("#search-plugin").val() + "/search",
{"data": text}, {"data": text},