diff --git a/.bzrignore b/.bzrignore
index 2620fea42..1d2bb8267 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -20,3 +20,4 @@ _eric4project
openlp/core/resources.py.old
*.qm
resources/windows/warnOpenLP.txt
+openlp.cfg
diff --git a/openlp.pyw b/openlp.pyw
index a39f6cf65..962109592 100755
--- a/openlp.pyw
+++ b/openlp.pyw
@@ -79,6 +79,8 @@ class OpenLP(QtGui.QApplication):
class in order to provide the core of the application.
"""
+ args = []
+
def exec_(self):
"""
Override exec method to allow the shared memory to be released on exit
@@ -92,7 +94,7 @@ class OpenLP(QtGui.QApplication):
"""
# On Windows, the args passed into the constructor are
# ignored. Not very handy, so set the ones we want to use.
- self.args = args
+ self.args.extend(args)
# provide a listener for widgets to reqest a screen update.
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
@@ -125,6 +127,8 @@ class OpenLP(QtGui.QApplication):
# now kill the splashscreen
self.splash.finish(self.mainWindow)
log.debug(u'Splashscreen closed')
+ # make sure Qt really display the splash screen
+ self.processEvents()
self.mainWindow.repaint()
self.processEvents()
if not has_run_wizard:
@@ -180,6 +184,18 @@ class OpenLP(QtGui.QApplication):
"""
self.restoreOverrideCursor()
+ def event(self, event):
+ """
+ Enables direct file opening on OS X
+ """
+ if event.type() == QtCore.QEvent.FileOpen:
+ file_name = event.file()
+ log.debug(u'Got open file event for %s!', file_name)
+ self.args.insert(0, unicode(file_name))
+ return True
+ else:
+ return QtGui.QApplication.event(self, event)
+
def main():
"""
The main function which parses command line options and then runs
diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py
index 7fbd5243c..f83e92de7 100644
--- a/openlp/core/lib/__init__.py
+++ b/openlp/core/lib/__init__.py
@@ -205,7 +205,7 @@ def clean_tags(text):
text = text.replace(u'
', u'\n')
text = text.replace(u'{br}', u'\n')
text = text.replace(u' ', u' ')
- for tag in DisplayTags.get_html_tags():
+ for tag in FormattingTags.get_html_tags():
text = text.replace(tag[u'start tag'], u'')
text = text.replace(tag[u'end tag'], u'')
return text
@@ -214,7 +214,7 @@ def expand_tags(text):
"""
Expand tags HTML for display
"""
- for tag in DisplayTags.get_html_tags():
+ for tag in FormattingTags.get_html_tags():
text = text.replace(tag[u'start tag'], tag[u'start html'])
text = text.replace(tag[u'end tag'], tag[u'end html'])
return text
@@ -233,9 +233,9 @@ def check_directory_exists(dir):
except IOError:
pass
-from listwidgetwithdnd import ListWidgetWithDnD
-from displaytags import DisplayTags
from eventreceiver import Receiver
+from listwidgetwithdnd import ListWidgetWithDnD
+from formattingtags import FormattingTags
from spelltextedit import SpellTextEdit
from settingsmanager import SettingsManager
from plugin import PluginStatus, StringContent, Plugin
diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py
index 5b4d97feb..41b445cd5 100644
--- a/openlp/core/lib/db.py
+++ b/openlp/core/lib/db.py
@@ -223,7 +223,9 @@ class Manager(object):
query = self.session.query(object_class)
if filter_clause is not None:
query = query.filter(filter_clause)
- if order_by_ref is not None:
+ if isinstance(order_by_ref, list):
+ return query.order_by(*order_by_ref).all()
+ elif order_by_ref is not None:
return query.order_by(order_by_ref).all()
return query.all()
diff --git a/openlp/core/lib/displaytags.py b/openlp/core/lib/formattingtags.py
similarity index 76%
rename from openlp/core/lib/displaytags.py
rename to openlp/core/lib/formattingtags.py
index 95ce13bda..ae9d5c1cf 100644
--- a/openlp/core/lib/displaytags.py
+++ b/openlp/core/lib/formattingtags.py
@@ -25,12 +25,12 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
-Provide Html Tag management and Display Tag access class
+Provide HTML Tag management and Formatting Tag access class
"""
from openlp.core.lib import translate
-class DisplayTags(object):
+class FormattingTags(object):
"""
Static Class to HTML Tags to be access around the code the list is managed
by the Options Tab.
@@ -42,89 +42,93 @@ class DisplayTags(object):
"""
Provide access to the html_expands list.
"""
- return DisplayTags.html_expands
+ return FormattingTags.html_expands
@staticmethod
def reset_html_tags():
"""
Resets the html_expands list.
"""
- DisplayTags.html_expands = []
+ FormattingTags.html_expands = []
base_tags = []
# Append the base tags.
# Hex Color tags from http://www.w3schools.com/html/html_colornames.asp
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Red'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Red'),
u'start tag': u'{r}',
u'start html': u'',
u'end tag': u'{/r}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Black'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Black'),
u'start tag': u'{b}',
u'start html': u'',
u'end tag': u'{/b}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Blue'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Blue'),
u'start tag': u'{bl}',
u'start html': u'',
u'end tag': u'{/bl}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Yellow'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Yellow'),
u'start tag': u'{y}',
u'start html': u'',
u'end tag': u'{/y}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Green'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Green'),
u'start tag': u'{g}',
u'start html': u'',
u'end tag': u'{/g}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Pink'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Pink'),
u'start tag': u'{pk}',
u'start html': u'',
u'end tag': u'{/pk}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Orange'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Orange'),
u'start tag': u'{o}',
u'start html': u'',
u'end tag': u'{/o}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Purple'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Purple'),
u'start tag': u'{pp}',
u'start html': u'',
u'end tag': u'{/pp}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'White'),
+ base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'White'),
u'start tag': u'{w}',
u'start html': u'',
u'end tag': u'{/w}', u'end html': u'', u'protected': True})
base_tags.append({
- u'desc': translate('OpenLP.DisplayTags', 'Superscript'),
+ u'desc': translate('OpenLP.FormattingTags', 'Superscript'),
u'start tag': u'{su}', u'start html': u'',
u'end tag': u'{/su}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Subscript'),
+ base_tags.append({
+ u'desc': translate('OpenLP.FormattingTags', 'Subscript'),
u'start tag': u'{sb}', u'start html': u'',
u'end tag': u'{/sb}', u'end html': u'', u'protected': True})
- base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Paragraph'),
+ base_tags.append({
+ u'desc': translate('OpenLP.FormattingTags', 'Paragraph'),
u'start tag': u'{p}', u'start html': u'
', u'end tag': u'{/p}', u'end html': u'
', u'protected': True}) - base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Bold'), + base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Bold'), u'start tag': u'{st}', u'start html': u'', u'end tag': u'{/st}', u'end html': u'', u'protected': True}) - base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Italics'), + base_tags.append({ + u'desc': translate('OpenLP.FormattingTags', 'Italics'), u'start tag': u'{it}', u'start html': u'', u'end tag': u'{/it}', u'end html': u'', u'protected': True}) - base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Underline'), + base_tags.append({ + u'desc': translate('OpenLP.FormattingTags', 'Underline'), u'start tag': u'{u}', u'start html': u'', u'end tag': u'{/u}', u'end html': u'', u'protected': True}) - base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Break'), + base_tags.append({u'desc': translate('OpenLP.FormattingTags', 'Break'), u'start tag': u'{br}', u'start html': u'