forked from openlp/openlp
Head 937
This commit is contained in:
commit
84792a779a
@ -323,8 +323,14 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
translate('MediaManagerItem',
|
||||
'&Add to selected Service Item'),
|
||||
self.onAddEditClick))
|
||||
QtCore.QObject.connect(
|
||||
self.listView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||
if QtCore.QSettings().value(u'advanced/double click live',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
QtCore.QObject.connect(self.listView,
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||
self.onLiveClick)
|
||||
else:
|
||||
QtCore.QObject.connect(self.listView,
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||
self.onPreviewClick)
|
||||
|
||||
def initialise(self):
|
||||
|
@ -55,7 +55,7 @@ class AdvancedTab(SettingsTab):
|
||||
self.leftLayout.setMargin(0)
|
||||
self.uiGroupBox = QtGui.QGroupBox(self.leftWidget)
|
||||
self.uiGroupBox.setObjectName(u'uiGroupBox')
|
||||
self.uiGroupBox.setMaximumWidth(260)
|
||||
self.uiGroupBox.setMaximumWidth(320)
|
||||
self.uiLayout = QtGui.QVBoxLayout(self.uiGroupBox)
|
||||
self.uiLayout.setSpacing(8)
|
||||
self.uiLayout.setMargin(6)
|
||||
@ -78,6 +78,9 @@ class AdvancedTab(SettingsTab):
|
||||
self.mediaPluginCheckBox = QtGui.QCheckBox(self.uiGroupBox)
|
||||
self.mediaPluginCheckBox.setObjectName(u'mediaPluginCheckBox')
|
||||
self.uiLayout.addWidget(self.mediaPluginCheckBox)
|
||||
self.doubleClickLiveCheckBox = QtGui.QCheckBox(self.uiGroupBox)
|
||||
self.doubleClickLiveCheckBox.setObjectName(u'doubleClickLiveCheckBox')
|
||||
self.uiLayout.addWidget(self.doubleClickLiveCheckBox)
|
||||
self.leftLayout.addWidget(self.uiGroupBox)
|
||||
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget)
|
||||
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
|
||||
@ -133,6 +136,8 @@ class AdvancedTab(SettingsTab):
|
||||
translate('AdvancedTab', 'Number of recent files to display:'))
|
||||
self.mediaPluginCheckBox.setText(translate('AdvancedTab',
|
||||
'Save currently selected media manager plugin'))
|
||||
self.doubleClickLiveCheckBox.setText(translate('AdvancedTab',
|
||||
'Double-click to send items straight to live (requires restart)'))
|
||||
# self.sharedDirGroupBox.setTitle(
|
||||
# translate('AdvancedTab', 'Central Data Store'))
|
||||
# self.sharedCheckBox.setText(
|
||||
@ -157,6 +162,9 @@ class AdvancedTab(SettingsTab):
|
||||
self.mediaPluginCheckBox.setChecked(
|
||||
settings.value(u'save current plugin',
|
||||
QtCore.QVariant(False)).toBool())
|
||||
self.doubleClickLiveCheckBox.setChecked(
|
||||
settings.value(u'double click live',
|
||||
QtCore.QVariant(False)).toBool())
|
||||
settings.endGroup()
|
||||
|
||||
def save(self):
|
||||
@ -169,6 +177,8 @@ class AdvancedTab(SettingsTab):
|
||||
QtCore.QVariant(self.recentSpinBox.value()))
|
||||
settings.setValue(u'save current plugin',
|
||||
QtCore.QVariant(self.mediaPluginCheckBox.isChecked()))
|
||||
settings.setValue(u'double click live',
|
||||
QtCore.QVariant(self.doubleClickLiveCheckBox.isChecked()))
|
||||
settings.endGroup()
|
||||
|
||||
def onSharedCheckBoxChanged(self, checked):
|
||||
@ -178,4 +188,3 @@ class AdvancedTab(SettingsTab):
|
||||
self.sharedLabel.setEnabled(checked)
|
||||
self.sharedTextEdit.setEnabled(checked)
|
||||
self.sharedPushButton.setEnabled(checked)
|
||||
|
||||
|
@ -130,9 +130,9 @@ class Ui_AmendThemeDialog(object):
|
||||
self.ImageLineEdit.setObjectName(u'ImageLineEdit')
|
||||
self.horizontalLayout_2.addWidget(self.ImageLineEdit)
|
||||
self.ImageToolButton = QtGui.QToolButton(self.ImageFilenameWidget)
|
||||
icon1 = build_icon(u':/general/general_open.png')
|
||||
self.ImageToolButton.setIcon(icon1)
|
||||
self.ImageToolButton.setIcon(build_icon(u':/general/general_open.png'))
|
||||
self.ImageToolButton.setObjectName(u'ImageToolButton')
|
||||
self.ImageToolButton.setAutoRaise(True)
|
||||
self.horizontalLayout_2.addWidget(self.ImageToolButton)
|
||||
self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole,
|
||||
self.ImageFilenameWidget)
|
||||
|
@ -59,7 +59,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
QtCore.QObject.connect(self.ShadowColorPushButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onShadowColorPushButtonClicked)
|
||||
QtCore.QObject.connect(self.ImageToolButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onImageToolButtonClicked)
|
||||
QtCore.SIGNAL(u'clicked()'), self.onImageToolButtonClicked)
|
||||
#Combo boxes
|
||||
QtCore.QObject.connect(self.BackgroundComboBox,
|
||||
QtCore.SIGNAL(u'activated(int)'), self.onBackgroundComboBoxSelected)
|
||||
|
@ -202,15 +202,21 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.addToolbarWidget(u'Hide Menu', self.HideMenu)
|
||||
self.HideMenu.setMenu(QtGui.QMenu(
|
||||
translate('SlideController', 'Hide'), self.Toolbar))
|
||||
self.BlankScreen = QtGui.QAction(QtGui.QIcon( u':/slides/slide_blank.png'), u'Blank Screen', self.HideMenu)
|
||||
self.BlankScreen = QtGui.QAction(QtGui.QIcon(
|
||||
u':/slides/slide_blank.png'), u'Blank Screen', self.HideMenu)
|
||||
self.BlankScreen.setCheckable(True)
|
||||
QtCore.QObject.connect(self.BlankScreen, QtCore.SIGNAL("triggered(bool)"), self.onBlankDisplay)
|
||||
self.ThemeScreen = QtGui.QAction(QtGui.QIcon(u':/slides/slide_theme.png'), u'Blank to Theme', self.HideMenu)
|
||||
QtCore.QObject.connect(self.BlankScreen,
|
||||
QtCore.SIGNAL("triggered(bool)"), self.onBlankDisplay)
|
||||
self.ThemeScreen = QtGui.QAction(QtGui.QIcon(
|
||||
u':/slides/slide_theme.png'), u'Blank to Theme', self.HideMenu)
|
||||
self.ThemeScreen.setCheckable(True)
|
||||
QtCore.QObject.connect(self.ThemeScreen, QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay)
|
||||
self.DesktopScreen = QtGui.QAction(QtGui.QIcon(u':/slides/slide_desktop.png'), u'Show Desktop', self.HideMenu)
|
||||
QtCore.QObject.connect(self.ThemeScreen,
|
||||
QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay)
|
||||
self.DesktopScreen = QtGui.QAction(QtGui.QIcon(
|
||||
u':/slides/slide_desktop.png'), u'Show Desktop', self.HideMenu)
|
||||
self.DesktopScreen.setCheckable(True)
|
||||
QtCore.QObject.connect(self.DesktopScreen, QtCore.SIGNAL("triggered(bool)"), self.onHideDisplay)
|
||||
QtCore.QObject.connect(self.DesktopScreen,
|
||||
QtCore.SIGNAL("triggered(bool)"), self.onHideDisplay)
|
||||
self.HideMenu.setDefaultAction(self.BlankScreen)
|
||||
self.HideMenu.menu().addAction(self.BlankScreen)
|
||||
self.HideMenu.menu().addAction(self.ThemeScreen)
|
||||
@ -241,8 +247,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.addToolbarWidget(
|
||||
u'Image SpinBox', self.DelaySpinBox)
|
||||
self.DelaySpinBox.setSuffix(translate('SlideController', 's'))
|
||||
self.DelaySpinBox.setToolTip(
|
||||
translate('SlideController',
|
||||
self.DelaySpinBox.setToolTip(translate('SlideController',
|
||||
'Delay between slides in seconds'))
|
||||
self.ControllerLayout.addWidget(self.Toolbar)
|
||||
#Build a Media ToolBar
|
||||
@ -268,8 +273,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Audio Volume', self.volumeSlider)
|
||||
self.Mediabar.addToolbarWidget(u'Audio Volume', self.volumeSlider)
|
||||
self.ControllerLayout.addWidget(self.Mediabar)
|
||||
# Build the Song Toolbar
|
||||
if isLive:
|
||||
@ -328,6 +332,11 @@ class SlideController(QtGui.QWidget):
|
||||
# Signals
|
||||
QtCore.QObject.connect(self.PreviewListWidget,
|
||||
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
|
||||
if not self.isLive:
|
||||
if QtCore.QSettings().value(u'advanced/double click live',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
QtCore.QObject.connect(self.PreviewListWidget,
|
||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onGoLive)
|
||||
if isLive:
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
|
||||
|
@ -116,6 +116,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
self.thumbPath = os.path.join(self.path, u'thumbnails')
|
||||
self.checkThemesExists(self.thumbPath)
|
||||
self.amendThemeForm.path = self.path
|
||||
self.oldBackgroundImage = None
|
||||
# Last little bits of setting up
|
||||
self.global_theme = unicode(QtCore.QSettings().value(
|
||||
self.settingsSection + u'/global theme',
|
||||
@ -187,6 +188,8 @@ class ThemeManager(QtGui.QWidget):
|
||||
item = self.ThemeListWidget.currentItem()
|
||||
theme = self.getThemeData(
|
||||
unicode(item.data(QtCore.Qt.UserRole).toString()))
|
||||
if theme.background_type == u'image':
|
||||
self.oldBackgroundImage = theme.background_filename
|
||||
self.amendThemeForm.loadTheme(theme)
|
||||
self.saveThemeName = unicode(
|
||||
item.data(QtCore.Qt.UserRole).toString())
|
||||
@ -544,6 +547,12 @@ class ThemeManager(QtGui.QWidget):
|
||||
QtGui.QMessageBox.No)
|
||||
if result == QtGui.QMessageBox.Yes:
|
||||
# Save the theme, overwriting the existing theme if necessary.
|
||||
if image_to and self.oldBackgroundImage and \
|
||||
image_to != self.oldBackgroundImage:
|
||||
try:
|
||||
os.remove(self.oldBackgroundImage)
|
||||
except OSError:
|
||||
log.exception(u'Unable to remove old theme background')
|
||||
outfile = None
|
||||
try:
|
||||
outfile = open(theme_file, u'w')
|
||||
|
Loading…
Reference in New Issue
Block a user