From 5378399302ecdccd6141c6532213b01719a4d767 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 17 May 2012 18:32:43 +0200 Subject: [PATCH] more clean ups --- openlp/core/lib/__init__.py | 2 +- openlp/core/ui/servicemanager.py | 12 ++++++------ openlp/plugins/media/lib/mediatab.py | 18 ++++++++---------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index ad696f954..695825e56 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -82,7 +82,7 @@ class Settings(QtCore.QSettings): return setting.toStringList() if isinstance(defaultValue, QtCore.QPoint): return setting.toPoint() - print u'No!' + print u'No!', type(defaultValue) return setting def setValue(self, key, value): diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ae76ccd44..48abc500a 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -274,9 +274,9 @@ class ServiceManager(QtGui.QWidget): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate) # Last little bits of setting up - self.service_theme = unicode(Settings().value( + self.service_theme = Settings().value( self.mainwindow.serviceManagerSettingsSection + u'/service theme', - u'')) + u'') self.servicePath = AppLocation.get_section_data_path(u'servicemanager') # build the drag and drop context menu self.dndMenu = QtGui.QMenu() @@ -608,18 +608,18 @@ class ServiceManager(QtGui.QWidget): day_delta += 7 time = now + timedelta(days=day_delta) time = time.replace(hour=service_hour, minute=service_minute) - default_pattern = unicode(Settings().value( + default_pattern = Settings().value( u'advanced/default service name', translate('OpenLP.AdvancedTab', 'Service %Y-%m-%d %H-%M', 'This may not contain any of the following characters: ' '/\\?*|<>\[\]":+\nSee http://docs.python.org/library/' 'datetime.html#strftime-strptime-behavior for more ' - 'information.'))) + 'information.')) default_filename = time.strftime(default_pattern) else: default_filename = u'' - directory = unicode(SettingsManager.get_last_dir( - self.mainwindow.serviceManagerSettingsSection)) + directory = SettingsManager.get_last_dir( + self.mainwindow.serviceManagerSettingsSection) path = os.path.join(directory, default_filename) fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, UiStrings().SaveService, path, diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 566c2a821..df17bfca6 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -67,8 +67,7 @@ class MediaTab(SettingsTab): self.playerOrderGroupBox.setObjectName(u'playerOrderGroupBox') self.playerOrderLayout = QtGui.QHBoxLayout(self.playerOrderGroupBox) self.playerOrderLayout.setObjectName(u'playerOrderLayout') - self.playerOrderlistWidget = QtGui.QListWidget( \ - self.playerOrderGroupBox) + self.playerOrderlistWidget = QtGui.QListWidget(self.playerOrderGroupBox) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) @@ -76,11 +75,11 @@ class MediaTab(SettingsTab): sizePolicy.setHeightForWidth(self.playerOrderlistWidget. \ sizePolicy().hasHeightForWidth()) self.playerOrderlistWidget.setSizePolicy(sizePolicy) - self.playerOrderlistWidget.setVerticalScrollBarPolicy( \ + self.playerOrderlistWidget.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarAsNeeded) - self.playerOrderlistWidget.setHorizontalScrollBarPolicy( \ + self.playerOrderlistWidget.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) - self.playerOrderlistWidget.setEditTriggers( \ + self.playerOrderlistWidget.setEditTriggers( QtGui.QAbstractItemView.NoEditTriggers) self.playerOrderlistWidget.setObjectName(u'playerOrderlistWidget') self.playerOrderLayout.addWidget(self.playerOrderlistWidget) @@ -199,13 +198,12 @@ class MediaTab(SettingsTab): player_string_changed = True override_changed = True setting_key = self.settingsSection + u'/override player' - if Settings().value(setting_key).toInt()[0] != \ + if Settings().value(setting_key, QtCore.Qt.Unchecked) != \ self.overridePlayerCheckBox.checkState(): Settings().setValue(setting_key, self.overridePlayerCheckBox.checkState()) override_changed = True - if override_changed: - Receiver.send_message(u'mediaitem_media_rebuild') - if player_string_changed: - Receiver.send_message(u'mediaitem_media_rebuild') + if player_string_changed or override_changed: + if override_changed: + Receiver.send_message(u'mediaitem_media_rebuild') Receiver.send_message(u'config_screen_changed')