Main window done

This commit is contained in:
Tim Bentley 2012-12-29 13:15:42 +00:00
parent 2b6b6d5756
commit 4b6292220a
9 changed files with 365 additions and 681 deletions

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -42,16 +42,13 @@ class Ui_FileRenameDialog(object):
self.fileNameLabel.setObjectName(u'fileNameLabel')
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
self.fileNameEdit = QtGui.QLineEdit(fileRenameDialog)
self.fileNameEdit.setValidator(QtGui.QRegExpValidator(
QtCore.QRegExp(r'[^/\\?*|<>\[\]":+%]+'), self))
self.fileNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":+%]+'), self))
self.fileNameEdit.setObjectName(u'fileNameEdit')
self.dialogLayout.addWidget(self.fileNameEdit, 0, 1)
self.buttonBox = create_button_box(fileRenameDialog, u'buttonBox',
[u'cancel', u'ok'])
self.buttonBox = create_button_box(fileRenameDialog, u'buttonBox', [u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
self.retranslateUi(fileRenameDialog)
self.setMaximumHeight(self.sizeHint().height())
def retranslateUi(self, fileRenameDialog):
self.fileNameLabel.setText(translate('OpenLP.FileRenameForm',
'New File Name:'))
self.fileNameLabel.setText(translate('OpenLP.FileRenameForm', 'New File Name:'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -46,9 +46,7 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
Run the Dialog with correct heading.
"""
if copy:
self.setWindowTitle(translate('OpenLP.FileRenameForm',
'File Copy'))
self.setWindowTitle(translate('OpenLP.FileRenameForm', 'File Copy'))
else:
self.setWindowTitle(translate('OpenLP.FileRenameForm',
'File Rename'))
self.setWindowTitle(translate('OpenLP.FileRenameForm', 'File Rename'))
return QtGui.QDialog.exec_(self)

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -39,8 +39,7 @@ from ConfigParser import SafeConfigParser
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, \
check_directory_exists, Settings
from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, check_directory_exists, Settings
from openlp.core.utils import get_web_page, AppLocation, get_filesystem_encoding
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
@ -65,8 +64,7 @@ class ThemeScreenshotThread(QtCore.QThread):
filename = config.get(u'theme_%s' % theme, u'filename')
screenshot = config.get(u'theme_%s' % theme, u'screenshot')
urllib.urlretrieve(u'%s%s' % (self.parent().web, screenshot),
os.path.join(unicode(gettempdir(), get_filesystem_encoding()),
u'openlp', screenshot))
os.path.join(unicode(gettempdir(), get_filesystem_encoding()), u'openlp', screenshot))
item = QtGui.QListWidgetItem(title, self.parent().themesListWidget)
item.setData(QtCore.Qt.UserRole, filename)
item.setCheckState(QtCore.Qt.Unchecked)
@ -97,12 +95,11 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
'Downloading %s...')
QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL('clicked()'),
self.onCancelButtonClicked)
QtCore.QObject.connect(self.noInternetFinishButton,
QtCore.SIGNAL('clicked()'), self.onNoInternetFinishButtonClicked)
QtCore.QObject.connect(self,
QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.updateScreenListCombo)
QtCore.QObject.connect(self.noInternetFinishButton, QtCore.SIGNAL('clicked()'),
self.onNoInternetFinishButtonClicked)
QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'),
self.updateScreenListCombo)
def exec_(self):
"""
@ -126,10 +123,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
songs = self.config.get(u'songs', u'languages')
songs = songs.split(u',')
for song in songs:
title = unicode(self.config.get(
u'songs_%s' % song, u'title'), u'utf8')
filename = unicode(self.config.get(
u'songs_%s' % song, u'filename'), u'utf8')
title = unicode(self.config.get(u'songs_%s' % song, u'title'), u'utf8')
filename = unicode(self.config.get(u'songs_%s' % song, u'filename'), u'utf8')
item = QtGui.QListWidgetItem(title, self.songsListWidget)
item.setData(QtCore.Qt.UserRole, filename)
item.setCheckState(QtCore.Qt.Unchecked)
@ -137,17 +132,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
bible_languages = self.config.get(u'bibles', u'languages')
bible_languages = bible_languages.split(u',')
for lang in bible_languages:
language = unicode(self.config.get(
u'bibles_%s' % lang, u'title'), u'utf8')
langItem = QtGui.QTreeWidgetItem(
self.biblesTreeWidget, [language])
language = unicode(self.config.get(u'bibles_%s' % lang, u'title'), u'utf8')
langItem = QtGui.QTreeWidgetItem(self.biblesTreeWidget, [language])
bibles = self.config.get(u'bibles_%s' % lang, u'translations')
bibles = bibles.split(u',')
for bible in bibles:
title = unicode(self.config.get(
u'bible_%s' % bible, u'title'), u'utf8')
filename = unicode(self.config.get(
u'bible_%s' % bible, u'filename'))
title = unicode(self.config.get(u'bible_%s' % bible, u'title'), u'utf8')
filename = unicode(self.config.get(u'bible_%s' % bible, u'filename'))
item = QtGui.QTreeWidgetItem(langItem, [title])
item.setData(0, QtCore.Qt.UserRole, filename)
item.setCheckState(0, QtCore.Qt.Unchecked)
@ -199,8 +190,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
if self.hasRunWizard:
self.noInternetLabel.setText(self.noInternetText)
else:
self.noInternetLabel.setText(self.noInternetText +
self.cancelWizardText)
self.noInternetLabel.setText(self.noInternetText + self.cancelWizardText)
elif pageId == FirstTimePage.Defaults:
self.themeComboBox.clear()
for iter in xrange(self.themesListWidget.count()):
@ -249,7 +239,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
Process the triggering of the cancel button.
"""
if self.lastId == FirstTimePage.NoInternet or \
(self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard):
(self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard):
QtCore.QCoreApplication.exit()
sys.exit()
self.downloadCancelled = True
@ -304,8 +294,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
item = self.themesListWidget.item(index)
if item.data(QtCore.Qt.UserRole) == filename:
break
item.setIcon(build_icon(os.path.join(unicode(gettempdir(),
get_filesystem_encoding()), u'openlp', screenshot)))
item.setIcon(build_icon(os.path.join(unicode(gettempdir(), get_filesystem_encoding()), u'openlp',
screenshot)))
def _getFileSize(self, url):
site = urllib.urlopen(url)
@ -372,15 +362,12 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.progressBar.setValue(0)
self.progressBar.setMinimum(0)
self.progressBar.setMaximum(self.max_progress)
self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Setting Up And Downloading'))
self.progressPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Please wait while OpenLP is set up '
'and your data is downloaded.'))
self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Setting Up And Downloading'))
self.progressPage.setSubTitle(
translate('OpenLP.FirstTimeWizard', 'Please wait while OpenLP is set up and your data is downloaded.'))
else:
self.progressBar.setVisible(False)
self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Setting Up'))
self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Setting Up'))
self.progressPage.setSubTitle(u'Setup complete.')
self.repaint()
Receiver.send_message(u'openlp_process_events')
@ -395,12 +382,10 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
self.progressBar.setValue(self.progressBar.maximum())
if self.hasRunWizard:
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
'Download complete.'
' Click the finish button to return to OpenLP.'))
'Download complete. Click the finish button to return to OpenLP.'))
else:
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
'Download complete.'
' Click the finish button to start OpenLP.'))
'Download complete. Click the finish button to start OpenLP.'))
else:
if self.hasRunWizard:
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
@ -419,15 +404,13 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
Run the tasks in the wizard.
"""
# Set plugin states
self._incrementProgressBar(translate('OpenLP.FirstTimeWizard',
'Enabling selected plugins...'))
self._incrementProgressBar(translate('OpenLP.FirstTimeWizard', 'Enabling selected plugins...'))
self._setPluginStatus(self.songsCheckBox, u'songs/status')
self._setPluginStatus(self.bibleCheckBox, u'bibles/status')
# TODO Presentation plugin is not yet working on Mac OS X.
# For now just ignore it.
if sys.platform != 'darwin':
self._setPluginStatus(self.presentationCheckBox,
u'presentations/status')
self._setPluginStatus(self.presentationCheckBox, u'presentations/status')
self._setPluginStatus(self.imageCheckBox, u'images/status')
self._setPluginStatus(self.mediaCheckBox, u'media/status')
self._setPluginStatus(self.remoteCheckBox, u'remotes/status')
@ -447,8 +430,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
filename = item.data(QtCore.Qt.UserRole)
self._incrementProgressBar(self.downloading % filename, 0)
self.previous_size = 0
destination = os.path.join(songs_destination,
unicode(filename))
destination = os.path.join(songs_destination, unicode(filename))
self.urlGetFile(u'%s%s' % (self.web, filename), destination)
# Download Bibles
bibles_iterator = QtGui.QTreeWidgetItemIterator(
@ -459,8 +441,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
bible = item.data(0, QtCore.Qt.UserRole)
self._incrementProgressBar(self.downloading % bible, 0)
self.previous_size = 0
self.urlGetFile(u'%s%s' % (self.web, bible),
os.path.join(bibles_destination, bible))
self.urlGetFile(u'%s%s' % (self.web, bible), os.path.join(bibles_destination, bible))
bibles_iterator += 1
# Download themes
for i in xrange(self.themesListWidget.count()):
@ -469,20 +450,15 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
theme = item.data(QtCore.Qt.UserRole)
self._incrementProgressBar(self.downloading % theme, 0)
self.previous_size = 0
self.urlGetFile(u'%s%s' % (self.web, theme),
os.path.join(themes_destination, theme))
self.urlGetFile(u'%s%s' % (self.web, theme), os.path.join(themes_destination, theme))
# Set Default Display
if self.displayComboBox.currentIndex() != -1:
Settings().setValue(u'General/monitor',
self.displayComboBox.currentIndex())
self.screens.set_current_display(
self.displayComboBox.currentIndex())
Settings().setValue(u'General/monitor', self.displayComboBox.currentIndex())
self.screens.set_current_display(self.displayComboBox.currentIndex())
# Set Global Theme
if self.themeComboBox.currentIndex() != -1:
Settings().setValue(u'themes/global theme',
self.themeComboBox.currentText())
Settings().setValue(u'themes/global theme', self.themeComboBox.currentText())
def _setPluginStatus(self, field, tag):
status = PluginStatus.Active if field.checkState() \
== QtCore.Qt.Checked else PluginStatus.Inactive
status = PluginStatus.Active if field.checkState() == QtCore.Qt.Checked else PluginStatus.Inactive
Settings().setValue(tag, status)

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -49,22 +49,17 @@ class Ui_FirstTimeLanguageDialog(object):
self.languageLabel.setObjectName(u'languageLabel')
self.languageLayout.addWidget(self.languageLabel)
self.languageComboBox = QtGui.QComboBox(languageDialog)
self.languageComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToContents)
self.languageComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.languageComboBox.setObjectName("languageComboBox")
self.languageLayout.addWidget(self.languageComboBox)
self.dialogLayout.addLayout(self.languageLayout)
self.buttonBox = create_button_box(languageDialog, u'buttonBox',
[u'cancel', u'ok'])
self.buttonBox = create_button_box(languageDialog, u'buttonBox', [u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox)
self.retranslateUi(languageDialog)
self.setMaximumHeight(self.sizeHint().height())
def retranslateUi(self, languageDialog):
self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',
'Select Translation'))
self.infoLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
'Choose the translation you\'d like to use in OpenLP.'))
self.languageLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
'Translation:'))
self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm', 'Select Translation'))
self.infoLabel.setText(
translate('OpenLP.FirstTimeLanguageForm', 'Choose the translation you\'d like to use in OpenLP.'))
self.languageLabel.setText(translate('OpenLP.FirstTimeLanguageForm', 'Translation:'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -51,10 +51,8 @@ class Ui_FirstTimeWizard(object):
FirstTimeWizard.resize(550, 386)
FirstTimeWizard.setModal(True)
FirstTimeWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages |
QtGui.QWizard.NoBackButtonOnStartPage |
QtGui.QWizard.NoBackButtonOnLastPage |
QtGui.QWizard.HaveCustomButton1)
FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage |
QtGui.QWizard.NoBackButtonOnLastPage |QtGui.QWizard.HaveCustomButton1)
self.finishButton = self.button(QtGui.QWizard.FinishButton)
self.noInternetFinishButton = self.button(QtGui.QWizard.CustomButton1)
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
@ -175,8 +173,7 @@ class Ui_FirstTimeWizard(object):
self.themeComboBox = QtGui.QComboBox(self.defaultsPage)
self.themeComboBox.setEditable(False)
self.themeComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
self.themeComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToContents)
self.themeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.themeComboBox.setObjectName(u'themeComboBox')
self.defaultsLayout.addRow(self.themeLabel, self.themeComboBox)
FirstTimeWizard.setPage(FirstTimePage.Defaults, self.defaultsPage)
@ -198,41 +195,27 @@ class Ui_FirstTimeWizard(object):
def retranslateUi(self, FirstTimeWizard):
FirstTimeWizard.setWindowTitle(translate(
'OpenLP.FirstTimeWizard', 'First Time Wizard'))
self.titleLabel.setText(
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
translate('OpenLP.FirstTimeWizard',
'Welcome to the First Time Wizard'))
self.titleLabel.setText(u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
translate('OpenLP.FirstTimeWizard', 'Welcome to the First Time Wizard'))
self.informationLabel.setText(translate('OpenLP.FirstTimeWizard',
'This wizard will help you to configure OpenLP for initial use.'
' Click the next button below to start.'))
self.pluginPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Activate required Plugins'))
self.pluginPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Select the Plugins you wish to use. '))
self.pluginPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Activate required Plugins'))
self.pluginPage.setSubTitle(translate('OpenLP.FirstTimeWizard','Select the Plugins you wish to use. '))
self.songsCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Custom Slides'))
self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard','Custom Slides'))
self.bibleCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Bible'))
self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Images'))
self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Images'))
# TODO Presentation plugin is not yet working on Mac OS X.
# For now just ignore it.
if sys.platform != 'darwin':
self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Presentations'))
self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Media (Audio and Video)'))
self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Allow remote access'))
self.songUsageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Monitor Song Usage'))
self.alertCheckBox.setText(translate('OpenLP.FirstTimeWizard',
'Allow Alerts'))
self.noInternetPage.setTitle(translate('OpenLP.FirstTimeWizard',
'No Internet Connection'))
self.noInternetPage.setSubTitle(translate(
'OpenLP.FirstTimeWizard',
'Unable to detect an Internet connection.'))
self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Presentations'))
self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Media (Audio and Video)'))
self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Allow remote access'))
self.songUsageCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Monitor Song Usage'))
self.alertCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Allow Alerts'))
self.noInternetPage.setTitle(translate('OpenLP.FirstTimeWizard', 'No Internet Connection'))
self.noInternetPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.'))
self.noInternetText = translate('OpenLP.FirstTimeWizard',
'No Internet connection was found. The First Time Wizard needs an '
'Internet connection in order to be able to download sample '
@ -244,27 +227,16 @@ class Ui_FirstTimeWizard(object):
self.cancelWizardText = translate('OpenLP.FirstTimeWizard',
'\n\nTo cancel the First Time Wizard completely (and not start '
'OpenLP), click the Cancel button now.')
self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Sample Songs'))
self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Select and download public domain songs.'))
self.biblesPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Sample Bibles'))
self.biblesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Select and download free Bibles.'))
self.themesPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Sample Themes'))
self.themesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Select and download sample themes.'))
self.defaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
'Default Settings'))
self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Songs'))
self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download public domain songs.'))
self.biblesPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Bibles'))
self.biblesPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download free Bibles.'))
self.themesPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Themes'))
self.themesPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download sample themes.'))
self.defaultsPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Default Settings'))
self.defaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Set up default settings to be used by OpenLP.'))
self.displayLabel.setText(translate('OpenLP.FirstTimeWizard',
'Default output display:'))
self.themeLabel.setText(translate('OpenLP.FirstTimeWizard',
'Select default theme:'))
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
'Starting configuration process...'))
FirstTimeWizard.setButtonText(QtGui.QWizard.CustomButton1,
translate('OpenLP.FirstTimeWizard', 'Finish'))
self.displayLabel.setText(translate('OpenLP.FirstTimeWizard', 'Default output display:'))
self.themeLabel.setText(translate('OpenLP.FirstTimeWizard', 'Select default theme:'))
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard', 'Starting configuration process...'))
FirstTimeWizard.setButtonText(QtGui.QWizard.CustomButton1, translate('OpenLP.FirstTimeWizard', 'Finish'))

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -189,21 +189,15 @@ class GeneralTab(SettingsTab):
self.rightLayout.addWidget(self.settingsGroupBox)
self.rightLayout.addStretch()
# Signals and slots
QtCore.QObject.connect(self.overrideRadioButton,
QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideRadioButtonPressed)
QtCore.QObject.connect(self.customHeightValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customWidthValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customYValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customXValueEdit,
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.monitorComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.overrideRadioButton, QtCore.SIGNAL(u'toggled(bool)'),
self.onOverrideRadioButtonPressed)
QtCore.QObject.connect(self.customHeightValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customWidthValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customYValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.customXValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
QtCore.QObject.connect(self.monitorComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged)
# Reload the tab, as the screen resolution/count may have changed.
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.load)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'), self.load)
# Remove for now
self.usernameLabel.setVisible(False)
self.usernameEdit.setVisible(False)
@ -215,40 +209,25 @@ class GeneralTab(SettingsTab):
Translate the general settings tab to the currently selected language
"""
self.tabTitleVisible = translate('OpenLP.GeneralTab', 'General')
self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab',
'Monitors'))
self.monitorRadioButton.setText(translate('OpenLP.GeneralTab',
'Select monitor for output display:'))
self.displayOnMonitorCheck.setText(
translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.startupGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Application Startup'))
self.warningCheckBox.setText(
translate('OpenLP.GeneralTab', 'Show blank screen warning'))
self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab',
'Automatically open the last service'))
self.showSplashCheckBox.setText(
translate('OpenLP.GeneralTab', 'Show the splash screen'))
self.checkForUpdatesCheckBox.setText(
translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
self.settingsGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Application Settings'))
self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Monitors'))
self.monitorRadioButton.setText(translate('OpenLP.GeneralTab', 'Select monitor for output display:'))
self.displayOnMonitorCheck.setText(translate('OpenLP.GeneralTab', 'Display if a single screen'))
self.startupGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Application Startup'))
self.warningCheckBox.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning'))
self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service'))
self.showSplashCheckBox.setText(translate('OpenLP.GeneralTab', 'Show the splash screen'))
self.checkForUpdatesCheckBox.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
self.settingsGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Application Settings'))
self.saveCheckServiceCheckBox.setText(translate('OpenLP.GeneralTab',
'Prompt to save before starting a new service'))
self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab',
'Unblank display when adding new live item'))
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
'Automatically preview next item in service'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
'Timed slide interval:'))
self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item'))
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
self.ccliGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'CCLI Details'))
self.ccliGroupBox.setTitle(translate('OpenLP.GeneralTab', 'CCLI Details'))
self.numberLabel.setText(UiStrings().CCLINumberLabel)
self.usernameLabel.setText(
translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.passwordLabel.setText(
translate('OpenLP.GeneralTab', 'SongSelect password:'))
self.usernameLabel.setText(translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.passwordLabel.setText(translate('OpenLP.GeneralTab', 'SongSelect password:'))
# Moved from display tab
self.overrideRadioButton.setText(translate('OpenLP.GeneralTab',
'Override display position:'))
@ -256,12 +235,9 @@ class GeneralTab(SettingsTab):
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
self.audioGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Background Audio'))
self.startPausedCheckBox.setText(
translate('OpenLP.GeneralTab', 'Start background audio paused'))
self.repeatListCheckBox.setText(
translate('OpenLP.GeneralTab', 'Repeat track list'))
self.audioGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Background Audio'))
self.startPausedCheckBox.setText(translate('OpenLP.GeneralTab', 'Start background audio paused'))
self.repeatListCheckBox.setText(translate('OpenLP.GeneralTab', 'Repeat track list'))
def load(self):
"""
@ -271,49 +247,34 @@ class GeneralTab(SettingsTab):
settings.beginGroup(self.settingsSection)
self.monitorComboBox.clear()
self.monitorComboBox.addItems(self.screens.get_screen_list())
monitorNumber = settings.value(
u'monitor', self.screens.display_count - 1)
monitorNumber = settings.value(u'monitor', self.screens.display_count - 1)
self.monitorComboBox.setCurrentIndex(monitorNumber)
self.numberEdit.setText(settings.value(u'ccli number', u''))
self.usernameEdit.setText(settings.value(u'songselect username', u''))
self.passwordEdit.setText(settings.value(u'songselect password', u''))
self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt',
False))
self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank',
False))
self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt', False))
self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank', False))
self.displayOnMonitorCheck.setChecked(self.screens.display)
self.warningCheckBox.setChecked(settings.value(u'blank warning', False))
self.autoOpenCheckBox.setChecked(settings.value(u'auto open', False))
self.showSplashCheckBox.setChecked(settings.value(u'show splash', True))
self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check',
True))
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview',
False))
self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check', True))
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview', False))
self.timeoutSpinBox.setValue(settings.value(u'loop delay', 5))
self.monitorRadioButton.setChecked(
not settings.value(u'override position', False))
self.overrideRadioButton.setChecked(settings.value(u'override position',
False))
self.customXValueEdit.setValue(settings.value(u'x position',
self.screens.current[u'size'].x()))
self.customYValueEdit.setValue(settings.value(u'y position',
self.screens.current[u'size'].y()))
self.customHeightValueEdit.setValue(settings.value(u'height',
self.screens.current[u'size'].height()))
self.customWidthValueEdit.setValue(settings.value(u'width',
self.screens.current[u'size'].width()))
self.startPausedCheckBox.setChecked(settings.value(
u'audio start paused', True))
self.repeatListCheckBox.setChecked(settings.value(
u'audio repeat list', False))
self.monitorRadioButton.setChecked(not settings.value(u'override position', False))
self.overrideRadioButton.setChecked(settings.value(u'override position', False))
self.customXValueEdit.setValue(settings.value(u'x position', self.screens.current[u'size'].x()))
self.customYValueEdit.setValue(settings.value(u'y position', self.screens.current[u'size'].y()))
self.customHeightValueEdit.setValue(settings.value(u'height', self.screens.current[u'size'].height()))
self.customWidthValueEdit.setValue(settings.value(u'width', self.screens.current[u'size'].width()))
self.startPausedCheckBox.setChecked(settings.value(u'audio start paused', True))
self.repeatListCheckBox.setChecked(settings.value(u'audio repeat list', False))
settings.endGroup()
self.monitorComboBox.setDisabled(self.overrideRadioButton.isChecked())
self.customXValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customYValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customHeightValueEdit.setEnabled(
self.overrideRadioButton.isChecked())
self.customWidthValueEdit.setEnabled(
self.overrideRadioButton.isChecked())
self.customHeightValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customWidthValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.display_changed = False
settings.beginGroup(self.settingsSection)
@ -324,33 +285,25 @@ class GeneralTab(SettingsTab):
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'monitor', self.monitorComboBox.currentIndex())
settings.setValue(u'display on monitor',
self.displayOnMonitorCheck.isChecked())
settings.setValue(u'display on monitor', self.displayOnMonitorCheck.isChecked())
settings.setValue(u'blank warning', self.warningCheckBox.isChecked())
settings.setValue(u'auto open', self.autoOpenCheckBox.isChecked())
settings.setValue(u'show splash', self.showSplashCheckBox.isChecked())
settings.setValue(u'update check',
self.checkForUpdatesCheckBox.isChecked())
settings.setValue(u'save prompt',
self.saveCheckServiceCheckBox.isChecked())
settings.setValue(u'update check', self.checkForUpdatesCheckBox.isChecked())
settings.setValue(u'save prompt', self.saveCheckServiceCheckBox.isChecked())
settings.setValue(u'auto unblank', self.autoUnblankCheckBox.isChecked())
settings.setValue(u'auto preview', self.autoPreviewCheckBox.isChecked())
settings.setValue(u'loop delay', self.timeoutSpinBox.value())
settings.setValue(u'ccli number', self.numberEdit.displayText())
settings.setValue(u'songselect username',
self.usernameEdit.displayText())
settings.setValue(u'songselect password',
self.passwordEdit.displayText())
settings.setValue(u'songselect username', self.usernameEdit.displayText())
settings.setValue(u'songselect password', self.passwordEdit.displayText())
settings.setValue(u'x position', self.customXValueEdit.value())
settings.setValue(u'y position', self.customYValueEdit.value())
settings.setValue(u'height', self.customHeightValueEdit.value())
settings.setValue(u'width', self.customWidthValueEdit.value())
settings.setValue(u'override position',
self.overrideRadioButton.isChecked())
settings.setValue(u'audio start paused',
self.startPausedCheckBox.isChecked())
settings.setValue(u'audio repeat list',
self.repeatListCheckBox.isChecked())
settings.setValue(u'override position', self.overrideRadioButton.isChecked())
settings.setValue(u'audio start paused', self.startPausedCheckBox.isChecked())
settings.setValue(u'audio repeat list', self.repeatListCheckBox.isChecked())
settings.endGroup()
# On save update the screens as well
self.postSetUp(True)
@ -360,8 +313,7 @@ class GeneralTab(SettingsTab):
Apply settings after settings tab has loaded and most of the
system so must be delayed
"""
Receiver.send_message(u'slidecontroller_live_spin_delay',
self.timeoutSpinBox.value())
Receiver.send_message(u'slidecontroller_live_spin_delay', self.timeoutSpinBox.value())
# Do not continue on start up.
if not postUpdate:
return

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -38,8 +38,8 @@ import sys
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
from PyQt4.phonon import Phonon
from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \
translate, PluginManager, expand_tags, Settings, ImageSource
from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, translate, PluginManager, expand_tags,\
Settings, ImageSource
from openlp.core.lib.theme import BackgroundType
from openlp.core.ui import HideMode, ScreenList, AlertLocation
@ -81,10 +81,8 @@ class Display(QtGui.QGraphicsView):
self.setGeometry(self.screen[u'size'])
log.debug(u'Setup webView')
self.webView = QtWebKit.QWebView(self)
self.webView.setGeometry(0, 0,
self.screen[u'size'].width(), self.screen[u'size'].height())
self.webView.settings().setAttribute(
QtWebKit.QWebSettings.PluginsEnabled, True)
self.webView.setGeometry(0, 0, self.screen[u'size'].width(), self.screen[u'size'].height())
self.webView.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True)
palette = self.webView.palette()
palette.setBrush(QtGui.QPalette.Base, QtCore.Qt.transparent)
self.webView.page().setPalette(palette)
@ -92,8 +90,7 @@ class Display(QtGui.QGraphicsView):
self.page = self.webView.page()
self.frame = self.page.mainFrame()
if self.isLive and log.getEffectiveLevel() == logging.DEBUG:
self.webView.settings().setAttribute(
QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
self.webView.settings().setAttribute(QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
QtCore.QObject.connect(self.webView,
QtCore.SIGNAL(u'loadFinished(bool)'), self.isWebLoaded)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
@ -161,14 +158,10 @@ class MainDisplay(Display):
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setTransparency(False)
if self.isLive:
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_display_hide'), self.hideDisplay)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_display_show'), self.showDisplay)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'update_display_css'), self.cssChanged)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_updated'), self.configChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_display_hide'), self.hideDisplay)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_display_show'), self.showDisplay)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'update_display_css'), self.cssChanged)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.configChanged)
def setTransparency(self, enabled):
if enabled:
@ -211,12 +204,10 @@ class MainDisplay(Display):
if self.isLive:
# Build the initial frame.
background_color = QtGui.QColor()
background_color.setNamedColor(Settings().value(
u'advanced/default color', u'#ffffff'))
background_color.setNamedColor(Settings().value(u'advanced/default color', u'#ffffff'))
if not background_color.isValid():
background_color = QtCore.Qt.white
image_file = Settings().value(u'advanced/default image',
u':/graphics/openlp-splash-screen.png')
image_file = Settings().value(u'advanced/default image', u':/graphics/openlp-splash-screen.png')
splash_image = QtGui.QImage(image_file)
self.initialFrame = QtGui.QImage(
self.screen[u'size'].width(),
@ -252,8 +243,7 @@ class MainDisplay(Display):
Receiver.send_message(u'openlp_process_events')
self.setGeometry(self.screen[u'size'])
if animate:
self.frame.evaluateJavaScript(u'show_text("%s")' %
slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
self.frame.evaluateJavaScript(u'show_text("%s")' % slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
else:
# This exists for https://bugs.launchpad.net/openlp/+bug/1016843
# For unknown reasons if evaluateJavaScript is called
@ -274,10 +264,8 @@ class MainDisplay(Display):
log.debug(u'alert to display')
# First we convert <>& marks to html variants, then apply
# formattingtags, finally we double all backslashes for JavaScript.
text_prepared = expand_tags(
cgi.escape(text)).replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')
if self.height() != self.screen[u'size'].height() or not \
self.isVisible():
text_prepared = expand_tags(cgi.escape(text)).replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')
if self.height() != self.screen[u'size'].height() or not self.isVisible():
shrink = True
js = u'show_alert("%s", "%s")' % (text_prepared, u'top')
else:
@ -290,11 +278,9 @@ class MainDisplay(Display):
self.resize(self.width(), alert_height)
self.setVisible(True)
if location == AlertLocation.Middle:
self.move(self.screen[u'size'].left(),
(self.screen[u'size'].height() - alert_height) / 2)
self.move(self.screen[u'size'].left(), (self.screen[u'size'].height() - alert_height) / 2)
elif location == AlertLocation.Bottom:
self.move(self.screen[u'size'].left(),
self.screen[u'size'].height() - alert_height)
self.move(self.screen[u'size'].left(), self.screen[u'size'].height() - alert_height)
else:
self.setVisible(False)
self.setGeometry(self.screen[u'size'])
@ -363,10 +349,8 @@ class MainDisplay(Display):
if self.isLive and hasattr(self, u'serviceItem'):
# Wait for the fade to finish before geting the preview.
# Important otherwise preview will have incorrect text if at all!
if self.serviceItem.themedata and \
self.serviceItem.themedata.display_slide_transition:
while self.frame.evaluateJavaScript(u'show_text_complete()') \
== u'false':
if self.serviceItem.themedata and self.serviceItem.themedata.display_slide_transition:
while self.frame.evaluateJavaScript(u'show_text_complete()') == u'false':
Receiver.send_message(u'openlp_process_events')
# Wait for the webview to update before getting the preview.
# Important otherwise first preview will miss the background !
@ -403,27 +387,22 @@ class MainDisplay(Display):
Receiver.send_message(u'video_background_replaced')
self.override = {}
# We have a different theme.
elif self.override[u'theme'] != \
serviceItem.themedata.background_filename:
elif self.override[u'theme'] != serviceItem.themedata.background_filename:
Receiver.send_message(u'live_theme_changed')
self.override = {}
else:
# replace the background
background = self.imageManager.getImageBytes(
self.override[u'image'], ImageSource.ImagePlugin)
background = self.imageManager.getImageBytes(self.override[u'image'], ImageSource.ImagePlugin)
self.setTransparency(self.serviceItem.themedata.background_type ==
BackgroundType.to_string(BackgroundType.Transparent))
if self.serviceItem.themedata.background_filename:
self.serviceItem.bg_image_bytes = self.imageManager.getImageBytes(
self.serviceItem.themedata.background_filename,
ImageSource.Theme)
self.serviceItem.themedata.background_filename,ImageSource.Theme)
if image_path:
image_bytes = self.imageManager.getImageBytes(
image_path, ImageSource.ImagePlugin)
image_bytes = self.imageManager.getImageBytes(image_path, ImageSource.ImagePlugin)
else:
image_bytes = None
html = build_html(self.serviceItem, self.screen, self.isLive,
background, image_bytes, self.plugins)
html = build_html(self.serviceItem, self.screen, self.isLive, background, image_bytes, self.plugins)
log.debug(u'buildHtml - pre setHtml')
self.webView.setHtml(html)
log.debug(u'buildHtml - post setHtml')
@ -442,8 +421,7 @@ class MainDisplay(Display):
Display the Footer
"""
log.debug(u'footer')
js = u'show_footer(\'' + \
text.replace(u'\\', u'\\\\').replace(u'\'', u'\\\'') + u'\')'
js = u'show_footer(\'' + text.replace(u'\\', u'\\\\').replace(u'\'', u'\\\'') + u'\')'
self.frame.evaluateJavaScript(js)
def hideDisplay(self, mode=HideMode.Screen):
@ -523,10 +501,8 @@ class AudioPlayer(QtCore.QObject):
self.mediaObject.setTickInterval(100)
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
Phonon.createPath(self.mediaObject, self.audioObject)
QtCore.QObject.connect(self.mediaObject,
QtCore.SIGNAL(u'aboutToFinish()'), self.onAboutToFinish)
QtCore.QObject.connect(self.mediaObject,
QtCore.SIGNAL(u'finished()'), self.onFinished)
QtCore.QObject.connect(self.mediaObject, QtCore.SIGNAL(u'aboutToFinish()'), self.onAboutToFinish)
QtCore.QObject.connect(self.mediaObject, QtCore.SIGNAL(u'finished()'), self.onFinished)
def __del__(self):
"""
@ -621,5 +597,6 @@ class AudioPlayer(QtCore.QObject):
if isPlaying:
self.mediaObject.play()
#@todo is this used?
def connectSlot(self, signal, slot):
QtCore.QObject.connect(self.mediaObject, signal, slot)

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@ -39,16 +39,15 @@ from datetime import datetime
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, \
PluginManager, Receiver, translate, ImageManager, PluginStatus
from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, PluginManager, Receiver, translate, ImageManager, \
PluginStatus
from openlp.core.lib.ui import UiStrings, create_action
from openlp.core.lib import SlideLimits, Settings
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
ThemeManager, SlideController, PluginForm, MediaDockManager, \
ShortcutListForm, FormattingTagForm
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \
MediaDockManager, ShortcutListForm, FormattingTagForm
from openlp.core.ui.media import MediaController
from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
get_application_version, get_filesystem_encoding
from openlp.core.utils import AppLocation, add_actions, LanguageManager, get_application_version, \
get_filesystem_encoding
from openlp.core.utils.actions import ActionList, CategoryOrder
from openlp.core.ui.firsttimeform import FirstTimeForm
from openlp.core.ui import ScreenList
@ -150,36 +149,28 @@ class Ui_MainWindow(object):
self.defaultThemeLabel.setObjectName(u'defaultThemeLabel')
self.statusBar.addPermanentWidget(self.defaultThemeLabel)
# Create the MediaManager
self.mediaManagerDock = OpenLPDockWidget(mainWindow,
u'mediaManagerDock', u':/system/system_mediamanager.png')
self.mediaManagerDock = OpenLPDockWidget(mainWindow,u'mediaManagerDock', u':/system/system_mediamanager.png')
self.mediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
# Create the media toolbox
self.mediaToolBox = QtGui.QToolBox(self.mediaManagerDock)
self.mediaToolBox.setObjectName(u'mediaToolBox')
self.mediaManagerDock.setWidget(self.mediaToolBox)
mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea,
self.mediaManagerDock)
mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.mediaManagerDock)
# Create the service manager
self.serviceManagerDock = OpenLPDockWidget(mainWindow,
u'serviceManagerDock', u':/system/system_servicemanager.png')
self.serviceManagerContents = ServiceManager(mainWindow,
self.serviceManagerDock)
self.serviceManagerDock = OpenLPDockWidget(mainWindow, u'serviceManagerDock',
u':/system/system_servicemanager.png')
self.serviceManagerContents = ServiceManager(mainWindow, self.serviceManagerDock)
self.serviceManagerDock.setWidget(self.serviceManagerContents)
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.serviceManagerDock)
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.serviceManagerDock)
# Create the theme manager
self.themeManagerDock = OpenLPDockWidget(mainWindow,
u'themeManagerDock', u':/system/system_thememanager.png')
self.themeManagerContents = ThemeManager(mainWindow,
self.themeManagerDock)
self.themeManagerDock = OpenLPDockWidget(mainWindow, u'themeManagerDock', u':/system/system_thememanager.png')
self.themeManagerContents = ThemeManager(mainWindow, self.themeManagerDock)
self.themeManagerContents.setObjectName(u'themeManagerContents')
self.themeManagerDock.setWidget(self.themeManagerContents)
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
self.themeManagerDock)
mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.themeManagerDock)
# Create the menu items
action_list = ActionList.get_instance()
action_list.add_category(UiStrings().File,
CategoryOrder.standardMenu)
action_list.add_category(UiStrings().File, CategoryOrder.standardMenu)
self.fileNewItem = create_action(mainWindow, u'fileNewItem',
icon=u':/general/general_new.png',
shortcuts=[QtGui.QKeySequence(u'Ctrl+N')],
@ -209,20 +200,13 @@ class Ui_MainWindow(object):
category=UiStrings().File, triggers=mainWindow.close)
# Give QT Extra Hint that this is the Exit Menu Item
self.fileExitItem.setMenuRole(QtGui.QAction.QuitRole)
action_list.add_category(UiStrings().Import,
CategoryOrder.standardMenu)
self.importThemeItem = create_action(mainWindow,
u'importThemeItem', category=UiStrings().Import)
self.importLanguageItem = create_action(mainWindow,
u'importLanguageItem')#, category=UiStrings().Import)
action_list.add_category(UiStrings().Export,
CategoryOrder.standardMenu)
self.exportThemeItem = create_action(mainWindow,
u'exportThemeItem', category=UiStrings().Export)
self.exportLanguageItem = create_action(mainWindow,
u'exportLanguageItem')#, category=UiStrings().Export)
action_list.add_category(UiStrings().View,
CategoryOrder.standardMenu)
action_list.add_category(UiStrings().Import, CategoryOrder.standardMenu)
self.importThemeItem = create_action(mainWindow, u'importThemeItem', category=UiStrings().Import)
self.importLanguageItem = create_action(mainWindow, u'importLanguageItem')
action_list.add_category(UiStrings().Export, CategoryOrder.standardMenu)
self.exportThemeItem = create_action(mainWindow, u'exportThemeItem', category=UiStrings().Export)
self.exportLanguageItem = create_action(mainWindow, u'exportLanguageItem')
action_list.add_category(UiStrings().View, CategoryOrder.standardMenu)
self.viewMediaManagerItem = create_action(mainWindow,
u'viewMediaManagerItem', shortcuts=[QtGui.QKeySequence(u'F8')],
icon=u':/system/system_mediamanager.png',
@ -248,12 +232,10 @@ class Ui_MainWindow(object):
checked=panelLocked, triggers=self.setLockPanel)
action_list.add_category(UiStrings().ViewMode,
CategoryOrder.standardMenu)
self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem',
checked=False, category=UiStrings().ViewMode)
self.modeSetupItem = create_action(mainWindow, u'modeSetupItem',
checked=False, category=UiStrings().ViewMode)
self.modeLiveItem = create_action(mainWindow, u'modeLiveItem',
checked=True, category=UiStrings().ViewMode)
self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem', checked=False,
category=UiStrings().ViewMode)
self.modeSetupItem = create_action(mainWindow, u'modeSetupItem', checked=False, category=UiStrings().ViewMode)
self.modeLiveItem = create_action(mainWindow, u'modeLiveItem', checked=True, category=UiStrings().ViewMode)
self.modeGroup = QtGui.QActionGroup(mainWindow)
self.modeGroup.addAction(self.modeDefaultItem)
self.modeGroup.addAction(self.modeSetupItem)
@ -288,29 +270,21 @@ class Ui_MainWindow(object):
qmList = LanguageManager.get_qm_list()
savedLanguage = LanguageManager.get_language()
for key in sorted(qmList.keys()):
languageItem = create_action(mainWindow, key,
checked=qmList[key] == savedLanguage)
languageItem = create_action(mainWindow, key, checked=qmList[key] == savedLanguage)
add_actions(self.languageGroup, [languageItem])
self.settingsShortcutsItem = create_action(mainWindow,
u'settingsShortcutsItem',
icon=u':/system/system_configure_shortcuts.png',
category=UiStrings().Settings)
self.settingsShortcutsItem = create_action(mainWindow, u'settingsShortcutsItem',
icon=u':/system/system_configure_shortcuts.png', category=UiStrings().Settings)
# Formatting Tags were also known as display tags.
self.formattingTagItem = create_action(mainWindow,
u'displayTagItem', icon=u':/system/tag_editor.png',
category=UiStrings().Settings)
self.settingsConfigureItem = create_action(mainWindow,
u'settingsConfigureItem', icon=u':/system/system_settings.png',
category=UiStrings().Settings)
self.formattingTagItem = create_action(mainWindow, u'displayTagItem',
icon=u':/system/tag_editor.png', category=UiStrings().Settings)
self.settingsConfigureItem = create_action(mainWindow, u'settingsConfigureItem',
icon=u':/system/system_settings.png', category=UiStrings().Settings)
# Give QT Extra Hint that this is the Preferences Menu Item
self.settingsConfigureItem.setMenuRole(QtGui.QAction.PreferencesRole)
self.settingsImportItem = create_action(mainWindow,
u'settingsImportItem', category=UiStrings().Settings)
self.settingsExportItem = create_action(mainWindow,
u'settingsExportItem', category=UiStrings().Settings)
self.settingsImportItem = create_action(mainWindow, u'settingsImportItem', category=UiStrings().Settings)
self.settingsExportItem = create_action(mainWindow, u'settingsExportItem', category=UiStrings().Settings)
action_list.add_category(UiStrings().Help, CategoryOrder.standardMenu)
self.aboutItem = create_action(mainWindow, u'aboutItem',
icon=u':/system/system_about.png',
self.aboutItem = create_action(mainWindow, u'aboutItem', icon=u':/system/system_about.png',
shortcuts=[QtGui.QKeySequence(u'Ctrl+F1')],
category=UiStrings().Help, triggers=self.onAboutItemClicked)
# Give QT Extra Hint that this is an About Menu Item
@ -326,22 +300,16 @@ class Ui_MainWindow(object):
icon=u':/system/system_online_help.png',
shortcuts=[QtGui.QKeySequence(u'Alt+F1')],
category=UiStrings().Help, triggers=self.onOnlineHelpClicked)
self.webSiteItem = create_action(mainWindow,
u'webSiteItem', category=UiStrings().Help)
add_actions(self.fileImportMenu, (self.settingsImportItem, None,
self.importThemeItem, self.importLanguageItem))
add_actions(self.fileExportMenu, (self.settingsExportItem, None,
self.exportThemeItem, self.exportLanguageItem))
self.webSiteItem = create_action(mainWindow, u'webSiteItem', category=UiStrings().Help)
add_actions(self.fileImportMenu, (self.settingsImportItem, None, self.importThemeItem, self.importLanguageItem))
add_actions(self.fileExportMenu, (self.settingsExportItem, None, self.exportThemeItem, self.exportLanguageItem))
add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,
self.fileSaveItem, self.fileSaveAsItem,
self.recentFilesMenu.menuAction(), None,
self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(),
None, self.printServiceOrderItem, self.fileExitItem))
add_actions(self.viewModeMenu, (self.modeDefaultItem,
self.modeSetupItem, self.modeLiveItem))
add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),
None, self.viewMediaManagerItem, self.viewServiceManagerItem,
self.viewThemeManagerItem, None, self.viewPreviewPanel,
self.fileSaveItem, self.fileSaveAsItem, self.recentFilesMenu.menuAction(), None,
self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(), None, self.printServiceOrderItem,
self.fileExitItem))
add_actions(self.viewModeMenu, (self.modeDefaultItem, self.modeSetupItem, self.modeLiveItem))
add_actions(self.viewMenu, (self.viewModeMenu.menuAction(), None, self.viewMediaManagerItem,
self.viewServiceManagerItem, self.viewThemeManagerItem, None, self.viewPreviewPanel,
self.viewLivePanel, None, self.lockPanel))
# i18n add Language Actions
add_actions(self.settingsLanguageMenu, (self.autoLanguageItem, None))
@ -349,35 +317,27 @@ class Ui_MainWindow(object):
# Order things differently in OS X so that Preferences menu item in the
# app menu is correct (this gets picked up automatically by Qt).
if sys.platform == u'darwin':
add_actions(self.settingsMenu, (self.settingsPluginListItem,
self.settingsLanguageMenu.menuAction(), None,
self.settingsConfigureItem, self.settingsShortcutsItem,
self.formattingTagItem))
add_actions(self.settingsMenu, (self.settingsPluginListItem, self.settingsLanguageMenu.menuAction(), None,
self.settingsConfigureItem, self.settingsShortcutsItem, self.formattingTagItem))
else:
add_actions(self.settingsMenu, (self.settingsPluginListItem,
self.settingsLanguageMenu.menuAction(), None,
self.formattingTagItem, self.settingsShortcutsItem,
self.settingsConfigureItem))
add_actions(self.settingsMenu, (self.settingsPluginListItem, self.settingsLanguageMenu.menuAction(), None,
self.formattingTagItem, self.settingsShortcutsItem, self.settingsConfigureItem))
add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
add_actions(self.toolsMenu, (self.toolsFirstTimeWizard, None))
add_actions(self.toolsMenu, [self.updateThemeImages])
if os.name == u'nt':
add_actions(self.helpMenu, (self.offlineHelpItem,
self.onlineHelpItem, None, self.webSiteItem,
self.aboutItem))
add_actions(self.helpMenu, (self.offlineHelpItem, self.onlineHelpItem, None, self.webSiteItem,
self.aboutItem))
else:
add_actions(self.helpMenu, (self.onlineHelpItem, None,
self.webSiteItem, self.aboutItem))
add_actions(self.menuBar, (self.fileMenu.menuAction(),
self.viewMenu.menuAction(), self.toolsMenu.menuAction(),
add_actions(self.helpMenu, (self.onlineHelpItem, None, self.webSiteItem, self.aboutItem))
add_actions(self.menuBar, (self.fileMenu.menuAction(), self.viewMenu.menuAction(), self.toolsMenu.menuAction(),
self.settingsMenu.menuAction(), self.helpMenu.menuAction()))
# Initialise the translation
self.retranslateUi(mainWindow)
self.mediaToolBox.setCurrentIndex(0)
# Connect up some signals and slots
QtCore.QObject.connect(self.fileMenu,
QtCore.SIGNAL(u'aboutToShow()'), self.updateRecentFilesMenu)
QtCore.QObject.connect(self.fileMenu, QtCore.SIGNAL(u'aboutToShow()'), self.updateRecentFilesMenu)
# Hide the entry, as it does not have any functionality yet.
self.toolsAddToolItem.setVisible(False)
self.importLanguageItem.setVisible(False)
@ -394,152 +354,94 @@ class Ui_MainWindow(object):
self.fileMenu.setTitle(translate('OpenLP.MainWindow', '&File'))
self.fileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import'))
self.fileExportMenu.setTitle(translate('OpenLP.MainWindow', '&Export'))
self.recentFilesMenu.setTitle(
translate('OpenLP.MainWindow', '&Recent Files'))
self.recentFilesMenu.setTitle(translate('OpenLP.MainWindow', '&Recent Files'))
self.viewMenu.setTitle(translate('OpenLP.MainWindow', '&View'))
self.viewModeMenu.setTitle(translate('OpenLP.MainWindow', 'M&ode'))
self.toolsMenu.setTitle(translate('OpenLP.MainWindow', '&Tools'))
self.settingsMenu.setTitle(translate('OpenLP.MainWindow', '&Settings'))
self.settingsLanguageMenu.setTitle(translate('OpenLP.MainWindow',
'&Language'))
self.settingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language'))
self.helpMenu.setTitle(translate('OpenLP.MainWindow', '&Help'))
self.mediaManagerDock.setWindowTitle(
translate('OpenLP.MainWindow', 'Media Manager'))
self.serviceManagerDock.setWindowTitle(
translate('OpenLP.MainWindow', 'Service Manager'))
self.themeManagerDock.setWindowTitle(
translate('OpenLP.MainWindow', 'Theme Manager'))
self.mediaManagerDock.setWindowTitle(translate('OpenLP.MainWindow', 'Media Manager'))
self.serviceManagerDock.setWindowTitle(translate('OpenLP.MainWindow', 'Service Manager'))
self.themeManagerDock.setWindowTitle(translate('OpenLP.MainWindow', 'Theme Manager'))
self.fileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
self.fileNewItem.setToolTip(UiStrings().NewService)
self.fileNewItem.setStatusTip(UiStrings().CreateService)
self.fileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
self.fileOpenItem.setToolTip(UiStrings().OpenService)
self.fileOpenItem.setStatusTip(
translate('OpenLP.MainWindow', 'Open an existing service.'))
self.fileOpenItem.setStatusTip(translate('OpenLP.MainWindow', 'Open an existing service.'))
self.fileSaveItem.setText(translate('OpenLP.MainWindow', '&Save'))
self.fileSaveItem.setToolTip(UiStrings().SaveService)
self.fileSaveItem.setStatusTip(
translate('OpenLP.MainWindow', 'Save the current service to disk.'))
self.fileSaveAsItem.setText(
translate('OpenLP.MainWindow', 'Save &As...'))
self.fileSaveAsItem.setToolTip(
translate('OpenLP.MainWindow', 'Save Service As'))
self.fileSaveAsItem.setStatusTip(translate('OpenLP.MainWindow',
'Save the current service under a new name.'))
self.fileSaveItem.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service to disk.'))
self.fileSaveAsItem.setText(translate('OpenLP.MainWindow', 'Save &As...'))
self.fileSaveAsItem.setToolTip(translate('OpenLP.MainWindow', 'Save Service As'))
self.fileSaveAsItem.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service under a new name.'))
self.printServiceOrderItem.setText(UiStrings().PrintService)
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
'Print the current service.'))
self.fileExitItem.setText(
translate('OpenLP.MainWindow', 'E&xit'))
self.fileExitItem.setStatusTip(
translate('OpenLP.MainWindow', 'Quit OpenLP'))
self.importThemeItem.setText(
translate('OpenLP.MainWindow', '&Theme'))
self.importLanguageItem.setText(
translate('OpenLP.MainWindow', '&Language'))
self.exportThemeItem.setText(
translate('OpenLP.MainWindow', '&Theme'))
self.exportLanguageItem.setText(
translate('OpenLP.MainWindow', '&Language'))
self.settingsShortcutsItem.setText(
translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
self.formattingTagItem.setText(
translate('OpenLP.MainWindow', 'Configure &Formatting Tags...'))
self.settingsConfigureItem.setText(
translate('OpenLP.MainWindow', '&Configure OpenLP...'))
self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow', 'Print the current service.'))
self.fileExitItem.setText(translate('OpenLP.MainWindow', 'E&xit'))
self.fileExitItem.setStatusTip(translate('OpenLP.MainWindow', 'Quit OpenLP'))
self.importThemeItem.setText(translate('OpenLP.MainWindow', '&Theme'))
self.importLanguageItem.setText(translate('OpenLP.MainWindow', '&Language'))
self.exportThemeItem.setText(translate('OpenLP.MainWindow', '&Theme'))
self.exportLanguageItem.setText(translate('OpenLP.MainWindow', '&Language'))
self.settingsShortcutsItem.setText(translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
self.formattingTagItem.setText(translate('OpenLP.MainWindow', 'Configure &Formatting Tags...'))
self.settingsConfigureItem.setText(translate('OpenLP.MainWindow', '&Configure OpenLP...'))
self.settingsExportItem.setStatusTip(translate('OpenLP.MainWindow',
'Export OpenLP settings to a specified *.config file'))
self.settingsExportItem.setText(
translate('OpenLP.MainWindow', 'Settings'))
self.settingsExportItem.setText(translate('OpenLP.MainWindow', 'Settings'))
self.settingsImportItem.setStatusTip(translate('OpenLP.MainWindow',
'Import OpenLP settings from a specified *.config file previously '
'exported on this or another machine'))
self.settingsImportItem.setText(
translate('OpenLP.MainWindow', 'Settings'))
self.viewMediaManagerItem.setText(
translate('OpenLP.MainWindow', '&Media Manager'))
self.viewMediaManagerItem.setToolTip(
translate('OpenLP.MainWindow', 'Toggle Media Manager'))
'Import OpenLP settings from a specified *.config file previously exported on this or another machine'))
self.settingsImportItem.setText(translate('OpenLP.MainWindow', 'Settings'))
self.viewMediaManagerItem.setText(translate('OpenLP.MainWindow', '&Media Manager'))
self.viewMediaManagerItem.setToolTip(translate('OpenLP.MainWindow', 'Toggle Media Manager'))
self.viewMediaManagerItem.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the media manager.'))
self.viewThemeManagerItem.setText(
translate('OpenLP.MainWindow', '&Theme Manager'))
self.viewThemeManagerItem.setToolTip(
translate('OpenLP.MainWindow', 'Toggle Theme Manager'))
self.viewThemeManagerItem.setText(translate('OpenLP.MainWindow', '&Theme Manager'))
self.viewThemeManagerItem.setToolTip(translate('OpenLP.MainWindow', 'Toggle Theme Manager'))
self.viewThemeManagerItem.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the theme manager.'))
self.viewServiceManagerItem.setText(
translate('OpenLP.MainWindow', '&Service Manager'))
self.viewServiceManagerItem.setToolTip(
translate('OpenLP.MainWindow', 'Toggle Service Manager'))
self.viewServiceManagerItem.setText(translate('OpenLP.MainWindow', '&Service Manager'))
self.viewServiceManagerItem.setToolTip(translate('OpenLP.MainWindow', 'Toggle Service Manager'))
self.viewServiceManagerItem.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the service manager.'))
self.viewPreviewPanel.setText(
translate('OpenLP.MainWindow', '&Preview Panel'))
self.viewPreviewPanel.setToolTip(
translate('OpenLP.MainWindow', 'Toggle Preview Panel'))
self.viewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the preview panel.'))
self.viewLivePanel.setText(
translate('OpenLP.MainWindow', '&Live Panel'))
self.viewLivePanel.setToolTip(
translate('OpenLP.MainWindow', 'Toggle Live Panel'))
self.lockPanel.setText(
translate('OpenLP.MainWindow', 'L&ock Panels'))
self.lockPanel.setStatusTip(
translate('OpenLP.MainWindow', 'Prevent the panels being moved.'))
self.viewLivePanel.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the live panel.'))
self.settingsPluginListItem.setText(translate('OpenLP.MainWindow',
'&Plugin List'))
self.settingsPluginListItem.setStatusTip(
translate('OpenLP.MainWindow', 'List the Plugins'))
self.viewPreviewPanel.setText(translate('OpenLP.MainWindow', '&Preview Panel'))
self.viewPreviewPanel.setToolTip(translate('OpenLP.MainWindow', 'Toggle Preview Panel'))
self.viewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the preview panel.'))
self.viewLivePanel.setText(translate('OpenLP.MainWindow', '&Live Panel'))
self.viewLivePanel.setToolTip(translate('OpenLP.MainWindow', 'Toggle Live Panel'))
self.lockPanel.setText(translate('OpenLP.MainWindow', 'L&ock Panels'))
self.lockPanel.setStatusTip(translate('OpenLP.MainWindow', 'Prevent the panels being moved.'))
self.viewLivePanel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the live panel.'))
self.settingsPluginListItem.setText(translate('OpenLP.MainWindow', '&Plugin List'))
self.settingsPluginListItem.setStatusTip(translate('OpenLP.MainWindow', 'List the Plugins'))
self.aboutItem.setText(translate('OpenLP.MainWindow', '&About'))
self.aboutItem.setStatusTip(
translate('OpenLP.MainWindow', 'More information about OpenLP'))
self.aboutItem.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP'))
if os.name == u'nt':
self.offlineHelpItem.setText(
translate('OpenLP.MainWindow', '&User Guide'))
self.onlineHelpItem.setText(
translate('OpenLP.MainWindow', '&Online Help'))
self.webSiteItem.setText(
translate('OpenLP.MainWindow', '&Web Site'))
self.offlineHelpItem.setText(translate('OpenLP.MainWindow', '&User Guide'))
self.onlineHelpItem.setText(translate('OpenLP.MainWindow', '&Online Help'))
self.webSiteItem.setText(translate('OpenLP.MainWindow', '&Web Site'))
for item in self.languageGroup.actions():
item.setText(item.objectName())
item.setStatusTip(translate('OpenLP.MainWindow',
'Set the interface language to %s') % item.objectName())
self.autoLanguageItem.setText(
translate('OpenLP.MainWindow', '&Autodetect'))
self.autoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
'Use the system language, if available.'))
self.toolsAddToolItem.setText(
translate('OpenLP.MainWindow', 'Add &Tool...'))
self.toolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
'Add an application to the list of tools.'))
self.toolsOpenDataFolder.setText(
translate('OpenLP.MainWindow', 'Open &Data Folder...'))
item.setStatusTip(translate('OpenLP.MainWindow', 'Set the interface language to %s') % item.objectName())
self.autoLanguageItem.setText(translate('OpenLP.MainWindow', '&Autodetect'))
self.autoLanguageItem.setStatusTip(translate('OpenLP.MainWindow', 'Use the system language, if available.'))
self.toolsAddToolItem.setText(translate('OpenLP.MainWindow', 'Add &Tool...'))
self.toolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow', 'Add an application to the list of tools.'))
self.toolsOpenDataFolder.setText(translate('OpenLP.MainWindow', 'Open &Data Folder...'))
self.toolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
'Open the folder where songs, bibles and other data resides.'))
self.toolsFirstTimeWizard.setText(
translate('OpenLP.MainWindow', 'Re-run First Time Wizard'))
self.toolsFirstTimeWizard.setText(translate('OpenLP.MainWindow', 'Re-run First Time Wizard'))
self.toolsFirstTimeWizard.setStatusTip(translate('OpenLP.MainWindow',
'Re-run the First Time Wizard, importing songs, Bibles and '
'themes.'))
self.updateThemeImages.setText(
translate('OpenLP.MainWindow', 'Update Theme Images'))
self.updateThemeImages.setStatusTip(
translate('OpenLP.MainWindow', 'Update the preview images for all '
'themes.'))
self.modeDefaultItem.setText(
translate('OpenLP.MainWindow', '&Default'))
self.modeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
'Set the view mode back to the default.'))
'Re-run the First Time Wizard, importing songs, Bibles and themes.'))
self.updateThemeImages.setText(translate('OpenLP.MainWindow', 'Update Theme Images'))
self.updateThemeImages.setStatusTip(translate('OpenLP.MainWindow', 'Update the preview images for all themes.'))
self.modeDefaultItem.setText(translate('OpenLP.MainWindow', '&Default'))
self.modeDefaultItem.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode back to the default.'))
self.modeSetupItem.setText(translate('OpenLP.MainWindow', '&Setup'))
self.modeSetupItem.setStatusTip(
translate('OpenLP.MainWindow', 'Set the view mode to Setup.'))
self.modeSetupItem.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode to Setup.'))
self.modeLiveItem.setText(translate('OpenLP.MainWindow', '&Live'))
self.modeLiveItem.setStatusTip(
translate('OpenLP.MainWindow', 'Set the view mode to Live.'))
self.modeLiveItem.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode to Live.'))
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
@ -592,75 +494,50 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.newDataPath = u''
self.copyData = False
# Set up signals and slots
QtCore.QObject.connect(self.importThemeItem,
QtCore.SIGNAL(u'triggered()'),
QtCore.QObject.connect(self.importThemeItem, QtCore.SIGNAL(u'triggered()'),
self.themeManagerContents.onImportTheme)
QtCore.QObject.connect(self.exportThemeItem,
QtCore.SIGNAL(u'triggered()'),
QtCore.QObject.connect(self.exportThemeItem, QtCore.SIGNAL(u'triggered()'),
self.themeManagerContents.onExportTheme)
QtCore.QObject.connect(self.mediaManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
QtCore.QObject.connect(self.mediaManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.viewMediaManagerItem.setChecked)
QtCore.QObject.connect(self.serviceManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
QtCore.QObject.connect(self.serviceManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.viewServiceManagerItem.setChecked)
QtCore.QObject.connect(self.themeManagerDock,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
QtCore.QObject.connect(self.themeManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.viewThemeManagerItem.setChecked)
QtCore.QObject.connect(self.webSiteItem,
QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
QtCore.QObject.connect(self.toolsOpenDataFolder,
QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
QtCore.QObject.connect(self.toolsFirstTimeWizard,
QtCore.SIGNAL(u'triggered()'), self.onFirstTimeWizardClicked)
QtCore.QObject.connect(self.updateThemeImages,
QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
QtCore.QObject.connect(self.formattingTagItem,
QtCore.SIGNAL(u'triggered()'), self.onFormattingTagItemClicked)
QtCore.QObject.connect(self.settingsConfigureItem,
QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
QtCore.QObject.connect(self.settingsShortcutsItem,
QtCore.SIGNAL(u'triggered()'), self.onSettingsShortcutsItemClicked)
QtCore.QObject.connect(self.settingsImportItem,
QtCore.SIGNAL(u'triggered()'), self.onSettingsImportItemClicked)
QtCore.QObject.connect(self.settingsExportItem,
QtCore.SIGNAL(u'triggered()'), self.onSettingsExportItemClicked)
QtCore.QObject.connect(self.webSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
QtCore.QObject.connect(self.toolsOpenDataFolder, QtCore.SIGNAL(u'triggered()'),
self.onToolsOpenDataFolderClicked)
QtCore.QObject.connect(self.toolsFirstTimeWizard, QtCore.SIGNAL(u'triggered()'), self.onFirstTimeWizardClicked)
QtCore.QObject.connect(self.updateThemeImages, QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
QtCore.QObject.connect(self.formattingTagItem, QtCore.SIGNAL(u'triggered()'), self.onFormattingTagItemClicked)
QtCore.QObject.connect(self.settingsConfigureItem, QtCore.SIGNAL(u'triggered()'),
self.onSettingsConfigureItemClicked)
QtCore.QObject.connect(self.settingsShortcutsItem, QtCore.SIGNAL(u'triggered()'),
self.onSettingsShortcutsItemClicked)
QtCore.QObject.connect(self.settingsImportItem, QtCore.SIGNAL(u'triggered()'),
self.onSettingsImportItemClicked)
QtCore.QObject.connect(self.settingsExportItem,QtCore.SIGNAL(u'triggered()'), self.onSettingsExportItemClicked)
# i18n set signals for languages
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.versionNotice)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'live_display_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'mainwindow_status_text'), self.showStatusMessage)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'cleanup'), self.cleanUp)
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.versionNotice)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_display_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'mainwindow_status_text'), self.showStatusMessage)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'cleanup'), self.cleanUp)
# Media Manager
QtCore.QObject.connect(self.mediaToolBox,
QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
QtCore.QObject.connect(self.mediaToolBox, QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
Receiver.send_message(u'cursor_busy')
# Simple message boxes
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_error_message'), self.onErrorMessage)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_warning_message'), self.onWarningMessage)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_information_message'),
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_error_message'), self.onErrorMessage)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_warning_message'), self.onWarningMessage)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_information_message'),
self.onInformationMessage)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'set_new_data_path'), self.setNewDataPath)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'set_copy_data'), self.setCopyData)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'set_new_data_path'), self.setNewDataPath)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'set_copy_data'), self.setCopyData)
# warning cyclic dependency
# renderer needs to call ThemeManager and
# ThemeManager needs to call Renderer
@ -729,13 +606,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
Notifies the user that a newer version of OpenLP is available.
Triggered by delay thread.
"""
version_text = translate('OpenLP.MainWindow',
'Version %s of OpenLP is now available for download (you are '
'currently running version %s). \n\nYou can download the latest '
'version from http://openlp.org/.')
version_text = translate('OpenLP.MainWindow', 'Version %s of OpenLP is now available for download (you are '
'currently running version %s). \n\nYou can download the latest version from http://openlp.org/.')
QtGui.QMessageBox.question(self,
translate('OpenLP.MainWindow', 'OpenLP Version Updated'),
version_text % (version, get_application_version()[u'full']))
version_text % (version, get_application_version()[u'full']))
def show(self):
"""
@ -756,8 +631,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
elif Settings().value(
self.generalSettingsSection + u'/auto open', False):
self.serviceManagerContents.loadLastFile()
view_mode = Settings().value(u'%s/view mode' %
self.generalSettingsSection, u'default')
view_mode = Settings().value(u'%s/view mode' % self.generalSettingsSection, u'default')
if view_mode == u'default':
self.modeDefaultItem.setChecked(True)
elif view_mode == u'setup':
@ -797,15 +671,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
"""
answer = QtGui.QMessageBox.warning(self,
translate('OpenLP.MainWindow', 'Re-run First Time Wizard?'),
translate('OpenLP.MainWindow',
'Are you sure you want to re-run the First Time Wizard?\n\n'
'Re-running this wizard may make changes to your current '
'OpenLP configuration and possibly add songs to your '
'existing songs list and change your default theme.'),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
translate('OpenLP.MainWindow', 'Are you sure you want to re-run the First Time Wizard?\n\n'
'Re-running this wizard may make changes to your current '
'OpenLP configuration and possibly add songs to your '
'existing songs list and change your default theme.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
return
Receiver.send_message(u'cursor_busy')
@ -827,8 +698,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.activePlugin.toggleStatus(PluginStatus.Inactive)
self.themeManagerContents.configUpdated()
self.themeManagerContents.loadThemes(True)
Receiver.send_message(u'theme_update_global',
self.themeManagerContents.global_theme)
Receiver.send_message(u'theme_update_global', self.themeManagerContents.global_theme)
# Check if any Bibles downloaded. If there are, they will be
# processed.
Receiver.send_message(u'bibles_load_list', True)
@ -843,11 +713,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
False):
if settings.value(u'%s/blank warning' % self.generalSettingsSection,
False):
QtGui.QMessageBox.question(self,
translate('OpenLP.MainWindow',
'OpenLP Main Display Blanked'),
translate('OpenLP.MainWindow',
'The Main Display has been blanked out'))
QtGui.QMessageBox.question(self, translate('OpenLP.MainWindow', 'OpenLP Main Display Blanked'),
translate('OpenLP.MainWindow', 'The Main Display has been blanked out'))
def onErrorMessage(self, data):
Receiver.send_message(u'close_splash')
@ -937,24 +804,16 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
"""
Import settings from an export INI file
"""
answer = QtGui.QMessageBox.critical(self,
translate('OpenLP.MainWindow', 'Import settings?'),
translate('OpenLP.MainWindow',
'Are you sure you want to import settings?\n\n'
'Importing settings will make permanent changes to your current '
'OpenLP configuration.\n\n'
'Importing incorrect settings may cause erratic behaviour or '
'OpenLP to terminate abnormally.'),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
answer = QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'Import settings?'),
translate('OpenLP.MainWindow', 'Are you sure you want to import settings?\n\n'
'Importing settings will make permanent changes to your current OpenLP configuration.\n\n'
'Importing incorrect settings may cause erratic behaviour or OpenLP to terminate abnormally.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
return
import_file_name = QtGui.QFileDialog.getOpenFileName(self,
translate('OpenLP.MainWindow', 'Open File'), '',
translate('OpenLP.MainWindow',
'OpenLP Export Settings Files (*.conf)'))
import_file_name = QtGui.QFileDialog.getOpenFileName(self,translate('OpenLP.MainWindow', 'Open File'), '',
translate('OpenLP.MainWindow', 'OpenLP Export Settings Files (*.conf)'))
if not import_file_name:
return
setting_sections = []
@ -987,16 +846,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
section_key = section + "/" + key
# Make sure it's a valid section for us.
if not section in setting_sections:
QtGui.QMessageBox.critical(self,
translate('OpenLP.MainWindow', 'Import settings'),
translate('OpenLP.MainWindow',
'The file you selected does appear to be a valid OpenLP '
'settings file.\n\n'
'Section [%s] is not valid \n\n'
'Processing has terminated and no changed have been made.'
).replace('%s', section),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok))
QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'Import settings'),
translate('OpenLP.MainWindow', 'The file you selected does appear to be a valid OpenLP '
'settings file.\n\n Section [%s] is not valid \n\n'
'Processing has terminated and no changed have been made.').replace('%s', section),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return
# We have a good file, import it.
for section_key in import_keys:
@ -1012,13 +866,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# We must do an immediate restart or current configuration will
# overwrite what was just imported when application terminates
# normally. We need to exit without saving configuration.
QtGui.QMessageBox.information(self,
translate('OpenLP.MainWindow', 'Import settings'),
translate('OpenLP.MainWindow',
'OpenLP will now close. Imported settings will '
'be applied the next time you start OpenLP.'),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok))
QtGui.QMessageBox.information(self, translate('OpenLP.MainWindow', 'Import settings'),
translate('OpenLP.MainWindow', 'OpenLP will now close. Imported settings will '
'be applied the next time you start OpenLP.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.settingsImported = True
self.cleanUp()
QtCore.QCoreApplication.exit()
@ -1029,8 +880,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
"""
export_file_name = QtGui.QFileDialog.getSaveFileName(self,
translate('OpenLP.MainWindow', 'Export Settings File'), '',
translate('OpenLP.MainWindow',
'OpenLP Export Settings File (*.conf)'))
translate('OpenLP.MainWindow', 'OpenLP Export Settings File (*.conf)'))
if not export_file_name:
return
# Make sure it's a .conf file.
@ -1120,8 +970,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
"""
if mode:
settings = Settings()
settings.setValue(u'%s/view mode' % self.generalSettingsSection,
mode)
settings.setValue(u'%s/view mode' % self.generalSettingsSection, mode)
self.mediaManagerDock.setVisible(media)
self.serviceManagerDock.setVisible(service)
self.themeManagerDock.setVisible(theme)
@ -1171,12 +1020,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
event.ignore()
else:
if Settings().value(u'advanced/enable exit confirmation', True):
ret = QtGui.QMessageBox.question(self,
translate('OpenLP.MainWindow', 'Close OpenLP'),
translate('OpenLP.MainWindow',
'Are you sure you want to close OpenLP?'),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
ret = QtGui.QMessageBox.question(self, translate('OpenLP.MainWindow', 'Close OpenLP'),
translate('OpenLP.MainWindow', 'Are you sure you want to close OpenLP?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.Yes)
if ret == QtGui.QMessageBox.Yes:
self.cleanUp()
@ -1201,8 +1047,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.serviceManagerContents.cleanUp()
if save_settings:
if Settings().value(u'advanced/save current plugin', False):
Settings().setValue(u'advanced/current media plugin',
self.mediaToolBox.currentIndex())
Settings().setValue(u'advanced/current media plugin', self.mediaToolBox.currentIndex())
# Call the cleanup method to shutdown plugins.
log.info(u'cleanup plugins')
self.pluginManager.finalise_plugins()
@ -1262,15 +1107,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.statusBar.showMessage(message)
def defaultThemeChanged(self, theme):
self.defaultThemeLabel.setText(
translate('OpenLP.MainWindow', 'Default Theme: %s') % theme)
self.defaultThemeLabel.setText(translate('OpenLP.MainWindow', 'Default Theme: %s') % theme)
def toggleMediaManager(self):
self.mediaManagerDock.setVisible(not self.mediaManagerDock.isVisible())
def toggleServiceManager(self):
self.serviceManagerDock.setVisible(
not self.serviceManagerDock.isVisible())
self.serviceManagerDock.setVisible(not self.serviceManagerDock.isVisible())
def toggleThemeManager(self):
self.themeManagerDock.setVisible(not self.themeManagerDock.isVisible())
@ -1294,24 +1137,18 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
Sets the ability to stop the toolbars being changed.
"""
if lock:
self.themeManagerDock.setFeatures(
QtGui.QDockWidget.NoDockWidgetFeatures)
self.serviceManagerDock.setFeatures(
QtGui.QDockWidget.NoDockWidgetFeatures)
self.mediaManagerDock.setFeatures(
QtGui.QDockWidget.NoDockWidgetFeatures)
self.themeManagerDock.setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures)
self.serviceManagerDock.setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures)
self.mediaManagerDock.setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures)
self.viewMediaManagerItem.setEnabled(False)
self.viewServiceManagerItem.setEnabled(False)
self.viewThemeManagerItem.setEnabled(False)
self.viewPreviewPanel.setEnabled(False)
self.viewLivePanel.setEnabled(False)
else:
self.themeManagerDock.setFeatures(
QtGui.QDockWidget.AllDockWidgetFeatures)
self.serviceManagerDock.setFeatures(
QtGui.QDockWidget.AllDockWidgetFeatures)
self.mediaManagerDock.setFeatures(
QtGui.QDockWidget.AllDockWidgetFeatures)
self.themeManagerDock.setFeatures(QtGui.QDockWidget.AllDockWidgetFeatures)
self.serviceManagerDock.setFeatures(QtGui.QDockWidget.AllDockWidgetFeatures)
self.mediaManagerDock.setFeatures(QtGui.QDockWidget.AllDockWidgetFeatures)
self.viewMediaManagerItem.setEnabled(True)
self.viewServiceManagerItem.setEnabled(True)
self.viewThemeManagerItem.setEnabled(True)
@ -1339,17 +1176,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
"""
log.debug(u'Loading QSettings')
# Migrate Wrap Settings to Slide Limits Settings
if Settings().contains(self.generalSettingsSection +
u'/enable slide loop'):
if Settings().value(self.generalSettingsSection +
u'/enable slide loop', True):
Settings().setValue(self.advancedSettingsSection +
u'/slide limits', SlideLimits.Wrap)
if Settings().contains(self.generalSettingsSection + u'/enable slide loop'):
if Settings().value(self.generalSettingsSection + u'/enable slide loop', True):
Settings().setValue(self.advancedSettingsSection + u'/slide limits', SlideLimits.Wrap)
else:
Settings().setValue(self.advancedSettingsSection +
u'/slide limits', SlideLimits.End)
Settings().remove(self.generalSettingsSection +
u'/enable slide loop')
Settings().setValue(self.advancedSettingsSection + u'/slide limits', SlideLimits.End)
Settings().remove(self.generalSettingsSection + u'/enable slide loop')
Receiver.send_message(u'slidecontroller_update_slide_limits')
settings = Settings()
# Remove obsolete entries.
@ -1360,16 +1192,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
settings.endGroup()
settings.beginGroup(self.uiSettingsSection)
self.move(settings.value(u'main window position', QtCore.QPoint(0, 0)))
self.restoreGeometry(
settings.value(u'main window geometry', QtCore.QByteArray()))
self.restoreState(
settings.value(u'main window state', QtCore.QByteArray()))
self.liveController.splitter.restoreState(
settings.value(u'live splitter geometry', QtCore.QByteArray()))
self.previewController.splitter.restoreState(
settings.value(u'preview splitter geometry', QtCore.QByteArray()))
self.controlSplitter.restoreState(settings.value(
u'mainwindow splitter geometry', QtCore.QByteArray()))
self.restoreGeometry(settings.value(u'main window geometry', QtCore.QByteArray()))
self.restoreState(settings.value(u'main window state', QtCore.QByteArray()))
self.liveController.splitter.restoreState(settings.value(u'live splitter geometry', QtCore.QByteArray()))
self.previewController.splitter.restoreState(settings.value(u'preview splitter geometry', QtCore.QByteArray()))
self.controlSplitter.restoreState(settings.value(u'mainwindow splitter geometry', QtCore.QByteArray()))
settings.endGroup()
def saveSettings(self):
@ -1388,12 +1215,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
settings.setValue(u'main window position', self.pos())
settings.setValue(u'main window state', self.saveState())
settings.setValue(u'main window geometry', self.saveGeometry())
settings.setValue(u'live splitter geometry',
self.liveController.splitter.saveState())
settings.setValue(u'preview splitter geometry',
self.previewController.splitter.saveState())
settings.setValue(u'mainwindow splitter geometry',
self.controlSplitter.saveState())
settings.setValue(u'live splitter geometry', self.liveController.splitter.saveState())
settings.setValue(u'preview splitter geometry', self.previewController.splitter.saveState())
settings.setValue(u'mainwindow splitter geometry', self.controlSplitter.saveState())
settings.endGroup()
def updateRecentFilesMenu(self):
@ -1414,10 +1238,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
triggers=self.serviceManagerContents.onRecentServiceClicked)
self.recentFilesMenu.addAction(action)
clearRecentFilesAction = create_action(self, u'',
text=translate('OpenLP.MainWindow', 'Clear List',
'Clear List of recent files'),
statustip=translate('OpenLP.MainWindow',
'Clear the list of recent files.'),
text=translate('OpenLP.MainWindow', 'Clear List', 'Clear List of recent files'),
statustip=translate('OpenLP.MainWindow', 'Clear the list of recent files.'),
enabled=bool(self.recentFiles),
triggers=self.clearRecentFileMenu)
add_actions(self.recentFilesMenu, (None, clearRecentFilesAction))
@ -1500,22 +1322,17 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
Receiver.send_message(u'openlp_process_events')
Receiver.send_message(u'cursor_busy')
self.showStatusMessage(
translate('OpenLP.MainWindow',
'Copying OpenLP data to new data directory location - %s '
'- Please wait for copy to finish'
).replace('%s', self.newDataPath))
translate('OpenLP.MainWindow', 'Copying OpenLP data to new data directory location - %s '
'- Please wait for copy to finish').replace('%s', self.newDataPath))
dir_util.copy_tree(old_data_path, self.newDataPath)
log.info(u'Copy sucessful')
except (IOError, os.error, DistutilsFileError), why:
Receiver.send_message(u'cursor_normal')
log.exception(u'Data copy failed %s' % unicode(why))
QtGui.QMessageBox.critical(self,
translate('OpenLP.MainWindow', 'New Data Directory Error'),
QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'New Data Directory Error'),
translate('OpenLP.MainWindow',
'OpenLP Data directory copy failed\n\n%s'
).replace('%s', unicode(why)),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Ok))
'OpenLP Data directory copy failed\n\n%s').replace('%s', unicode(why)),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return False
else:
log.info(u'No data copy requested')