From 81640a96128057899f8c4678ce0184b8ade76bfb Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 21 Dec 2012 19:19:26 +0000 Subject: [PATCH 1/3] Fix media starting in wrong place --- openlp/core/ui/media/mediacontroller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 2480aef28..e7f052e21 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -414,9 +414,13 @@ class MediaController(object): """ log.debug(u'video_play') controller = msg[0] + controller.seekSlider.blockSignals(True) + controller.volumeSlider.blockSignals(True) for display in self.curDisplayMediaPlayer.keys(): if display.controller == controller: if not self.curDisplayMediaPlayer[display].play(display): + controller.seekSlider.blockSignals(False) + controller.volumeSlider.blockSignals(False) return False if status: display.frame.evaluateJavaScript(u'show_blank("desktop");') @@ -428,6 +432,8 @@ class MediaController(object): # Start Timer for ui updates if not self.timer.isActive(): self.timer.start() + controller.seekSlider.blockSignals(False) + controller.volumeSlider.blockSignals(False) return True def video_pause(self, msg): From e54f4eec7b84408c8facb36133cc902e80b3a7e2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 26 Dec 2012 12:20:30 +0000 Subject: [PATCH 2/3] Interface unusable when run on XFce --- openlp/core/ui/advancedtab.py | 3 +++ openlp/core/ui/maindisplay.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 193fc63d7..bf1fe2662 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -499,6 +499,9 @@ class AdvancedTab(SettingsTab): # Default to False on Gnome. x11_bypass_default = bool(not os.environ.get(u'GNOME_DESKTOP_SESSION_ID')) + # Default to False on XFce + if os.environ.get(u'DESKTOP_SESSION') == u'xfce': + x11_bypass_default = False self.x11BypassCheckBox.setChecked(settings.value( u'x11 bypass wm', QtCore.QVariant(x11_bypass_default)).toBool()) self.defaultColor = settings.value(u'default color', diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 5302e8413..f5aa34762 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -143,6 +143,9 @@ class MainDisplay(Display): # Default to False on Gnome. x11_bypass_default = bool(not os.environ.get(u'GNOME_DESKTOP_SESSION_ID')) + # Default to False on XFce + if os.environ.get(u'DESKTOP_SESSION') == u'xfce': + x11_bypass_default = False if Settings().value(u'advanced/x11 bypass wm', QtCore.QVariant(x11_bypass_default)).toBool(): windowFlags |= QtCore.Qt.X11BypassWindowManagerHint From 4257ce29322b93923106ca97d5bb7ea201800c96 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Sat, 29 Dec 2012 22:55:40 +0000 Subject: [PATCH 3/3] Attempt to load %General section, and just ignore those we don't know --- openlp/core/ui/mainwindow.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 24980d00c..a2ca43859 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -982,6 +982,22 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): settings = Settings() import_settings = Settings(import_file_name, Settings.IniFormat) + # Lets do a basic sanity check. If it contains this string we can + # assume it was created by OpenLP and so we'll load what we can + # from it, and just silently ignore anything we don't recognise + if import_settings.value(u'SettingsImport/type').toString() \ + != u'OpenLP_settings_export': + QtGui.QMessageBox.critical(self, + translate('OpenLP.MainWindow', 'Import settings'), + translate('OpenLP.MainWindow', + 'The file you selected does appear to be a valid OpenLP ' + 'settings file.\n\n' + 'Section [%s] is not valid \n\n' + 'Processing has terminated and no changed have been made.' + ).replace('%s', u'SettingsImport'), + QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Ok)) + return import_keys = import_settings.allKeys() for section_key in import_keys: # We need to handle the really bad files. @@ -991,22 +1007,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): section = u'unknown' key = u'' # Switch General back to lowercase. - if section == u'General': + if section == u'General' or section == u'%General': section = u'general' section_key = section + "/" + key # Make sure it's a valid section for us. if not section in setting_sections: - QtGui.QMessageBox.critical(self, - translate('OpenLP.MainWindow', 'Import settings'), - translate('OpenLP.MainWindow', - 'The file you selected does appear to be a valid OpenLP ' - 'settings file.\n\n' - 'Section [%s] is not valid \n\n' - 'Processing has terminated and no changed have been made.' - ).replace('%s', section), - QtGui.QMessageBox.StandardButtons( - QtGui.QMessageBox.Ok)) - return + continue # We have a good file, import it. for section_key in import_keys: value = import_settings.value(section_key)