diff --git a/documentation/manual/make.bat b/documentation/manual/make.bat index 8d21b45ce..20bff1ee7 100644 --- a/documentation/manual/make.bat +++ b/documentation/manual/make.bat @@ -1,112 +1,112 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -set SPHINXBUILD=sphinx-build -set ALLSPHINXOPTS=-d build/doctrees %SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (build\*) do rmdir /q /s %%i - del /q /s build\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% build/html - echo. - echo.Build finished. The HTML pages are in build/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% build/dirhtml - echo. - echo.Build finished. The HTML pages are in build/dirhtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% build/pickle - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% build/json - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% build/htmlhelp - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in build/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% build/qthelp - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in build/qthelp, like this: - echo.^> qcollectiongenerator build\qthelp\OpenLP.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile build\qthelp\OpenLP.ghc - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% build/latex - echo. - echo.Build finished; the LaTeX files are in build/latex. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% build/changes - echo. - echo.The overview file is in build/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% build/linkcheck - echo. - echo.Link check complete; look for any errors in the above output ^ -or in build/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% build/doctest - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in build/doctest/output.txt. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +set SPHINXBUILD=sphinx-build +set ALLSPHINXOPTS=-d build/doctrees %SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (build\*) do rmdir /q /s %%i + del /q /s build\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% build/html + echo. + echo.Build finished. The HTML pages are in build/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% build/dirhtml + echo. + echo.Build finished. The HTML pages are in build/dirhtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% build/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% build/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% build/htmlhelp + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in build/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% build/qthelp + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in build/qthelp, like this: + echo.^> qcollectiongenerator build\qthelp\OpenLP.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile build\qthelp\OpenLP.ghc + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% build/latex + echo. + echo.Build finished; the LaTeX files are in build/latex. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% build/changes + echo. + echo.The overview file is in build/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% build/linkcheck + echo. + echo.Link check complete; look for any errors in the above output ^ +or in build/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% build/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in build/doctest/output.txt. + goto end +) + +:end diff --git a/documentation/manual/source/conf.py b/documentation/manual/source/conf.py index 6e9285aed..2e9c0a88f 100644 --- a/documentation/manual/source/conf.py +++ b/documentation/manual/source/conf.py @@ -42,7 +42,7 @@ master_doc = 'index' # General information about the project. project = u'OpenLP' -copyright = u'2010, Raoul Snyman' +copyright = u'2004 - 2011, Raoul Snyman' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -92,19 +92,30 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +if sys.argv[2] == 'qthelp' or sys.argv[2] == 'htmlhelp': + html_theme = 'openlp_qthelp' +else: + html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +if sys.argv[2] == 'html': + html_theme_options = { + 'sidebarbgcolor': '#3a60a9', + 'relbarbgcolor': '#203b6f', + 'footerbgcolor': '#26437c', + 'headtextcolor': '#203b6f', + 'linkcolor': '#26437c', + 'sidebarlinkcolor': '#ceceff' + } # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +html_theme_path = [os.path.join(os.path.abspath('..'), 'themes')] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +html_title = u'OpenLP 2.0 Reference Manual' # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None @@ -125,7 +136,7 @@ html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. @@ -165,7 +176,7 @@ html_static_path = ['_static'] #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'OpenLPdoc' +htmlhelp_basename = 'OpenLP' # -- Options for LaTeX output -------------------------------------------------- @@ -179,7 +190,7 @@ htmlhelp_basename = 'OpenLPdoc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'OpenLP.tex', u'OpenLP Documentation', + ('index', 'OpenLP.tex', u'OpenLP Reference Manual', u'Wesley Stout', 'manual'), ] @@ -212,6 +223,6 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'openlp', u'OpenLP Documentation', + ('index', 'openlp', u'OpenLP Reference Manual', [u'Wesley Stout'], 1) ] diff --git a/openlp.pyw b/openlp.pyw index 8d5a17a28..3f2199038 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -38,6 +38,7 @@ from traceback import format_exception from PyQt4 import QtCore, QtGui from openlp.core.lib import Receiver, check_directory_exists +from openlp.core.lib.ui import UiStrings from openlp.core.resources import qInitResources from openlp.core.ui.mainwindow import MainWindow from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm @@ -77,6 +78,13 @@ class OpenLP(QtGui.QApplication): class in order to provide the core of the application. """ + def exec_(self): + """ + Override exec method to allow the shared memory to be released on exit + """ + QtGui.QApplication.exec_() + self.sharedMemory.detach() + def run(self): """ Run the OpenLP application. @@ -107,7 +115,8 @@ class OpenLP(QtGui.QApplication): # make sure Qt really display the splash screen self.processEvents() # start the main app window - self.mainWindow = MainWindow(screens, self.clipboard()) + self.mainWindow = MainWindow(screens, self.clipboard(), + self.arguments()) self.mainWindow.show() if show_splash: # now kill the splashscreen @@ -122,6 +131,24 @@ class OpenLP(QtGui.QApplication): VersionThread(self.mainWindow).start() return self.exec_() + def isAlreadyRunning(self): + """ + Look to see if OpenLP is already running and ask if a 2nd copy + is to be started. + """ + self.sharedMemory = QtCore.QSharedMemory('OpenLP') + if self.sharedMemory.attach(): + status = QtGui.QMessageBox.critical(None, + UiStrings.Error, UiStrings.OpenLPStart, + QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) + if status == QtGui.QMessageBox.No: + return True + return False + else: + self.sharedMemory.create(1) + return False + def hookException(self, exctype, value, traceback): if not hasattr(self, u'mainWindow'): log.exception(''.join(format_exception(exctype, value, traceback))) @@ -194,6 +221,9 @@ def main(): qInitResources() # Now create and actually run the application. app = OpenLP(qt_args) + # Instance check + if app.isAlreadyRunning(): + sys.exit() app.setOrganizationName(u'OpenLP') app.setOrganizationDomain(u'openlp.org') app.setApplicationName(u'OpenLP') diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index a8034fbb6..bee195b0f 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -101,6 +101,10 @@ class EventReceiver(QtCore.QObject): ``servicemanager_previous_item`` Display the previous item in the service + ``servicemanager_preview_live`` + Requests a Preview item from the Service Manager to update live and + add a new item to the preview panel + ``servicemanager_next_item`` Display the next item in the service diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 67a05c6a1..c4361a421 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -85,7 +85,12 @@ body { } /* lyric css */ %s - +sup { + font-size:0.6em; + vertical-align:top; + position:relative; + top:-0.3em; +}