forked from openlp/openlp
Attempt to check for gnome version
This commit is contained in:
parent
d2659a64fc
commit
16f798e404
@ -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__ + \
|
||||
|
@ -38,6 +38,8 @@ from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \
|
||||
|
||||
from openlp.core.ui import HideMode, ScreenList, AlertLocation
|
||||
|
||||
from openlp.core.utils import get_gnome_version
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
#http://www.steveheffernan.com/html5-video-player/demo-video-player.html
|
||||
@ -120,6 +122,8 @@ class MainDisplay(Display):
|
||||
self.audioPlayer = None
|
||||
self.firstTime = True
|
||||
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
|
||||
gnome_vers = get_gnome_version()
|
||||
if gnome_vers is None or gnome_vers < u'3.2':
|
||||
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool |
|
||||
QtCore.Qt.WindowStaysOnTopHint |
|
||||
QtCore.Qt.X11BypassWindowManagerHint)
|
||||
|
@ -502,6 +502,18 @@ def get_uno_instance(resolver):
|
||||
return resolver.resolve(u'uno:socket,host=localhost,port=2002;' \
|
||||
+ u'urp;StarOffice.ComponentContext')
|
||||
|
||||
def get_gnome_version():
|
||||
if sys.platform == u'win32' or sys.platform == u'darwin':
|
||||
return None
|
||||
if os.environ.get(u'DESKTOP_SESSION') != u'gnome':
|
||||
return None
|
||||
gnome = Popen((u'gnome-session', u'--version'), stdout=PIPE)
|
||||
output, error = gnome.communicate()
|
||||
code = gnome.wait()
|
||||
if code != 1:
|
||||
return None
|
||||
return output.split(u' ')[1]
|
||||
|
||||
from languagemanager import LanguageManager
|
||||
from actions import ActionList
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user