diff --git a/openlp.pyw b/openlp.pyw index 3e5d18f16..c67d54e41 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -27,6 +27,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### +import sys from openlp.core import main @@ -34,4 +35,10 @@ if __name__ == u'__main__': """ Instantiate and run the application. """ + # Mac OS X passes arguments like '-psn_XXXX' to gui application. + # This argument is process serial number. However, this causes + # conflict with other OpenLP arguments. Since we do not use this + # argument we can delete it to avoid any potential conflicts. + if sys.platform.startswith('darwin'): + sys.argv = filter(lambda x: not x.startswith('-psn'), sys.argv) main() diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 674aab1b9..78a84f3fb 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -330,7 +330,24 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): Copies the display text to the clipboard as plain text """ self.update_song_usage() - self.mainWindow.clipboard.setText(self.document.toPlainText()) + cursor = QtGui.QTextCursor(self.document) + cursor.select(QtGui.QTextCursor.Document) + clipboard_text = cursor.selectedText() + # We now have the unprocessed unicode service text in the cursor + # So we replace u2028 with \n and u2029 with \n\n and a few others + clipboard_text = clipboard_text.replace(u'\u2028', u'\n') + clipboard_text = clipboard_text.replace(u'\u2029', u'\n\n') + clipboard_text = clipboard_text.replace(u'\u2018', u'\'') + clipboard_text = clipboard_text.replace(u'\u2019', u'\'') + clipboard_text = clipboard_text.replace(u'\u201c', u'"') + clipboard_text = clipboard_text.replace(u'\u201d', u'"') + clipboard_text = clipboard_text.replace(u'\u2026', u'...') + clipboard_text = clipboard_text.replace(u'\u2013', u'-') + clipboard_text = clipboard_text.replace(u'\u2014', u'-') + # remove the icon from the text + clipboard_text = clipboard_text.replace(u'\ufffc\xa0', u'') + # and put it all on the clipboard + self.mainWindow.clipboard.setText(clipboard_text) def copyHtmlText(self): """