refactoring: merge with trunk and use sys.platform

This commit is contained in:
Martin Zibricky 2011-12-22 19:29:55 +01:00
commit 79c5a3a4d4
2 changed files with 13 additions and 5 deletions

View File

@ -32,7 +32,7 @@ import platform
import sqlalchemy
import BeautifulSoup
from lxml import etree
from PyQt4 import Qt, QtCore, QtGui
from PyQt4 import Qt, QtCore, QtGui, QtWebKit
try:
from PyQt4.phonon import Phonon
@ -77,6 +77,11 @@ try:
UNO_VERSION = node.getByName(u'ooSetupVersion')
except ImportError:
UNO_VERSION = u'-'
try:
WEBKIT_VERSION = QtWebKit.qWebKitVersion()
except AttributeError:
WEBKIT_VERSION = u'-'
from openlp.core.lib import translate, SettingsManager
from openlp.core.lib.ui import UiStrings
@ -111,6 +116,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
u'Qt4: %s\n' % Qt.qVersion() + \
u'Phonon: %s\n' % PHONON_VERSION + \
u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
u'QtWebkit: %s\n' % WEBKIT_VERSION + \
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
u'SQLAlchemy Migrate: %s\n' % MIGRATE_VERSION + \
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \

View File

@ -29,7 +29,8 @@ The :mod:`maindisplay` module provides the functionality to display screens
and play multimedia within OpenLP.
"""
import logging
import platform
import os
import sys
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
from PyQt4.phonon import Phonon
@ -122,12 +123,13 @@ class MainDisplay(Display):
self.firstTime = True
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
windowFlags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | \
QtCore.Qt.WindowStaysOnTopHint | \
QtCore.Qt.X11BypassWindowManagerHint
QtCore.Qt.WindowStaysOnTopHint
if os.environ.get(u'XDG_CURRENT_DESKTOP') == u'Unity':
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 platform.system() == 'Darwin':
if sys.platform == 'darwin':
windowFlags = windowFlags | QtCore.Qt.SplashScreen
self.setWindowFlags(windowFlags)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)