forked from openlp/openlp
r1359
This commit is contained in:
commit
d35ee103a0
38
openlp.pyw
38
openlp.pyw
@ -24,7 +24,6 @@
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
@ -37,6 +36,8 @@ from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import Receiver, check_directory_exists
|
||||
from openlp.core.resources import qInitResources
|
||||
from openlp.core.ui.mainwindow import MainWindow
|
||||
from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm
|
||||
from openlp.core.ui.firsttimeform import FirstTimeForm
|
||||
from openlp.core.ui.exceptionform import ExceptionForm
|
||||
from openlp.core.ui import SplashScreen, ScreenList
|
||||
from openlp.core.utils import AppLocation, LanguageManager, VersionThread
|
||||
@ -150,10 +151,6 @@ class OpenLP(QtGui.QApplication):
|
||||
log.info(u'Openlp version %s' % app_version[u'version'])
|
||||
return app_version
|
||||
|
||||
# def notify(self, obj, evt):
|
||||
# #TODO needed for presentation exceptions
|
||||
# return QtGui.QApplication.notify(self, obj, evt)
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Run the OpenLP application.
|
||||
@ -170,6 +167,13 @@ class OpenLP(QtGui.QApplication):
|
||||
self.setOrganizationDomain(u'openlp.org')
|
||||
self.setApplicationName(u'OpenLP')
|
||||
self.setApplicationVersion(app_version[u'version'])
|
||||
# Decide how many screens we have and their size
|
||||
screens = ScreenList(self.desktop())
|
||||
# First time checks in settings
|
||||
firstTime = QtCore.QSettings().value(
|
||||
u'general/first time', QtCore.QVariant(True)).toBool()
|
||||
if firstTime:
|
||||
FirstTimeForm(screens).exec_()
|
||||
if os.name == u'nt':
|
||||
self.setStyleSheet(application_stylesheet)
|
||||
show_splash = QtCore.QSettings().value(
|
||||
@ -179,17 +183,10 @@ class OpenLP(QtGui.QApplication):
|
||||
self.splash.show()
|
||||
# make sure Qt really display the splash screen
|
||||
self.processEvents()
|
||||
screens = ScreenList()
|
||||
# Decide how many screens we have and their size
|
||||
for screen in xrange(0, self.desktop().numScreens()):
|
||||
size = self.desktop().screenGeometry(screen)
|
||||
screens.add_screen({u'number': screen,
|
||||
u'size': size,
|
||||
u'primary': (self.desktop().primaryScreen() == screen)})
|
||||
log.info(u'Screen %d found with resolution %s', screen, size)
|
||||
# start the main app window
|
||||
self.appClipboard = self.clipboard()
|
||||
self.mainWindow = MainWindow(screens, app_version, self.appClipboard)
|
||||
self.mainWindow = MainWindow(screens, app_version, self.appClipboard,
|
||||
firstTime)
|
||||
self.mainWindow.show()
|
||||
if show_splash:
|
||||
# now kill the splashscreen
|
||||
@ -273,10 +270,19 @@ def main():
|
||||
qInitResources()
|
||||
# Now create and actually run the application.
|
||||
app = OpenLP(qt_args)
|
||||
if sys.platform == 'darwin':
|
||||
# Define the settings environment
|
||||
QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||
# First time checks in settings
|
||||
# Use explicit reference as not inside a QT environment yet
|
||||
if QtCore.QSettings(u'OpenLP', u'OpenLP').value(
|
||||
u'general/first time', QtCore.QVariant(True)).toBool():
|
||||
if not FirstTimeLanguageForm().exec_():
|
||||
# if cancel then stop processing
|
||||
sys.exit()
|
||||
if sys.platform == u'darwin':
|
||||
OpenLP.addLibraryPath(QtGui.QApplication.applicationDirPath()
|
||||
+ "/qt4_plugins")
|
||||
#i18n Set Language
|
||||
# i18n Set Language
|
||||
language = LanguageManager.get_language()
|
||||
appTranslator = LanguageManager.get_translator(language)
|
||||
app.installTranslator(appTranslator)
|
||||
|
@ -220,8 +220,6 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
if self.hasDeleteIcon:
|
||||
toolbar_actions.append([StringContent.Delete,
|
||||
u':/general/general_delete.png', self.onDeleteClick])
|
||||
## Separator Line ##
|
||||
self.addToolbarSeparator()
|
||||
## Preview ##
|
||||
toolbar_actions.append([StringContent.Preview,
|
||||
u':/general/general_preview.png', self.onPreviewClick])
|
||||
@ -232,6 +230,8 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
toolbar_actions.append([StringContent.Service,
|
||||
u':/general/general_add.png', self.onAddClick])
|
||||
for action in toolbar_actions:
|
||||
if action[0] == StringContent.Preview:
|
||||
self.addToolbarSeparator()
|
||||
self.addToolbarButton(
|
||||
self.plugin.getString(action[0])[u'title'],
|
||||
self.plugin.getString(action[0])[u'tooltip'],
|
||||
|
@ -69,7 +69,6 @@ class RenderManager(object):
|
||||
self.image_manager = ImageManager()
|
||||
self.display = MainDisplay(self, screens, False)
|
||||
self.display.imageManager = self.image_manager
|
||||
self.display.setup()
|
||||
self.theme_manager = theme_manager
|
||||
self.renderer = Renderer()
|
||||
self.calculate_default(self.screens.current[u'size'])
|
||||
|
@ -88,8 +88,8 @@ class ServiceItem(object):
|
||||
self.audit = u''
|
||||
self.items = []
|
||||
self.iconic_representation = None
|
||||
self.raw_footer = None
|
||||
self.foot_text = None
|
||||
self.raw_footer = []
|
||||
self.foot_text = u''
|
||||
self.theme = None
|
||||
self.service_item_type = None
|
||||
self._raw_frames = []
|
||||
@ -183,9 +183,8 @@ class ServiceItem(object):
|
||||
else:
|
||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||
self.title = clean_tags(self.title)
|
||||
self.foot_text = None
|
||||
if self.raw_footer:
|
||||
self.foot_text = u'<br>'.join(self.raw_footer)
|
||||
self.foot_text = \
|
||||
u'<br>'.join([footer for footer in self.raw_footer if footer])
|
||||
|
||||
def add_from_image(self, path, title):
|
||||
"""
|
||||
|
@ -51,6 +51,8 @@ class HideMode(object):
|
||||
Theme = 2
|
||||
Screen = 3
|
||||
|
||||
from firsttimeform import FirstTimeForm
|
||||
from firsttimelanguageform import FirstTimeLanguageForm
|
||||
from themeform import ThemeForm
|
||||
from filerenameform import FileRenameForm
|
||||
from starttimeform import StartTimeForm
|
||||
@ -74,4 +76,4 @@ from thememanager import ThemeManager
|
||||
|
||||
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay',
|
||||
'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager',
|
||||
'ServiceItemEditForm']
|
||||
'ServiceItemEditForm', u'FirstTimeForm']
|
||||
|
@ -106,38 +106,86 @@ class Ui_AboutDialog(object):
|
||||
))
|
||||
self.aboutNotebook.setTabText(
|
||||
self.aboutNotebook.indexOf(self.aboutTab), UiStrings.About)
|
||||
self.creditsTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
||||
lead = u'Raoul "superfly" Snyman'
|
||||
developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin',
|
||||
u'Michael "cocooncrash" Gorven',
|
||||
u'Andreas "googol" Preikschat', u'Raoul "superfly" Snyman',
|
||||
u'Martin "mijiti" Thompson', u'Jon "Meths" Tibble']
|
||||
contributors = [u'Scott "sguerrieri" Guerrieri',
|
||||
u'Meinert "m2j" Jordan', u'Armin "orangeshirt" K\xf6hler',
|
||||
u'Christian "crichter" Richter', u'Philip "Phill" Ridout',
|
||||
u'Jeffrey "whydoubt" Smith', u'Maikel Stuivenberg',
|
||||
u'Carsten "catini" Tingaard', u'Frode "frodus" Woldsund']
|
||||
testers = [u'Philip "Phill" Ridout', u'Wesley "wrst" Stout',
|
||||
u'John "jseagull1" Cegalis (lead)']
|
||||
packagers = ['Thomas "tabthorpe" Abthorpe (FreeBSD)',
|
||||
u'Tim "TRB143" Bentley (Fedora)',
|
||||
u'Michael "cocooncrash" Gorven (Ubuntu)',
|
||||
u'Matthias "matthub" Hub (Mac OS X)',
|
||||
u'Raoul "superfly" Snyman (Windows, Ubuntu)']
|
||||
translators = {
|
||||
u'af': [u'Johan "nuvolari" Mynhardt'],
|
||||
u'de': [u'Patrick "madmuffin" Br\xfcckner',
|
||||
u'Meinert "m2j" Jordan',
|
||||
u'Andreas "googol" Preikschat',
|
||||
u'Christian "crichter" Richter'],
|
||||
u'en_GB': [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin'],
|
||||
u'en_ZA': [u'Raoul "superfly" Snyman'],
|
||||
u'et': [u'Mattias "mahfiaz" P\xf5ldaru'],
|
||||
u'fr': [u'Stephan\xe9 "stbrunner" Brunner'],
|
||||
u'hu': [u'Gyuris Gellért'],
|
||||
u'ja': [u'Kunio "Kunio" Nakamaru'],
|
||||
u'nb': [u'Atle "pendlaren" Weibell', u'Frode "frodus" Woldsund'],
|
||||
u'nl': [u'Arjen "typovar" van Voorst'],
|
||||
u'pt_BR': [u'Rafael "rafaellerm" Lerm'],
|
||||
u'ru': [u'Sergey "ratz" Ratz']
|
||||
}
|
||||
documentors = [u'Wesley "wrst" Stout',
|
||||
u'John "jseagull1" Cegalis (lead)']
|
||||
self.creditsTextEdit.setPlainText(unicode(translate('OpenLP.AboutForm',
|
||||
'Project Lead\n'
|
||||
' Raoul "superfly" Snyman\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Developers\n'
|
||||
' Tim "TRB143" Bentley\n'
|
||||
' Jonathan "gushie" Corwin\n'
|
||||
' Michael "cocooncrash" Gorven\n'
|
||||
' Scott "sguerrieri" Guerrieri\n'
|
||||
' Raoul "superfly" Snyman\n'
|
||||
' Martin "mijiti" Thompson\n'
|
||||
' Jon "Meths" Tibble\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Contributors\n'
|
||||
' Meinert "m2j" Jordan\n'
|
||||
' Andreas "googol" Preikschat\n'
|
||||
' Christian "crichter" Richter\n'
|
||||
' Philip "Phill" Ridout\n'
|
||||
' Maikel Stuivenberg\n'
|
||||
' Carsten "catini" Tingaard\n'
|
||||
' Frode "frodus" Woldsund\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Testers\n'
|
||||
' Philip "Phill" Ridout\n'
|
||||
' Wesley "wrst" Stout (lead)\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Packagers\n'
|
||||
' Thomas "tabthorpe" Abthorpe (FreeBSD)\n'
|
||||
' Tim "TRB143" Bentley (Fedora)\n'
|
||||
' Michael "cocooncrash" Gorven (Ubuntu)\n'
|
||||
' Matthias "matthub" Hub (Mac OS X)\n'
|
||||
' Raoul "superfly" Snyman (Windows, Ubuntu)\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Translators\n'
|
||||
' Afrikaans (af)\n'
|
||||
' %s\n'
|
||||
' German (de)\n'
|
||||
' %s\n'
|
||||
' English, United Kingdom (en_GB)\n'
|
||||
' %s\n'
|
||||
' English, South Africa (en_ZA)\n'
|
||||
' %s\n'
|
||||
' Estonian (et)\n'
|
||||
' %s\n'
|
||||
' French (fr)\n'
|
||||
' %s\n'
|
||||
' Hungarian (hu)\n'
|
||||
' %s\n'
|
||||
' Japanese (ja)\n'
|
||||
' %s\n'
|
||||
' Norwegian Bokm\xe5l (nb)\n'
|
||||
' %s\n'
|
||||
' Dutch (nl)\n'
|
||||
' %s\n'
|
||||
' Portuguese, Brazil (pt_BR)\n'
|
||||
' %s\n'
|
||||
' Russian (ru)\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Documentation\n'
|
||||
' %s\n'
|
||||
'\n'
|
||||
'Built With\n'
|
||||
' Python: http://www.python.org/\n'
|
||||
@ -155,31 +203,42 @@ class Ui_AboutDialog(object):
|
||||
' God our Father, for sending His Son to die\n'
|
||||
' on the cross, setting us free from sin. We\n'
|
||||
' bring this software to you for free because\n'
|
||||
' He has set us free.'
|
||||
))
|
||||
' He has set us free.')) % (lead, u'\n '.join(developers),
|
||||
u'\n '.join(contributors), u'\n '.join(testers),
|
||||
u'\n '.join(packagers), u'\n '.join(translators[u'af']),
|
||||
u'\n '.join(translators[u'de']),
|
||||
u'\n '.join(translators[u'en_GB']),
|
||||
u'\n '.join(translators[u'en_ZA']),
|
||||
u'\n '.join(translators[u'et']),
|
||||
u'\n '.join(translators[u'fr']),
|
||||
u'\n '.join(translators[u'hu']),
|
||||
u'\n '.join(translators[u'ja']),
|
||||
u'\n '.join(translators[u'nb']),
|
||||
u'\n '.join(translators[u'nl']),
|
||||
u'\n '.join(translators[u'pt_BR']),
|
||||
u'\n '.join(translators[u'ru']),
|
||||
u'\n '.join(documentors)))
|
||||
self.aboutNotebook.setTabText(
|
||||
self.aboutNotebook.indexOf(self.creditsTab),
|
||||
translate('OpenLP.AboutForm', 'Credits'))
|
||||
self.licenseTextEdit.setPlainText(translate('OpenLP.AboutForm',
|
||||
copyright = translate('OpenLP.AboutForm',
|
||||
'Copyright \xa9 2004-2011 Raoul Snyman\n'
|
||||
'Portions copyright \xa9 2004-2011 '
|
||||
'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri,\n'
|
||||
'Meinert Jordan, Andreas Preikschat, Christian Richter, Philip\n'
|
||||
'Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Carstenn'
|
||||
'Tinggaard, Frode Woldsund\n'
|
||||
'\n'
|
||||
'Tinggaard, Frode Woldsund')
|
||||
licence = translate('OpenLP.AboutForm',
|
||||
'This program is free software; you can redistribute it and/or '
|
||||
'modify it under the terms of the GNU General Public License as '
|
||||
'published by the Free Software Foundation; version 2 of the '
|
||||
'License.\n'
|
||||
'\n'
|
||||
'License.')
|
||||
disclaimer = translate('OpenLP.AboutForm',
|
||||
'This program is distributed in the hope that it will be useful, '
|
||||
'but WITHOUT ANY WARRANTY; without even the implied warranty of '
|
||||
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below '
|
||||
'for more details.\n'
|
||||
'\n'
|
||||
'\n'
|
||||
'GNU GENERAL PUBLIC LICENSE\n'
|
||||
'for more details.')
|
||||
gpltext = ('GNU GENERAL PUBLIC LICENSE\n'
|
||||
'Version 2, June 1991\n'
|
||||
'\n'
|
||||
'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 '
|
||||
@ -549,7 +608,9 @@ class Ui_AboutDialog(object):
|
||||
'subroutine library, you may consider it more useful to permit '
|
||||
'linking proprietary applications with the library. If this is '
|
||||
'what you want to do, use the GNU Lesser General Public License '
|
||||
'instead of this License.'))
|
||||
'instead of this License.')
|
||||
self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' %
|
||||
(copyright, licence, disclaimer, gpltext))
|
||||
self.aboutNotebook.setTabText(
|
||||
self.aboutNotebook.indexOf(self.licenseTab),
|
||||
translate('OpenLP.AboutForm', 'License'))
|
||||
|
208
openlp/core/ui/firsttimeform.py
Normal file
208
openlp/core/ui/firsttimeform.py
Normal file
@ -0,0 +1,208 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||
# more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License along #
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import ConfigParser
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import urllib
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from firsttimewizard import Ui_FirstTimeWizard
|
||||
|
||||
from openlp.core.lib import translate, PluginStatus, check_directory_exists, \
|
||||
Receiver
|
||||
from openlp.core.utils import get_web_page, AppLocation
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
"""
|
||||
This is the Theme Import Wizard, which allows easy creation and editing of
|
||||
OpenLP themes.
|
||||
"""
|
||||
log.info(u'ThemeWizardForm loaded')
|
||||
|
||||
def __init__(self, screens, parent=None):
|
||||
# check to see if we have web access
|
||||
self.web = u'http://openlp.org/files/frw/'
|
||||
self.config = ConfigParser.ConfigParser()
|
||||
self.webAccess = get_web_page(u'%s%s' % (self.web, u'download.cfg'))
|
||||
if self.webAccess:
|
||||
files = self.webAccess.read()
|
||||
self.config.readfp(io.BytesIO(files))
|
||||
QtGui.QWizard.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
for screen in screens.get_screen_list():
|
||||
self.displaySelectionComboBox.addItem(screen)
|
||||
self.songsText = translate('OpenLP.FirstTimeWizard', 'Songs')
|
||||
self.biblesText = translate('OpenLP.FirstTimeWizard', 'Bibles')
|
||||
self.themesText = translate('OpenLP.FirstTimeWizard', 'Themes')
|
||||
self.startUpdates = translate('OpenLP.FirstTimeWizard',
|
||||
'Starting Updates')
|
||||
self.downloading = unicode(translate('OpenLP.FirstTimeWizard',
|
||||
'Downloading %s'))
|
||||
|
||||
def exec_(self, edit=False):
|
||||
"""
|
||||
Run the wizard.
|
||||
"""
|
||||
self.setDefaults()
|
||||
return QtGui.QWizard.exec_(self)
|
||||
|
||||
def setDefaults(self):
|
||||
"""
|
||||
Set up display at start of theme edit.
|
||||
"""
|
||||
self.restart()
|
||||
# Sort out internet access for downloads
|
||||
if self.webAccess:
|
||||
self.internetGroupBox.setVisible(True)
|
||||
self.noInternetLabel.setVisible(False)
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
|
||||
treewidgetitem.setText(0, self.songsText)
|
||||
self._loadChild(treewidgetitem, u'songs', u'languages', u'songs')
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
|
||||
treewidgetitem.setText(0, self.biblesText)
|
||||
self._loadChild(treewidgetitem, u'bibles', u'translations',
|
||||
u'bible')
|
||||
treewidgetitem = QtGui.QTreeWidgetItem(self.selectionTreeWidget)
|
||||
treewidgetitem.setText(0, self.themesText)
|
||||
self._loadChild(treewidgetitem, u'themes', u'files', 'theme')
|
||||
else:
|
||||
self.internetGroupBox.setVisible(False)
|
||||
self.noInternetLabel.setVisible(True)
|
||||
|
||||
def _loadChild(self, tree, list, tag, root):
|
||||
files = self.config.get(list, tag)
|
||||
files = files.split(u',')
|
||||
for file in files:
|
||||
if file:
|
||||
child = QtGui.QTreeWidgetItem(tree)
|
||||
child.setText(0, self.config.get(u'%s_%s'
|
||||
% (root, file), u'title'))
|
||||
child.setData(0, QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(self.config.get(u'%s_%s'
|
||||
% (root, file), u'filename')))
|
||||
child.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
child.setFlags(QtCore.Qt.ItemIsUserCheckable |
|
||||
QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
|
||||
|
||||
def initializePage(self, id):
|
||||
"""
|
||||
Set up the pages for Initial run through dialog
|
||||
"""
|
||||
wizardPage = self.page(id)
|
||||
if wizardPage == self.DefaultsPage:
|
||||
listIterator = QtGui.QTreeWidgetItemIterator(
|
||||
self.selectionTreeWidget)
|
||||
while listIterator.value():
|
||||
parent = listIterator.value().parent()
|
||||
if parent and listIterator.value().checkState(0) \
|
||||
== QtCore.Qt.Checked:
|
||||
if unicode(parent.text(0)) == self.themesText:
|
||||
self.themeSelectionComboBox.addItem(
|
||||
listIterator.value().text(0))
|
||||
listIterator += 1
|
||||
|
||||
def accept(self):
|
||||
self._updateMessage(self.startUpdates)
|
||||
# Set up the Plugin status's
|
||||
self._pluginStatus(self.songsCheckBox, u'songs/status')
|
||||
self._pluginStatus(self.bibleCheckBox, u'bibles/status')
|
||||
self._pluginStatus(self.presentationCheckBox, u'presentations/status')
|
||||
self._pluginStatus(self.imageCheckBox, u'images/status')
|
||||
self._pluginStatus(self.mediaCheckBox, u'media/status')
|
||||
self._pluginStatus(self.remoteCheckBox, u'remotes/status')
|
||||
self._pluginStatus(self.customCheckBox, u'custom/status')
|
||||
self._pluginStatus(self.songUsageCheckBox, u'songusage/status')
|
||||
self._pluginStatus(self.alertCheckBox, u'alerts/status')
|
||||
# Build directories for downloads
|
||||
songsDestination = AppLocation.get_section_data_path(u'songs')
|
||||
check_directory_exists(songsDestination)
|
||||
bibleDestination = AppLocation.get_section_data_path(u'bibles')
|
||||
check_directory_exists(bibleDestination)
|
||||
themeDestination = AppLocation.get_section_data_path(u'themes')
|
||||
check_directory_exists(themeDestination)
|
||||
# Install Selected Items looping through them
|
||||
listIterator = QtGui.QTreeWidgetItemIterator(self.selectionTreeWidget)
|
||||
while listIterator.value():
|
||||
type = listIterator.value().parent()
|
||||
if listIterator.value().parent():
|
||||
if listIterator.value().checkState(0) == QtCore.Qt.Checked:
|
||||
# Install items as theu have been selected
|
||||
item = unicode(listIterator.value().text(0))
|
||||
# Download Song database if selected
|
||||
if unicode(type.text(0)) == self.songsText:
|
||||
songs = unicode(listIterator.value().data(0,
|
||||
QtCore.Qt.UserRole).toString())
|
||||
message = self.downloading % item
|
||||
self._updateMessage(message)
|
||||
# Song database is a fixed file name
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, songs),
|
||||
os.path.join(songsDestination, u'songs.sqlite'))
|
||||
# Download and selected Bibles
|
||||
if unicode(type.text(0)) == self.biblesText:
|
||||
bible = unicode(listIterator.value().data(0,
|
||||
QtCore.Qt.UserRole).toString())
|
||||
message = self.downloading % item
|
||||
self._updateMessage(message)
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, bible),
|
||||
os.path.join(bibleDestination, bible))
|
||||
# Download any themes
|
||||
if unicode(type.text(0)) == self.themesText:
|
||||
theme = unicode(listIterator.value().data(0,
|
||||
QtCore.Qt.UserRole).toString())
|
||||
message = self.downloading % item
|
||||
self._updateMessage(message)
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, theme),
|
||||
os.path.join(themeDestination, theme))
|
||||
listIterator += 1
|
||||
# Set Default Display
|
||||
if self.displaySelectionComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'General/monitor',
|
||||
QtCore.QVariant(self.displaySelectionComboBox.
|
||||
currentIndex()))
|
||||
# Set Global Theme
|
||||
if self.themeSelectionComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'themes/global theme',
|
||||
QtCore.QVariant(self.themeSelectionComboBox.currentText()))
|
||||
QtCore.QSettings().setValue(u'general/first time',
|
||||
QtCore.QVariant(False))
|
||||
return QtGui.QWizard.accept(self)
|
||||
|
||||
def _pluginStatus(self, field, tag):
|
||||
status = PluginStatus.Active if field.checkState() \
|
||||
== QtCore.Qt.Checked else PluginStatus.Inactive
|
||||
QtCore.QSettings().setValue(tag, QtCore.QVariant(status))
|
||||
|
||||
def _updateMessage(self, text):
|
||||
"""
|
||||
Keep screen up to date
|
||||
"""
|
||||
self.updateLabel.setText(text)
|
||||
Receiver.send_message(u'openlp_process_events')
|
55
openlp/core/ui/firsttimelanguagedialog.py
Normal file
55
openlp/core/ui/firsttimelanguagedialog.py
Normal file
@ -0,0 +1,55 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||
# more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License along #
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.lib.ui import create_accept_reject_button_box
|
||||
|
||||
class Ui_FirstTimeLanguageDialog(object):
|
||||
def setupUi(self, firstTimeLanguageDialog):
|
||||
firstTimeLanguageDialog.setObjectName(u'firstTimeLanguageDialog')
|
||||
firstTimeLanguageDialog.resize(300, 10)
|
||||
self.dialogLayout = QtGui.QGridLayout(firstTimeLanguageDialog)
|
||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
||||
self.fileNameLabel = QtGui.QLabel(firstTimeLanguageDialog)
|
||||
self.fileNameLabel.setObjectName(u'fileNameLabel')
|
||||
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
|
||||
self.LanguageComboBox = QtGui.QComboBox(firstTimeLanguageDialog)
|
||||
self.LanguageComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
|
||||
self.LanguageComboBox.setObjectName("LanguageComboBox")
|
||||
self.dialogLayout.addWidget(self.LanguageComboBox, 0, 1)
|
||||
self.buttonBox = create_accept_reject_button_box(firstTimeLanguageDialog, True)
|
||||
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
|
||||
self.retranslateUi(firstTimeLanguageDialog)
|
||||
self.setMaximumHeight(self.sizeHint().height())
|
||||
QtCore.QMetaObject.connectSlotsByName(firstTimeLanguageDialog)
|
||||
|
||||
def retranslateUi(self, firstTimeLanguageDialog):
|
||||
self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Initial Set up Language'))
|
||||
self.fileNameLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Initial Language:'))
|
67
openlp/core/ui/firsttimelanguageform.py
Normal file
67
openlp/core/ui/firsttimelanguageform.py
Normal file
@ -0,0 +1,67 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||
# more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License along #
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from firsttimelanguagedialog import Ui_FirstTimeLanguageDialog
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.utils import LanguageManager
|
||||
|
||||
class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
"""
|
||||
The exception dialog
|
||||
"""
|
||||
def __init__(self, parent=None):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
self.qmList = LanguageManager.get_qm_list()
|
||||
self.LanguageComboBox.addItem(u'Automatic')
|
||||
for key in sorted(self.qmList.keys()):
|
||||
self.LanguageComboBox.addItem(key)
|
||||
|
||||
def exec_(self):
|
||||
"""
|
||||
Run the Dialog with correct heading.
|
||||
"""
|
||||
return QtGui.QDialog.exec_(self)
|
||||
|
||||
def accept(self):
|
||||
# It's the first row so must be Automatic
|
||||
if self.LanguageComboBox.currentIndex() == 0:
|
||||
LanguageManager.auto_language = True
|
||||
LanguageManager.set_language(False, False)
|
||||
else:
|
||||
LanguageManager.auto_language = False
|
||||
action = QtGui.QAction(None)
|
||||
action.setObjectName(unicode(self.LanguageComboBox.currentText()))
|
||||
LanguageManager.set_language(action, False)
|
||||
return QtGui.QDialog.accept(self)
|
||||
|
||||
def reject(self):
|
||||
LanguageManager.auto_language = True
|
||||
LanguageManager.set_language(False, False)
|
||||
return QtGui.QDialog.reject(self)
|
227
openlp/core/ui/firsttimewizard.py
Normal file
227
openlp/core/ui/firsttimewizard.py
Normal file
@ -0,0 +1,227 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Meinert Jordan, Armin Köhler, Andreas Preikschat, #
|
||||
# Christian Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon #
|
||||
# Tibble, Carsten Tinggaard, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||
# more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License along #
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate
|
||||
|
||||
|
||||
class Ui_FirstTimeWizard(object):
|
||||
def setupUi(self, FirstTimeWizard):
|
||||
FirstTimeWizard.setObjectName(u'FirstTimeWizard')
|
||||
FirstTimeWizard.resize(550, 386)
|
||||
FirstTimeWizard.setModal(True)
|
||||
FirstTimeWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
|
||||
FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages|
|
||||
QtGui.QWizard.NoBackButtonOnStartPage)
|
||||
self.welcomePage = QtGui.QWizardPage()
|
||||
self.welcomePage.setTitle(u'')
|
||||
self.welcomePage.setSubTitle(u'')
|
||||
self.welcomePage.setObjectName(u'welcomePage')
|
||||
self.welcomeLayout = QtGui.QHBoxLayout(self.welcomePage)
|
||||
self.welcomeLayout.setSpacing(8)
|
||||
self.welcomeLayout.setMargin(0)
|
||||
self.welcomeLayout.setObjectName(u'welcomeLayout')
|
||||
self.importBibleImage = QtGui.QLabel(self.welcomePage)
|
||||
self.importBibleImage.setMinimumSize(QtCore.QSize(163, 0))
|
||||
self.importBibleImage.setMaximumSize(QtCore.QSize(163, 16777215))
|
||||
self.importBibleImage.setLineWidth(0)
|
||||
self.importBibleImage.setText(u'')
|
||||
self.importBibleImage.setPixmap(
|
||||
QtGui.QPixmap(u':/wizards/wizard_importbible.bmp'))
|
||||
self.importBibleImage.setIndent(0)
|
||||
self.importBibleImage.setObjectName(u'importBibleImage')
|
||||
self.welcomeLayout.addWidget(self.importBibleImage)
|
||||
self.welcomePageLayout = QtGui.QVBoxLayout()
|
||||
self.welcomePageLayout.setSpacing(8)
|
||||
self.welcomePageLayout.setObjectName(u'welcomePageLayout')
|
||||
self.titleLabel = QtGui.QLabel(self.welcomePage)
|
||||
self.titleLabel.setObjectName(u'titleLabel')
|
||||
self.welcomePageLayout.addWidget(self.titleLabel)
|
||||
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
self.welcomePageLayout.addItem(spacerItem)
|
||||
self.informationLabel = QtGui.QLabel(self.welcomePage)
|
||||
self.informationLabel.setWordWrap(True)
|
||||
self.informationLabel.setMargin(10)
|
||||
self.informationLabel.setObjectName(u'informationLabel')
|
||||
self.welcomePageLayout.addWidget(self.informationLabel)
|
||||
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
|
||||
QtGui.QSizePolicy.Expanding)
|
||||
self.welcomePageLayout.addItem(spacerItem1)
|
||||
self.welcomeLayout.addLayout(self.welcomePageLayout)
|
||||
FirstTimeWizard.addPage(self.welcomePage)
|
||||
self.PluginPagePage = QtGui.QWizardPage()
|
||||
self.PluginPagePage.setObjectName(u'PluginPagePage')
|
||||
self.verticalLayout_2 = QtGui.QVBoxLayout(self.PluginPagePage)
|
||||
self.verticalLayout_2.setObjectName(u'verticalLayout_2')
|
||||
self.verticalLayout = QtGui.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(u'verticalLayout')
|
||||
self.songsCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.songsCheckBox.setChecked(True)
|
||||
self.songsCheckBox.setObjectName(u'songsCheckBox')
|
||||
self.verticalLayout.addWidget(self.songsCheckBox)
|
||||
self.customCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.customCheckBox.setChecked(True)
|
||||
self.customCheckBox.setObjectName(u'customCheckBox')
|
||||
self.verticalLayout.addWidget(self.customCheckBox)
|
||||
self.bibleCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.bibleCheckBox.setChecked(True)
|
||||
self.bibleCheckBox.setObjectName(u'bibleCheckBox')
|
||||
self.verticalLayout.addWidget(self.bibleCheckBox)
|
||||
self.imageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.imageCheckBox.setChecked(True)
|
||||
self.imageCheckBox.setObjectName(u'imageCheckBox')
|
||||
self.verticalLayout.addWidget(self.imageCheckBox)
|
||||
self.presentationCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.presentationCheckBox.setChecked(True)
|
||||
self.presentationCheckBox.setObjectName(u'presentationCheckBox')
|
||||
self.verticalLayout.addWidget(self.presentationCheckBox)
|
||||
self.mediaCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.mediaCheckBox.setChecked(True)
|
||||
self.mediaCheckBox.setObjectName(u'mediaCheckBox')
|
||||
self.verticalLayout.addWidget(self.mediaCheckBox)
|
||||
self.remoteCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.remoteCheckBox.setObjectName(u'remoteCheckBox')
|
||||
self.verticalLayout.addWidget(self.remoteCheckBox)
|
||||
self.songUsageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.songUsageCheckBox.setChecked(True)
|
||||
self.songUsageCheckBox.setObjectName(u'songUsageCheckBox')
|
||||
self.verticalLayout.addWidget(self.songUsageCheckBox)
|
||||
self.alertCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.alertCheckBox.setChecked(True)
|
||||
self.alertCheckBox.setObjectName(u'alertCheckBox')
|
||||
self.verticalLayout.addWidget(self.alertCheckBox)
|
||||
self.verticalLayout_2.addLayout(self.verticalLayout)
|
||||
FirstTimeWizard.addPage(self.PluginPagePage)
|
||||
self.downloadDefaultsPage = QtGui.QWizardPage()
|
||||
self.downloadDefaultsPage.setObjectName(u'downloadDefaultsPage')
|
||||
self.noInternetLabel = QtGui.QLabel(self.downloadDefaultsPage)
|
||||
self.noInternetLabel.setGeometry(QtCore.QRect(20, 20, 461, 17))
|
||||
self.noInternetLabel.setObjectName(u'noInternetLabel')
|
||||
self.internetGroupBox = QtGui.QGroupBox(self.downloadDefaultsPage)
|
||||
self.internetGroupBox.setGeometry(QtCore.QRect(20, 10, 501, 271))
|
||||
self.internetGroupBox.setObjectName(u'internetGroupBox')
|
||||
self.verticalLayout_4 = QtGui.QVBoxLayout(self.internetGroupBox)
|
||||
self.verticalLayout_4.setObjectName(u'verticalLayout_4')
|
||||
self.selectionTreeWidget = QtGui.QTreeWidget(self.internetGroupBox)
|
||||
self.selectionTreeWidget.setHorizontalScrollBarPolicy(
|
||||
QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.selectionTreeWidget.setProperty(u'showDropIndicator', False)
|
||||
self.selectionTreeWidget.setAlternatingRowColors(True)
|
||||
self.selectionTreeWidget.setObjectName(u'selectionTreeWidget')
|
||||
self.selectionTreeWidget.headerItem().setText(0, u'1')
|
||||
self.selectionTreeWidget.header().setVisible(False)
|
||||
self.verticalLayout_4.addWidget(self.selectionTreeWidget)
|
||||
FirstTimeWizard.addPage(self.downloadDefaultsPage)
|
||||
self.DefaultsPage = QtGui.QWizardPage()
|
||||
self.DefaultsPage.setObjectName(u'DefaultsPage')
|
||||
self.layoutWidget = QtGui.QWidget(self.DefaultsPage)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(20, 20, 491, 113))
|
||||
self.layoutWidget.setObjectName(u'layoutWidget')
|
||||
self.gridLayout = QtGui.QGridLayout(self.layoutWidget)
|
||||
self.gridLayout.setMargin(0)
|
||||
self.gridLayout.setObjectName(u'gridLayout')
|
||||
self.displaySelectionLabel = QtGui.QLabel(self.layoutWidget)
|
||||
self.displaySelectionLabel.setObjectName(u'displaySelectionLabel')
|
||||
self.gridLayout.addWidget(self.displaySelectionLabel, 0, 0, 1, 1)
|
||||
self.displaySelectionComboBox = QtGui.QComboBox(self.layoutWidget)
|
||||
self.displaySelectionComboBox.setEditable(False)
|
||||
self.displaySelectionComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.displaySelectionComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToContents)
|
||||
self.displaySelectionComboBox.setObjectName(u'displaySelectionComboBox')
|
||||
self.gridLayout.addWidget(self.displaySelectionComboBox, 0, 1, 1, 1)
|
||||
self.themeSelectionLabel = QtGui.QLabel(self.layoutWidget)
|
||||
self.themeSelectionLabel.setObjectName(u'themeSelectionLabel')
|
||||
self.gridLayout.addWidget(self.themeSelectionLabel, 1, 0, 1, 1)
|
||||
self.themeSelectionComboBox = QtGui.QComboBox(self.layoutWidget)
|
||||
self.themeSelectionComboBox.setSizeAdjustPolicy(
|
||||
QtGui.QComboBox.AdjustToContents)
|
||||
self.themeSelectionComboBox.setObjectName(u'themeSelectionComboBox')
|
||||
self.gridLayout.addWidget(self.themeSelectionComboBox, 1, 1, 1, 1)
|
||||
self.messageLabel = QtGui.QLabel(self.DefaultsPage)
|
||||
self.messageLabel.setGeometry(QtCore.QRect(60, 160, 471, 17))
|
||||
self.messageLabel.setObjectName(u'messageLabel')
|
||||
self.updateLabel = QtGui.QLabel(self.DefaultsPage)
|
||||
self.updateLabel.setGeometry(QtCore.QRect(60, 220, 351, 17))
|
||||
self.updateLabel.setObjectName(u'updateLabel')
|
||||
FirstTimeWizard.addPage(self.DefaultsPage)
|
||||
|
||||
self.retranslateUi(FirstTimeWizard)
|
||||
QtCore.QMetaObject.connectSlotsByName(FirstTimeWizard)
|
||||
|
||||
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.informationLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'This wizard will help you to configure OpenLP for initial use .'
|
||||
' Click the next button below to start the process of selection '
|
||||
'your initial options. '))
|
||||
self.PluginPagePage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Activate required Plugins'))
|
||||
self.PluginPagePage.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 Text'))
|
||||
self.bibleCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Bible'))
|
||||
self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Images'))
|
||||
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.downloadDefaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Download Samples from OpenLP.org'))
|
||||
self.downloadDefaultsPage.setSubTitle(translate(
|
||||
'OpenLP.FirstTimeWizard',
|
||||
'Select samples to downlaod and install for use.'))
|
||||
self.noInternetLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'No Internet connection found so unable to download any default'
|
||||
' files.'))
|
||||
self.internetGroupBox.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Download Example Files'))
|
||||
self.DefaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Default Settings'))
|
||||
self.DefaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Set up default values to be used by OpenLP'))
|
||||
self.displaySelectionLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Default output display'))
|
||||
self.themeSelectionLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Select the default Theme'))
|
||||
self.messageLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Press Finish to apply all you changes and start OpenLP'))
|
@ -234,6 +234,9 @@ class GeneralTab(SettingsTab):
|
||||
QtCore.QObject.connect(self.customXValueEdit,
|
||||
QtCore.SIGNAL(u'textEdited(const QString&)'),
|
||||
self.onDisplayPositionChanged)
|
||||
# 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)
|
||||
|
||||
def retranslateUi(self):
|
||||
"""
|
||||
@ -300,13 +303,9 @@ class GeneralTab(SettingsTab):
|
||||
"""
|
||||
settings = QtCore.QSettings()
|
||||
settings.beginGroup(self.settingsSection)
|
||||
for screen in self.screens.screen_list:
|
||||
screen_name = u'%s %d' % (translate('OpenLP.GeneralTab', 'Screen'),
|
||||
screen[u'number'] + 1)
|
||||
if screen[u'primary']:
|
||||
screen_name = u'%s (%s)' % (screen_name,
|
||||
translate('OpenLP.GeneralTab', 'primary'))
|
||||
self.monitorComboBox.addItem(screen_name)
|
||||
self.monitorComboBox.clear()
|
||||
for screen in self.screens.get_screen_list():
|
||||
self.monitorComboBox.addItem(screen)
|
||||
self.numberEdit.setText(unicode(settings.value(
|
||||
u'ccli number', QtCore.QVariant(u'')).toString()))
|
||||
self.usernameEdit.setText(unicode(settings.value(
|
||||
|
@ -158,6 +158,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.webView.setHtml(build_html(serviceItem, self.screen,
|
||||
self.alertTab, self.isLive, None))
|
||||
self.initialFrame = True
|
||||
self.__hideMouse()
|
||||
# To display or not to display?
|
||||
if not self.screen[u'primary']:
|
||||
self.show()
|
||||
@ -232,9 +233,6 @@ class MainDisplay(DisplayWidget):
|
||||
image = self.imageManager.get_image_bytes(name)
|
||||
self.resetVideo()
|
||||
self.displayImage(image)
|
||||
# show screen
|
||||
if self.isLive:
|
||||
self.setVisible(True)
|
||||
return self.preview()
|
||||
|
||||
def displayImage(self, image):
|
||||
@ -318,7 +316,7 @@ class MainDisplay(DisplayWidget):
|
||||
Changes the volume of a running video
|
||||
"""
|
||||
log.debug(u'videoVolume %d' % volume)
|
||||
vol = float(volume)/float(10)
|
||||
vol = float(volume) / float(10)
|
||||
if self.phononActive:
|
||||
self.audio.setVolume(vol)
|
||||
else:
|
||||
@ -334,7 +332,7 @@ class MainDisplay(DisplayWidget):
|
||||
# We are running a background theme
|
||||
self.override[u'theme'] = u''
|
||||
self.override[u'video'] = True
|
||||
vol = float(volume)/float(10)
|
||||
vol = float(volume) / float(10)
|
||||
if isBackground or not self.usePhonon:
|
||||
js = u'show_video("init", "%s", %s, true); show_video("play");' % \
|
||||
(videoPath.replace(u'\\', u'\\\\'), str(vol))
|
||||
@ -387,9 +385,10 @@ class MainDisplay(DisplayWidget):
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
# if was hidden keep it hidden
|
||||
if self.isLive:
|
||||
self.setVisible(True)
|
||||
if self.hideMode:
|
||||
self.hideDisplay(self.hideMode)
|
||||
else:
|
||||
self.setVisible(True)
|
||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height(),
|
||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||
@ -434,15 +433,7 @@ class MainDisplay(DisplayWidget):
|
||||
# if was hidden keep it hidden
|
||||
if self.hideMode and self.isLive:
|
||||
self.hideDisplay(self.hideMode)
|
||||
# Hide mouse cursor when moved over display if enabled in settings
|
||||
settings = QtCore.QSettings()
|
||||
if settings.value(u'advanced/hide mouse',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
self.setCursor(QtCore.Qt.BlankCursor)
|
||||
self.frame.evaluateJavaScript('document.body.style.cursor = "none"')
|
||||
else:
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.frame.evaluateJavaScript('document.body.style.cursor = "auto"')
|
||||
self.__hideMouse()
|
||||
|
||||
def footer(self, text):
|
||||
"""
|
||||
@ -492,6 +483,16 @@ class MainDisplay(DisplayWidget):
|
||||
# Trigger actions when display is active again
|
||||
Receiver.send_message(u'maindisplay_active')
|
||||
|
||||
def __hideMouse(self):
|
||||
# Hide mouse cursor when moved over display if enabled in settings
|
||||
if QtCore.QSettings().value(u'advanced/hide mouse',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
self.setCursor(QtCore.Qt.BlankCursor)
|
||||
self.frame.evaluateJavaScript('document.body.style.cursor = "none"')
|
||||
else:
|
||||
self.setCursor(QtCore.Qt.ArrowCursor)
|
||||
self.frame.evaluateJavaScript('document.body.style.cursor = "auto"')
|
||||
|
||||
|
||||
class AudioPlayer(QtCore.QObject):
|
||||
"""
|
||||
|
@ -206,7 +206,7 @@ class Ui_MainWindow(object):
|
||||
mainWindow.actionList.add_action(self.ModeDefaultItem, u'View Mode')
|
||||
self.ModeSetupItem = checkable_action(mainWindow, u'ModeLiveItem')
|
||||
mainWindow.actionList.add_action(self.ModeSetupItem, u'View Mode')
|
||||
self.ModeLiveItem = checkable_action(mainWindow, u'ModeLiveItem')
|
||||
self.ModeLiveItem = checkable_action(mainWindow, u'ModeLiveItem', True)
|
||||
mainWindow.actionList.add_action(self.ModeLiveItem, u'View Mode')
|
||||
self.ModeGroup = QtGui.QActionGroup(mainWindow)
|
||||
self.ModeGroup.addAction(self.ModeDefaultItem)
|
||||
@ -215,6 +215,8 @@ class Ui_MainWindow(object):
|
||||
self.ModeDefaultItem.setChecked(True)
|
||||
self.ToolsAddToolItem = icon_action(mainWindow, u'ToolsAddToolItem',
|
||||
u':/tools/tools_add.png')
|
||||
# Hide the entry, as it does not have any functionality yet.
|
||||
self.ToolsAddToolItem.setVisible(False)
|
||||
mainWindow.actionList.add_action(self.ToolsAddToolItem, u'Tools')
|
||||
self.ToolsOpenDataFolder = icon_action(mainWindow,
|
||||
u'ToolsOpenDataFolder', u':/general/general_open.png')
|
||||
@ -225,19 +227,17 @@ class Ui_MainWindow(object):
|
||||
u'Settings')
|
||||
# i18n Language Items
|
||||
self.AutoLanguageItem = checkable_action(mainWindow,
|
||||
u'AutoLanguageItem')
|
||||
u'AutoLanguageItem', LanguageManager.auto_language)
|
||||
mainWindow.actionList.add_action(self.AutoLanguageItem, u'Settings')
|
||||
self.LanguageGroup = QtGui.QActionGroup(mainWindow)
|
||||
self.LanguageGroup.setExclusive(True)
|
||||
self.LanguageGroup.setObjectName(u'LanguageGroup')
|
||||
self.AutoLanguageItem.setChecked(LanguageManager.auto_language)
|
||||
self.LanguageGroup.setDisabled(LanguageManager.auto_language)
|
||||
qmList = LanguageManager.get_qm_list()
|
||||
savedLanguage = LanguageManager.get_language()
|
||||
for key in sorted(qmList.keys()):
|
||||
languageItem = checkable_action(mainWindow, key)
|
||||
if qmList[key] == savedLanguage:
|
||||
languageItem.setChecked(True)
|
||||
languageItem = checkable_action(
|
||||
mainWindow, key, qmList[key] == savedLanguage)
|
||||
add_actions(self.LanguageGroup, [languageItem])
|
||||
self.SettingsShortcutsItem = icon_action(mainWindow,
|
||||
u'SettingsShortcutsItem',
|
||||
@ -461,7 +461,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
|
||||
actionList = ActionList()
|
||||
|
||||
def __init__(self, screens, applicationVersion, clipboard):
|
||||
def __init__(self, screens, applicationVersion, clipboard, firstTime):
|
||||
"""
|
||||
This constructor sets up the interface, the various managers, and the
|
||||
plugins.
|
||||
@ -626,6 +626,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.MediaToolBox.setCurrentIndex(savedPlugin)
|
||||
self.settingsForm.postSetUp()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
# Import themes if first time
|
||||
if firstTime:
|
||||
self.themeManagerContents.firstTime()
|
||||
|
||||
|
||||
def setAutoLanguage(self, value):
|
||||
self.LanguageGroup.setDisabled(value)
|
||||
@ -650,8 +654,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
Show the main form, as well as the display form
|
||||
"""
|
||||
QtGui.QWidget.show(self)
|
||||
self.liveController.display.setup()
|
||||
self.previewController.display.setup()
|
||||
if self.liveController.display.isVisible():
|
||||
self.liveController.display.setFocus()
|
||||
self.activateWindow()
|
||||
|
@ -25,11 +25,15 @@
|
||||
###############################################################################
|
||||
"""
|
||||
The :mod:`screen` module provides management functionality for a machines'
|
||||
displays
|
||||
displays.
|
||||
"""
|
||||
import logging
|
||||
import copy
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import Receiver, translate
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class ScreenList(object):
|
||||
@ -38,7 +42,14 @@ class ScreenList(object):
|
||||
"""
|
||||
log.info(u'Screen loaded')
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, desktop):
|
||||
"""
|
||||
Initialise the screen list.
|
||||
|
||||
``desktop``
|
||||
A ``QDesktopWidget`` object.
|
||||
"""
|
||||
self.desktop = desktop
|
||||
self.preview = None
|
||||
self.current = None
|
||||
self.override = None
|
||||
@ -48,19 +59,120 @@ class ScreenList(object):
|
||||
self.current_display = 0
|
||||
# save config display number
|
||||
self.monitor_number = 0
|
||||
self.screen_count_changed()
|
||||
QtCore.QObject.connect(desktop,
|
||||
QtCore.SIGNAL(u'resized(int)'), self.screen_resolution_changed)
|
||||
QtCore.QObject.connect(desktop,
|
||||
QtCore.SIGNAL(u'screenCountChanged(int)'),
|
||||
self.screen_count_changed)
|
||||
|
||||
def screen_resolution_changed(self, number):
|
||||
"""
|
||||
Called when the resolution of a screen has changed.
|
||||
|
||||
``number``
|
||||
The number of the screen, which size has changed.
|
||||
"""
|
||||
log.info(u'screenResolutionChanged %d' % number)
|
||||
for screen in self.screen_list:
|
||||
if number == screen[u'number']:
|
||||
newScreen = {
|
||||
u'number': number,
|
||||
u'size': self.desktop.screenGeometry(number),
|
||||
u'primary': self.desktop.primaryScreen() == number
|
||||
}
|
||||
self.remove_screen(number)
|
||||
self.add_screen(newScreen)
|
||||
# The screen's default size is used, that is why we have to
|
||||
# update the override screen.
|
||||
if screen == self.override:
|
||||
self.override = copy.deepcopy(newScreen)
|
||||
self.set_override_display()
|
||||
Receiver.send_message(u'config_screen_changed')
|
||||
break
|
||||
|
||||
def screen_count_changed(self, changed_screen=-1):
|
||||
"""
|
||||
Called when a screen has been added or removed.
|
||||
|
||||
``changed_screen``
|
||||
The screen's number which has been (un)plugged.
|
||||
"""
|
||||
# Remove unplugged screens.
|
||||
for screen in copy.deepcopy(self.screen_list):
|
||||
if screen[u'number'] == self.desktop.numScreens():
|
||||
self.remove_screen(screen[u'number'])
|
||||
# Add new screens.
|
||||
for number in xrange(0, self.desktop.numScreens()):
|
||||
if not self.screen_exists(number):
|
||||
self.add_screen({
|
||||
u'number': number,
|
||||
u'size': self.desktop.screenGeometry(number),
|
||||
u'primary': (self.desktop.primaryScreen() == number)
|
||||
})
|
||||
# We do not want to send this message, when the method is called the
|
||||
# first time.
|
||||
if changed_screen != -1:
|
||||
# Reload setting tabs to apply possible changes.
|
||||
Receiver.send_message(u'config_screen_changed')
|
||||
|
||||
def get_screen_list(self):
|
||||
"""
|
||||
Returns a list with the screens. This should only be used to display
|
||||
available screens to the user::
|
||||
|
||||
[u'Screen 1 (primary)', u'Screen 2']
|
||||
"""
|
||||
screen_list = []
|
||||
for screen in self.screen_list:
|
||||
screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'),
|
||||
screen[u'number'] + 1)
|
||||
if screen[u'primary']:
|
||||
screen_name = u'%s (%s)' % (screen_name,
|
||||
translate('OpenLP.ScreenList', 'primary'))
|
||||
screen_list.append(screen_name)
|
||||
return screen_list
|
||||
|
||||
def add_screen(self, screen):
|
||||
"""
|
||||
Add a screen to the list of known screens
|
||||
Add a screen to the list of known screens.
|
||||
|
||||
``screen``
|
||||
A dict with the screen properties::
|
||||
|
||||
{
|
||||
u'primary': True,
|
||||
u'number': 0,
|
||||
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
|
||||
}
|
||||
"""
|
||||
log.info(u'Screen %d found with resolution %s',
|
||||
screen[u'number'], screen[u'size'])
|
||||
if screen[u'primary']:
|
||||
self.current = screen
|
||||
self.screen_list.append(screen)
|
||||
self.display_count += 1
|
||||
|
||||
def remove_screen(self, number):
|
||||
"""
|
||||
Remove a screen from the list of known screens.
|
||||
|
||||
``number``
|
||||
The screen number (int).
|
||||
"""
|
||||
log.info(u'remove_screen %d' % number)
|
||||
for screen in self.screen_list:
|
||||
if screen[u'number'] == number:
|
||||
self.screen_list.remove(screen)
|
||||
self.display_count -= 1
|
||||
break
|
||||
|
||||
def screen_exists(self, number):
|
||||
"""
|
||||
Confirms a screen is known
|
||||
Confirms a screen is known.
|
||||
|
||||
``number``
|
||||
The screen number (int).
|
||||
"""
|
||||
for screen in self.screen_list:
|
||||
if screen[u'number'] == number:
|
||||
@ -69,7 +181,10 @@ class ScreenList(object):
|
||||
|
||||
def set_current_display(self, number):
|
||||
"""
|
||||
Set up the current screen dimensions
|
||||
Set up the current screen dimensions.
|
||||
|
||||
``number``
|
||||
The screen number (int).
|
||||
"""
|
||||
log.debug(u'set_current_display %s', number)
|
||||
if number + 1 > self.display_count:
|
||||
@ -86,8 +201,8 @@ class ScreenList(object):
|
||||
|
||||
def set_override_display(self):
|
||||
"""
|
||||
replace the current size with the override values
|
||||
user wants to have their own screen attributes
|
||||
Replace the current size with the override values, as the user wants to
|
||||
have their own screen attributes.
|
||||
"""
|
||||
log.debug(u'set_override_display')
|
||||
self.current = copy.deepcopy(self.override)
|
||||
@ -95,8 +210,8 @@ class ScreenList(object):
|
||||
|
||||
def reset_current_display(self):
|
||||
"""
|
||||
replace the current values with the correct values
|
||||
user wants to use the correct screen attributes
|
||||
Replace the current values with the correct values, as the user wants to
|
||||
use the correct screen attributes.
|
||||
"""
|
||||
log.debug(u'reset_current_display')
|
||||
self.set_current_display(self.current_display)
|
||||
|
@ -943,6 +943,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
for item in self.serviceItems:
|
||||
if item[u'service_item']._uuid == uuid:
|
||||
item[u'service_item'].edit_id = editId
|
||||
self.setModified(True)
|
||||
|
||||
def replaceServiceItem(self, newItem):
|
||||
"""
|
||||
@ -1123,13 +1124,14 @@ class ServiceManager(QtGui.QWidget):
|
||||
self.serviceItems.remove(serviceItem)
|
||||
self.serviceItems.insert(endpos, serviceItem)
|
||||
self.repaintServiceList(endpos, child)
|
||||
self.setModified(True)
|
||||
else:
|
||||
# we are not over anything so drop
|
||||
replace = False
|
||||
if item is None:
|
||||
self.dropPosition = len(self.serviceItems)
|
||||
else:
|
||||
# we are over somthing so lets investigate
|
||||
# we are over something so lets investigate
|
||||
pos = self._getParentItemData(item) - 1
|
||||
serviceItem = self.serviceItems[pos]
|
||||
if (plugin == serviceItem[u'service_item'].name and
|
||||
|
@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
||||
ItemCapabilities, translate
|
||||
from openlp.core.lib.ui import UiStrings, shortcut_action
|
||||
from openlp.core.lib.ui import icon_action, UiStrings, shortcut_action
|
||||
from openlp.core.ui import HideMode, MainDisplay
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -114,8 +114,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.previewListWidget = SlideList(self)
|
||||
self.previewListWidget.setColumnCount(1)
|
||||
self.previewListWidget.horizontalHeader().setVisible(False)
|
||||
self.previewListWidget.setColumnWidth(
|
||||
0, self.controller.width())
|
||||
self.previewListWidget.setColumnWidth(0, self.controller.width())
|
||||
self.previewListWidget.isLive = self.isLive
|
||||
self.previewListWidget.setObjectName(u'PreviewListWidget')
|
||||
self.previewListWidget.setSelectionBehavior(1)
|
||||
@ -146,36 +145,30 @@ class SlideController(QtGui.QWidget):
|
||||
u':/slides/slide_next.png',
|
||||
translate('OpenLP.SlideController', 'Move to next'),
|
||||
self.onSlideSelectedNext)
|
||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
||||
if self.isLive:
|
||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.hideMenu = QtGui.QToolButton(self.toolbar)
|
||||
self.hideMenu.setText(translate('OpenLP.SlideController', 'Hide'))
|
||||
self.hideMenu.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
|
||||
self.toolbar.addToolbarWidget(u'Hide Menu', self.hideMenu)
|
||||
self.hideMenu.setMenu(QtGui.QMenu(
|
||||
translate('OpenLP.SlideController', 'Hide'), self.toolbar))
|
||||
self.blankScreen = QtGui.QAction(QtGui.QIcon(
|
||||
u':/slides/slide_blank.png'),
|
||||
translate('OpenLP.SlideController',
|
||||
'Blank Screen'), self.hideMenu)
|
||||
self.blankScreen.setCheckable(True)
|
||||
self.themeScreen = QtGui.QAction(QtGui.QIcon(
|
||||
u':/slides/slide_theme.png'),
|
||||
translate('OpenLP.SlideController',
|
||||
'Blank to Theme'), self.hideMenu)
|
||||
self.themeScreen.setCheckable(True)
|
||||
self.blankScreen = icon_action(self.hideMenu, u'Blank Screen',
|
||||
u':/slides/slide_blank.png', False)
|
||||
self.blankScreen.setText(
|
||||
translate('OpenLP.SlideController', 'Blank Screen'))
|
||||
self.themeScreen = icon_action(self.hideMenu, u'Blank Theme',
|
||||
u':/slides/slide_theme.png', False)
|
||||
self.themeScreen.setText(
|
||||
translate('OpenLP.SlideController', 'Blank to Theme'))
|
||||
self.desktopScreen = icon_action(self.hideMenu, u'Desktop Screen',
|
||||
u':/slides/slide_desktop.png', False)
|
||||
self.desktopScreen.setText(
|
||||
translate('OpenLP.SlideController', 'Show Desktop'))
|
||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
||||
self.hideMenu.menu().addAction(self.blankScreen)
|
||||
self.hideMenu.menu().addAction(self.themeScreen)
|
||||
if self.screens.display_count > 1:
|
||||
self.desktopScreen = QtGui.QAction(QtGui.QIcon(
|
||||
u':/slides/slide_desktop.png'),
|
||||
translate('OpenLP.SlideController',
|
||||
'Show Desktop'), self.hideMenu)
|
||||
self.hideMenu.menu().addAction(self.desktopScreen)
|
||||
self.desktopScreen.setCheckable(True)
|
||||
QtCore.QObject.connect(self.desktopScreen,
|
||||
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
|
||||
self.hideMenu.menu().addAction(self.desktopScreen)
|
||||
self.toolbar.addToolbarSeparator(u'Loop Separator')
|
||||
self.toolbar.addToolbarButton(
|
||||
# Does not need translating - control string.
|
||||
@ -195,7 +188,6 @@ class SlideController(QtGui.QWidget):
|
||||
self.delaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
||||
'Delay between slides in seconds'))
|
||||
else:
|
||||
self.toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.toolbar.addToolbarButton(
|
||||
# Does not need translating - control string.
|
||||
u'Go Live', u':/general/general_live.png',
|
||||
@ -226,8 +218,7 @@ class SlideController(QtGui.QWidget):
|
||||
if self.isLive:
|
||||
# Build the Song Toolbar
|
||||
self.songMenu = QtGui.QToolButton(self.toolbar)
|
||||
self.songMenu.setText(translate('OpenLP.SlideController',
|
||||
'Go To'))
|
||||
self.songMenu.setText(translate('OpenLP.SlideController', 'Go To'))
|
||||
self.songMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
|
||||
self.toolbar.addToolbarWidget(u'Song Menu', self.songMenu)
|
||||
self.songMenu.setMenu(QtGui.QMenu(
|
||||
@ -303,6 +294,8 @@ class SlideController(QtGui.QWidget):
|
||||
QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay)
|
||||
QtCore.QObject.connect(self.themeScreen,
|
||||
QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay)
|
||||
QtCore.QObject.connect(self.desktopScreen,
|
||||
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
|
||||
QtCore.QObject.connect(self.volumeSlider,
|
||||
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
@ -469,6 +462,9 @@ class SlideController(QtGui.QWidget):
|
||||
self.onSlideSelected()
|
||||
|
||||
def receiveSpinDelay(self, value):
|
||||
"""
|
||||
Adjusts the value of the ``delaySpinBox`` to the given one.
|
||||
"""
|
||||
self.delaySpinBox.setValue(int(value))
|
||||
|
||||
def enableToolBar(self, item):
|
||||
@ -624,6 +620,11 @@ class SlideController(QtGui.QWidget):
|
||||
self.parent.renderManager.width,
|
||||
self.parent.renderManager.height)
|
||||
else:
|
||||
# If current slide set background to image
|
||||
if framenumber == slideno:
|
||||
self.serviceItem.bg_image_bytes = \
|
||||
self.parent.renderManager.image_manager. \
|
||||
get_image_bytes(frame[u'title'])
|
||||
image = self.parent.renderManager.image_manager. \
|
||||
get_image(frame[u'title'])
|
||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||
@ -747,8 +748,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
||||
self.blankScreen.setChecked(checked)
|
||||
self.themeScreen.setChecked(False)
|
||||
if self.screens.display_count > 1:
|
||||
self.desktopScreen.setChecked(False)
|
||||
self.desktopScreen.setChecked(False)
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
||||
QtCore.QSettings().setValue(
|
||||
@ -769,8 +769,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.hideMenu.setDefaultAction(self.themeScreen)
|
||||
self.blankScreen.setChecked(False)
|
||||
self.themeScreen.setChecked(checked)
|
||||
if self.screens.display_count > 1:
|
||||
self.desktopScreen.setChecked(False)
|
||||
self.desktopScreen.setChecked(False)
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
||||
QtCore.QSettings().setValue(
|
||||
@ -791,9 +790,6 @@ class SlideController(QtGui.QWidget):
|
||||
self.hideMenu.setDefaultAction(self.desktopScreen)
|
||||
self.blankScreen.setChecked(False)
|
||||
self.themeScreen.setChecked(False)
|
||||
# On valid if more than 1 display
|
||||
if self.screens.display_count <= 1:
|
||||
return
|
||||
self.desktopScreen.setChecked(checked)
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||
@ -857,6 +853,8 @@ class SlideController(QtGui.QWidget):
|
||||
frame = self.display.text(toDisplay)
|
||||
else:
|
||||
frame = self.display.image(toDisplay)
|
||||
# reset the store used to display first image
|
||||
self.serviceItem.bg_image_bytes = None
|
||||
self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
self.selectedRow = row
|
||||
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
|
||||
@ -1096,15 +1094,15 @@ class SlideController(QtGui.QWidget):
|
||||
Used by command items which provide their own displays to reset the
|
||||
screen hide attributes
|
||||
"""
|
||||
blank = None
|
||||
if self.blankScreen.isChecked:
|
||||
self.blankScreen.setChecked(False)
|
||||
self.hideMenu.setDefaultAction(self.blankScreen)
|
||||
blank = self.blankScreen
|
||||
if self.themeScreen.isChecked:
|
||||
blank = self.themeScreen
|
||||
if self.desktopScreen.isChecked:
|
||||
blank = self.desktopScreen
|
||||
if blank:
|
||||
blank.setChecked(False)
|
||||
self.hideMenu.setDefaultAction(blank)
|
||||
QtCore.QSettings().remove(
|
||||
self.parent.generalSettingsSection + u'/screen blank')
|
||||
if self.themeScreen.isChecked:
|
||||
self.themeScreen.setChecked(False)
|
||||
self.hideMenu.setDefaultAction(self.themeScreen)
|
||||
if self.screens.display_count > 1:
|
||||
if self.desktopScreen.isChecked:
|
||||
self.desktopScreen.setChecked(False)
|
||||
self.hideMenu.setDefaultAction(self.desktopScreen)
|
||||
|
@ -145,6 +145,20 @@ class ThemeManager(QtGui.QWidget):
|
||||
# Last little bits of setting up
|
||||
self.configUpdated()
|
||||
|
||||
def firstTime(self):
|
||||
"""
|
||||
Import new themes downloaded by the first time wizard
|
||||
"""
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
encoding = get_filesystem_encoding()
|
||||
files = SettingsManager.get_files(self.settingsSection, u'.otz')
|
||||
for file in files:
|
||||
file = os.path.join(self.path, file).encode(encoding)
|
||||
self.unzipTheme(file, self.path)
|
||||
delete_file(file)
|
||||
self.loadThemes()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
|
||||
def configUpdated(self, firstTime=False):
|
||||
"""
|
||||
Triggered when Config dialog is updated.
|
||||
@ -370,6 +384,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
'Save Theme - (%s)')) % theme,
|
||||
SettingsManager.get_last_dir(self.settingsSection, 1))
|
||||
path = unicode(path)
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
if path:
|
||||
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
||||
themePath = os.path.join(path, theme + u'.otz')
|
||||
@ -395,6 +410,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
finally:
|
||||
if zip:
|
||||
zip.close()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
|
||||
def onImportTheme(self):
|
||||
"""
|
||||
@ -408,12 +424,14 @@ class ThemeManager(QtGui.QWidget):
|
||||
unicode(translate('OpenLP.ThemeManager',
|
||||
'OpenLP Themes (*.theme *.otz)')))
|
||||
log.info(u'New Themes %s', unicode(files))
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
if files:
|
||||
for file in files:
|
||||
SettingsManager.set_last_dir(
|
||||
self.settingsSection, unicode(file))
|
||||
self.unzipTheme(file, self.path)
|
||||
self.loadThemes()
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
|
||||
def loadThemes(self):
|
||||
"""
|
||||
|
@ -100,12 +100,15 @@ class LanguageManager(object):
|
||||
return language
|
||||
|
||||
@staticmethod
|
||||
def set_language(action):
|
||||
def set_language(action, message=True):
|
||||
"""
|
||||
Set the language to translate OpenLP into
|
||||
|
||||
``action``
|
||||
The language menu option
|
||||
|
||||
``message``
|
||||
Display the message option
|
||||
"""
|
||||
language = u'en'
|
||||
if action:
|
||||
@ -114,13 +117,16 @@ class LanguageManager(object):
|
||||
language = u'%s' % qm_list[action_name]
|
||||
if LanguageManager.auto_language:
|
||||
language = u'[%s]' % language
|
||||
QtCore.QSettings().setValue(
|
||||
# This needs to be here for the setValue to work
|
||||
settings = QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||
settings.setValue(
|
||||
u'general/language', QtCore.QVariant(language))
|
||||
log.info(u'Language file: \'%s\' written to conf file' % language)
|
||||
QtGui.QMessageBox.information(None,
|
||||
translate('OpenLP.LanguageManager', 'Language'),
|
||||
translate('OpenLP.LanguageManager',
|
||||
'Please restart OpenLP to use your new language setting.'))
|
||||
if message:
|
||||
QtGui.QMessageBox.information(None,
|
||||
translate('OpenLP.LanguageManager', 'Language'),
|
||||
translate('OpenLP.LanguageManager',
|
||||
'Please restart OpenLP to use your new language setting.'))
|
||||
|
||||
@staticmethod
|
||||
def init_qm_list():
|
||||
|
@ -163,7 +163,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
|
||||
# We found '<>' in the alert text, but the ParameterEdit field is empty.
|
||||
if text.find(u'<>') != -1 and not self.parameterEdit.text() and \
|
||||
QtGui.QMessageBox.question(self,
|
||||
translate('AlertPlugin.AlertForm', 'No Parameter found'),
|
||||
translate('AlertPlugin.AlertForm', 'No Parameter Found'),
|
||||
translate('AlertPlugin.AlertForm', 'You have not entered a '
|
||||
'parameter to be replaced.\nDo you want to continue anyway?'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
||||
@ -174,9 +174,9 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
|
||||
# in the alert text.
|
||||
elif text.find(u'<>') == -1 and self.parameterEdit.text() and \
|
||||
QtGui.QMessageBox.question(self,
|
||||
translate('AlertPlugin.AlertForm', 'No Placeholder found'),
|
||||
translate('AlertPlugin.AlertForm', 'No Placeholder Found'),
|
||||
translate('AlertPlugin.AlertForm', 'The alert text does not'
|
||||
' contain \'<>\'.\nDo want to continue anyway?'),
|
||||
' contain \'<>\'.\nDo you want to continue anyway?'),
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
||||
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.No:
|
||||
self.parameterEdit.setFocus()
|
||||
|
@ -568,7 +568,8 @@ class BibleImportForm(OpenLPWizard):
|
||||
"""
|
||||
self.getFileName(WizardStrings.OpenTypeFile % UiStrings.OLPV1,
|
||||
self.openlp1FileEdit, u'%s (*.bible)' %
|
||||
translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible'))
|
||||
translate('BiblesPlugin.ImportWizardForm',
|
||||
'openlp.org 1.x Bible Files'))
|
||||
|
||||
def registerFields(self):
|
||||
"""
|
||||
|
@ -69,8 +69,6 @@ import logging
|
||||
import chardet
|
||||
import csv
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import Receiver, translate
|
||||
from openlp.plugins.bibles.lib.db import BibleDB, Testament
|
||||
|
||||
|
@ -250,7 +250,7 @@ class BibleManager(object):
|
||||
if not bible:
|
||||
Receiver.send_message(u'openlp_information_message', {
|
||||
u'title': translate('BiblesPlugin.BibleManager',
|
||||
'No Bibles available'),
|
||||
'No Bibles Available'),
|
||||
u'message': translate('BiblesPlugin.BibleManager',
|
||||
'There are no Bibles currently installed. Please use the '
|
||||
'Import Wizard to install one or more Bibles.')
|
||||
|
@ -346,7 +346,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
self.advancedSearchButton.setEnabled(False)
|
||||
critical_error_message_box(
|
||||
message=translate('BiblePlugin.MediaItem',
|
||||
'Bible not fully loaded'))
|
||||
'Bible not fully loaded.'))
|
||||
else:
|
||||
self.advancedSearchButton.setEnabled(True)
|
||||
self.adjustComboBox(1, self.chapter_count, self.advancedFromChapter)
|
||||
@ -539,8 +539,9 @@ class BibleMediaItem(MediaManagerItem):
|
||||
self.displayResults(bible, second_bible)
|
||||
elif critical_error_message_box(
|
||||
message=translate('BiblePlugin.MediaItem',
|
||||
'You cannot combine single and second bible verses. Do you '
|
||||
'want to delete your search results and start a new search?'),
|
||||
'You cannot combine single and dual Bible verse search results. '
|
||||
'Do you want to delete your search results and start a new '
|
||||
'search?'),
|
||||
parent=self, question=True) == QtGui.QMessageBox.Yes:
|
||||
self.listView.clear()
|
||||
self.displayResults(bible, second_bible)
|
||||
@ -635,7 +636,6 @@ class BibleMediaItem(MediaManagerItem):
|
||||
bible_text = u''
|
||||
old_item = None
|
||||
old_chapter = -1
|
||||
raw_footer = []
|
||||
raw_slides = []
|
||||
raw_title = []
|
||||
for item in items:
|
||||
@ -656,13 +656,13 @@ class BibleMediaItem(MediaManagerItem):
|
||||
second_text = self._decodeQtObject(bitem, 'second_text')
|
||||
verse_text = self.formatVerse(old_chapter, chapter, verse)
|
||||
footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
|
||||
if footer not in raw_footer:
|
||||
raw_footer.append(footer)
|
||||
if footer not in service_item.raw_footer:
|
||||
service_item.raw_footer.append(footer)
|
||||
if second_bible:
|
||||
footer = u'%s (%s %s %s)' % (book, second_version,
|
||||
second_copyright, second_permissions)
|
||||
if footer not in raw_footer:
|
||||
raw_footer.append(footer)
|
||||
if footer not in service_item.raw_footer:
|
||||
service_item.raw_footer.append(footer)
|
||||
bible_text = u'%s %s\n\n%s %s' % (verse_text, text,
|
||||
verse_text, second_text)
|
||||
raw_slides.append(bible_text.rstrip())
|
||||
@ -706,11 +706,6 @@ class BibleMediaItem(MediaManagerItem):
|
||||
service_item.theme = self.settings.bible_theme
|
||||
for slide in raw_slides:
|
||||
service_item.add_from_text(slide[:30], slide)
|
||||
if service_item.raw_footer:
|
||||
for footer in raw_footer:
|
||||
service_item.raw_footer.append(footer)
|
||||
else:
|
||||
service_item.raw_footer = raw_footer
|
||||
return True
|
||||
|
||||
def formatTitle(self, start_item, old_item):
|
||||
|
@ -27,8 +27,6 @@
|
||||
import logging
|
||||
import sqlite
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import Receiver
|
||||
from openlp.core.ui.wizard import WizardStrings
|
||||
from openlp.plugins.bibles.lib.db import BibleDB
|
||||
|
@ -25,9 +25,7 @@
|
||||
###############################################################################
|
||||
|
||||
import logging
|
||||
|
||||
from lxml import objectify
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import Receiver, translate
|
||||
from openlp.plugins.bibles.lib.db import BibleDB
|
||||
|
@ -31,8 +31,6 @@ import chardet
|
||||
import codecs
|
||||
import re
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import Receiver, translate
|
||||
from openlp.core.utils import AppLocation
|
||||
from openlp.plugins.bibles.lib.db import BibleDB
|
||||
|
@ -810,4 +810,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
# This method must only be run after the self.song = Song() assignment.
|
||||
log.debug(u'processTitle')
|
||||
self.song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'',
|
||||
unicode(self.song.search_title)).lower()
|
||||
unicode(self.song.search_title)).lower().strip()
|
||||
|
@ -98,7 +98,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
match = self.verse_regex.match(text)
|
||||
if match:
|
||||
verse_tag = match.group(1)
|
||||
verse_num = int(match.group(2))
|
||||
try:
|
||||
verse_num = int(match.group(2))
|
||||
except ValueError:
|
||||
verse_num = 1
|
||||
verse_type_index = VerseType.from_loose_input(verse_tag)
|
||||
if verse_type_index is not None:
|
||||
self.verseNumberBox.setValue(verse_num)
|
||||
@ -127,7 +130,10 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
||||
if match:
|
||||
verse_type = match.group(1)
|
||||
verse_type_index = VerseType.from_loose_input(verse_type)
|
||||
verse_number = int(match.group(2))
|
||||
try:
|
||||
verse_number = int(match.group(2))
|
||||
except ValueError:
|
||||
verse_number = 1
|
||||
if verse_type_index is not None:
|
||||
self.verseTypeComboBox.setCurrentIndex(verse_type_index)
|
||||
self.verseNumberBox.setValue(verse_number)
|
||||
|
@ -226,7 +226,7 @@ class SongExportForm(OpenLPWizard):
|
||||
translate('SongsPlugin.ExportWizardForm',
|
||||
'No Save Location specified'),
|
||||
translate('SongsPlugin.ExportWizardForm',
|
||||
'You need to specified a directory to save the songs in.'))
|
||||
'You need to specify a directory.'))
|
||||
return False
|
||||
return True
|
||||
elif self.currentPage() == self.progressPage:
|
||||
@ -355,7 +355,8 @@ class SongExportForm(OpenLPWizard):
|
||||
the path to *directoryLineEdit*.
|
||||
"""
|
||||
path = unicode(QtGui.QFileDialog.getExistingDirectory(self,
|
||||
translate('SongsPlugin.ExportWizardForm', 'Selecte to Folder'),
|
||||
translate('SongsPlugin.ExportWizardForm',
|
||||
'Select Destination Folder'),
|
||||
SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
|
||||
options=QtGui.QFileDialog.ShowDirsOnly))
|
||||
SettingsManager.set_last_dir(self.plugin.settingsSection, path, 1)
|
||||
|
@ -540,7 +540,7 @@ class FoilPresenter(object):
|
||||
song.alternate_title = self._child(titelstring)
|
||||
song.search_title += u'@' + song.alternate_title
|
||||
song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'',
|
||||
unicode(song.search_title)).lower()
|
||||
unicode(song.search_title)).lower().strip()
|
||||
|
||||
def _process_topics(self, foilpresenterfolie, song):
|
||||
"""
|
||||
|
@ -330,7 +330,6 @@ class SongMediaItem(MediaManagerItem):
|
||||
|
||||
def generateSlideData(self, service_item, item=None, xmlVersion=False):
|
||||
log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
|
||||
raw_footer = []
|
||||
item_id = self._getIdOfItemToGenerate(item, self.remoteSong)
|
||||
service_item.add_capability(ItemCapabilities.AllowsEdit)
|
||||
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
||||
@ -392,16 +391,15 @@ class SongMediaItem(MediaManagerItem):
|
||||
service_item.add_from_text(slide[:30], unicode(slide))
|
||||
service_item.title = song.title
|
||||
author_list = [unicode(author.display_name) for author in song.authors]
|
||||
raw_footer.append(song.title)
|
||||
raw_footer.append(u', '.join(author_list))
|
||||
raw_footer.append(song.copyright)
|
||||
service_item.raw_footer.append(song.title)
|
||||
service_item.raw_footer.append(u', '.join(author_list))
|
||||
service_item.raw_footer.append(song.copyright)
|
||||
if QtCore.QSettings().value(u'general/ccli number',
|
||||
QtCore.QVariant(u'')).toString():
|
||||
raw_footer.append(unicode(
|
||||
service_item.raw_footer.append(unicode(
|
||||
translate('SongsPlugin.MediaItem', 'CCLI License: ') +
|
||||
QtCore.QSettings().value(u'general/ccli number',
|
||||
QtCore.QVariant(u'')).toString()))
|
||||
service_item.raw_footer = raw_footer
|
||||
service_item.audit = [
|
||||
song.title, author_list, song.copyright, unicode(song.ccli_number)
|
||||
]
|
||||
|
@ -167,7 +167,7 @@ class OpenLPSongImport(SongImport):
|
||||
new_song.alternate_title = old_titles[1]
|
||||
else:
|
||||
new_song.alternate_title = u''
|
||||
new_song.search_title = song.search_title
|
||||
new_song.search_title = song.search_title.strip()
|
||||
new_song.song_number = song.song_number
|
||||
new_song.lyrics = song.lyrics
|
||||
new_song.search_lyrics = song.search_lyrics
|
||||
|
@ -276,6 +276,7 @@ class SongImport(QtCore.QObject):
|
||||
song.alternate_title = self.alternate_title
|
||||
song.search_title = self.remove_punctuation(self.title).lower() \
|
||||
+ '@' + self.remove_punctuation(self.alternate_title).lower()
|
||||
song.search_title = song.search_title.strip()
|
||||
song.song_number = self.song_number
|
||||
song.search_lyrics = u''
|
||||
verses_changed_to_other = {}
|
||||
|
@ -536,7 +536,7 @@ class OpenLyrics(object):
|
||||
song.alternate_title = self._text(title)
|
||||
song.search_title += u'@' + song.alternate_title
|
||||
song.search_title = re.sub(r'[\'"`,;:(){}?]+', u'',
|
||||
unicode(song.search_title)).lower()
|
||||
unicode(song.search_title)).lower().strip()
|
||||
|
||||
def _process_topics(self, properties, song):
|
||||
"""
|
||||
|
@ -154,7 +154,7 @@ class SongsPlugin(Plugin):
|
||||
if song.alternate_title is None:
|
||||
song.alternate_title = u''
|
||||
song.search_title = self.whitespace.sub(u' ', song.title.lower() +
|
||||
u' ' + song.alternate_title.lower())
|
||||
u' ' + song.alternate_title.lower()).strip()
|
||||
# Remove the "language" attribute from lyrics tag. This is not very
|
||||
# important, but this keeps the database clean. This can be removed
|
||||
# when everybody has run the reindex tool once.
|
||||
|
375
resources/forms/firsttimewizard.ui
Normal file
375
resources/forms/firsttimewizard.ui
Normal file
@ -0,0 +1,375 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FirstTimeWizard</class>
|
||||
<widget class="QWizard" name="FirstTimeWizard">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>550</width>
|
||||
<height>386</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>First Time Wizard</string>
|
||||
</property>
|
||||
<property name="modal">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="wizardStyle">
|
||||
<enum>QWizard::ModernStyle</enum>
|
||||
</property>
|
||||
<property name="options">
|
||||
<set>QWizard::IndependentPages|QWizard::NoBackButtonOnStartPage</set>
|
||||
</property>
|
||||
<widget class="QWizardPage" name="welcomePage">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="welcomeLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="importBibleImage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>163</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>163</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../images/openlp-2.qrc">:/wizards/wizard_importbible.bmp</pixmap>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="welcomePageLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="titleLabel">
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600;">Welcome to the First Time Wizard</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="welcomeTopSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="informationLabel">
|
||||
<property name="text">
|
||||
<string>This wizard will help you to configure OpenLP for initial use . Click the next button below to start the process of selection your initial options. </string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="welcomeBottomSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="PluginPagePage">
|
||||
<property name="title">
|
||||
<string>Activate required Plugins</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Select the Plugins you wish to use. </string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="songsCheckBox">
|
||||
<property name="text">
|
||||
<string>Songs</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="customCheckBox">
|
||||
<property name="text">
|
||||
<string>Custom Text</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="bibleCheckBox">
|
||||
<property name="text">
|
||||
<string>Bible</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="imageCheckBox">
|
||||
<property name="text">
|
||||
<string>Images</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="presentationCheckBox">
|
||||
<property name="text">
|
||||
<string>Presentations</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mediaCheckBox">
|
||||
<property name="text">
|
||||
<string>Media (Audio and Video)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="remoteCheckBox">
|
||||
<property name="text">
|
||||
<string>Allow remote access</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="songUsageCheckBox">
|
||||
<property name="text">
|
||||
<string>Monitor Song Usage</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="alertCheckBox">
|
||||
<property name="text">
|
||||
<string>Allow Alerts</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="downloadDefaultsPage">
|
||||
<property name="title">
|
||||
<string>Download Samples from OpenLP.org</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Select samples to downlaod and install for use.</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="noInternetLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>461</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No Internet connection found so unable to download any default files.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="internetGroupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>0</y>
|
||||
<width>501</width>
|
||||
<height>281</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Download Example Files</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="selectionTreeWidget">
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="showDropIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWizardPage" name="DefaultsPage">
|
||||
<property name="title">
|
||||
<string>Default Settings</string>
|
||||
</property>
|
||||
<property name="subTitle">
|
||||
<string>Set up default values to be used by OpenLP</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>491</width>
|
||||
<height>113</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="displaySelectionLabel">
|
||||
<property name="text">
|
||||
<string>Default output display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="displaySelectionComboBox">
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::NoInsert</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="themeSelectionLabel">
|
||||
<property name="text">
|
||||
<string>Select the default Theme</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="themeSelectionComboBox">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="messageLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>160</y>
|
||||
<width>471</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Press Finish to apply all you changes and start OpenLP</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="updateLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>220</y>
|
||||
<width>351</width>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images/openlp-2.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
3928
resources/i18n/af.ts
3928
resources/i18n/af.ts
File diff suppressed because it is too large
Load Diff
4279
resources/i18n/de.ts
4279
resources/i18n/de.ts
File diff suppressed because it is too large
Load Diff
3692
resources/i18n/en.ts
3692
resources/i18n/en.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
3707
resources/i18n/es.ts
3707
resources/i18n/es.ts
File diff suppressed because it is too large
Load Diff
4027
resources/i18n/et.ts
4027
resources/i18n/et.ts
File diff suppressed because it is too large
Load Diff
4699
resources/i18n/fr.ts
Normal file
4699
resources/i18n/fr.ts
Normal file
File diff suppressed because it is too large
Load Diff
3707
resources/i18n/hu.ts
3707
resources/i18n/hu.ts
File diff suppressed because it is too large
Load Diff
4691
resources/i18n/id.ts
Normal file
4691
resources/i18n/id.ts
Normal file
File diff suppressed because it is too large
Load Diff
4939
resources/i18n/ja.ts
4939
resources/i18n/ja.ts
File diff suppressed because it is too large
Load Diff
3694
resources/i18n/ko.ts
3694
resources/i18n/ko.ts
File diff suppressed because it is too large
Load Diff
3698
resources/i18n/nb.ts
3698
resources/i18n/nb.ts
File diff suppressed because it is too large
Load Diff
6417
resources/i18n/nl.ts
6417
resources/i18n/nl.ts
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4694
resources/i18n/ru.ts
Normal file
4694
resources/i18n/ru.ts
Normal file
File diff suppressed because it is too large
Load Diff
3829
resources/i18n/sv.ts
3829
resources/i18n/sv.ts
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user