diff --git a/documentation/manual/source/glossary.rst b/documentation/manual/source/glossary.rst index 41a8f4ac6..6f4ebcdd6 100644 --- a/documentation/manual/source/glossary.rst +++ b/documentation/manual/source/glossary.rst @@ -48,7 +48,7 @@ Service Manger -------------- The service manager contains the media items in your service file. This is the -area from wich your media items go live, and you can also save, open, and edit +area from which your media items go live, and you can also save, open, and edit services files. .. image:: pics/servicemanager.png diff --git a/documentation/manual/source/index.rst b/documentation/manual/source/index.rst index ac29c4360..5786af1ae 100644 --- a/documentation/manual/source/index.rst +++ b/documentation/manual/source/index.rst @@ -14,6 +14,8 @@ Contents: introduction glossary dualmonitors + mediamanager + songs Indices and tables ================== diff --git a/documentation/manual/source/mediamanager.rst b/documentation/manual/source/mediamanager.rst new file mode 100644 index 000000000..2cf1d2c57 --- /dev/null +++ b/documentation/manual/source/mediamanager.rst @@ -0,0 +1,26 @@ +============= +Media Manager +============= + +Once you get your system set up for OpenLP you will be ready to add content to +your setup. This will all happen through the **Media Manager**. The +`Media Manager` contains all the bibles, songs, presentations, media, and +everything else that you will project through OpenLP. + +Enabling the Plugins +-------------------- + +You may need to enable the plugins that came with OpenLP. As you can see below +this is what the `Media Manager` looks like with all the plugins enabled. + +.. image:: pics/mediamanager.png + +To enable the plugins navigate to :menuselection:`Settings --> Plugins` or +press `F7`. You will then want to click on the plugin to the left that you want +to enable and select **active** from the drop down box to the right. + +.. image:: pics/plugins.png + + +Now you should be ready to add content to OpenLP check out the section of this +guide on the individual plugins. diff --git a/documentation/manual/source/pics/finishedimport.png b/documentation/manual/source/pics/finishedimport.png new file mode 100644 index 000000000..d49876ec9 Binary files /dev/null and b/documentation/manual/source/pics/finishedimport.png differ diff --git a/documentation/manual/source/pics/plugins.png b/documentation/manual/source/pics/plugins.png new file mode 100644 index 000000000..b6810242b Binary files /dev/null and b/documentation/manual/source/pics/plugins.png differ diff --git a/documentation/manual/source/pics/selectsongs.png b/documentation/manual/source/pics/selectsongs.png new file mode 100644 index 000000000..20df3ba2a Binary files /dev/null and b/documentation/manual/source/pics/selectsongs.png differ diff --git a/documentation/manual/source/pics/songimporter.png b/documentation/manual/source/pics/songimporter.png new file mode 100644 index 000000000..96c39ea38 Binary files /dev/null and b/documentation/manual/source/pics/songimporter.png differ diff --git a/documentation/manual/source/pics/songimporterchoices.png b/documentation/manual/source/pics/songimporterchoices.png new file mode 100644 index 000000000..5c458838e Binary files /dev/null and b/documentation/manual/source/pics/songimporterchoices.png differ diff --git a/documentation/manual/source/pics/songselectlyrics.png b/documentation/manual/source/pics/songselectlyrics.png new file mode 100644 index 000000000..2e3d92f0d Binary files /dev/null and b/documentation/manual/source/pics/songselectlyrics.png differ diff --git a/documentation/manual/source/pics/songselectsongsearch.png b/documentation/manual/source/pics/songselectsongsearch.png new file mode 100644 index 000000000..de0ea12ca Binary files /dev/null and b/documentation/manual/source/pics/songselectsongsearch.png differ diff --git a/documentation/manual/source/pics/songusage.png b/documentation/manual/source/pics/songusage.png new file mode 100644 index 000000000..10f29f2a9 Binary files /dev/null and b/documentation/manual/source/pics/songusage.png differ diff --git a/documentation/manual/source/pics/songusagedelete.png b/documentation/manual/source/pics/songusagedelete.png new file mode 100644 index 000000000..fec1b5e5d Binary files /dev/null and b/documentation/manual/source/pics/songusagedelete.png differ diff --git a/documentation/manual/source/pics/songusagereport.png b/documentation/manual/source/pics/songusagereport.png new file mode 100644 index 000000000..c0d9df3dd Binary files /dev/null and b/documentation/manual/source/pics/songusagereport.png differ diff --git a/documentation/manual/source/pics/vistadisplaysettings.png b/documentation/manual/source/pics/vistadisplaysettings.png old mode 100755 new mode 100644 diff --git a/documentation/manual/source/pics/vistapersonalize.png b/documentation/manual/source/pics/vistapersonalize.png old mode 100755 new mode 100644 diff --git a/documentation/manual/source/pics/winsevendisplay.png b/documentation/manual/source/pics/winsevendisplay.png old mode 100755 new mode 100644 diff --git a/documentation/manual/source/pics/winsevenresolution.png b/documentation/manual/source/pics/winsevenresolution.png old mode 100755 new mode 100644 diff --git a/documentation/manual/source/pics/xpdisplaysettings.png b/documentation/manual/source/pics/xpdisplaysettings.png index eb7a8921c..e1ec66c6f 100644 Binary files a/documentation/manual/source/pics/xpdisplaysettings.png and b/documentation/manual/source/pics/xpdisplaysettings.png differ diff --git a/documentation/manual/source/songs.rst b/documentation/manual/source/songs.rst new file mode 100644 index 000000000..678a6206c --- /dev/null +++ b/documentation/manual/source/songs.rst @@ -0,0 +1,100 @@ +===== +Songs +===== + +Managing your songs in OpenLP is a relatively simple process. There are also +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 +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`. + +.. image:: pics/songimporter.png + +After choosing :guilabel:`Next` you can then 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 +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 +need to locate your version 1 database file. + +Windows XP:: + + C:\Documents and Settings\All Users\Application Data\openlp.org\Data\songs.olp + +Windows Vista / Windows 7:: + + C:\ProgramData\openlp.org\Data\songs.olp + +After clicking :guilabel:`Next` your conversion should be complete. + +.. image:: pics/finishedimport.png + +Then press :guilabel:`Finish` and you should now be ready to use your OpenLP +version one songs. + +Importing from OpenSong +^^^^^^^^^^^^^^^^^^^^^^^ + +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 +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. + +.. image:: pics/finishedimport.png + +Press :guilabel:`Finish` and you will now be ready to use your songs imported +from OpenSong. + +Importing from CCLI Song Select +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To import from CCLI Song Select you must be a CCLI Subscriber and also a +subscriber of the Song Select service. For info on that go to: +http://www.ccli.com + +The first step for importing from CCLI Song Select is to log into your account. +Then search for your desired song. For this example we will be adding the song +"Amazing Grace". + +.. 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. + +.. 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 +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. + +.. image:: pics/finishedimport.png + +Press :guilabel:`Finish` and you will now be ready to use your songs imported +from CCLI SongSelect. + + diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 1ad17a039..a90a4c194 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -38,48 +38,51 @@ log = logging.getLogger(__name__) # TODO make external and configurable in alpha 4 via a settings dialog html_expands = [] -html_expands.append({u'desc':u'Red', u'start tag':u'{r}', - u'start html':u'', - u'end tag':u'{/r}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Black', u'start tag':u'{b}', - u'start html':u'', - u'end tag':u'{/b}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Blue', u'start tag':u'{bl}', - u'start html':u'', - u'end tag':u'{/bl}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Yellow', u'start tag':u'{y}', - u'start html':u'', - u'end tag':u'{/y}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Green', u'start tag':u'{g}', - u'start html':u'', - u'end tag':u'{/g}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Pink', u'start tag':u'{pk}', - u'start html':u'', - u'end tag':u'{/pk}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Orange', u'start tag':u'{o}', - u'start html':u'', - u'end tag':u'{/o}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Purple', u'start tag':u'{pp}', - u'start html':u'', - u'end tag':u'{/pp}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'White', u'start tag':u'{w}', - u'start html':u'', - u'end tag':u'{/w}', u'end html':u'', u'protected':False}) -html_expands.append({u'desc':u'Superscript', u'start tag':u'{su}', - u'start html':u'', u'end tag':u'{/su}', u'end html':u'', - u'protected':True}) -html_expands.append({u'desc':u'Subscript', u'start tag':u'{sb}', - u'start html':u'', u'end tag':u'{/sb}', u'end html':u'', - u'protected':True}) -html_expands.append({u'desc':u'Paragraph', u'start tag':u'{p}', - u'start html':u'
', u'end tag':u'{/p}', u'end html':u'
', - u'protected':True}) -html_expands.append({u'desc':u'Bold', u'start tag':u'{st}', - u'start html':u'', u'end tag':u'{/st}', u'end html':u'', - u'protected':True}) -html_expands.append({u'desc':u'Italics', u'start tag':u'{it}', - u'start html':u'', u'end tag':u'{/it}', u'end html':u'', - u'protected':True}) +html_expands.append({u'desc': u'Red', u'start tag': u'{r}', + u'start html': u'', + u'end tag': u'{/r}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Black', u'start tag': u'{b}', + u'start html': u'', + u'end tag': u'{/b}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Blue', u'start tag': u'{bl}', + u'start html': u'', + u'end tag': u'{/bl}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Yellow', u'start tag': u'{y}', + u'start html': u'', + u'end tag': u'{/y}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Green', u'start tag': u'{g}', + u'start html': u'', + u'end tag': u'{/g}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Pink', u'start tag': u'{pk}', + u'start html': u'', + u'end tag': u'{/pk}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Orange', u'start tag': u'{o}', + u'start html': u'', + u'end tag': u'{/o}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Purple', u'start tag': u'{pp}', + u'start html': u'', + u'end tag': u'{/pp}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'White', u'start tag': u'{w}', + u'start html': u'', + u'end tag': u'{/w}', u'end html': u'', u'protected': False}) +html_expands.append({u'desc': u'Superscript', u'start tag': u'{su}', + u'start html': u'', u'end tag': u'{/su}', u'end html': u'', + u'protected': True}) +html_expands.append({u'desc': u'Subscript', u'start tag': u'{sb}', + u'start html': u'', u'end tag': u'{/sb}', u'end html': u'', + u'protected': True}) +html_expands.append({u'desc': u'Paragraph', u'start tag': u'{p}', + u'start html': u'', u'end tag': u'{/p}', u'end html': u'
', + u'protected': True}) +html_expands.append({u'desc': u'Bold', u'start tag': u'{st}', + u'start html': u'', u'end tag': u'{/st}', u'end html': u'', + u'protected': True}) +html_expands.append({u'desc': u'Italics', u'start tag': u'{it}', + u'start html': u'', u'end tag': u'{/it}', u'end html': u'', + u'protected': True}) +html_expands.append({u'desc': u'Underline', u'start tag': u'{u}', + u'start html': u'', + u'end tag': u'{/u}', u'end html': u'', u'protected': True}) def translate(context, text, comment=None): """ @@ -303,6 +306,8 @@ def expand_tags(text): text = text.replace(tag[u'end tag'], tag[u'end html']) return text +from theme import ThemeLevel, ThemeXML, BackgroundGradientType, BackgroundType, \ + HorizontalType, VerticalType from spelltextedit import SpellTextEdit from eventreceiver import Receiver from imagemanager import ImageManager @@ -317,7 +322,6 @@ from htmlbuilder import build_html, build_lyrics_format_css, \ build_lyrics_outline_css from toolbar import OpenLPToolbar from dockwidget import OpenLPDockWidget -from theme import ThemeLevel, ThemeXML from renderer import Renderer from rendermanager import RenderManager from mediamanageritem import MediaManagerItem diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 7c4536ccf..8afa02111 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -117,6 +117,7 @@ class Manager(object): settings = QtCore.QSettings() settings.beginGroup(plugin_name) self.db_url = u'' + self.is_dirty = False db_type = unicode( settings.value(u'db type', QtCore.QVariant(u'sqlite')).toString()) if db_type == u'sqlite': @@ -150,12 +151,34 @@ class Manager(object): self.session.add(object_instance) if commit: self.session.commit() + self.is_dirty = True return True except InvalidRequestError: self.session.rollback() log.exception(u'Object save failed') return False + def save_objects(self, object_list, commit=True): + """ + Save a list of objects to the database + + ``object_list`` + The list of objects to save + + ``commit`` + Commit the session with this object + """ + try: + self.session.add_all(object_list) + if commit: + self.session.commit() + self.is_dirty = True + return True + except InvalidRequestError: + self.session.rollback() + log.exception(u'Object list save failed') + return False + def get_object(self, object_class, key=None): """ Return the details of an object @@ -205,6 +228,22 @@ class Manager(object): return query.order_by(order_by_ref).all() return query.all() + def get_object_count(self, object_class, filter_clause=None): + """ + Returns a count of the number of objects in the database. + + ``object_class`` + The type of objects to return. + + ``filter_clause`` + The filter governing selection of objects to return. Defaults to + None. + """ + query = self.session.query(object_class) + if filter_clause is not None: + query = query.filter(filter_clause) + return query.count() + def delete_object(self, object_class, key): """ Delete an object from the database @@ -220,6 +259,7 @@ class Manager(object): try: self.session.delete(object_instance) self.session.commit() + self.is_dirty = True return True except InvalidRequestError: self.session.rollback() @@ -241,6 +281,7 @@ class Manager(object): query = query.filter(filter_clause) query.delete(synchronize_session=False) self.session.commit() + self.is_dirty = True return True except InvalidRequestError: self.session.rollback() @@ -251,5 +292,7 @@ class Manager(object): """ VACUUM the database on exit. """ - engine = create_engine(self.db_url) - engine.execute("vacuum") + if self.is_dirty: + engine = create_engine(self.db_url) + if self.db_url.startswith(u'sqlite'): + engine.execute("vacuum") diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index dc3a48565..b2f46e655 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -25,8 +25,11 @@ ############################################################################### import logging + from PyQt4 import QtWebKit +from openlp.core.lib import BackgroundType, BackgroundGradientType + log = logging.getLogger(__name__) HTMLSRC = u""" @@ -368,16 +371,32 @@ def build_background_css(item, width, height): theme = item.themedata background = u'background-color: black' if theme: - if theme.background_type == u'solid': + if theme.background_type == BackgroundType.to_string(BackgroundType.Solid): background = u'background-color: %s' % theme.background_color else: - if theme.background_direction == u'horizontal': + if theme.background_direction == BackgroundGradientType.to_string \ + (BackgroundGradientType.Horizontal): background = \ u'background: ' \ u'-webkit-gradient(linear, left top, left bottom, ' \ 'from(%s), to(%s))' % (theme.background_start_color, theme.background_end_color) - elif theme.background_direction == u'vertical': + elif theme.background_direction == BackgroundGradientType.to_string \ + (BackgroundGradientType.LeftTop): + background = \ + u'background: ' \ + u'-webkit-gradient(linear, left top, right bottom, ' \ + 'from(%s), to(%s))' % (theme.background_start_color, + theme.background_end_color) + elif theme.background_direction == BackgroundGradientType.to_string \ + (BackgroundGradientType.LeftBottom): + background = \ + u'background: ' \ + u'-webkit-gradient(linear, left bottom, right top, ' \ + 'from(%s), to(%s))' % (theme.background_start_color, + theme.background_end_color) + elif theme.background_direction == BackgroundGradientType.to_string \ + (BackgroundGradientType.Vertical): background = \ u'background: -webkit-gradient(linear, left top, ' \ u'right top, from(%s), to(%s))' % \ @@ -452,17 +471,17 @@ def build_lyrics_css(item, webkitvers): lyricsmain += build_lyrics_outline_css(theme) else: outline = build_lyrics_outline_css(theme) - if theme.display_shadow: - if theme.display_outline and webkitvers < 534.3: + if theme.font_main_shadow: + if theme.font_main_outline and webkitvers < 534.3: shadow = u'padding-left: %spx; padding-top: %spx;' % \ - (int(theme.display_shadow_size) + - (int(theme.display_outline_size) * 2), - theme.display_shadow_size) + (int(theme.font_main_shadow_size) + + (int(theme.font_main_outline_size) * 2), + theme.font_main_shadow_size) shadow += build_lyrics_outline_css(theme, True) else: lyricsmain += u' text-shadow: %s %spx %spx;' % \ - (theme.display_shadow_color, theme.display_shadow_size, - theme.display_shadow_size) + (theme.font_main_shadow_color, theme.font_main_shadow_size, + theme.font_main_shadow_size) lyrics_css = style % (lyricstable, lyrics, lyricsmain, outline, shadow) return lyrics_css @@ -477,14 +496,14 @@ def build_lyrics_outline_css(theme, is_shadow=False): `is_shadow` If true, use the shadow colors instead """ - if theme.display_outline: - size = float(theme.display_outline_size) / 16 + if theme.font_main_outline: + size = float(theme.font_main_outline_size) / 16 if is_shadow: - fill_color = theme.display_shadow_color - outline_color = theme.display_shadow_color + fill_color = theme.font_main_shadow_color + outline_color = theme.font_main_shadow_color else: fill_color = theme.font_main_color - outline_color = theme.display_outline_color + outline_color = theme.font_main_outline_color return u' -webkit-text-stroke: %sem %s; ' \ u'-webkit-text-fill-color: %s; ' % (size, outline_color, fill_color) else: @@ -517,23 +536,23 @@ def build_lyrics_format_css(theme, width, height): valign = u'middle' else: valign = u'top' - if theme.display_outline: - left_margin = int(theme.display_outline_size) * 2 + if theme.font_main_outline: + left_margin = int(theme.font_main_outline_size) * 2 else: left_margin = 0 lyrics = u'white-space:pre-wrap; word-wrap: break-word; ' \ 'text-align: %s; vertical-align: %s; font-family: %s; ' \ 'font-size: %spt; color: %s; line-height: %d%%; margin:0;' \ 'padding:0; padding-left:%spx; width: %spx; height: %spx; ' % \ - (align, valign, theme.font_main_name, theme.font_main_proportion, + (align, valign, theme.font_main_name, theme.font_main_size, theme.font_main_color, 100 + int(theme.font_main_line_adjustment), left_margin, width, height) - if theme.display_outline: + if theme.font_main_outline: if webkit_version() < 534.3: lyrics += u' letter-spacing: 1px;' if theme.font_main_italics: lyrics += u' font-style:italic; ' - if theme.font_main_weight == u'Bold': + if theme.font_main_bold: lyrics += u' font-weight:bold; ' return lyrics @@ -553,7 +572,7 @@ def build_lyrics_html(item, webkitvers): # display:table/display:table-cell are required for each lyric block. lyrics = u'' theme = item.themedata - if webkitvers < 534.4 and theme and theme.display_outline: + if webkitvers < 534.4 and theme and theme.font_main_outline: lyrics += u'