Head r925

This commit is contained in:
Jonathan Corwin 2010-07-07 20:31:51 +01:00
commit 4e9bdd9ec1
11 changed files with 266 additions and 137 deletions

View File

@ -57,15 +57,33 @@ class SettingsManager(object):
self.mainwindow_left + self.mainwindow_right) - 100 ) / 2 self.mainwindow_left + self.mainwindow_right) - 100 ) / 2
self.slidecontroller_image = self.slidecontroller - 50 self.slidecontroller_image = self.slidecontroller - 50
self.showPreviewPanel = QtCore.QSettings().value( def get_preview_visibility(self):
u'user interface/preview panel', QtCore.QVariant(True)).toBool()
def togglePreviewPanel(self, isVisible):
""" """
Toggle the preview panel visibility. Return the preview panel's visibility.
"""
return QtCore.QSettings().value(u'user interface/preview panel',
QtCore.QVariant(True)).toBool()
def set_preview_visibility(self, visible):
"""
Set the preview panel's visibility.
""" """
QtCore.QSettings().setValue(u'user interface/preview panel', QtCore.QSettings().setValue(u'user interface/preview panel',
QtCore.QVariant(isVisible)) QtCore.QVariant(visible))
def get_live_visibility(self):
"""
Return the live panel's visibility.
"""
return QtCore.QSettings().value(u'user interface/live panel',
QtCore.QVariant(True)).toBool()
def set_live_visibility(self, visible):
"""
Set the live panel's visibility.
"""
QtCore.QSettings().setValue(u'user interface/live panel',
QtCore.QVariant(visible))
@staticmethod @staticmethod
def get_last_dir(section, num=None): def get_last_dir(section, num=None):

View File

@ -42,7 +42,7 @@ class OpenLPToolbar(QtGui.QToolBar):
""" """
Initialise the toolbar. Initialise the toolbar.
""" """
QtGui.QToolBar.__init__(self, None) QtGui.QToolBar.__init__(self, parent)
# useful to be able to reuse button icons... # useful to be able to reuse button icons...
self.icons = {} self.icons = {}
self.setIconSize(QtCore.QSize(20, 20)) self.setIconSize(QtCore.QSize(20, 20))

View File

@ -596,15 +596,15 @@ class Ui_AmendThemeDialog(object):
self.TransitionGroupBox.setObjectName(u'TransitionGroupBox') self.TransitionGroupBox.setObjectName(u'TransitionGroupBox')
self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox) self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox)
self.gridLayout_5.setObjectName(u'gridLayout_5') self.gridLayout_5.setObjectName(u'gridLayout_5')
self.SlideTransitionCheckedBoxLabel = QtGui.QLabel( self.SlideTransitionCheckBoxLabel = QtGui.QLabel(
self.TransitionGroupBox) self.TransitionGroupBox)
self.SlideTransitionCheckedBoxLabel.setObjectName( self.SlideTransitionCheckBoxLabel.setObjectName(
u'SlideTransitionCheckedBoxLabel') u'SlideTransitionCheckBoxLabel')
self.gridLayout_5.addWidget( self.gridLayout_5.addWidget(
self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) self.SlideTransitionCheckBoxLabel, 0, 0, 1, 1)
self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox) self.SlideTransitionCheckBox = QtGui.QCheckBox(self.AlignmentGroupBox)
self.SlideTransitionCheckedBox.setTristate(False) self.SlideTransitionCheckBox.setTristate(False)
self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1) self.gridLayout_5.addWidget(self.SlideTransitionCheckBox, 0, 1, 1, 1)
self.OptionsRightLayout.addWidget(self.TransitionGroupBox) self.OptionsRightLayout.addWidget(self.TransitionGroupBox)
spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Expanding) QtGui.QSizePolicy.Expanding)
@ -864,7 +864,7 @@ class Ui_AmendThemeDialog(object):
translate('AmendThemeForm', 'Bottom')) translate('AmendThemeForm', 'Bottom'))
self.TransitionGroupBox.setTitle( self.TransitionGroupBox.setTitle(
translate('AmendThemeForm', 'Slide Transition')) translate('AmendThemeForm', 'Slide Transition'))
self.SlideTransitionCheckedBoxLabel.setText( self.SlideTransitionCheckBoxLabel.setText(
translate('AmendThemeForm', 'Transition active:')) translate('AmendThemeForm', 'Transition active:'))
self.ThemeTabWidget.setTabText( self.ThemeTabWidget.setTabText(
self.ThemeTabWidget.indexOf(self.OtherOptionsTab), self.ThemeTabWidget.indexOf(self.OtherOptionsTab),

View File

@ -133,9 +133,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
QtCore.QObject.connect(self.OutlineSpinBox, QtCore.QObject.connect(self.OutlineSpinBox,
QtCore.SIGNAL(u'editingFinished()'), QtCore.SIGNAL(u'editingFinished()'),
self.onOutlineSpinBoxChanged) self.onOutlineSpinBoxChanged)
QtCore.QObject.connect(self.SlideTransitionCheckedBox, QtCore.QObject.connect(self.SlideTransitionCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onSlideTransitionCheckedBoxChanged) self.onSlideTransitionCheckBoxChanged)
def accept(self): def accept(self):
new_theme = ThemeXML() new_theme = ThemeXML()
@ -500,7 +500,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.stateChanging(self.theme) self.stateChanging(self.theme)
self.previewTheme() self.previewTheme()
def onSlideTransitionCheckedBoxChanged(self, value): def onSlideTransitionCheckBoxChanged(self, value):
if value == 2: # checked if value == 2: # checked
self.theme.display_slideTransition = True self.theme.display_slideTransition = True
else: else:
@ -624,9 +624,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.ShadowColorPushButton.setEnabled(False) self.ShadowColorPushButton.setEnabled(False)
self.ShadowSpinBox.setValue(int(self.theme.display_shadow_size)) self.ShadowSpinBox.setValue(int(self.theme.display_shadow_size))
if self.theme.display_slideTransition: if self.theme.display_slideTransition:
self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Checked) self.SlideTransitionCheckBox.setCheckState(QtCore.Qt.Checked)
else: else:
self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Unchecked) self.SlideTransitionCheckBox.setCheckState(QtCore.Qt.Unchecked)
self.HorizontalComboBox.setCurrentIndex( self.HorizontalComboBox.setCurrentIndex(
self.theme.display_horizontalAlign) self.theme.display_horizontalAlign)
self.VerticalComboBox.setCurrentIndex(self.theme.display_verticalAlign) self.VerticalComboBox.setCurrentIndex(self.theme.display_verticalAlign)

View File

@ -210,7 +210,6 @@ class MainDisplay(DisplayWidget):
self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.parent = parent
# WA_TranslucentBackground is not available in QT4.4 # WA_TranslucentBackground is not available in QT4.4
try: try:
self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
@ -241,7 +240,8 @@ class MainDisplay(DisplayWidget):
#Sort out screen locations and sizes #Sort out screen locations and sizes
self.setGeometry(self.screen[u'size']) self.setGeometry(self.screen[u'size'])
self.scene.setSceneRect(0,0,self.size().width(), self.size().height()) self.scene.setSceneRect(0,0,self.size().width(), self.size().height())
self.webView.setGeometry(0, 0, self.size().width(), self.size().height()) self.webView.setGeometry(0, 0, self.size().width(),
self.size().height())
#Build a custom splash screen #Build a custom splash screen
self.InitialFrame = QtGui.QImage( self.InitialFrame = QtGui.QImage(
self.screen[u'size'].width(), self.screen[u'size'].width(),
@ -288,11 +288,14 @@ class MainDisplay(DisplayWidget):
self.webView = QtWebKit.QWebView() self.webView = QtWebKit.QWebView()
self.page = self.webView.page() self.page = self.webView.page()
self.videoDisplay = self.page.mainFrame() self.videoDisplay = self.page.mainFrame()
self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Vertical, QtCore.Qt.ScrollBarAlwaysOff) self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Vertical,
self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Horizontal, QtCore.Qt.ScrollBarAlwaysOff) QtCore.Qt.ScrollBarAlwaysOff)
self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Horizontal,
QtCore.Qt.ScrollBarAlwaysOff)
self.proxy = QtGui.QGraphicsProxyWidget() self.proxy = QtGui.QGraphicsProxyWidget()
self.proxy.setWidget(self.webView) self.proxy.setWidget(self.webView)
self.proxy.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) self.proxy.setWindowFlags(QtCore.Qt.Window |
QtCore.Qt.FramelessWindowHint)
self.proxy.setZValue(1) self.proxy.setZValue(1)
self.scene.addItem(self.proxy) self.scene.addItem(self.proxy)
@ -413,7 +416,8 @@ class MainDisplay(DisplayWidget):
log.debug(u'adddisplayVideo') log.debug(u'adddisplayVideo')
self.displayImage(self.transparent) self.displayImage(self.transparent)
self.videoDisplay.setHtml(HTMLVIDEO % self.videoDisplay.setHtml(HTMLVIDEO %
(path, self.screen[u'size'].width(), self.screen[u'size'].height())) (path, self.screen[u'size'].width(),
self.screen[u'size'].height()))
def frameView(self, frame, transition=False): def frameView(self, frame, transition=False):
""" """
@ -514,7 +518,7 @@ class VideoDisplay(Phonon.VideoWidget):
Sets up the screen on a particular screen. Sets up the screen on a particular screen.
""" """
log.debug(u'VideoDisplay Setup %s for %s ' % (self.screens, log.debug(u'VideoDisplay Setup %s for %s ' % (self.screens,
self.screens.monitor_number)) self.screens.monitor_number))
self.screen = self.screens.current self.screen = self.screens.current
#Sort out screen locations and sizes #Sort out screen locations and sizes
self.setGeometry(self.screen[u'size']) self.setGeometry(self.screen[u'size'])
@ -616,7 +620,7 @@ class VideoDisplay(Phonon.VideoWidget):
def mediaShow(self, message=''): def mediaShow(self, message=''):
""" """
Show the video disaply if it was already hidden Show the video display if it was already hidden
""" """
if self.hidden: if self.hidden:
self.hidden = False self.hidden = False
@ -625,7 +629,7 @@ class VideoDisplay(Phonon.VideoWidget):
class AudioPlayer(QtCore.QObject): class AudioPlayer(QtCore.QObject):
""" """
This Class will play audio only allowing components to work witn a This Class will play audio only allowing components to work with a
soundtrack which does not take over the user interface. soundtrack which does not take over the user interface.
""" """
log.info(u'AudioPlayer Loaded') log.info(u'AudioPlayer Loaded')
@ -641,8 +645,7 @@ class AudioPlayer(QtCore.QObject):
The list of screens. The list of screens.
""" """
log.debug(u'AudioPlayer Initialisation started') log.debug(u'AudioPlayer Initialisation started')
QtCore.QObject.__init__(self) QtCore.QObject.__init__(self, parent)
self.parent = parent
self.message = None self.message = None
self.mediaObject = Phonon.MediaObject() self.mediaObject = Phonon.MediaObject()
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory) self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)

View File

@ -147,16 +147,20 @@ class Ui_MainWindow(object):
self.FileImportMenu.setObjectName(u'FileImportMenu') self.FileImportMenu.setObjectName(u'FileImportMenu')
self.FileExportMenu = QtGui.QMenu(self.FileMenu) self.FileExportMenu = QtGui.QMenu(self.FileMenu)
self.FileExportMenu.setObjectName(u'FileExportMenu') self.FileExportMenu.setObjectName(u'FileExportMenu')
self.OptionsMenu = QtGui.QMenu(self.MenuBar) # View Menu
self.OptionsMenu.setObjectName(u'OptionsMenu') self.ViewMenu = QtGui.QMenu(self.MenuBar)
self.OptionsViewMenu = QtGui.QMenu(self.OptionsMenu) self.ViewMenu.setObjectName(u'ViewMenu')
self.OptionsViewMenu.setObjectName(u'OptionsViewMenu') self.ViewModeMenu = QtGui.QMenu(self.ViewMenu)
self.ViewModeMenu = QtGui.QMenu(self.OptionsViewMenu)
self.ViewModeMenu.setObjectName(u'ViewModeMenu') self.ViewModeMenu.setObjectName(u'ViewModeMenu')
self.OptionsLanguageMenu = QtGui.QMenu(self.OptionsMenu) # Tools Menu
self.OptionsLanguageMenu.setObjectName(u'OptionsLanguageMenu')
self.ToolsMenu = QtGui.QMenu(self.MenuBar) self.ToolsMenu = QtGui.QMenu(self.MenuBar)
self.ToolsMenu.setObjectName(u'ToolsMenu') self.ToolsMenu.setObjectName(u'ToolsMenu')
# Settings Menu
self.SettingsMenu = QtGui.QMenu(self.MenuBar)
self.SettingsMenu.setObjectName(u'SettingsMenu')
self.SettingsLanguageMenu = QtGui.QMenu(self.SettingsMenu)
self.SettingsLanguageMenu.setObjectName(u'SettingsLanguageMenu')
# Help Menu
self.HelpMenu = QtGui.QMenu(self.MenuBar) self.HelpMenu = QtGui.QMenu(self.MenuBar)
self.HelpMenu.setObjectName(u'HelpMenu') self.HelpMenu.setObjectName(u'HelpMenu')
MainWindow.setMenuBar(self.MenuBar) MainWindow.setMenuBar(self.MenuBar)
@ -168,8 +172,8 @@ class Ui_MainWindow(object):
self.StatusBar.addPermanentWidget(self.DefaultThemeLabel) self.StatusBar.addPermanentWidget(self.DefaultThemeLabel)
# Create the MediaManager # Create the MediaManager
self.MediaManagerDock = OpenLPDockWidget(MainWindow) self.MediaManagerDock = OpenLPDockWidget(MainWindow)
MediaManagerIcon = build_icon(u':/system/system_mediamanager.png') self.MediaManagerDock.setWindowIcon(
self.MediaManagerDock.setWindowIcon(MediaManagerIcon) build_icon(u':/system/system_mediamanager.png'))
self.MediaManagerDock.setStyleSheet(media_manager_style) self.MediaManagerDock.setStyleSheet(media_manager_style)
self.MediaManagerDock.setMinimumWidth( self.MediaManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_left) self.settingsmanager.mainwindow_left)
@ -188,8 +192,8 @@ class Ui_MainWindow(object):
QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock) QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock)
# Create the service manager # Create the service manager
self.ServiceManagerDock = OpenLPDockWidget(MainWindow) self.ServiceManagerDock = OpenLPDockWidget(MainWindow)
ServiceManagerIcon = build_icon(u':/system/system_servicemanager.png') self.ServiceManagerDock.setWindowIcon(
self.ServiceManagerDock.setWindowIcon(ServiceManagerIcon) build_icon(u':/system/system_servicemanager.png'))
self.ServiceManagerDock.setObjectName(u'ServiceManagerDock') self.ServiceManagerDock.setObjectName(u'ServiceManagerDock')
self.ServiceManagerDock.setMinimumWidth( self.ServiceManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right) self.settingsmanager.mainwindow_right)
@ -199,8 +203,8 @@ class Ui_MainWindow(object):
QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock)
# Create the theme manager # Create the theme manager
self.ThemeManagerDock = OpenLPDockWidget(MainWindow) self.ThemeManagerDock = OpenLPDockWidget(MainWindow)
ThemeManagerIcon = build_icon(u':/system/system_thememanager.png') self.ThemeManagerDock.setWindowIcon(
self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon) build_icon(u':/system/system_thememanager.png'))
self.ThemeManagerDock.setObjectName(u'ThemeManagerDock') self.ThemeManagerDock.setObjectName(u'ThemeManagerDock')
self.ThemeManagerDock.setMinimumWidth( self.ThemeManagerDock.setMinimumWidth(
self.settingsmanager.mainwindow_right) self.settingsmanager.mainwindow_right)
@ -227,8 +231,7 @@ class Ui_MainWindow(object):
self.FileSaveAsItem = QtGui.QAction(MainWindow) self.FileSaveAsItem = QtGui.QAction(MainWindow)
self.FileSaveAsItem.setObjectName(u'FileSaveAsItem') self.FileSaveAsItem.setObjectName(u'FileSaveAsItem')
self.FileExitItem = QtGui.QAction(MainWindow) self.FileExitItem = QtGui.QAction(MainWindow)
ExitIcon = build_icon(u':/system/system_exit.png') self.FileExitItem.setIcon(build_icon(u':/system/system_exit.png'))
self.FileExitItem.setIcon(ExitIcon)
self.FileExitItem.setObjectName(u'FileExitItem') self.FileExitItem.setObjectName(u'FileExitItem')
self.ImportThemeItem = QtGui.QAction(MainWindow) self.ImportThemeItem = QtGui.QAction(MainWindow)
self.ImportThemeItem.setObjectName(u'ImportThemeItem') self.ImportThemeItem.setObjectName(u'ImportThemeItem')
@ -238,39 +241,41 @@ class Ui_MainWindow(object):
self.ExportThemeItem.setObjectName(u'ExportThemeItem') self.ExportThemeItem.setObjectName(u'ExportThemeItem')
self.ExportLanguageItem = QtGui.QAction(MainWindow) self.ExportLanguageItem = QtGui.QAction(MainWindow)
self.ExportLanguageItem.setObjectName(u'ExportLanguageItem') self.ExportLanguageItem.setObjectName(u'ExportLanguageItem')
self.actionLook_Feel = QtGui.QAction(MainWindow) self.SettingsConfigureItem = QtGui.QAction(MainWindow)
self.actionLook_Feel.setObjectName(u'actionLook_Feel') self.SettingsConfigureItem.setIcon(
self.OptionsSettingsItem = QtGui.QAction(MainWindow) build_icon(u':/system/system_settings.png'))
SettingsIcon = build_icon(u':/system/system_settings.png') self.SettingsConfigureItem.setObjectName(u'SettingsConfigureItem')
self.OptionsSettingsItem.setIcon(SettingsIcon)
self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem')
self.ViewMediaManagerItem = QtGui.QAction(MainWindow) self.ViewMediaManagerItem = QtGui.QAction(MainWindow)
self.ViewMediaManagerItem.setCheckable(True) self.ViewMediaManagerItem.setCheckable(True)
self.ViewMediaManagerItem.setChecked(self.MediaManagerDock.isVisible()) self.ViewMediaManagerItem.setChecked(self.MediaManagerDock.isVisible())
self.ViewMediaManagerItem.setIcon(MediaManagerIcon) self.ViewMediaManagerItem.setIcon(
build_icon(u':/system/system_mediamanager.png'))
self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem') self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem')
self.ViewThemeManagerItem = QtGui.QAction(MainWindow) self.ViewThemeManagerItem = QtGui.QAction(MainWindow)
self.ViewThemeManagerItem.setCheckable(True) self.ViewThemeManagerItem.setCheckable(True)
self.ViewThemeManagerItem.setChecked(self.ThemeManagerDock.isVisible()) self.ViewThemeManagerItem.setChecked(self.ThemeManagerDock.isVisible())
self.ViewThemeManagerItem.setIcon(ThemeManagerIcon) self.ViewThemeManagerItem.setIcon(
build_icon(u':/system/system_thememanager.png'))
self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem') self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem')
self.ViewServiceManagerItem = QtGui.QAction(MainWindow) self.ViewServiceManagerItem = QtGui.QAction(MainWindow)
self.ViewServiceManagerItem.setCheckable(True) self.ViewServiceManagerItem.setCheckable(True)
self.ViewServiceManagerItem.setChecked( self.ViewServiceManagerItem.setChecked(
self.ServiceManagerDock.isVisible()) self.ServiceManagerDock.isVisible())
self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) self.ViewServiceManagerItem.setIcon(
build_icon(u':/system/system_servicemanager.png'))
self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem') self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem')
self.PluginItem = QtGui.QAction(MainWindow) self.SettingsPluginListItem = QtGui.QAction(MainWindow)
#self.PluginItem.setIcon(AlertIcon) self.SettingsPluginListItem.setIcon(
self.PluginItem.setObjectName(u'PluginItem') build_icon(u':/system/settings_plugin_list.png'))
self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem')
self.HelpDocumentationItem = QtGui.QAction(MainWindow) self.HelpDocumentationItem = QtGui.QAction(MainWindow)
ContentsIcon = build_icon(u':/system/system_help_contents.png') self.HelpDocumentationItem.setIcon(
self.HelpDocumentationItem.setIcon(ContentsIcon) build_icon(u':/system/system_help_contents.png'))
self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem') self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem')
self.HelpDocumentationItem.setEnabled(False) self.HelpDocumentationItem.setEnabled(False)
self.HelpAboutItem = QtGui.QAction(MainWindow) self.HelpAboutItem = QtGui.QAction(MainWindow)
AboutIcon = build_icon(u':/system/system_about.png') self.HelpAboutItem.setIcon(
self.HelpAboutItem.setIcon(AboutIcon) build_icon(u':/system/system_about.png'))
self.HelpAboutItem.setObjectName(u'HelpAboutItem') self.HelpAboutItem.setObjectName(u'HelpAboutItem')
self.HelpOnlineHelpItem = QtGui.QAction(MainWindow) self.HelpOnlineHelpItem = QtGui.QAction(MainWindow)
self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem') self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem')
@ -294,18 +299,36 @@ class Ui_MainWindow(object):
add_actions(self.LanguageGroup, [languageItem]) add_actions(self.LanguageGroup, [languageItem])
self.LanguageGroup.setDisabled(LanguageManager.AutoLanguage) self.LanguageGroup.setDisabled(LanguageManager.AutoLanguage)
self.ToolsAddToolItem = QtGui.QAction(MainWindow) self.ToolsAddToolItem = QtGui.QAction(MainWindow)
AddToolIcon = build_icon(u':/tools/tools_add.png') self.ToolsAddToolItem.setIcon(build_icon(u':/tools/tools_add.png'))
self.ToolsAddToolItem.setIcon(AddToolIcon)
self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem') self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem')
self.action_Preview_Panel = QtGui.QAction(MainWindow) self.ViewPreviewPanel = QtGui.QAction(MainWindow)
self.action_Preview_Panel.setCheckable(True) self.ViewPreviewPanel.setCheckable(True)
self.action_Preview_Panel.setChecked( self.ViewPreviewPanel.setChecked(
self.settingsmanager.showPreviewPanel) self.settingsmanager.get_preview_visibility())
self.action_Preview_Panel.setObjectName(u'action_Preview_Panel') self.ViewPreviewPanel.setObjectName(u'ViewPreviewPanel')
self.PreviewController.Panel.setVisible( self.PreviewController.Panel.setVisible(
self.settingsmanager.showPreviewPanel) self.settingsmanager.get_preview_visibility())
self.ViewLivePanel = QtGui.QAction(MainWindow)
self.ViewLivePanel.setCheckable(True)
self.ViewLivePanel.setChecked(
self.settingsmanager.get_live_visibility())
self.ViewLivePanel.setObjectName(u'ViewLivePanel')
self.LiveController.Panel.setVisible(
self.settingsmanager.get_live_visibility())
self.ModeDefaultItem = QtGui.QAction(MainWindow)
self.ModeDefaultItem.setCheckable(True)
self.ModeDefaultItem.setObjectName(u'ModeDefaultItem')
self.ModeSetupItem = QtGui.QAction(MainWindow)
self.ModeSetupItem.setCheckable(True)
self.ModeSetupItem.setObjectName(u'ModeLiveItem')
self.ModeLiveItem = QtGui.QAction(MainWindow) self.ModeLiveItem = QtGui.QAction(MainWindow)
self.ModeLiveItem.setCheckable(True)
self.ModeLiveItem.setObjectName(u'ModeLiveItem') self.ModeLiveItem.setObjectName(u'ModeLiveItem')
self.ModeGroup = QtGui.QActionGroup(MainWindow)
self.ModeGroup.addAction(self.ModeDefaultItem)
self.ModeGroup.addAction(self.ModeSetupItem)
self.ModeGroup.addAction(self.ModeLiveItem)
self.ModeDefaultItem.setChecked(True)
add_actions(self.FileImportMenu, add_actions(self.FileImportMenu,
(self.ImportThemeItem, self.ImportLanguageItem)) (self.ImportThemeItem, self.ImportLanguageItem))
add_actions(self.FileExportMenu, add_actions(self.FileExportMenu,
@ -314,23 +337,27 @@ class Ui_MainWindow(object):
self.FileSaveItem, self.FileSaveAsItem, None, self.FileSaveItem, self.FileSaveAsItem, None,
self.FileImportMenu.menuAction(), self.FileExportMenu.menuAction(), self.FileImportMenu.menuAction(), self.FileExportMenu.menuAction(),
self.FileExitItem) self.FileExitItem)
add_actions(self.ViewModeMenu, [self.ModeLiveItem]) add_actions(self.ViewModeMenu, (self.ModeDefaultItem,
add_actions(self.OptionsViewMenu, (self.ViewModeMenu.menuAction(), self.ModeSetupItem, self.ModeLiveItem))
add_actions(self.ViewMenu, (self.ViewModeMenu.menuAction(),
None, self.ViewMediaManagerItem, self.ViewServiceManagerItem, None, self.ViewMediaManagerItem, self.ViewServiceManagerItem,
self.ViewThemeManagerItem, None, self.action_Preview_Panel)) self.ViewThemeManagerItem, None, self.ViewPreviewPanel,
self.ViewLivePanel))
#i18n add Language Actions #i18n add Language Actions
add_actions(self.OptionsLanguageMenu, (self.AutoLanguageItem, None)) add_actions(self.SettingsLanguageMenu, (self.AutoLanguageItem, None))
add_actions(self.OptionsLanguageMenu, self.LanguageGroup.actions()) add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions())
add_actions(self.OptionsMenu, (self.OptionsLanguageMenu.menuAction(), add_actions(self.SettingsMenu, (self.SettingsPluginListItem,
self.OptionsViewMenu.menuAction(), None, self.OptionsSettingsItem)) self.SettingsLanguageMenu.menuAction(), None,
self.SettingsConfigureItem))
add_actions(self.ToolsMenu, add_actions(self.ToolsMenu,
(self.PluginItem, None, self.ToolsAddToolItem)) (self.ToolsAddToolItem, None))
add_actions(self.HelpMenu, add_actions(self.HelpMenu,
(self.HelpDocumentationItem, self.HelpOnlineHelpItem, None, (self.HelpDocumentationItem, self.HelpOnlineHelpItem, None,
self.HelpWebSiteItem, self.HelpAboutItem)) self.HelpWebSiteItem, self.HelpAboutItem))
add_actions(self.MenuBar, add_actions(self.MenuBar,
(self.FileMenu.menuAction(), self.OptionsMenu.menuAction(), (self.FileMenu.menuAction(), self.ViewMenu.menuAction(),
self.ToolsMenu.menuAction(), self.HelpMenu.menuAction())) self.ToolsMenu.menuAction(), self.SettingsMenu.menuAction(),
self.HelpMenu.menuAction()))
# Initialise the translation # Initialise the translation
self.retranslateUi(MainWindow) self.retranslateUi(MainWindow)
self.MediaToolBox.setCurrentIndex(0) self.MediaToolBox.setCurrentIndex(0)
@ -360,12 +387,12 @@ class Ui_MainWindow(object):
self.FileMenu.setTitle(translate('MainWindow', '&File')) self.FileMenu.setTitle(translate('MainWindow', '&File'))
self.FileImportMenu.setTitle(translate('MainWindow', '&Import')) self.FileImportMenu.setTitle(translate('MainWindow', '&Import'))
self.FileExportMenu.setTitle(translate('MainWindow', '&Export')) self.FileExportMenu.setTitle(translate('MainWindow', '&Export'))
self.OptionsMenu.setTitle(translate('MainWindow', '&Options')) self.ViewMenu.setTitle(translate('MainWindow', '&View'))
self.OptionsViewMenu.setTitle(translate('MainWindow', '&View'))
self.ViewModeMenu.setTitle(translate('MainWindow', 'M&ode')) self.ViewModeMenu.setTitle(translate('MainWindow', 'M&ode'))
self.OptionsLanguageMenu.setTitle(translate('MainWindow',
'&Language'))
self.ToolsMenu.setTitle(translate('MainWindow', '&Tools')) self.ToolsMenu.setTitle(translate('MainWindow', '&Tools'))
self.SettingsMenu.setTitle(translate('MainWindow', '&Settings'))
self.SettingsLanguageMenu.setTitle(translate('MainWindow',
'&Language'))
self.HelpMenu.setTitle(translate('MainWindow', '&Help')) self.HelpMenu.setTitle(translate('MainWindow', '&Help'))
self.MediaManagerDock.setWindowTitle( self.MediaManagerDock.setWindowTitle(
translate('MainWindow', 'Media Manager')) translate('MainWindow', 'Media Manager'))
@ -376,24 +403,24 @@ class Ui_MainWindow(object):
self.FileNewItem.setText(translate('MainWindow', '&New')) self.FileNewItem.setText(translate('MainWindow', '&New'))
self.FileNewItem.setToolTip(translate('MainWindow', 'New Service')) self.FileNewItem.setToolTip(translate('MainWindow', 'New Service'))
self.FileNewItem.setStatusTip( self.FileNewItem.setStatusTip(
translate('MainWindow', 'Create a new Service')) translate('MainWindow', 'Create a new service.'))
self.FileNewItem.setShortcut(translate('MainWindow', 'Ctrl+N')) self.FileNewItem.setShortcut(translate('MainWindow', 'Ctrl+N'))
self.FileOpenItem.setText(translate('MainWindow', '&Open')) self.FileOpenItem.setText(translate('MainWindow', '&Open'))
self.FileOpenItem.setToolTip(translate('MainWindow', 'Open Service')) self.FileOpenItem.setToolTip(translate('MainWindow', 'Open Service'))
self.FileOpenItem.setStatusTip( self.FileOpenItem.setStatusTip(
translate('MainWindow', 'Open an existing service')) translate('MainWindow', 'Open an existing service.'))
self.FileOpenItem.setShortcut(translate('MainWindow', 'Ctrl+O')) self.FileOpenItem.setShortcut(translate('MainWindow', 'Ctrl+O'))
self.FileSaveItem.setText(translate('MainWindow', '&Save')) self.FileSaveItem.setText(translate('MainWindow', '&Save'))
self.FileSaveItem.setToolTip(translate('MainWindow', 'Save Service')) self.FileSaveItem.setToolTip(translate('MainWindow', 'Save Service'))
self.FileSaveItem.setStatusTip( self.FileSaveItem.setStatusTip(
translate('MainWindow', 'Save the current service to disk')) translate('MainWindow', 'Save the current service to disk.'))
self.FileSaveItem.setShortcut(translate('MainWindow', 'Ctrl+S')) self.FileSaveItem.setShortcut(translate('MainWindow', 'Ctrl+S'))
self.FileSaveAsItem.setText(translate('MainWindow', 'Save &As...')) self.FileSaveAsItem.setText(translate('MainWindow', 'Save &As...'))
self.FileSaveAsItem.setToolTip( self.FileSaveAsItem.setToolTip(
translate('MainWindow', 'Save Service As')) translate('MainWindow', 'Save Service As'))
self.FileSaveAsItem.setStatusTip(translate('MainWindow', self.FileSaveAsItem.setStatusTip(translate('MainWindow',
'Save the current service under a new name')) 'Save the current service under a new name.'))
self.FileSaveAsItem.setShortcut(translate('MainWindow', 'F12')) self.FileSaveAsItem.setShortcut(translate('MainWindow', 'Ctrl+Shift+S'))
self.FileExitItem.setText(translate('MainWindow', 'E&xit')) self.FileExitItem.setText(translate('MainWindow', 'E&xit'))
self.FileExitItem.setStatusTip(translate('MainWindow', 'Quit OpenLP')) self.FileExitItem.setStatusTip(translate('MainWindow', 'Quit OpenLP'))
self.FileExitItem.setShortcut(translate('MainWindow', 'Alt+F4')) self.FileExitItem.setShortcut(translate('MainWindow', 'Alt+F4'))
@ -401,40 +428,48 @@ class Ui_MainWindow(object):
self.ImportLanguageItem.setText(translate('MainWindow', '&Language')) self.ImportLanguageItem.setText(translate('MainWindow', '&Language'))
self.ExportThemeItem.setText(translate('MainWindow', '&Theme')) self.ExportThemeItem.setText(translate('MainWindow', '&Theme'))
self.ExportLanguageItem.setText(translate('MainWindow', '&Language')) self.ExportLanguageItem.setText(translate('MainWindow', '&Language'))
self.actionLook_Feel.setText(translate('MainWindow', 'Look && &Feel')) self.SettingsConfigureItem.setText(translate('MainWindow',
self.OptionsSettingsItem.setText(translate('MainWindow', '&Settings')) '&Configure OpenLP...'))
self.ViewMediaManagerItem.setText( self.ViewMediaManagerItem.setText(
translate('MainWindow', '&Media Manager')) translate('MainWindow', '&Media Manager'))
self.ViewMediaManagerItem.setToolTip( self.ViewMediaManagerItem.setToolTip(
translate('MainWindow', 'Toggle Media Manager')) translate('MainWindow', 'Toggle Media Manager'))
self.ViewMediaManagerItem.setStatusTip(translate('MainWindow', self.ViewMediaManagerItem.setStatusTip(translate('MainWindow',
'Toggle the visibility of the Media Manager')) 'Toggle the visibility of the media manager.'))
self.ViewMediaManagerItem.setShortcut(translate('MainWindow', 'F8')) self.ViewMediaManagerItem.setShortcut(translate('MainWindow', 'F8'))
self.ViewThemeManagerItem.setText( self.ViewThemeManagerItem.setText(
translate('MainWindow', '&Theme Manager')) translate('MainWindow', '&Theme Manager'))
self.ViewThemeManagerItem.setToolTip( self.ViewThemeManagerItem.setToolTip(
translate('MainWindow', 'Toggle Theme Manager')) translate('MainWindow', 'Toggle Theme Manager'))
self.ViewThemeManagerItem.setStatusTip(translate('MainWindow', self.ViewThemeManagerItem.setStatusTip(translate('MainWindow',
'Toggle the visibility of the Theme Manager')) 'Toggle the visibility of the theme manager.'))
self.ViewThemeManagerItem.setShortcut(translate('MainWindow', 'F10')) self.ViewThemeManagerItem.setShortcut(translate('MainWindow', 'F10'))
self.ViewServiceManagerItem.setText( self.ViewServiceManagerItem.setText(
translate('MainWindow', '&Service Manager')) translate('MainWindow', '&Service Manager'))
self.ViewServiceManagerItem.setToolTip( self.ViewServiceManagerItem.setToolTip(
translate('MainWindow', 'Toggle Service Manager')) translate('MainWindow', 'Toggle Service Manager'))
self.ViewServiceManagerItem.setStatusTip(translate('MainWindow', self.ViewServiceManagerItem.setStatusTip(translate('MainWindow',
'Toggle the visibility of the Service Manager')) 'Toggle the visibility of the service manager.'))
self.ViewServiceManagerItem.setShortcut(translate('MainWindow', 'F9')) self.ViewServiceManagerItem.setShortcut(translate('MainWindow', 'F9'))
self.action_Preview_Panel.setText( self.ViewPreviewPanel.setText(
translate('MainWindow', '&Preview Panel')) translate('MainWindow', '&Preview Panel'))
self.action_Preview_Panel.setToolTip( self.ViewPreviewPanel.setToolTip(
translate('MainWindow', 'Toggle Preview Panel')) translate('MainWindow', 'Toggle Preview Panel'))
self.action_Preview_Panel.setStatusTip(translate('MainWindow', self.ViewPreviewPanel.setStatusTip(translate('MainWindow',
'Toggle the visibility of the Preview Panel')) 'Toggle the visibility of the preview panel.'))
self.action_Preview_Panel.setShortcut(translate('MainWindow', 'F11')) self.ViewPreviewPanel.setShortcut(translate('MainWindow', 'F11'))
self.PluginItem.setText(translate('MainWindow', '&Plugin List')) self.ViewLivePanel.setText(
self.PluginItem.setStatusTip( translate('MainWindow', '&Live Panel'))
self.ViewLivePanel.setToolTip(
translate('MainWindow', 'Toggle Live Panel'))
self.ViewLivePanel.setStatusTip(translate('MainWindow',
'Toggle the visibility of the live panel.'))
self.ViewLivePanel.setShortcut(translate('MainWindow', 'F12'))
self.SettingsPluginListItem.setText(translate('MainWindow',
'&Plugin List'))
self.SettingsPluginListItem.setStatusTip(
translate('MainWindow', 'List the Plugins')) translate('MainWindow', 'List the Plugins'))
self.PluginItem.setShortcut(translate('MainWindow', 'Alt+F7')) self.SettingsPluginListItem.setShortcut(translate('MainWindow', 'Alt+F7'))
self.HelpDocumentationItem.setText( self.HelpDocumentationItem.setText(
translate('MainWindow', '&User Guide')) translate('MainWindow', '&User Guide'))
self.HelpAboutItem.setText(translate('MainWindow', '&About')) self.HelpAboutItem.setText(translate('MainWindow', '&About'))
@ -444,10 +479,9 @@ class Ui_MainWindow(object):
self.HelpOnlineHelpItem.setText( self.HelpOnlineHelpItem.setText(
translate('MainWindow', '&Online Help')) translate('MainWindow', '&Online Help'))
self.HelpWebSiteItem.setText(translate('MainWindow', '&Web Site')) self.HelpWebSiteItem.setText(translate('MainWindow', '&Web Site'))
#i18n
self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect')) self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect'))
self.AutoLanguageItem.setStatusTip( self.AutoLanguageItem.setStatusTip(
translate('MainWindow', 'Choose System language, if available')) translate('MainWindow', 'Use the system language, if available.'))
for item in self.LanguageGroup.actions(): for item in self.LanguageGroup.actions():
item.setText(item.objectName()) item.setText(item.objectName())
item.setStatusTip(unicode(translate('MainWindow', item.setStatusTip(unicode(translate('MainWindow',
@ -455,10 +489,19 @@ class Ui_MainWindow(object):
self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...')) self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...'))
self.ToolsAddToolItem.setStatusTip( self.ToolsAddToolItem.setStatusTip(
translate('MainWindow', translate('MainWindow',
'Add an application to the list of tools')) 'Add an application to the list of tools.'))
self.action_Preview_Panel.setText( self.ModeDefaultItem.setText(translate('MainWindow', '&Default'))
translate('MainWindow', '&Preview Pane')) self.ModeDefaultItem.setStatusTip(
translate('MainWindow',
'Set the view mode back to the default.'))
self.ModeSetupItem.setText(translate('MainWindow', '&Setup'))
self.ModeSetupItem.setStatusTip(
translate('MainWindow',
'Set the view mode to Setup.'))
self.ModeLiveItem.setText(translate('MainWindow', '&Live')) self.ModeLiveItem.setText(translate('MainWindow', '&Live'))
self.ModeLiveItem.setStatusTip(
translate('MainWindow',
'Set the view mode to Live.'))
class MainWindow(QtGui.QMainWindow, Ui_MainWindow): class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
@ -514,9 +557,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.QObject.connect(self.ViewThemeManagerItem, QtCore.QObject.connect(self.ViewThemeManagerItem,
QtCore.SIGNAL(u'triggered(bool)'), QtCore.SIGNAL(u'triggered(bool)'),
self.toggleThemeManager) self.toggleThemeManager)
QtCore.QObject.connect(self.action_Preview_Panel, QtCore.QObject.connect(self.ViewPreviewPanel,
QtCore.SIGNAL(u'toggled(bool)'), QtCore.SIGNAL(u'toggled(bool)'),
self.togglePreviewPanel) self.setPreviewPanelVisibility)
QtCore.QObject.connect(self.ViewLivePanel,
QtCore.SIGNAL(u'toggled(bool)'),
self.setLivePanelVisibility)
QtCore.QObject.connect(self.MediaManagerDock, QtCore.QObject.connect(self.MediaManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'), QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.ViewMediaManagerItem.setChecked) self.ViewMediaManagerItem.setChecked)
@ -526,27 +572,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.QObject.connect(self.ThemeManagerDock, QtCore.QObject.connect(self.ThemeManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'), QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.ViewThemeManagerItem.setChecked) self.ViewThemeManagerItem.setChecked)
QtCore.QObject.connect(self.PreviewController.Panel,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.action_Preview_Panel.setChecked)
QtCore.QObject.connect(self.HelpWebSiteItem, QtCore.QObject.connect(self.HelpWebSiteItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
QtCore.QObject.connect(self.HelpAboutItem, QtCore.QObject.connect(self.HelpAboutItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked)
QtCore.QObject.connect(self.PluginItem, QtCore.QObject.connect(self.SettingsPluginListItem,
QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked)
QtCore.QObject.connect(self.OptionsSettingsItem, QtCore.QObject.connect(self.SettingsConfigureItem,
QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage)
QtCore.QObject.connect(self.FileNewItem, QtCore.QObject.connect(self.FileNewItem,
QtCore.SIGNAL(u'triggered()'), QtCore.SIGNAL(u'triggered()'),
self.ServiceManagerContents.onNewService) self.ServiceManagerContents.onNewService)
@ -564,6 +597,25 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtCore.SIGNAL(u'toggled(bool)'), QtCore.SIGNAL(u'toggled(bool)'),
self.setAutoLanguage) self.setAutoLanguage)
self.LanguageGroup.triggered.connect(LanguageManager.set_language) self.LanguageGroup.triggered.connect(LanguageManager.set_language)
QtCore.QObject.connect(self.ModeDefaultItem,
QtCore.SIGNAL(u'triggered()'),
self.onModeDefaultItemClicked)
QtCore.QObject.connect(self.ModeSetupItem,
QtCore.SIGNAL(u'triggered()'),
self.onModeSetupItemClicked)
QtCore.QObject.connect(self.ModeLiveItem,
QtCore.SIGNAL(u'triggered()'),
self.onModeLiveItemClicked)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage)
#warning cyclic dependency #warning cyclic dependency
#RenderManager needs to call ThemeManager and #RenderManager needs to call ThemeManager and
#ThemeManager needs to call RenderManager #ThemeManager needs to call RenderManager
@ -607,7 +659,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
log.info(u'Load data from Settings') log.info(u'Load data from Settings')
self.settingsForm.postSetUp() self.settingsForm.postSetUp()
#i18n
def setAutoLanguage(self, value): def setAutoLanguage(self, value):
self.LanguageGroup.setDisabled(value) self.LanguageGroup.setDisabled(value)
LanguageManager.AutoLanguage = value LanguageManager.AutoLanguage = value
@ -695,6 +746,36 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
""" """
self.settingsForm.exec_() self.settingsForm.exec_()
def onModeDefaultItemClicked(self):
"""
Put OpenLP into "Default" view mode.
"""
self.MediaManagerDock.setVisible(True)
self.ServiceManagerDock.setVisible(True)
self.ThemeManagerDock.setVisible(True)
self.setPreviewPanelVisibility(True)
self.setLivePanelVisibility(True)
def onModeSetupItemClicked(self):
"""
Put OpenLP into "Setup" view mode.
"""
self.MediaManagerDock.setVisible(True)
self.ServiceManagerDock.setVisible(True)
self.ThemeManagerDock.setVisible(False)
self.setPreviewPanelVisibility(True)
self.setLivePanelVisibility(False)
def onModeLiveItemClicked(self):
"""
Put OpenLP into "Live" view mode.
"""
self.MediaManagerDock.setVisible(False)
self.ServiceManagerDock.setVisible(True)
self.ThemeManagerDock.setVisible(False)
self.setPreviewPanelVisibility(False)
self.setLivePanelVisibility(True)
def screenChanged(self): def screenChanged(self):
""" """
The screen has changed to so tell the displays to update_display The screen has changed to so tell the displays to update_display
@ -787,10 +868,33 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
if self.ThemeManagerDock.isVisible() != visible: if self.ThemeManagerDock.isVisible() != visible:
self.ThemeManagerDock.setVisible(visible) self.ThemeManagerDock.setVisible(visible)
def togglePreviewPanel(self): def setPreviewPanelVisibility(self, visible):
previewBool = self.PreviewController.Panel.isVisible() """
self.PreviewController.Panel.setVisible(not previewBool) Sets the visibility of the preview panel including saving the setting
self.settingsmanager.togglePreviewPanel(not previewBool) and updating the menu.
``visible``
A bool giving the state to set the panel to
True - Visible
False - Hidden
"""
self.PreviewController.Panel.setVisible(visible)
self.settingsmanager.set_preview_visibility(visible)
self.ViewPreviewPanel.setChecked(visible)
def setLivePanelVisibility(self, visible):
"""
Sets the visibility of the live panel including saving the setting and
updating the menu.
``visible``
A bool giving the state to set the panel to
True - Visible
False - Hidden
"""
self.LiveController.Panel.setVisible(visible)
self.settingsmanager.set_live_visibility(visible)
self.ViewLivePanel.setChecked(visible)
def loadSettings(self): def loadSettings(self):
log.debug(u'Loading QSettings') log.debug(u'Loading QSettings')

View File

@ -35,7 +35,7 @@ from openlp.plugins.alerts.forms import AlertForm
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class alertsPlugin(Plugin): class AlertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded') log.info(u'Alerts Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
@ -88,7 +88,7 @@ class alertsPlugin(Plugin):
Plugin.finalise(self) Plugin.finalise(self)
self.toolsAlertItem.setVisible(False) self.toolsAlertItem.setVisible(False)
def togglealertsState(self): def toggleAlertsState(self):
self.alertsActive = not self.alertsActive self.alertsActive = not self.alertsActive
QtCore.QSettings().setValue( QtCore.QSettings().setValue(
self.settingsSection + u'/active', self.settingsSection + u'/active',
@ -102,4 +102,5 @@ class alertsPlugin(Plugin):
about_text = translate('AlertsPlugin', about_text = translate('AlertsPlugin',
'<b>Alerts Plugin</b><br>This plugin ' '<b>Alerts Plugin</b><br>This plugin '
'controls the displaying of alerts on the presentations screen') 'controls the displaying of alerts on the presentations screen')
return about_text return about_text

View File

@ -88,13 +88,14 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
self.AlertTextEdit.setText(u'') self.AlertTextEdit.setText(u'')
self.SaveButton.setEnabled(False) self.SaveButton.setEnabled(False)
self.DeleteButton.setEnabled(False) self.DeleteButton.setEnabled(False)
self.EditButton.setEnabled(False)
def onNewClick(self): def onNewClick(self):
if len(self.AlertTextEdit.text()) == 0: if len(self.AlertTextEdit.text()) == 0:
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate('AlertsPlugin.AlertForm', 'Item selected to Add'), translate('AlertsPlugin.AlertForm', 'New Alert'),
translate('AlertsPlugin.AlertForm', 'Missing data')) translate('AlertsPlugin.AlertForm', 'You haven\'t specified '
'any text for your alert. Please type in some text before '
'clicking New.'))
else: else:
alert = AlertItem() alert = AlertItem()
alert.text = unicode(self.AlertTextEdit.text()) alert.text = unicode(self.AlertTextEdit.text())

View File

@ -95,7 +95,7 @@ class AlertsManager(QtCore.QObject):
alertTab = self.parent.alertsTab alertTab = self.parent.alertsTab
text = HTMLCODE % (alertTab.font_color, alertTab.bg_color, text = HTMLCODE % (alertTab.font_color, alertTab.bg_color,
alertTab.font_face, alertTab.font_size, text) alertTab.font_face, alertTab.font_size, text)
self.parent.preview_controller.parent.displayManager.addAlert(text, self.parent.previewController.parent.displayManager.addAlert(text,
alertTab.location) alertTab.location)
# check to see if we have a timer running # check to see if we have a timer running
if self.timer_id == 0: if self.timer_id == 0:
@ -112,8 +112,9 @@ class AlertsManager(QtCore.QObject):
log.debug(u'timer event') log.debug(u'timer event')
alertTab = self.parent.alertsTab alertTab = self.parent.alertsTab
if event.timerId() == self.timer_id: if event.timerId() == self.timer_id:
self.parent.preview_controller.parent.displayManager.addAlert(u'', self.parent.previewController.parent.displayManager.addAlert(u'',
alertTab.location) alertTab.location)
self.killTimer(self.timer_id) self.killTimer(self.timer_id)
self.timer_id = 0 self.timer_id = 0
self.generateAlert() self.generateAlert()

View File

@ -98,6 +98,7 @@
<file>system_servicemanager.png</file> <file>system_servicemanager.png</file>
<file>system_thememanager.png</file> <file>system_thememanager.png</file>
<file>system_exit.png</file> <file>system_exit.png</file>
<file>settings_plugin_list.png</file>
<file>system_settings.png</file> <file>system_settings.png</file>
</qresource> </qresource>
<qresource prefix="media"> <qresource prefix="media">

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B