Change superscript so it still works in print. Fix problem with openlp not closing

This commit is contained in:
Jonathan Corwin 2011-03-28 21:18:55 +01:00
parent 1e973c6c8d
commit 2cce748d20
5 changed files with 25 additions and 17 deletions

View File

@ -78,12 +78,13 @@ class OpenLP(QtGui.QApplication):
class in order to provide the core of the application. class in order to provide the core of the application.
""" """
def exec_(self): #def exec_(self):
""" #"""
Override exec method to allow the shared memory to be released on exit #Override exec method to allow the shared memory to be released on exit
""" #"""
QtGui.QApplication.exec_() #return QtGui.QApplication.exec_()
self.sharedMemory.detach() #self.sharedMemory.detach()
#return i
def run(self): def run(self):
""" """
@ -115,7 +116,8 @@ class OpenLP(QtGui.QApplication):
# make sure Qt really display the splash screen # make sure Qt really display the splash screen
self.processEvents() self.processEvents()
# start the main app window # start the main app window
self.mainWindow = MainWindow(screens, self) self.mainWindow = MainWindow(screens, self.clipboard(),
self.arguments())
self.mainWindow.show() self.mainWindow.show()
if show_splash: if show_splash:
# now kill the splashscreen # now kill the splashscreen

View File

@ -65,9 +65,8 @@ base_html_expands.append({u'desc': u'White', u'start tag': u'{w}',
u'start html': u'<span style="-webkit-text-fill-color:white">', u'start html': u'<span style="-webkit-text-fill-color:white">',
u'end tag': u'{/w}', u'end html': u'</span>', u'protected': True}) u'end tag': u'{/w}', u'end html': u'</span>', u'protected': True})
base_html_expands.append({u'desc': u'Superscript', u'start tag': u'{su}', base_html_expands.append({u'desc': u'Superscript', u'start tag': u'{su}',
u'start html': u'<span style=" font-size:0.6em; vertical-align:top;' u'start html': u'<sup>', u'end tag': u'{/su}', u'end html': u'</sup>',
+ u' position:relative; top:-0.3em;">', u'end tag': u'{/su}', u'protected': True})
u'end html': u'</span>', u'protected': True})
base_html_expands.append({u'desc': u'Subscript', u'start tag': u'{sb}', base_html_expands.append({u'desc': u'Subscript', u'start tag': u'{sb}',
u'start html': u'<sub>', u'end tag': u'{/sb}', u'end html': u'</sub>', u'start html': u'<sub>', u'end tag': u'{/sb}', u'end html': u'</sub>',
u'protected': True}) u'protected': True})

View File

@ -85,7 +85,12 @@ body {
} }
/* lyric css */ /* lyric css */
%s %s
sup {
font-size:0.6em;
vertical-align:top;
position:relative;
top:-0.3em;
}
</style> </style>
<script language="javascript"> <script language="javascript">
var timer = null; var timer = null;

View File

@ -469,7 +469,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
actionList = ActionList() actionList = ActionList()
def __init__(self, screens, application): def __init__(self, screens, clipboard, arguments):
""" """
This constructor sets up the interface, the various managers, and the This constructor sets up the interface, the various managers, and the
plugins. plugins.
@ -477,7 +477,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
QtGui.QMainWindow.__init__(self) QtGui.QMainWindow.__init__(self)
self.screens = screens self.screens = screens
self.application = application #self.application = application
self.clipboard = clipboard
self.arguments = arguments
# Set up settings sections for the main application # Set up settings sections for the main application
# (not for use by plugins) # (not for use by plugins)
self.uiSettingsSection = u'user interface' self.uiSettingsSection = u'user interface'
@ -661,9 +663,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
if self.liveController.display.isVisible(): if self.liveController.display.isVisible():
self.liveController.display.setFocus() self.liveController.display.setFocus()
self.activateWindow() self.activateWindow()
if len(self.application.arguments()) > 0: if len(self.arguments) > 0:
args = [] args = []
for a in self.application.arguments(): for a in self.arguments:
args.extend([a]) args.extend([a])
self.ServiceManagerContents.loadFile(unicode(args[0])) self.ServiceManagerContents.loadFile(unicode(args[0]))
elif QtCore.QSettings().value( elif QtCore.QSettings().value(

View File

@ -184,14 +184,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
""" """
Copies the display text to the clipboard as plain text Copies the display text to the clipboard as plain text
""" """
self.mainWindow.application.clipboard.setText( self.mainWindow.clipboard.setText(
self.document.toPlainText()) self.document.toPlainText())
def copyHtmlText(self): def copyHtmlText(self):
""" """
Copies the display text to the clipboard as Html Copies the display text to the clipboard as Html
""" """
self.mainWindow.application.clipboard.setText(self.document.toHtml()) self.mainWindow.clipboard.setText(self.document.toHtml())
def printServiceOrder(self): def printServiceOrder(self):
""" """