AdvancedTab: Double click to live

This commit is contained in:
Jon Tibble 2010-07-13 17:00:33 +01:00
parent c7c9a11c36
commit 44506f2c84
3 changed files with 39 additions and 16 deletions

View File

@ -323,9 +323,15 @@ class MediaManagerItem(QtGui.QWidget):
translate('MediaManagerItem', translate('MediaManagerItem',
'&Add to selected Service Item'), '&Add to selected Service Item'),
self.onAddEditClick)) self.onAddEditClick))
QtCore.QObject.connect( if QtCore.QSettings().value(u'advanced/double click live',
self.listView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), QtCore.QVariant(False)).toBool():
self.onPreviewClick) 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): def initialise(self):
""" """

View File

@ -55,7 +55,7 @@ class AdvancedTab(SettingsTab):
self.leftLayout.setMargin(0) self.leftLayout.setMargin(0)
self.uiGroupBox = QtGui.QGroupBox(self.leftWidget) self.uiGroupBox = QtGui.QGroupBox(self.leftWidget)
self.uiGroupBox.setObjectName(u'uiGroupBox') self.uiGroupBox.setObjectName(u'uiGroupBox')
self.uiGroupBox.setMaximumWidth(260) self.uiGroupBox.setMaximumWidth(320)
self.uiLayout = QtGui.QVBoxLayout(self.uiGroupBox) self.uiLayout = QtGui.QVBoxLayout(self.uiGroupBox)
self.uiLayout.setSpacing(8) self.uiLayout.setSpacing(8)
self.uiLayout.setMargin(6) self.uiLayout.setMargin(6)
@ -78,6 +78,9 @@ class AdvancedTab(SettingsTab):
self.mediaPluginCheckBox = QtGui.QCheckBox(self.uiGroupBox) self.mediaPluginCheckBox = QtGui.QCheckBox(self.uiGroupBox)
self.mediaPluginCheckBox.setObjectName(u'mediaPluginCheckBox') self.mediaPluginCheckBox.setObjectName(u'mediaPluginCheckBox')
self.uiLayout.addWidget(self.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.leftLayout.addWidget(self.uiGroupBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget) # self.sharedDirGroupBox = QtGui.QGroupBox(self.leftWidget)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox') # self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
@ -133,6 +136,8 @@ class AdvancedTab(SettingsTab):
translate('AdvancedTab', 'Number of recent files to display:')) translate('AdvancedTab', 'Number of recent files to display:'))
self.mediaPluginCheckBox.setText(translate('AdvancedTab', self.mediaPluginCheckBox.setText(translate('AdvancedTab',
'Save currently selected media manager plugin')) 'Save currently selected media manager plugin'))
self.doubleClickLiveCheckBox.setText(translate('AdvancedTab',
'Double-click to send items straight to live (requires restart)'))
# self.sharedDirGroupBox.setTitle( # self.sharedDirGroupBox.setTitle(
# translate('AdvancedTab', 'Central Data Store')) # translate('AdvancedTab', 'Central Data Store'))
# self.sharedCheckBox.setText( # self.sharedCheckBox.setText(
@ -157,6 +162,9 @@ class AdvancedTab(SettingsTab):
self.mediaPluginCheckBox.setChecked( self.mediaPluginCheckBox.setChecked(
settings.value(u'save current plugin', settings.value(u'save current plugin',
QtCore.QVariant(False)).toBool()) QtCore.QVariant(False)).toBool())
self.doubleClickLiveCheckBox.setChecked(
settings.value(u'double click live',
QtCore.QVariant(False)).toBool())
settings.endGroup() settings.endGroup()
def save(self): def save(self):
@ -169,6 +177,8 @@ class AdvancedTab(SettingsTab):
QtCore.QVariant(self.recentSpinBox.value())) QtCore.QVariant(self.recentSpinBox.value()))
settings.setValue(u'save current plugin', settings.setValue(u'save current plugin',
QtCore.QVariant(self.mediaPluginCheckBox.isChecked())) QtCore.QVariant(self.mediaPluginCheckBox.isChecked()))
settings.setValue(u'double click live',
QtCore.QVariant(self.doubleClickLiveCheckBox.isChecked()))
settings.endGroup() settings.endGroup()
def onSharedCheckBoxChanged(self, checked): def onSharedCheckBoxChanged(self, checked):
@ -178,4 +188,3 @@ class AdvancedTab(SettingsTab):
self.sharedLabel.setEnabled(checked) self.sharedLabel.setEnabled(checked)
self.sharedTextEdit.setEnabled(checked) self.sharedTextEdit.setEnabled(checked)
self.sharedPushButton.setEnabled(checked) self.sharedPushButton.setEnabled(checked)

View File

@ -202,15 +202,21 @@ class SlideController(QtGui.QWidget):
self.Toolbar.addToolbarWidget(u'Hide Menu', self.HideMenu) self.Toolbar.addToolbarWidget(u'Hide Menu', self.HideMenu)
self.HideMenu.setMenu(QtGui.QMenu( self.HideMenu.setMenu(QtGui.QMenu(
translate('SlideController', 'Hide'), self.Toolbar)) 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) self.BlankScreen.setCheckable(True)
QtCore.QObject.connect(self.BlankScreen, QtCore.SIGNAL("triggered(bool)"), self.onBlankDisplay) QtCore.QObject.connect(self.BlankScreen,
self.ThemeScreen = QtGui.QAction(QtGui.QIcon(u':/slides/slide_theme.png'), u'Blank to Theme', self.HideMenu) 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) self.ThemeScreen.setCheckable(True)
QtCore.QObject.connect(self.ThemeScreen, QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay) QtCore.QObject.connect(self.ThemeScreen,
self.DesktopScreen = QtGui.QAction(QtGui.QIcon(u':/slides/slide_desktop.png'), u'Show Desktop', self.HideMenu) 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) 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.setDefaultAction(self.BlankScreen)
self.HideMenu.menu().addAction(self.BlankScreen) self.HideMenu.menu().addAction(self.BlankScreen)
self.HideMenu.menu().addAction(self.ThemeScreen) self.HideMenu.menu().addAction(self.ThemeScreen)
@ -241,9 +247,8 @@ class SlideController(QtGui.QWidget):
self.Toolbar.addToolbarWidget( self.Toolbar.addToolbarWidget(
u'Image SpinBox', self.DelaySpinBox) u'Image SpinBox', self.DelaySpinBox)
self.DelaySpinBox.setSuffix(translate('SlideController', 's')) self.DelaySpinBox.setSuffix(translate('SlideController', 's'))
self.DelaySpinBox.setToolTip( self.DelaySpinBox.setToolTip(translate('SlideController',
translate('SlideController', 'Delay between slides in seconds'))
'Delay between slides in seconds'))
self.ControllerLayout.addWidget(self.Toolbar) self.ControllerLayout.addWidget(self.Toolbar)
#Build a Media ToolBar #Build a Media ToolBar
self.Mediabar = OpenLPToolbar(self) self.Mediabar = OpenLPToolbar(self)
@ -268,8 +273,7 @@ class SlideController(QtGui.QWidget):
self.volumeSlider = Phonon.VolumeSlider() self.volumeSlider = Phonon.VolumeSlider()
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24)) self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
self.volumeSlider.setObjectName(u'volumeSlider') self.volumeSlider.setObjectName(u'volumeSlider')
self.Mediabar.addToolbarWidget( self.Mediabar.addToolbarWidget(u'Audio Volume', self.volumeSlider)
u'Audio Volume', self.volumeSlider)
self.ControllerLayout.addWidget(self.Mediabar) self.ControllerLayout.addWidget(self.Mediabar)
# Build the Song Toolbar # Build the Song Toolbar
if isLive: if isLive:
@ -328,6 +332,10 @@ class SlideController(QtGui.QWidget):
# Signals # Signals
QtCore.QObject.connect(self.PreviewListWidget, QtCore.QObject.connect(self.PreviewListWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
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: if isLive:
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'), QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),