forked from openlp/openlp
more clean ups
This commit is contained in:
parent
4a979b49d9
commit
5378399302
@ -82,7 +82,7 @@ class Settings(QtCore.QSettings):
|
|||||||
return setting.toStringList()
|
return setting.toStringList()
|
||||||
if isinstance(defaultValue, QtCore.QPoint):
|
if isinstance(defaultValue, QtCore.QPoint):
|
||||||
return setting.toPoint()
|
return setting.toPoint()
|
||||||
print u'No!'
|
print u'No!', type(defaultValue)
|
||||||
return setting
|
return setting
|
||||||
|
|
||||||
def setValue(self, key, value):
|
def setValue(self, key, value):
|
||||||
|
@ -274,9 +274,9 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate)
|
QtCore.SIGNAL(u'service_item_update'), self.serviceItemUpdate)
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
self.service_theme = unicode(Settings().value(
|
self.service_theme = Settings().value(
|
||||||
self.mainwindow.serviceManagerSettingsSection + u'/service theme',
|
self.mainwindow.serviceManagerSettingsSection + u'/service theme',
|
||||||
u''))
|
u'')
|
||||||
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
||||||
# build the drag and drop context menu
|
# build the drag and drop context menu
|
||||||
self.dndMenu = QtGui.QMenu()
|
self.dndMenu = QtGui.QMenu()
|
||||||
@ -608,18 +608,18 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
day_delta += 7
|
day_delta += 7
|
||||||
time = now + timedelta(days=day_delta)
|
time = now + timedelta(days=day_delta)
|
||||||
time = time.replace(hour=service_hour, minute=service_minute)
|
time = time.replace(hour=service_hour, minute=service_minute)
|
||||||
default_pattern = unicode(Settings().value(
|
default_pattern = Settings().value(
|
||||||
u'advanced/default service name',
|
u'advanced/default service name',
|
||||||
translate('OpenLP.AdvancedTab', 'Service %Y-%m-%d %H-%M',
|
translate('OpenLP.AdvancedTab', 'Service %Y-%m-%d %H-%M',
|
||||||
'This may not contain any of the following characters: '
|
'This may not contain any of the following characters: '
|
||||||
'/\\?*|<>\[\]":+\nSee http://docs.python.org/library/'
|
'/\\?*|<>\[\]":+\nSee http://docs.python.org/library/'
|
||||||
'datetime.html#strftime-strptime-behavior for more '
|
'datetime.html#strftime-strptime-behavior for more '
|
||||||
'information.')))
|
'information.'))
|
||||||
default_filename = time.strftime(default_pattern)
|
default_filename = time.strftime(default_pattern)
|
||||||
else:
|
else:
|
||||||
default_filename = u''
|
default_filename = u''
|
||||||
directory = unicode(SettingsManager.get_last_dir(
|
directory = SettingsManager.get_last_dir(
|
||||||
self.mainwindow.serviceManagerSettingsSection))
|
self.mainwindow.serviceManagerSettingsSection)
|
||||||
path = os.path.join(directory, default_filename)
|
path = os.path.join(directory, default_filename)
|
||||||
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
||||||
UiStrings().SaveService, path,
|
UiStrings().SaveService, path,
|
||||||
|
@ -67,8 +67,7 @@ class MediaTab(SettingsTab):
|
|||||||
self.playerOrderGroupBox.setObjectName(u'playerOrderGroupBox')
|
self.playerOrderGroupBox.setObjectName(u'playerOrderGroupBox')
|
||||||
self.playerOrderLayout = QtGui.QHBoxLayout(self.playerOrderGroupBox)
|
self.playerOrderLayout = QtGui.QHBoxLayout(self.playerOrderGroupBox)
|
||||||
self.playerOrderLayout.setObjectName(u'playerOrderLayout')
|
self.playerOrderLayout.setObjectName(u'playerOrderLayout')
|
||||||
self.playerOrderlistWidget = QtGui.QListWidget( \
|
self.playerOrderlistWidget = QtGui.QListWidget(self.playerOrderGroupBox)
|
||||||
self.playerOrderGroupBox)
|
|
||||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
|
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum,
|
||||||
QtGui.QSizePolicy.Expanding)
|
QtGui.QSizePolicy.Expanding)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
@ -76,11 +75,11 @@ class MediaTab(SettingsTab):
|
|||||||
sizePolicy.setHeightForWidth(self.playerOrderlistWidget. \
|
sizePolicy.setHeightForWidth(self.playerOrderlistWidget. \
|
||||||
sizePolicy().hasHeightForWidth())
|
sizePolicy().hasHeightForWidth())
|
||||||
self.playerOrderlistWidget.setSizePolicy(sizePolicy)
|
self.playerOrderlistWidget.setSizePolicy(sizePolicy)
|
||||||
self.playerOrderlistWidget.setVerticalScrollBarPolicy( \
|
self.playerOrderlistWidget.setVerticalScrollBarPolicy(
|
||||||
QtCore.Qt.ScrollBarAsNeeded)
|
QtCore.Qt.ScrollBarAsNeeded)
|
||||||
self.playerOrderlistWidget.setHorizontalScrollBarPolicy( \
|
self.playerOrderlistWidget.setHorizontalScrollBarPolicy(
|
||||||
QtCore.Qt.ScrollBarAlwaysOff)
|
QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
self.playerOrderlistWidget.setEditTriggers( \
|
self.playerOrderlistWidget.setEditTriggers(
|
||||||
QtGui.QAbstractItemView.NoEditTriggers)
|
QtGui.QAbstractItemView.NoEditTriggers)
|
||||||
self.playerOrderlistWidget.setObjectName(u'playerOrderlistWidget')
|
self.playerOrderlistWidget.setObjectName(u'playerOrderlistWidget')
|
||||||
self.playerOrderLayout.addWidget(self.playerOrderlistWidget)
|
self.playerOrderLayout.addWidget(self.playerOrderlistWidget)
|
||||||
@ -199,13 +198,12 @@ class MediaTab(SettingsTab):
|
|||||||
player_string_changed = True
|
player_string_changed = True
|
||||||
override_changed = True
|
override_changed = True
|
||||||
setting_key = self.settingsSection + u'/override player'
|
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():
|
self.overridePlayerCheckBox.checkState():
|
||||||
Settings().setValue(setting_key,
|
Settings().setValue(setting_key,
|
||||||
self.overridePlayerCheckBox.checkState())
|
self.overridePlayerCheckBox.checkState())
|
||||||
override_changed = True
|
override_changed = True
|
||||||
|
if player_string_changed or override_changed:
|
||||||
if override_changed:
|
if override_changed:
|
||||||
Receiver.send_message(u'mediaitem_media_rebuild')
|
Receiver.send_message(u'mediaitem_media_rebuild')
|
||||||
if player_string_changed:
|
|
||||||
Receiver.send_message(u'mediaitem_media_rebuild')
|
|
||||||
Receiver.send_message(u'config_screen_changed')
|
Receiver.send_message(u'config_screen_changed')
|
||||||
|
Loading…
Reference in New Issue
Block a user