forked from openlp/openlp
r1383
This commit is contained in:
commit
bc1938ae1d
@ -4,13 +4,10 @@ recursive-include openlp *.csv
|
||||
recursive-include openlp *.html
|
||||
recursive-include openlp *.js
|
||||
recursive-include openlp *.css
|
||||
recursive-include openlp *.qm
|
||||
recursive-include documentation *
|
||||
recursive-include resources/forms *
|
||||
recursive-include resources/i18n *
|
||||
recursive-include resources/images *
|
||||
recursive-include scripts *.py
|
||||
include resources/*.desktop
|
||||
recursive-include resources *
|
||||
recursive-include scripts *
|
||||
include copyright.txt
|
||||
include LICENSE
|
||||
include README.txt
|
||||
include openlp/.version
|
||||
|
@ -4,11 +4,11 @@ Dual Monitor Setup
|
||||
|
||||
The first step in getting OpenLP working on your system is to setup your
|
||||
computer properly for dual monitors. This is not very difficult, but the steps
|
||||
do vary depending on operating system.
|
||||
will vary depending on operating system.
|
||||
|
||||
Most modern computers do have the ability for dual monitors. To be certain
|
||||
Most modern computers have the ability for dual monitors. To be certain,
|
||||
check your computer's documentation. A typical desktop computer capable of dual
|
||||
monitors will have two of, or a combination of the two connectors below.
|
||||
monitors will have two of, or a combination of the two, connectors below.
|
||||
|
||||
**VGA**
|
||||
|
||||
@ -18,8 +18,8 @@ monitors will have two of, or a combination of the two connectors below.
|
||||
|
||||
.. image:: pics/dvi.png
|
||||
|
||||
A laptop computer setup only varies slightly, generally you will need only one
|
||||
of outputs pictured above since your laptops screen serves as one of the
|
||||
A laptop computer setup only varies slightly. Generally you will need only one
|
||||
of the outputs pictured above since your laptop screen serves as one of the
|
||||
monitors. Sometimes with older laptops a key stroke generally involving the
|
||||
:kbd:`Fn` key and another key is required to enable the second monitor on
|
||||
laptops.
|
||||
@ -27,9 +27,10 @@ laptops.
|
||||
Some computers also incorporate the use of :abbr:`S-Video (Separate Video)` or
|
||||
:abbr:`HDMI (High-Definition Multimedia Interface)` connections.
|
||||
|
||||
A typical OpenLP set up consist of your normal single monitor setup, with your
|
||||
projector setup as the second monitor. With the option of extending your
|
||||
desktop across the second monitor, or your operating system's equivalent.
|
||||
A typical OpenLP setup consist of your normal single monitor, with your
|
||||
projector hooked up to your computer as the second monitor. With the option of
|
||||
extending your desktop across the second monitor, or your operating system's
|
||||
equivalent.
|
||||
|
||||
Microsoft Windows
|
||||
-----------------
|
||||
@ -46,8 +47,8 @@ press :kbd:`Windows+P`.
|
||||
|
||||
The more traditional way is also fairly straight forward. Go to
|
||||
:guilabel:`Control Panel` and click on :guilabel:`Display`. This will open up
|
||||
the :guilabel:`Display` dialog. You can also bypass this step by right click on
|
||||
a blank area on your desktop and selecting :guilabel:`Resolution`.
|
||||
the :guilabel:`Display` dialog. You may also bypass this step by a right click
|
||||
on a blank area on your desktop and selecting :guilabel:`Resolution`.
|
||||
|
||||
.. image:: pics/winsevendisplay.png
|
||||
|
||||
@ -66,7 +67,7 @@ a blank place on the desktop and click :guilabel:`Personalization`.
|
||||
.. image:: pics/vistapersonalize.png
|
||||
|
||||
From the :guilabel:`Personalization` window click on :guilabel:`Display
|
||||
Settings`. Then enable the montior that represents your projector and make sure
|
||||
Settings`. Click on the monitor that represents your projector and make sure
|
||||
you have checked :guilabel:`Extend the desktop onto this monitor`.
|
||||
|
||||
.. image:: pics/vistadisplaysettings.png
|
||||
@ -77,7 +78,7 @@ Windows XP
|
||||
From :guilabel:`Control Panel` select :guilabel:`Display`, or right click on a
|
||||
blank area of the desktop and select :guilabel:`Properties`. From the
|
||||
:guilabel:`Display Properties` window click on the :guilabel:`Settings` tab.
|
||||
Then click on the monitor that represents your projector and make sure you have
|
||||
Click on the monitor that represents your projector and make sure you have
|
||||
checked :guilabel:`Extend my Windows desktop onto this monitor`.
|
||||
|
||||
.. image:: pics/xpdisplaysettings.png
|
||||
@ -87,7 +88,7 @@ Linux
|
||||
|
||||
Due to the vast varieties of hardware, distributions, desktops, and drivers
|
||||
this is not an exhaustive guide to dual monitor setup on Linux. This guide
|
||||
assumes that you have properly set up any proprietary drivers if needed. You
|
||||
assumes you have properly set up any proprietary drivers if needed. You
|
||||
should seek out your distributions documentation if this general guide does not
|
||||
work.
|
||||
|
||||
@ -123,7 +124,8 @@ Linux Systems Using nVidia Drivers
|
||||
|
||||
This guide is for users of the proprietary nVidia driver on Linux Distributions.
|
||||
It is assumed that you have properly setup your drivers according to your
|
||||
distribution's documentation, and you have a working ``xorg.conf`` file in place.
|
||||
distribution's documentation, and you have a working ``xorg.conf`` file in
|
||||
place.
|
||||
|
||||
If you wish to make the changes permanent in setting up your system for dual
|
||||
monitors it will be necessary to modify your ``xorg.conf`` file. It is always a
|
||||
@ -166,7 +168,7 @@ After clicking :guilabel:`Configure`, select :guilabel:`TwinView`. Then click
|
||||
|
||||
.. image:: pics/twinview.png
|
||||
|
||||
Then click :guilabel:`Apply` and if you are happy with the way things look click
|
||||
Click :guilabel:`Apply` and if you are happy with the way things look click
|
||||
:guilabel:`Keep` to keep your new settings. Don't worry if all goes wrong the
|
||||
settings will return back to the previous settings in 15 seconds without any
|
||||
action. nVidia Settings should take care of selecting your optimum resolution
|
||||
@ -175,6 +177,6 @@ on :guilabel:`Save to X Configuration File`.
|
||||
|
||||
.. image:: pics/xorgwrite.png
|
||||
|
||||
Then click :guilabel:`Save` and you should be set. You may want to restart X or
|
||||
Click :guilabel:`Save` and you should be set. You may want to restart X or
|
||||
your machine just to make sure all the settings carry over the next time you log
|
||||
in.
|
||||
|
@ -18,7 +18,7 @@ The Main Window contains all the tools and plugins that make OpenLP function
|
||||
Media Manager
|
||||
-------------
|
||||
|
||||
The Media Manager contains a number of tabs that plugins supply to OpenLP.
|
||||
The Media Manager contains a number of tabs the plugins supply to OpenLP.
|
||||
Each tab in the Media Manager is called a **Media Item**
|
||||
|
||||
.. image:: pics/mediamanager.png
|
||||
@ -36,20 +36,20 @@ with them.
|
||||
Service File
|
||||
------------
|
||||
|
||||
A service file, is the file that is created when you save your work on OpenLP.
|
||||
A service file is the file that is created when you save your service in OpenLP.
|
||||
The service file consist of **Service Items**
|
||||
|
||||
Service Item
|
||||
------------
|
||||
|
||||
A service item are the **media items** that are in the **service manager**
|
||||
Service items are the **media items** that are in the **service manager**
|
||||
|
||||
Service Manger
|
||||
--------------
|
||||
|
||||
The service manager contains the media items in your service file. This is the
|
||||
area from which your media items go live, and you can also save, open, and edit
|
||||
services files.
|
||||
area where your media items go live. You can also save, open, and edit
|
||||
services files from here.
|
||||
|
||||
.. image:: pics/servicemanager.png
|
||||
|
||||
@ -65,6 +65,6 @@ Theme Manager
|
||||
-------------
|
||||
|
||||
The theme manager is where themes are created and edited. Themes are the text
|
||||
styles backgrounds that you use to personalize your services.
|
||||
styles and backgrounds that you use to personalize your services.
|
||||
|
||||
.. image:: pics/thememanager.png
|
||||
|
@ -15,5 +15,4 @@ Contents:
|
||||
glossary
|
||||
dualmonitors
|
||||
mediamanager
|
||||
songs
|
||||
|
||||
songs
|
@ -8,26 +8,26 @@ converters provided to get data from other formats into OpenLP.
|
||||
Song Importer
|
||||
=============
|
||||
|
||||
If you are using an earlier version of OpenLP or come from another software
|
||||
If you are using an earlier version of OpenLP or, come from another software
|
||||
package, you may be able to convert your existing database to work in OpenLP
|
||||
2.0. To access the Song Importer :menuselection:`File --> Import --> Song`.
|
||||
You will then see the Song Importer window, then click :guilabel:`Next`.
|
||||
2.0. To access the Song Importer click :menuselection:`File --> Import --> Song`.
|
||||
You will see the Song Importer window, then click :guilabel:`Next`.
|
||||
|
||||
.. image:: pics/songimporter.png
|
||||
|
||||
After choosing :guilabel:`Next` you can then select from the various types of
|
||||
After choosing :guilabel:`Next` you can select from the various types of
|
||||
software that OpenLP will convert songs from.
|
||||
|
||||
.. image:: pics/songimporterchoices.png
|
||||
|
||||
Then click on the file folder icon to choose the file of the song database you
|
||||
Click on the file folder icon to choose the file of the song database you
|
||||
want to import. See the following sections for information on the different
|
||||
formats that OpenLP will import.
|
||||
|
||||
Importing from OpenLP Version 1
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Converting from OpenLP Version 1 is a pretty simple process. You will first
|
||||
Converting from OpenLP Version 1 is a simple process. First you will
|
||||
need to locate your version 1 database file.
|
||||
|
||||
Windows XP::
|
||||
@ -38,33 +38,34 @@ Windows Vista / Windows 7::
|
||||
|
||||
C:\ProgramData\openlp.org\Data\songs.olp
|
||||
|
||||
After clicking :guilabel:`Next` your conversion should be complete.
|
||||
After clicking :guilabel:`Next` your conversion will be complete.
|
||||
|
||||
.. image:: pics/finishedimport.png
|
||||
|
||||
Then press :guilabel:`Finish` and you should now be ready to use your OpenLP
|
||||
version one songs.
|
||||
Press :guilabel:`Finish` and you will now be ready to use your OpenLP
|
||||
version 1 songs.
|
||||
|
||||
Importing from OpenSong
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Converting from OpenSong you will need to locate your songs database. In the
|
||||
Converting from OpenSong, you will need to locate your songs database. In the
|
||||
later versions of OpenSong you are asked to define the location of this. The
|
||||
songs will be located in a folder named :guilabel:`Songs`. This folder should
|
||||
contain files with all your songs in them without a file extension. (file.xxx).
|
||||
When you have located this folder you will then need to select the songs from
|
||||
songs will be located in a folder named :guilabel:`Songs`. This folder will
|
||||
contain files with all your songs in them, without a file extension. (file.xxx).
|
||||
When you have located this folder you will need to select the songs from
|
||||
the folder.
|
||||
|
||||
.. image:: pics/selectsongs.png
|
||||
|
||||
On most operating systems to select all the songs, first select the first song
|
||||
in the lest then press shift and select the last song in the list. After this
|
||||
press :guilabel:`Next` and you should see that your import has been successful.
|
||||
On most operating systems, to select all the songs, first select the first song
|
||||
in the list, press the shift key, and select the last song in the list. After
|
||||
this press :guilabel:`Next` and you will see that your import has been
|
||||
successful.
|
||||
|
||||
.. image:: pics/finishedimport.png
|
||||
|
||||
Press :guilabel:`Finish` and you will now be ready to use your songs imported
|
||||
from OpenSong.
|
||||
Press :guilabel:`Finish` and OpenLP will be ready to use your songs that you
|
||||
imported from OpenSong.
|
||||
|
||||
Importing from CCLI Song Select
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -79,22 +80,23 @@ Then search for your desired song. For this example we will be adding the song
|
||||
|
||||
.. image:: pics/songselectsongsearch.png
|
||||
|
||||
For the song you are searching for select `lyrics` This should take you to a
|
||||
page displaying the lyrics and copyright info for your song.
|
||||
For the song you are searching for, select `lyrics` This will take you to a
|
||||
page displaying the lyrics and copyright information for your song.
|
||||
|
||||
.. image:: pics/songselectlyrics.png
|
||||
|
||||
Next, hover over the :guilabel:`Lyrics` menu from the upper right corner. Then
|
||||
choose either the .txt or .usr file. You will then be asked to chose a download
|
||||
Next, hover over the :guilabel:`Lyrics` menu from the upper right corner.
|
||||
Choose either the .txt or .usr file. You will be asked to chose a download
|
||||
location if your browser does not automatically select that for you. Select
|
||||
this file from the OpenLP import window and then click :guilabel:`Next` You can
|
||||
also select multiple songs for import at once on most operating systems by
|
||||
selecting the first item in the list then holding shift select the last item in
|
||||
the list. When finished you should see that your import has completed.
|
||||
selecting the first item in the list then holding the shift key and select the
|
||||
last item in the list. When finished, you will see that your import has
|
||||
completed.
|
||||
|
||||
.. image:: pics/finishedimport.png
|
||||
|
||||
Press :guilabel:`Finish` and you will now be ready to use your songs imported
|
||||
Press :guilabel:`Finish` and OpenLP will be ready to use your songs imported
|
||||
from CCLI SongSelect.
|
||||
|
||||
|
||||
|
17
openlp.pyw
17
openlp.pyw
@ -170,9 +170,9 @@ class OpenLP(QtGui.QApplication):
|
||||
# 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:
|
||||
has_run_wizard = QtCore.QSettings().value(
|
||||
u'general/has run wizard', QtCore.QVariant(False)).toBool()
|
||||
if not has_run_wizard:
|
||||
FirstTimeForm(screens).exec_()
|
||||
if os.name == u'nt':
|
||||
self.setStyleSheet(application_stylesheet)
|
||||
@ -184,9 +184,8 @@ class OpenLP(QtGui.QApplication):
|
||||
# make sure Qt really display the splash screen
|
||||
self.processEvents()
|
||||
# start the main app window
|
||||
self.appClipboard = self.clipboard()
|
||||
self.mainWindow = MainWindow(screens, app_version, self.appClipboard,
|
||||
firstTime)
|
||||
self.mainWindow = MainWindow(screens, app_version, self.clipboard(),
|
||||
not has_run_wizard)
|
||||
self.mainWindow.show()
|
||||
if show_splash:
|
||||
# now kill the splashscreen
|
||||
@ -271,11 +270,11 @@ def main():
|
||||
# Now create and actually run the application.
|
||||
app = OpenLP(qt_args)
|
||||
# Define the settings environment
|
||||
QtCore.QSettings(u'OpenLP', u'OpenLP')
|
||||
settings = 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 settings.value(u'general/has run wizard',
|
||||
QtCore.QVariant(False)).toBool():
|
||||
if not FirstTimeLanguageForm().exec_():
|
||||
# if cancel then stop processing
|
||||
sys.exit()
|
||||
|
@ -349,11 +349,11 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
Validates whether an image still exists and, if it does, is the
|
||||
thumbnail representation of the image up to date.
|
||||
"""
|
||||
if not os.path.exists(image):
|
||||
if not os.path.exists(unicode(image)):
|
||||
return False
|
||||
if os.path.exists(thumb):
|
||||
imageDate = os.stat(image).st_mtime
|
||||
thumbDate = os.stat(thumb).st_mtime
|
||||
imageDate = os.stat(unicode(image)).st_mtime
|
||||
thumbDate = os.stat(unicode(thumb)).st_mtime
|
||||
# If image has been updated rebuild icon
|
||||
if imageDate > thumbDate:
|
||||
self.iconFromFile(image, thumb)
|
||||
|
@ -49,16 +49,13 @@ class PluginManager(object):
|
||||
``plugin_dir``
|
||||
The directory to search for plugins.
|
||||
"""
|
||||
log.info(u'Plugin manager initing')
|
||||
log.info(u'Plugin manager Initialising')
|
||||
if not plugin_dir in sys.path:
|
||||
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
||||
sys.path.insert(0, plugin_dir)
|
||||
self.basepath = os.path.abspath(plugin_dir)
|
||||
log.debug(u'Base path %s ', self.basepath)
|
||||
self.plugin_helpers = []
|
||||
self.plugins = []
|
||||
# this has to happen after the UI is sorted
|
||||
# self.find_plugins(plugin_dir)
|
||||
log.info(u'Plugin manager Initialised')
|
||||
|
||||
def find_plugins(self, plugin_dir, plugin_helpers):
|
||||
@ -73,7 +70,7 @@ class PluginManager(object):
|
||||
A list of helper objects to pass to the plugins.
|
||||
|
||||
"""
|
||||
self.plugin_helpers = plugin_helpers
|
||||
log.info(u'Finding plugins')
|
||||
startdepth = len(os.path.abspath(plugin_dir).split(os.sep))
|
||||
log.debug(u'finding plugins in %s at depth %d',
|
||||
unicode(plugin_dir), startdepth)
|
||||
@ -102,11 +99,11 @@ class PluginManager(object):
|
||||
plugin_objects = []
|
||||
for p in plugin_classes:
|
||||
try:
|
||||
plugin = p(self.plugin_helpers)
|
||||
log.debug(u'Loaded plugin %s with helpers', unicode(p))
|
||||
plugin = p(plugin_helpers)
|
||||
log.debug(u'Loaded plugin %s', unicode(p))
|
||||
plugin_objects.append(plugin)
|
||||
except TypeError:
|
||||
log.exception(u'loaded plugin %s has no helpers', unicode(p))
|
||||
log.exception(u'Failed to load plugin %s', unicode(p))
|
||||
plugins_list = sorted(plugin_objects, self.order_by_weight)
|
||||
for plugin in plugins_list:
|
||||
if plugin.checkPreConditions():
|
||||
@ -203,6 +200,7 @@ class PluginManager(object):
|
||||
Loop through all the plugins and give them an opportunity to
|
||||
initialise themselves.
|
||||
"""
|
||||
log.info(u'Initialise Plugins - Started')
|
||||
for plugin in self.plugins:
|
||||
log.info(u'initialising plugins %s in a %s state'
|
||||
% (plugin.name, plugin.isActive()))
|
||||
@ -211,6 +209,7 @@ class PluginManager(object):
|
||||
log.info(u'Initialisation Complete for %s ' % plugin.name)
|
||||
if not plugin.isActive():
|
||||
plugin.removeToolboxItem()
|
||||
log.info(u'Initialise Plugins - Finished')
|
||||
|
||||
def finalise_plugins(self):
|
||||
"""
|
||||
|
@ -48,7 +48,7 @@ class OpenLPToolbar(QtGui.QToolBar):
|
||||
self.icons = {}
|
||||
self.setIconSize(QtCore.QSize(20, 20))
|
||||
self.actions = {}
|
||||
log.debug(u'Init done')
|
||||
log.debug(u'Init done for %s' % parent.__class__.__name__)
|
||||
|
||||
def addToolbarButton(self, title, icon, tooltip=None, slot=None,
|
||||
checkable=False, shortcut=0, alternate=0,
|
||||
|
@ -143,11 +143,11 @@ class Ui_DisplayTagDialog(object):
|
||||
self.tagTableWidget.horizontalHeaderItem(0).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Description'))
|
||||
self.tagTableWidget.horizontalHeaderItem(1).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Tag id'))
|
||||
translate('OpenLP.DisplayTagDialog', 'Tag Id'))
|
||||
self.tagTableWidget.horizontalHeaderItem(2).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'Start Html'))
|
||||
translate('OpenLP.DisplayTagDialog', 'Start HTML'))
|
||||
self.tagTableWidget.horizontalHeaderItem(3).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'End Html'))
|
||||
translate('OpenLP.DisplayTagDialog', 'End HTML'))
|
||||
self.tagTableWidget.setColumnWidth(0, 120)
|
||||
self.tagTableWidget.setColumnWidth(1, 40)
|
||||
self.tagTableWidget.setColumnWidth(2, 240)
|
||||
|
@ -24,19 +24,19 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import ConfigParser
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import urllib
|
||||
from tempfile import gettempdir
|
||||
from ConfigParser import SafeConfigParser
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from firsttimewizard import Ui_FirstTimeWizard
|
||||
|
||||
from openlp.core.lib import translate, PluginStatus, check_directory_exists, \
|
||||
Receiver
|
||||
from openlp.core.lib import translate, PluginStatus, check_directory_exists, \
|
||||
Receiver, build_icon
|
||||
from openlp.core.utils import get_web_page, AppLocation
|
||||
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -48,24 +48,18 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
log.info(u'ThemeWizardForm loaded')
|
||||
|
||||
def __init__(self, screens, parent=None):
|
||||
QtGui.QWizard.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
# check to see if we have web access
|
||||
self.web = u'http://openlp.org/files/frw/'
|
||||
self.config = ConfigParser.ConfigParser()
|
||||
self.config = SafeConfigParser()
|
||||
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.displayComboBox.addItems(screens.get_screen_list())
|
||||
self.downloading = unicode(translate('OpenLP.FirstTimeWizard',
|
||||
'Downloading %s'))
|
||||
'Downloading %s...'))
|
||||
QtCore.QObject.connect(self,
|
||||
QtCore.SIGNAL(u'currentIdChanged(int)'),
|
||||
self.onCurrentIdChanged)
|
||||
@ -84,134 +78,211 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
|
||||
self.restart()
|
||||
# Sort out internet access for downloads
|
||||
if self.webAccess:
|
||||
self.internetGroupBox.setVisible(True)
|
||||
self.noInternetLabel.setVisible(False)
|
||||
# If songs database exists do not allow a copy
|
||||
songs = os.path.join(AppLocation.get_section_data_path(u'songs'),
|
||||
u'songs.sqlite')
|
||||
if not os.path.exists(songs):
|
||||
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)
|
||||
songs = self.config.get(u'songs', u'languages')
|
||||
songs = songs.split(u',')
|
||||
for song in songs:
|
||||
title = unicode(self.config.get(
|
||||
u'songs_%s' % song, u'title'), u'utf8')
|
||||
filename = unicode(self.config.get(
|
||||
u'songs_%s' % song, u'filename'), u'utf8')
|
||||
item = QtGui.QListWidgetItem(title, self.songsListWidget)
|
||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(filename))
|
||||
item.setCheckState(QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
bible_languages = self.config.get(u'bibles', u'languages')
|
||||
bible_languages = bible_languages.split(u',')
|
||||
for lang in bible_languages:
|
||||
language = unicode(self.config.get(
|
||||
u'bibles_%s' % lang, u'title'), u'utf8')
|
||||
langItem = QtGui.QTreeWidgetItem(
|
||||
self.biblesTreeWidget, QtCore.QStringList(language))
|
||||
bibles = self.config.get(u'bibles_%s' % lang, u'translations')
|
||||
bibles = bibles.split(u',')
|
||||
for bible in bibles:
|
||||
title = unicode(self.config.get(
|
||||
u'bible_%s' % bible, u'title'), u'utf8')
|
||||
filename = unicode(self.config.get(
|
||||
u'bible_%s' % bible, u'filename'))
|
||||
item = QtGui.QTreeWidgetItem(
|
||||
langItem, QtCore.QStringList(title))
|
||||
item.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(filename))
|
||||
item.setCheckState(0, QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
self.biblesTreeWidget.expandAll()
|
||||
themes = self.config.get(u'themes', u'files')
|
||||
themes = themes.split(u',')
|
||||
for theme in themes:
|
||||
title = self.config.get(u'theme_%s' % theme, u'title')
|
||||
filename = self.config.get(u'theme_%s' % theme, u'filename')
|
||||
screenshot = self.config.get(u'theme_%s' % theme, u'screenshot')
|
||||
urllib.urlretrieve(u'%s/%s' % (self.web, screenshot),
|
||||
os.path.join(gettempdir(), screenshot))
|
||||
item = QtGui.QListWidgetItem(title, self.themesListWidget)
|
||||
item.setData(QtCore.Qt.UserRole,
|
||||
QtCore.QVariant(filename))
|
||||
item.setIcon(build_icon(
|
||||
os.path.join(gettempdir(), screenshot)))
|
||||
item.setCheckState(QtCore.Qt.Unchecked)
|
||||
item.setFlags(item.flags() | QtCore.Qt.ItemIsUserCheckable)
|
||||
|
||||
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 nextId(self):
|
||||
"""
|
||||
Determine the next page in the Wizard to go to.
|
||||
"""
|
||||
if self.currentId() == FirstTimePage.Plugins:
|
||||
if not self.webAccess:
|
||||
return FirstTimePage.NoInternet
|
||||
else:
|
||||
return FirstTimePage.Songs
|
||||
elif self.currentId() == FirstTimePage.Progress:
|
||||
return -1
|
||||
else:
|
||||
return self.currentId() + 1
|
||||
|
||||
def onCurrentIdChanged(self, pageId):
|
||||
"""
|
||||
Detects Page changes and updates as approprate.
|
||||
"""
|
||||
if self.page(pageId) == self.DefaultsPage:
|
||||
self.themeSelectionComboBox.clear()
|
||||
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
|
||||
if pageId == FirstTimePage.NoInternet:
|
||||
self.finishButton.setVisible(True)
|
||||
self.finishButton.setEnabled(True)
|
||||
self.nextButton.setVisible(False)
|
||||
elif pageId == FirstTimePage.Defaults:
|
||||
self.themeComboBox.clear()
|
||||
for iter in xrange(self.themesListWidget.count()):
|
||||
item = self.themesListWidget.item(iter)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
self.themeComboBox.addItem(item.text())
|
||||
elif pageId == FirstTimePage.Progress:
|
||||
self._preWizard()
|
||||
self._performWizard()
|
||||
self._postWizard()
|
||||
|
||||
def accept(self):
|
||||
Receiver.send_message(u'cursor_busy')
|
||||
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')
|
||||
def _incrementProgressBar(self, status_text, increment=1):
|
||||
"""
|
||||
Update the wizard progress page.
|
||||
|
||||
``status_text``
|
||||
Current status information to display.
|
||||
|
||||
``increment``
|
||||
The value to increment the progress bar by.
|
||||
"""
|
||||
if status_text:
|
||||
self.progressLabel.setText(status_text)
|
||||
if increment > 0:
|
||||
self.progressBar.setValue(self.progressBar.value() + increment)
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def _preWizard(self):
|
||||
"""
|
||||
Prepare the UI for the process.
|
||||
"""
|
||||
# We start on 2 for plugins status setting plus a "finished" point.
|
||||
max_progress = 2
|
||||
# Loop through the songs list and increase for each selected item
|
||||
for i in xrange(self.songsListWidget.count()):
|
||||
if self.songsListWidget.item(i).checkState() == QtCore.Qt.Checked:
|
||||
max_progress += 1
|
||||
# Loop through the Bibles list and increase for each selected item
|
||||
iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget)
|
||||
while iterator.value():
|
||||
item = iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
max_progress += 1
|
||||
iterator += 1
|
||||
# Loop through the themes list and increase for each selected item
|
||||
for i in xrange(self.themesListWidget.count()):
|
||||
if self.themesListWidget.item(i).checkState() == QtCore.Qt.Checked:
|
||||
max_progress += 1
|
||||
self.finishButton.setVisible(False)
|
||||
self.progressBar.setValue(0)
|
||||
self.progressBar.setMinimum(0)
|
||||
self.progressBar.setMaximum(max_progress)
|
||||
|
||||
def _postWizard(self):
|
||||
"""
|
||||
Clean up the UI after the process has finished.
|
||||
"""
|
||||
self.progressBar.setValue(self.progressBar.maximum())
|
||||
self.finishButton.setVisible(True)
|
||||
self.finishButton.setEnabled(True)
|
||||
self.cancelButton.setVisible(False)
|
||||
self.nextButton.setVisible(False)
|
||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Download complete. Click the finish button to start OpenLP.'))
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
|
||||
def _performWizard(self):
|
||||
"""
|
||||
Run the tasks in the wizard.
|
||||
"""
|
||||
# Set plugin states
|
||||
self._incrementProgressBar(translate('OpenLP.FirstTimeWizard',
|
||||
'Enabling selected plugins...'))
|
||||
self._setPluginStatus(self.songsCheckBox, u'songs/status')
|
||||
self._setPluginStatus(self.bibleCheckBox, u'bibles/status')
|
||||
self._setPluginStatus(self.presentationCheckBox, u'presentations/status')
|
||||
self._setPluginStatus(self.imageCheckBox, u'images/status')
|
||||
self._setPluginStatus(self.mediaCheckBox, u'media/status')
|
||||
self._setPluginStatus(self.remoteCheckBox, u'remotes/status')
|
||||
self._setPluginStatus(self.customCheckBox, u'custom/status')
|
||||
self._setPluginStatus(self.songUsageCheckBox, u'songusage/status')
|
||||
self._setPluginStatus(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
|
||||
songs_destination = AppLocation.get_section_data_path(u'songs')
|
||||
bibles_destination = AppLocation.get_section_data_path(u'bibles')
|
||||
themes_destination = AppLocation.get_section_data_path(u'themes')
|
||||
# Install songs
|
||||
for i in xrange(self.songsListWidget.count()):
|
||||
item = self.songsListWidget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
filename = item.data(QtCore.Qt.UserRole).toString()
|
||||
self._incrementProgressBar(self.downloading % filename)
|
||||
destination = os.path.join(songs_destination, u'songs.sqlite')
|
||||
if os.path.exists(destination):
|
||||
if QtGui.QMessageBox.question(self,
|
||||
translate('OpenLP.FirstTimeWizard',
|
||||
'Overwrite Existing Songs?'),
|
||||
translate('OpenLP.FirstTimeWizard', 'Your songs '
|
||||
'database already exists and your current songs will '
|
||||
'be permanently lost, are you sure you want to '
|
||||
'replace it ?'),
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
||||
QtGui.QMessageBox.No) != QtGui.QMessageBox.Yes:
|
||||
continue
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, filename), destination)
|
||||
# Install Bibles
|
||||
bibles_iterator = QtGui.QTreeWidgetItemIterator(self.biblesTreeWidget)
|
||||
while bibles_iterator.value():
|
||||
item = bibles_iterator.value()
|
||||
if item.parent() and item.checkState(0) == QtCore.Qt.Checked:
|
||||
bible = unicode(item.data(0, QtCore.Qt.UserRole).toString())
|
||||
self._incrementProgressBar(self.downloading % bible)
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, bible),
|
||||
os.path.join(bibles_destination, bible))
|
||||
bibles_iterator += 1
|
||||
# Install themes
|
||||
for i in xrange(self.themesListWidget.count()):
|
||||
item = self.themesListWidget.item(i)
|
||||
if item.checkState() == QtCore.Qt.Checked:
|
||||
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
self._incrementProgressBar(self.downloading % theme)
|
||||
urllib.urlretrieve(u'%s%s' % (self.web, theme),
|
||||
os.path.join(themes_destination, theme))
|
||||
# Set Default Display
|
||||
if self.displaySelectionComboBox.currentIndex() != -1:
|
||||
if self.displayComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'General/monitor',
|
||||
QtCore.QVariant(self.displaySelectionComboBox.
|
||||
currentIndex()))
|
||||
QtCore.QVariant(self.displayComboBox.currentIndex()))
|
||||
# Set Global Theme
|
||||
if self.themeSelectionComboBox.currentIndex() != -1:
|
||||
if self.themeComboBox.currentIndex() != -1:
|
||||
QtCore.QSettings().setValue(u'themes/global theme',
|
||||
QtCore.QVariant(self.themeSelectionComboBox.currentText()))
|
||||
QtCore.QSettings().setValue(u'general/first time',
|
||||
QtCore.QVariant(False))
|
||||
Receiver.send_message(u'cursor_normal')
|
||||
return QtGui.QWizard.accept(self)
|
||||
QtCore.QVariant(self.themeComboBox.currentText()))
|
||||
QtCore.QSettings().setValue(u'general/has run wizard',
|
||||
QtCore.QVariant(True))
|
||||
|
||||
def _pluginStatus(self, field, tag):
|
||||
def _setPluginStatus(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')
|
||||
|
@ -30,26 +30,37 @@ 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)
|
||||
def setupUi(self, languageDialog):
|
||||
languageDialog.setObjectName(u'languageDialog')
|
||||
languageDialog.resize(300, 50)
|
||||
self.dialogLayout = QtGui.QVBoxLayout(languageDialog)
|
||||
self.dialogLayout.setContentsMargins(8, 8, 8, 8)
|
||||
self.dialogLayout.setSpacing(8)
|
||||
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)
|
||||
self.infoLabel = QtGui.QLabel(languageDialog)
|
||||
self.infoLabel.setObjectName(u'infoLabel')
|
||||
self.dialogLayout.addWidget(self.infoLabel)
|
||||
self.languageLayout = QtGui.QHBoxLayout()
|
||||
self.languageLayout.setObjectName(u'languageLayout')
|
||||
self.languageLabel = QtGui.QLabel(languageDialog)
|
||||
self.languageLabel.setObjectName(u'languageLabel')
|
||||
self.languageLayout.addWidget(self.languageLabel)
|
||||
self.languageComboBox = QtGui.QComboBox(languageDialog)
|
||||
self.languageComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
|
||||
self.languageComboBox.setObjectName("languageComboBox")
|
||||
self.languageLayout.addWidget(self.languageComboBox)
|
||||
self.dialogLayout.addLayout(self.languageLayout)
|
||||
self.buttonBox = create_accept_reject_button_box(languageDialog, True)
|
||||
self.dialogLayout.addWidget(self.buttonBox)
|
||||
|
||||
def retranslateUi(self, firstTimeLanguageDialog):
|
||||
self.retranslateUi(languageDialog)
|
||||
self.setMaximumHeight(self.sizeHint().height())
|
||||
QtCore.QMetaObject.connectSlotsByName(languageDialog)
|
||||
|
||||
def retranslateUi(self, languageDialog):
|
||||
self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Initial Set up Language'))
|
||||
self.fileNameLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Initial Language:'))
|
||||
'Select Translation'))
|
||||
self.infoLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Choose the translation you\'d like to use in OpenLP.'))
|
||||
self.languageLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
|
||||
'Translation:'))
|
||||
|
@ -26,10 +26,9 @@
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from firsttimelanguagedialog import Ui_FirstTimeLanguageDialog
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.utils import LanguageManager
|
||||
from firsttimelanguagedialog import Ui_FirstTimeLanguageDialog
|
||||
|
||||
class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
"""
|
||||
@ -39,9 +38,9 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
self.qmList = LanguageManager.get_qm_list()
|
||||
self.LanguageComboBox.addItem(u'Automatic')
|
||||
self.languageComboBox.addItem(u'Autodetect')
|
||||
for key in sorted(self.qmList.keys()):
|
||||
self.LanguageComboBox.addItem(key)
|
||||
self.languageComboBox.addItem(key)
|
||||
|
||||
def exec_(self):
|
||||
"""
|
||||
@ -51,13 +50,13 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
|
||||
|
||||
def accept(self):
|
||||
# It's the first row so must be Automatic
|
||||
if self.LanguageComboBox.currentIndex() == 0:
|
||||
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()))
|
||||
action.setObjectName(unicode(self.languageComboBox.currentText()))
|
||||
LanguageManager.set_language(action, False)
|
||||
return QtGui.QDialog.accept(self)
|
||||
|
||||
|
@ -27,6 +27,17 @@
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.core.lib.ui import add_welcome_page
|
||||
|
||||
class FirstTimePage(object):
|
||||
Welcome = 0
|
||||
Plugins = 1
|
||||
NoInternet = 2
|
||||
Songs = 3
|
||||
Bibles = 4
|
||||
Themes = 5
|
||||
Defaults = 6
|
||||
Progress = 7
|
||||
|
||||
|
||||
class Ui_FirstTimeWizard(object):
|
||||
@ -36,140 +47,144 @@ class Ui_FirstTimeWizard(object):
|
||||
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)
|
||||
QtGui.QWizard.NoBackButtonOnStartPage |
|
||||
QtGui.QWizard.NoBackButtonOnLastPage)
|
||||
self.finishButton = self.button(QtGui.QWizard.FinishButton)
|
||||
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
||||
self.nextButton = self.button(QtGui.QWizard.NextButton)
|
||||
self.backButton = self.button(QtGui.QWizard.BackButton)
|
||||
add_welcome_page(FirstTimeWizard, u':/wizards/wizard_firsttime.bmp')
|
||||
# The plugins page
|
||||
self.pluginPage = QtGui.QWizardPage()
|
||||
self.pluginPage.setObjectName(u'pluginPage')
|
||||
self.pluginLayout = QtGui.QVBoxLayout(self.pluginPage)
|
||||
self.pluginLayout.setContentsMargins(40, 15, 40, 0)
|
||||
self.pluginLayout.setObjectName(u'pluginLayout')
|
||||
self.songsCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.songsCheckBox.setChecked(True)
|
||||
self.songsCheckBox.setObjectName(u'songsCheckBox')
|
||||
self.verticalLayout.addWidget(self.songsCheckBox)
|
||||
self.customCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.songsCheckBox)
|
||||
self.customCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.customCheckBox.setChecked(True)
|
||||
self.customCheckBox.setObjectName(u'customCheckBox')
|
||||
self.verticalLayout.addWidget(self.customCheckBox)
|
||||
self.bibleCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.customCheckBox)
|
||||
self.bibleCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.bibleCheckBox.setChecked(True)
|
||||
self.bibleCheckBox.setObjectName(u'bibleCheckBox')
|
||||
self.verticalLayout.addWidget(self.bibleCheckBox)
|
||||
self.imageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.bibleCheckBox)
|
||||
self.imageCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.imageCheckBox.setChecked(True)
|
||||
self.imageCheckBox.setObjectName(u'imageCheckBox')
|
||||
self.verticalLayout.addWidget(self.imageCheckBox)
|
||||
self.presentationCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.imageCheckBox)
|
||||
self.presentationCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.presentationCheckBox.setChecked(True)
|
||||
self.presentationCheckBox.setObjectName(u'presentationCheckBox')
|
||||
self.verticalLayout.addWidget(self.presentationCheckBox)
|
||||
self.mediaCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.presentationCheckBox)
|
||||
self.mediaCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.mediaCheckBox.setChecked(True)
|
||||
self.mediaCheckBox.setObjectName(u'mediaCheckBox')
|
||||
self.verticalLayout.addWidget(self.mediaCheckBox)
|
||||
self.remoteCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.mediaCheckBox)
|
||||
self.remoteCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.remoteCheckBox.setObjectName(u'remoteCheckBox')
|
||||
self.verticalLayout.addWidget(self.remoteCheckBox)
|
||||
self.songUsageCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.remoteCheckBox)
|
||||
self.songUsageCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
self.songUsageCheckBox.setChecked(True)
|
||||
self.songUsageCheckBox.setObjectName(u'songUsageCheckBox')
|
||||
self.verticalLayout.addWidget(self.songUsageCheckBox)
|
||||
self.alertCheckBox = QtGui.QCheckBox(self.PluginPagePage)
|
||||
self.pluginLayout.addWidget(self.songUsageCheckBox)
|
||||
self.alertCheckBox = QtGui.QCheckBox(self.pluginPage)
|
||||
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.pluginLayout.addWidget(self.alertCheckBox)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Plugins, self.pluginPage)
|
||||
# The "you don't have an internet connection" page.
|
||||
self.noInternetPage = QtGui.QWizardPage()
|
||||
self.noInternetPage.setObjectName(u'noInternetPage')
|
||||
self.noInternetLayout = QtGui.QVBoxLayout(self.noInternetPage)
|
||||
self.noInternetLayout.setContentsMargins(50, 30, 50, 40)
|
||||
self.noInternetLayout.setObjectName(u'noInternetLayout')
|
||||
self.noInternetLabel = QtGui.QLabel(self.noInternetPage)
|
||||
self.noInternetLabel.setWordWrap(True)
|
||||
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(
|
||||
self.noInternetLayout.addWidget(self.noInternetLabel)
|
||||
FirstTimeWizard.setPage(FirstTimePage.NoInternet, self.noInternetPage)
|
||||
# The song samples page
|
||||
self.songsPage = QtGui.QWizardPage()
|
||||
self.songsPage.setObjectName(u'songsPage')
|
||||
self.songsLayout = QtGui.QVBoxLayout(self.songsPage)
|
||||
self.songsLayout.setContentsMargins(50, 20, 50, 20)
|
||||
self.songsLayout.setObjectName(u'songsLayout')
|
||||
self.songsListWidget = QtGui.QListWidget(self.songsPage)
|
||||
self.songsListWidget.setAlternatingRowColors(True)
|
||||
self.songsListWidget.setObjectName(u'songsListWidget')
|
||||
self.songsLayout.addWidget(self.songsListWidget)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Songs, self.songsPage)
|
||||
# The Bible samples page
|
||||
self.biblesPage = QtGui.QWizardPage()
|
||||
self.biblesPage.setObjectName(u'biblesPage')
|
||||
self.biblesLayout = QtGui.QVBoxLayout(self.biblesPage)
|
||||
self.biblesLayout.setContentsMargins(50, 20, 50, 20)
|
||||
self.biblesLayout.setObjectName(u'biblesLayout')
|
||||
self.biblesTreeWidget = QtGui.QTreeWidget(self.biblesPage)
|
||||
self.biblesTreeWidget.setAlternatingRowColors(True)
|
||||
self.biblesTreeWidget.header().setVisible(False)
|
||||
self.biblesTreeWidget.setObjectName(u'biblesTreeWidget')
|
||||
self.biblesLayout.addWidget(self.biblesTreeWidget)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Bibles, self.biblesPage)
|
||||
# The theme samples page
|
||||
self.themesPage = QtGui.QWizardPage()
|
||||
self.themesPage.setObjectName(u'themesPage')
|
||||
self.themesLayout = QtGui.QVBoxLayout(self.themesPage)
|
||||
self.themesLayout.setContentsMargins(20, 50, 20, 60)
|
||||
self.themesLayout.setObjectName(u'themesLayout')
|
||||
self.themesListWidget = QtGui.QListWidget(self.themesPage)
|
||||
self.themesListWidget.setViewMode(QtGui.QListView.IconMode)
|
||||
self.themesListWidget.setMovement(QtGui.QListView.Static)
|
||||
self.themesListWidget.setFlow(QtGui.QListView.LeftToRight)
|
||||
self.themesListWidget.setSpacing(4)
|
||||
self.themesListWidget.setUniformItemSizes(True)
|
||||
self.themesListWidget.setIconSize(QtCore.QSize(133, 100))
|
||||
self.themesListWidget.setWrapping(False)
|
||||
self.themesListWidget.setObjectName(u'themesListWidget')
|
||||
self.themesLayout.addWidget(self.themesListWidget)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Themes, self.themesPage)
|
||||
# the default settings page
|
||||
self.defaultsPage = QtGui.QWizardPage()
|
||||
self.defaultsPage.setObjectName(u'defaultsPage')
|
||||
self.defaultsLayout = QtGui.QFormLayout(self.defaultsPage)
|
||||
self.defaultsLayout.setContentsMargins(50, 20, 50, 20)
|
||||
self.defaultsLayout.setObjectName(u'defaultsLayout')
|
||||
self.displayLabel = QtGui.QLabel(self.defaultsPage)
|
||||
self.displayLabel.setObjectName(u'displayLabel')
|
||||
self.displayComboBox = QtGui.QComboBox(self.defaultsPage)
|
||||
self.displayComboBox.setEditable(False)
|
||||
self.displayComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.displayComboBox.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(
|
||||
self.displayComboBox.setObjectName(u'displayComboBox')
|
||||
self.defaultsLayout.addRow(self.displayLabel, self.displayComboBox)
|
||||
self.themeLabel = QtGui.QLabel(self.defaultsPage)
|
||||
self.themeLabel.setObjectName(u'themeLabel')
|
||||
self.themeComboBox = QtGui.QComboBox(self.defaultsPage)
|
||||
self.themeComboBox.setEditable(False)
|
||||
self.themeComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
|
||||
self.themeComboBox.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.themeComboBox.setObjectName(u'themeComboBox')
|
||||
self.defaultsLayout.addRow(self.themeLabel, self.themeComboBox)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Defaults, self.defaultsPage)
|
||||
# Progress page
|
||||
self.progressPage = QtGui.QWizardPage()
|
||||
self.progressPage.setObjectName(u'progressPage')
|
||||
self.progressLayout = QtGui.QVBoxLayout(self.progressPage)
|
||||
self.progressLayout.setMargin(48)
|
||||
self.progressLayout.setObjectName(u'progressLayout')
|
||||
self.progressLabel = QtGui.QLabel(self.progressPage)
|
||||
self.progressLabel.setObjectName(u'progressLabel')
|
||||
self.progressLayout.addWidget(self.progressLabel)
|
||||
self.progressBar = QtGui.QProgressBar(self.progressPage)
|
||||
self.progressBar.setObjectName(u'progressBar')
|
||||
self.progressLayout.addWidget(self.progressBar)
|
||||
FirstTimeWizard.setPage(FirstTimePage.Progress, self.progressPage)
|
||||
|
||||
self.retranslateUi(FirstTimeWizard)
|
||||
QtCore.QMetaObject.connectSlotsByName(FirstTimeWizard)
|
||||
@ -182,12 +197,12 @@ class Ui_FirstTimeWizard(object):
|
||||
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 .'
|
||||
'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',
|
||||
self.pluginPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Activate required Plugins'))
|
||||
self.PluginPagePage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
self.pluginPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select the Plugins you wish to use. '))
|
||||
self.songsCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
|
||||
self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard',
|
||||
@ -205,23 +220,42 @@ class Ui_FirstTimeWizard(object):
|
||||
'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(
|
||||
self.noInternetPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'No Internet Connection'))
|
||||
self.noInternetPage.setSubTitle(translate(
|
||||
'OpenLP.FirstTimeWizard',
|
||||
'Select samples to downlaod and install for use.'))
|
||||
'Unable to detect an Internet connection.'))
|
||||
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',
|
||||
'No Internet connection was found. The First Time Wizard needs an '
|
||||
'Internet connection in order to be able to download sample '
|
||||
'songs, Bibles and themes.\n\nTo re-run the First Time Wizard and '
|
||||
'import this sample data at a later stage, press the cancel '
|
||||
'button now, check your Internet connection, and restart OpenLP.'
|
||||
'\n\nTo cancel the First Time Wizard completely, press the finish '
|
||||
'button now.'))
|
||||
self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Sample Songs'))
|
||||
self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select and download public domain songs.'))
|
||||
self.biblesPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Sample Bibles'))
|
||||
self.biblesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select and download free Bibles.'))
|
||||
self.themesPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Sample Themes'))
|
||||
self.themesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Select and download sample themes.'))
|
||||
self.defaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Default Settings'))
|
||||
self.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 your changes and start OpenLP'))
|
||||
self.defaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Set up default settings to be used by OpenLP.'))
|
||||
self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Setting Up And Importing'))
|
||||
self.progressPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
|
||||
'Please wait while OpenLP is set up and your data is imported.'))
|
||||
self.displayLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Default output display:'))
|
||||
self.themeLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Select default theme:'))
|
||||
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Starting configuration process...'))
|
||||
|
@ -232,7 +232,7 @@ class Ui_MainWindow(object):
|
||||
self.LanguageGroup = QtGui.QActionGroup(mainWindow)
|
||||
self.LanguageGroup.setExclusive(True)
|
||||
self.LanguageGroup.setObjectName(u'LanguageGroup')
|
||||
self.LanguageGroup.setDisabled(LanguageManager.auto_language)
|
||||
add_actions(self.LanguageGroup, [self.AutoLanguageItem])
|
||||
qmList = LanguageManager.get_qm_list()
|
||||
savedLanguage = LanguageManager.get_language()
|
||||
for key in sorted(qmList.keys()):
|
||||
@ -425,14 +425,14 @@ class Ui_MainWindow(object):
|
||||
translate('OpenLP.MainWindow', '&Online Help'))
|
||||
self.helpWebSiteItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Web Site'))
|
||||
self.AutoLanguageItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Auto Detect'))
|
||||
self.AutoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
'Use the system language, if available.'))
|
||||
for item in self.LanguageGroup.actions():
|
||||
item.setText(item.objectName())
|
||||
item.setStatusTip(unicode(translate('OpenLP.MainWindow',
|
||||
'Set the interface language to %s')) % item.objectName())
|
||||
self.AutoLanguageItem.setText(
|
||||
translate('OpenLP.MainWindow', '&Autodetect'))
|
||||
self.AutoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
'Use the system language, if available.'))
|
||||
self.ToolsAddToolItem.setText(
|
||||
translate('OpenLP.MainWindow', 'Add &Tool...'))
|
||||
self.ToolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
|
||||
@ -550,8 +550,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
QtCore.SIGNAL(u'triggered()'),
|
||||
self.ServiceManagerContents.printServiceOrder)
|
||||
# i18n set signals for languages
|
||||
QtCore.QObject.connect(self.AutoLanguageItem,
|
||||
QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage)
|
||||
self.LanguageGroup.triggered.connect(LanguageManager.set_language)
|
||||
QtCore.QObject.connect(self.ModeDefaultItem,
|
||||
QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
|
||||
|
@ -415,47 +415,75 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
if not self.fileName():
|
||||
return self.saveFileAs()
|
||||
else:
|
||||
fileName = self.fileName()
|
||||
log.debug(u'ServiceManager.saveFile - %s' % fileName)
|
||||
SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
|
||||
split_filename(fileName)[0])
|
||||
service = []
|
||||
serviceFileName = fileName.replace(u'.osz', u'.osd')
|
||||
zip = None
|
||||
file = None
|
||||
try:
|
||||
write_list = []
|
||||
zip = zipfile.ZipFile(unicode(fileName), 'w')
|
||||
for item in self.serviceItems:
|
||||
service.append({u'serviceitem': \
|
||||
item[u'service_item'].get_service_repr()})
|
||||
if item[u'service_item'].uses_file():
|
||||
for frame in item[u'service_item'].get_frames():
|
||||
if item[u'service_item'].is_image():
|
||||
path_from = frame[u'path']
|
||||
else:
|
||||
path_from = unicode(os.path.join(
|
||||
frame[u'path'],
|
||||
frame[u'title']))
|
||||
# On write a file once
|
||||
if not path_from in write_list:
|
||||
write_list.append(path_from)
|
||||
zip.write(path_from.encode(u'utf-8'))
|
||||
file = open(serviceFileName, u'wb')
|
||||
cPickle.dump(service, file)
|
||||
file.close()
|
||||
zip.write(serviceFileName.encode(u'utf-8'))
|
||||
except IOError:
|
||||
log.exception(u'Failed to save service to disk')
|
||||
finally:
|
||||
if file:
|
||||
file.close()
|
||||
if zip:
|
||||
zip.close()
|
||||
delete_file(serviceFileName)
|
||||
self.mainwindow.addRecentFile(fileName)
|
||||
self.setModified(False)
|
||||
path_file_name = unicode(self.fileName())
|
||||
(path, file_name) = os.path.split(path_file_name)
|
||||
(basename, extension) = os.path.splitext(file_name)
|
||||
service_file_name = basename + '.osd'
|
||||
log.debug(u'ServiceManager.saveFile - %s' % path_file_name)
|
||||
SettingsManager.set_last_dir(self.mainwindow.serviceSettingsSection,
|
||||
path)
|
||||
service = []
|
||||
write_list = []
|
||||
total_size = 0
|
||||
for item in self.serviceItems:
|
||||
service.append({u'serviceitem':
|
||||
item[u'service_item'].get_service_repr()})
|
||||
if not item[u'service_item'].uses_file():
|
||||
continue
|
||||
for frame in item[u'service_item'].get_frames():
|
||||
if item[u'service_item'].is_image():
|
||||
path_from = frame[u'path']
|
||||
else:
|
||||
path_from = os.path.join(frame[u'path'], frame[u'title'])
|
||||
# Only write a file once
|
||||
if path_from in write_list:
|
||||
continue
|
||||
file_size = os.path.getsize(path_from)
|
||||
size_limit = 52428800 # 50MiB
|
||||
#if file_size > size_limit:
|
||||
# # File exeeds size_limit bytes, ask user
|
||||
# message = unicode(translate('OpenLP.ServiceManager',
|
||||
# 'Do you want to include \n%.1f MB file "%s"\n'
|
||||
# 'into the service file?\nThis may take some time.\n\n'
|
||||
# 'Please note that you need to\ntake care of that file'
|
||||
# ' yourself,\nif you leave it out.')) % \
|
||||
# (file_size/1048576, os.path.split(path_from)[1])
|
||||
# ans = QtGui.QMessageBox.question(self.mainwindow,
|
||||
# translate('OpenLP.ServiceManager', 'Including Large '
|
||||
# 'File'), message, QtGui.QMessageBox.StandardButtons(
|
||||
# QtGui.QMessageBox.Ok|QtGui.QMessageBox.Cancel),
|
||||
# QtGui.QMessageBox.Ok)
|
||||
# if ans == QtGui.QMessageBox.Cancel:
|
||||
# continue
|
||||
write_list.append(path_from)
|
||||
total_size += file_size
|
||||
log.debug(u'ServiceManager.saveFile - ZIP contents size is %i bytes' %
|
||||
total_size)
|
||||
service_content = cPickle.dumps(service)
|
||||
# Usual Zip file cannot exceed 2GiB, file with Zip64 cannot be
|
||||
# extracted using unzip in UNIX.
|
||||
allow_zip_64 = (total_size > 2147483648 + len(service_content))
|
||||
log.debug(u'ServiceManager.saveFile - allowZip64 is %s' %
|
||||
allow_zip_64)
|
||||
zip = None
|
||||
try:
|
||||
zip = zipfile.ZipFile(path_file_name, 'w', zipfile.ZIP_STORED,
|
||||
allow_zip_64)
|
||||
# First we add service contents.
|
||||
# We save ALL filenames into ZIP using UTF-8.
|
||||
zip.writestr(service_file_name.encode(u'utf-8'),
|
||||
service_content)
|
||||
# Finally add all the listed media files.
|
||||
for path_from in write_list:
|
||||
zip.write(path_from, path_from.encode(u'utf-8'))
|
||||
except IOError:
|
||||
log.exception(u'Failed to save service to disk')
|
||||
return False
|
||||
finally:
|
||||
if zip:
|
||||
zip.close()
|
||||
self.mainwindow.addRecentFile(path_file_name)
|
||||
self.setModified(False)
|
||||
return True
|
||||
|
||||
def saveFileAs(self):
|
||||
|
@ -35,6 +35,7 @@ import urllib2
|
||||
from datetime import datetime
|
||||
|
||||
from PyQt4 import QtGui, QtCore
|
||||
|
||||
if sys.platform != u'win32' and sys.platform != u'darwin':
|
||||
try:
|
||||
from xdg import BaseDirectory
|
||||
@ -134,7 +135,7 @@ class AppLocation(object):
|
||||
elif dir_type == AppLocation.LanguageDir:
|
||||
app_path = _get_frozen_path(
|
||||
os.path.abspath(os.path.split(sys.argv[0])[0]),
|
||||
os.path.split(openlp.__file__)[0])
|
||||
_get_os_dir_path(dir_type))
|
||||
return os.path.join(app_path, u'i18n')
|
||||
else:
|
||||
return _get_os_dir_path(dir_type)
|
||||
@ -169,15 +170,21 @@ def _get_os_dir_path(dir_type):
|
||||
if dir_type == AppLocation.DataDir:
|
||||
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||
u'openlp', u'data')
|
||||
elif dir_type == AppLocation.LanguageDir:
|
||||
return os.path.split(openlp.__file__)[0]
|
||||
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||
u'openlp')
|
||||
elif sys.platform == u'darwin':
|
||||
if dir_type == AppLocation.DataDir:
|
||||
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||
u'Library', u'Application Support', u'openlp', u'Data')
|
||||
elif dir_type == AppLocation.LanguageDir:
|
||||
return os.path.split(openlp.__file__)[0]
|
||||
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||
u'Library', u'Application Support', u'openlp')
|
||||
else:
|
||||
if dir_type == AppLocation.LanguageDir:
|
||||
return os.path.join(u'/usr', u'share', u'openlp')
|
||||
if XDG_BASE_AVAILABLE:
|
||||
if dir_type == AppLocation.ConfigDir:
|
||||
return os.path.join(unicode(BaseDirectory.xdg_config_home,
|
||||
@ -337,6 +344,7 @@ def get_web_page(url, header=None, update_openlp=False):
|
||||
return None
|
||||
if update_openlp:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
log.debug(page)
|
||||
return page
|
||||
|
||||
def file_is_unicode(filename):
|
||||
|
@ -63,6 +63,8 @@ class LanguageManager(object):
|
||||
"""
|
||||
Find all available language files in this OpenLP install
|
||||
"""
|
||||
log.debug(u'Translation files: %s', AppLocation.get_directory(
|
||||
AppLocation.LanguageDir))
|
||||
trans_dir = QtCore.QDir(AppLocation.get_directory(
|
||||
AppLocation.LanguageDir))
|
||||
file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'),
|
||||
@ -112,9 +114,13 @@ class LanguageManager(object):
|
||||
"""
|
||||
language = u'en'
|
||||
if action:
|
||||
action_name = u'%s' % action.objectName()
|
||||
qm_list = LanguageManager.get_qm_list()
|
||||
language = u'%s' % qm_list[action_name]
|
||||
action_name = unicode(action.objectName())
|
||||
if action_name == u'AutoLanguageItem':
|
||||
LanguageManager.auto_language = True
|
||||
else:
|
||||
LanguageManager.auto_language = False
|
||||
qm_list = LanguageManager.get_qm_list()
|
||||
language = unicode(qm_list[action_name])
|
||||
if LanguageManager.auto_language:
|
||||
language = u'[%s]' % language
|
||||
# This needs to be here for the setValue to work
|
||||
|
@ -45,6 +45,18 @@ class MediaPlugin(Plugin):
|
||||
self.icon = build_icon(self.icon_path)
|
||||
# passed with drag and drop messages
|
||||
self.dnd_id = u'Media'
|
||||
self.additional_extensions = {
|
||||
u'audio/ac3': [u'.ac3'],
|
||||
u'audio/flac': [u'.flac'],
|
||||
u'audio/x-m4a': [u'.m4a'],
|
||||
u'audio/x-mp3': [u'.mp3'],
|
||||
u'audio/mpeg': [u'.mp3', u'.mp2', u'.mpga', u'.mpega', u'.m4a'],
|
||||
u'audio/qcelp': [u'.qcp'],
|
||||
u'audio/x-wma': [u'.wma'],
|
||||
u'audio/x-ms-wma': [u'.wma'],
|
||||
u'video/x-matroska': [u'.mpv', u'.mkv'],
|
||||
u'video/x-wmv': [u'.wmv'],
|
||||
u'video/x-ms-wmv': [u'.wmv']}
|
||||
self.audio_extensions_list = []
|
||||
self.video_extensions_list = []
|
||||
mimetypes.init()
|
||||
@ -65,6 +77,17 @@ class MediaPlugin(Plugin):
|
||||
self.serviceManager.supportedSuffixes(extension[1:])
|
||||
log.info(u'MediaPlugin: %s extensions: %s' % (mimetype,
|
||||
u' '.join(extensions)))
|
||||
# Add extensions for this mimetype from self.additional_extensions.
|
||||
# This hack clears mimetypes' and operating system's shortcomings
|
||||
# by providing possibly missing extensions.
|
||||
if mimetype in self.additional_extensions.keys():
|
||||
for extension in self.additional_extensions[mimetype]:
|
||||
ext = u'*%s' % extension
|
||||
if ext not in list:
|
||||
list.append(ext)
|
||||
self.serviceManager.supportedSuffixes(extension[1:])
|
||||
log.info(u'MediaPlugin: %s additional extensions: %s' % (mimetype,
|
||||
u' '.join(self.additional_extensions[mimetype])))
|
||||
|
||||
def about(self):
|
||||
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
|
||||
|
@ -256,7 +256,7 @@ def init_schema(url):
|
||||
mapper(Song, songs_table,
|
||||
properties={
|
||||
'authors': relation(Author, backref='songs',
|
||||
secondary=authors_songs_table),
|
||||
secondary=authors_songs_table, lazy=False),
|
||||
'book': relation(Book, backref='songs'),
|
||||
'media_files': relation(MediaFile, backref='songs',
|
||||
secondary=media_files_songs_table),
|
||||
|
@ -253,9 +253,9 @@ class SongMediaItem(MediaManagerItem):
|
||||
if self.searchAsYouType:
|
||||
search_length = 1
|
||||
if self.searchTextEdit.currentSearchType() == SongSearch.Entire:
|
||||
search_length = 7
|
||||
search_length = 4
|
||||
elif self.searchTextEdit.currentSearchType() == SongSearch.Lyrics:
|
||||
search_length = 6
|
||||
search_length = 3
|
||||
if len(text) > search_length:
|
||||
self.onSearchTextButtonClick()
|
||||
elif len(text) == 0:
|
||||
@ -310,6 +310,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.edit_song_form.loadSong(item_id, False)
|
||||
self.edit_song_form.exec_()
|
||||
self.editItem = None
|
||||
|
||||
def onDeleteClick(self):
|
||||
"""
|
||||
|
@ -96,7 +96,7 @@ class OooImport(SongImport):
|
||||
"""
|
||||
if os.name == u'nt':
|
||||
self.start_ooo_process()
|
||||
self.desktop = self.manager.createInstance(
|
||||
self.desktop = self.ooo_manager.createInstance(
|
||||
u'com.sun.star.frame.Desktop')
|
||||
else:
|
||||
context = uno.getComponentContext()
|
||||
@ -118,9 +118,9 @@ class OooImport(SongImport):
|
||||
def start_ooo_process(self):
|
||||
try:
|
||||
if os.name == u'nt':
|
||||
self.manager = Dispatch(u'com.sun.star.ServiceManager')
|
||||
self.manager._FlagAsMethod(u'Bridge_GetStruct')
|
||||
self.manager._FlagAsMethod(u'Bridge_GetValueObject')
|
||||
self.ooo_manager = Dispatch(u'com.sun.star.ServiceManager')
|
||||
self.ooo_manager._FlagAsMethod(u'Bridge_GetStruct')
|
||||
self.ooo_manager._FlagAsMethod(u'Bridge_GetValueObject')
|
||||
else:
|
||||
cmd = get_uno_command()
|
||||
process = QtCore.QProcess()
|
||||
@ -134,9 +134,11 @@ class OooImport(SongImport):
|
||||
"""
|
||||
Open the passed file in OpenOffice.org Impress
|
||||
"""
|
||||
self.filepath = filepath
|
||||
if os.name == u'nt':
|
||||
url = u'file:///' + filepath.replace(u'\\', u'/')
|
||||
url = filepath.replace(u'\\', u'/')
|
||||
url = url.replace(u':', u'|').replace(u' ', u'%20')
|
||||
url = u'file:///' + url
|
||||
else:
|
||||
url = uno.systemPathToFileUrl(filepath)
|
||||
properties = []
|
||||
@ -190,10 +192,7 @@ class OooImport(SongImport):
|
||||
if slidetext.strip() == u'':
|
||||
slidetext = u'\f'
|
||||
text += slidetext
|
||||
song = SongImport(self.manager)
|
||||
songs = SongImport.process_songs_text(self.manager, text)
|
||||
for song in songs:
|
||||
song.finish()
|
||||
self.process_songs_text(text)
|
||||
return
|
||||
|
||||
def process_doc(self):
|
||||
@ -215,6 +214,16 @@ class OooImport(SongImport):
|
||||
if textportion.BreakType in (PAGE_AFTER, PAGE_BOTH):
|
||||
paratext += u'\f'
|
||||
text += paratext + u'\n'
|
||||
songs = SongImport.process_songs_text(self.manager, text)
|
||||
for song in songs:
|
||||
song.finish()
|
||||
self.process_songs_text(text)
|
||||
|
||||
def process_songs_text(self, text):
|
||||
songtexts = self.tidy_text(text).split(u'\f')
|
||||
self.set_defaults()
|
||||
for songtext in songtexts:
|
||||
if songtext.strip():
|
||||
self.process_song_text(songtext.strip())
|
||||
if self.check_complete():
|
||||
self.finish()
|
||||
self.set_defaults()
|
||||
if self.check_complete():
|
||||
self.finish()
|
||||
|
@ -29,10 +29,11 @@ songs from the database to the OpenLyrics format.
|
||||
"""
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from openlp.core.lib import Receiver, translate
|
||||
from openlp.core.lib import check_directory_exists, Receiver, translate
|
||||
from openlp.plugins.songs.lib import OpenLyrics
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
@ -50,8 +51,7 @@ class OpenLyricsExport(object):
|
||||
self.manager = parent.plugin.manager
|
||||
self.songs = songs
|
||||
self.save_path = save_path
|
||||
if not os.path.exists(self.save_path):
|
||||
os.mkdir(self.save_path)
|
||||
check_directory_exists(self.save_path)
|
||||
|
||||
def do_export(self):
|
||||
"""
|
||||
@ -69,6 +69,10 @@ class OpenLyricsExport(object):
|
||||
song.title)
|
||||
xml = openLyrics.song_to_xml(song)
|
||||
tree = etree.ElementTree(etree.fromstring(xml))
|
||||
tree.write(os.path.join(self.save_path, song.title + u'.xml'),
|
||||
filename = u'%s (%s).xml' % (song.title,
|
||||
u', '.join([author.display_name for author in song.authors]))
|
||||
filename = re.sub(
|
||||
r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_')
|
||||
tree.write(os.path.join(self.save_path, filename),
|
||||
encoding=u'utf-8', xml_declaration=True, pretty_print=True)
|
||||
return True
|
||||
|
@ -72,6 +72,7 @@ class SofImport(OooImport):
|
||||
to SongImport for writing song to disk
|
||||
"""
|
||||
OooImport.__init__(self, manager, **kwargs)
|
||||
self.song = False
|
||||
|
||||
def process_ooo_document(self):
|
||||
"""
|
||||
@ -94,8 +95,8 @@ class SofImport(OooImport):
|
||||
if paragraph.supportsService("com.sun.star.text.Paragraph"):
|
||||
self.process_paragraph(paragraph)
|
||||
if self.song:
|
||||
self.song.finish()
|
||||
self.song = None
|
||||
self.finish()
|
||||
self.song = False
|
||||
|
||||
def process_paragraph(self, paragraph):
|
||||
"""
|
||||
@ -143,7 +144,7 @@ class SofImport(OooImport):
|
||||
self.blanklines += 1
|
||||
if self.blanklines > 1:
|
||||
return
|
||||
if self.song.title != u'':
|
||||
if self.title != u'':
|
||||
self.finish_verse()
|
||||
return
|
||||
self.blanklines = 0
|
||||
@ -161,17 +162,17 @@ class SofImport(OooImport):
|
||||
self.skip_to_close_bracket = True
|
||||
return
|
||||
if text.startswith(u'Copyright'):
|
||||
self.song.add_copyright(text)
|
||||
self.add_copyright(text)
|
||||
return
|
||||
if text == u'(Repeat)':
|
||||
self.finish_verse()
|
||||
self.song.repeat_verse()
|
||||
self.repeat_verse()
|
||||
return
|
||||
if self.song.title == u'':
|
||||
if self.song.copyright == u'':
|
||||
self.add_author(text)
|
||||
if self.title == u'':
|
||||
if self.copyright == u'':
|
||||
self.add_sof_author(text)
|
||||
else:
|
||||
self.song.add_copyright(text)
|
||||
self.add_copyright(text)
|
||||
return
|
||||
self.add_verse_line(text)
|
||||
|
||||
@ -183,15 +184,15 @@ class SofImport(OooImport):
|
||||
into line
|
||||
"""
|
||||
text = textportion.getString()
|
||||
text = SongImport.tidy_text(text)
|
||||
text = self.tidy_text(text)
|
||||
if text.strip() == u'':
|
||||
return text
|
||||
if textportion.CharWeight == BOLD:
|
||||
boldtext = text.strip()
|
||||
if boldtext.isdigit() and self.song.song_number == '':
|
||||
if boldtext.isdigit() and self.song_number == '':
|
||||
self.add_songnumber(boldtext)
|
||||
return u''
|
||||
if self.song.title == u'':
|
||||
if self.title == u'':
|
||||
text = self.uncap_text(text)
|
||||
self.add_title(text)
|
||||
return text
|
||||
@ -207,10 +208,11 @@ class SofImport(OooImport):
|
||||
"""
|
||||
if self.song:
|
||||
self.finish_verse()
|
||||
if not self.song.check_complete():
|
||||
if not self.check_complete():
|
||||
return
|
||||
self.song.finish()
|
||||
self.song = SongImport(self.manager)
|
||||
self.finish()
|
||||
self.song = True
|
||||
self.set_defaults()
|
||||
self.skip_to_close_bracket = False
|
||||
self.is_chorus = False
|
||||
self.italics = False
|
||||
@ -221,17 +223,17 @@ class SofImport(OooImport):
|
||||
Add a song number, store as alternate title. Also use the song
|
||||
number to work out which songbook we're in
|
||||
"""
|
||||
self.song.song_number = song_no
|
||||
self.song.alternate_title = song_no + u'.'
|
||||
self.song.song_book_pub = u'Kingsway Publications'
|
||||
self.song_number = song_no
|
||||
self.alternate_title = song_no + u'.'
|
||||
self.song_book_pub = u'Kingsway Publications'
|
||||
if int(song_no) <= 640:
|
||||
self.song.song_book = u'Songs of Fellowship 1'
|
||||
self.song_book = u'Songs of Fellowship 1'
|
||||
elif int(song_no) <= 1150:
|
||||
self.song.song_book = u'Songs of Fellowship 2'
|
||||
self.song_book = u'Songs of Fellowship 2'
|
||||
elif int(song_no) <= 1690:
|
||||
self.song.song_book = u'Songs of Fellowship 3'
|
||||
self.song_book = u'Songs of Fellowship 3'
|
||||
else:
|
||||
self.song.song_book = u'Songs of Fellowship 4'
|
||||
self.song_book = u'Songs of Fellowship 4'
|
||||
|
||||
def add_title(self, text):
|
||||
"""
|
||||
@ -243,10 +245,10 @@ class SofImport(OooImport):
|
||||
title = title[1:]
|
||||
if title.endswith(u','):
|
||||
title = title[:-1]
|
||||
self.song.title = title
|
||||
self.title = title
|
||||
self.import_wizard.incrementProgressBar(u'Processing song ' + title, 0)
|
||||
|
||||
def add_author(self, text):
|
||||
def add_sof_author(self, text):
|
||||
"""
|
||||
Add the author. OpenLP stores them individually so split by 'and', '&'
|
||||
and comma.
|
||||
@ -254,7 +256,7 @@ class SofImport(OooImport):
|
||||
"Mr Smith" and "Mrs Smith".
|
||||
"""
|
||||
text = text.replace(u' and ', u' & ')
|
||||
self.song.parse_author(text)
|
||||
self.parse_author(text)
|
||||
|
||||
def add_verse_line(self, text):
|
||||
"""
|
||||
@ -262,7 +264,7 @@ class SofImport(OooImport):
|
||||
we're beyond the second line of first verse, then this indicates
|
||||
a change of verse. Italics are a chorus
|
||||
"""
|
||||
if self.italics != self.is_chorus and ((len(self.song.verses) > 0) or
|
||||
if self.italics != self.is_chorus and ((len(self.verses) > 0) or
|
||||
(self.currentverse.count(u'\n') > 1)):
|
||||
self.finish_verse()
|
||||
if self.italics:
|
||||
@ -282,14 +284,14 @@ class SofImport(OooImport):
|
||||
splitat = None
|
||||
else:
|
||||
versetag = u'V'
|
||||
splitat = self.verse_splits(self.song.song_number)
|
||||
splitat = self.verse_splits(self.song_number)
|
||||
if splitat:
|
||||
ln = 0
|
||||
verse = u''
|
||||
for line in self.currentverse.split(u'\n'):
|
||||
ln += 1
|
||||
if line == u'' or ln > splitat:
|
||||
self.song.add_verse(verse, versetag)
|
||||
self.add_sof_verse(verse, versetag)
|
||||
ln = 0
|
||||
if line:
|
||||
verse = line + u'\n'
|
||||
@ -298,12 +300,18 @@ class SofImport(OooImport):
|
||||
else:
|
||||
verse += line + u'\n'
|
||||
if verse:
|
||||
self.song.add_verse(verse, versetag)
|
||||
self.add_sof_verse(verse, versetag)
|
||||
else:
|
||||
self.song.add_verse(self.currentverse, versetag)
|
||||
self.add_sof_verse(self.currentverse, versetag)
|
||||
self.currentverse = u''
|
||||
self.is_chorus = False
|
||||
|
||||
def add_sof_verse(self, lyrics, tag):
|
||||
self.add_verse(lyrics, tag)
|
||||
if not self.is_chorus and u'C1' in self.verse_order_list_generated:
|
||||
self.verse_order_list_generated.append(u'C1')
|
||||
self.verse_order_list_generated_useful = True
|
||||
|
||||
def uncap_text(self, text):
|
||||
"""
|
||||
Words in the title are in all capitals, so we lowercase them.
|
||||
|
@ -103,23 +103,7 @@ class SongImport(QtCore.QObject):
|
||||
def register(self, import_wizard):
|
||||
self.import_wizard = import_wizard
|
||||
|
||||
@staticmethod
|
||||
def process_songs_text(manager, text):
|
||||
songs = []
|
||||
songtexts = SongImport.tidy_text(text).split(u'\f')
|
||||
song = SongImport(manager)
|
||||
for songtext in songtexts:
|
||||
if songtext.strip():
|
||||
song.process_song_text(songtext.strip())
|
||||
if song.check_complete():
|
||||
songs.append(song)
|
||||
song = SongImport(manager)
|
||||
if song.check_complete():
|
||||
songs.append(song)
|
||||
return songs
|
||||
|
||||
@staticmethod
|
||||
def tidy_text(text):
|
||||
def tidy_text(self, text):
|
||||
"""
|
||||
Get rid of some dodgy unicode and formatting characters we're not
|
||||
interested in. Some can be converted to ascii.
|
||||
@ -146,12 +130,12 @@ class SongImport(QtCore.QObject):
|
||||
def process_verse_text(self, text):
|
||||
lines = text.split(u'\n')
|
||||
if text.lower().find(self.copyright_string) >= 0 \
|
||||
or text.find(SongStrings.CopyrightSymbol) >= 0:
|
||||
or text.find(unicode(SongStrings.CopyrightSymbol)) >= 0:
|
||||
copyright_found = False
|
||||
for line in lines:
|
||||
if (copyright_found or
|
||||
line.lower().find(self.copyright_string) >= 0 or
|
||||
line.find(SongStrings.CopyrightSymbol) >= 0):
|
||||
line.find(unicode(SongStrings.CopyrightSymbol)) >= 0):
|
||||
copyright_found = True
|
||||
self.add_copyright(line)
|
||||
else:
|
||||
@ -240,7 +224,7 @@ class SongImport(QtCore.QObject):
|
||||
self.verse_counts[verse_def[0]] = int(verse_def[1:])
|
||||
self.verses.append([verse_def, verse_text.rstrip(), lang])
|
||||
self.verse_order_list_generated.append(verse_def)
|
||||
|
||||
|
||||
def repeat_verse(self):
|
||||
"""
|
||||
Repeat the previous verse in the verse order
|
||||
|
@ -88,6 +88,15 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
||||
"""
|
||||
log.debug(u'accept')
|
||||
path = unicode(self.fileLineEdit.text())
|
||||
if path == u'':
|
||||
Receiver.send_message(u'openlp_error_message', {
|
||||
u'title': translate('SongUsagePlugin.SongUsageDetailForm',
|
||||
'Output Path Not Selected'),
|
||||
u'message': unicode(translate(
|
||||
'SongUsagePlugin.SongUsageDetailForm', 'You have not set a '
|
||||
'valid output location for your song usage report. Please '
|
||||
'select an existing path on your computer.'))})
|
||||
return
|
||||
check_directory_exists(path)
|
||||
filename = unicode(translate('SongUsagePlugin.SongUsageDetailForm',
|
||||
'usage_detail_%s_%s.txt')) % (
|
||||
|
@ -2,12 +2,16 @@
|
||||
# -*- makefile -*-
|
||||
|
||||
build:
|
||||
mkdir -p openlp/i18n
|
||||
mkdir -p resources/i18n/qm
|
||||
for TSFILE in resources/i18n/*.ts; do\
|
||||
lrelease-qt4 $$TSFILE -qm openlp/i18n/`basename $$TSFILE .ts`.qm;\
|
||||
lrelease-qt4 $$TSFILE -qm resources/i18n/qm/`basename $$TSFILE .ts`.qm;\
|
||||
done
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)/usr/share/openlp/i18n
|
||||
cd resources/i18n/qm && for QMFILE in*.qm; do\
|
||||
mv $QMFILE $(DESTDIR)/usr/share/openlp/i18n;\
|
||||
done
|
||||
|
||||
clean:
|
||||
|
||||
rm -fR resources/i18n/qm
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
|
||||
DEB_PYTHON_SYSTEM := pysupport
|
||||
DEB_MAKE_BUILD_TARGET := build
|
||||
DEB_MAKE_INSTALL_TARGET :=
|
||||
DEB_MAKE_CLEAN_TARGET :=
|
||||
DEB_MAKE_INSTALL_TARGET := install
|
||||
DEB_MAKE_CLEAN_TARGET := clean
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||
include /usr/share/cdbs/1/class/python-distutils.mk
|
||||
@ -14,8 +14,8 @@ binary-post-install/openlp::
|
||||
mkdir -p debian/openlp/usr/share/icons/hicolor/$$SIZE/apps && \
|
||||
cp resources/images/openlp-logo-$$SIZE.png debian/openlp/usr/share/icons/hicolor/$$SIZE/apps/openlp.png; \
|
||||
done
|
||||
|
||||
|
||||
mkdir -p debian/openlp/usr/share/icons/hicolor/scalable/apps && \
|
||||
cp resources/images/openlp-logo.svg debian/openlp/usr/share/icons/hicolor/scalable/apps/openlp.svg
|
||||
|
||||
|
||||
cd debian/openlp/usr/bin/ && mv openlp.pyw openlp
|
||||
|
1036
resources/i18n/af.ts
1036
resources/i18n/af.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
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
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
File diff suppressed because it is too large
Load Diff
1178
resources/i18n/ja.ts
1178
resources/i18n/ja.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
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
File diff suppressed because it is too large
Load Diff
4929
resources/i18n/zh_CN.ts
Normal file
4929
resources/i18n/zh_CN.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -92,6 +92,7 @@
|
||||
<file>wizard_exportsong.bmp</file>
|
||||
<file>wizard_importsong.bmp</file>
|
||||
<file>wizard_importbible.bmp</file>
|
||||
<file>wizard_firsttime.bmp</file>
|
||||
<file>wizard_createtheme.bmp</file>
|
||||
</qresource>
|
||||
<qresource prefix="services">
|
||||
|
BIN
resources/images/wizard_firsttime.bmp
Normal file
BIN
resources/images/wizard_firsttime.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 168 KiB |
Loading…
Reference in New Issue
Block a user