This commit is contained in:
Tim Bentley 2011-04-25 07:44:04 +01:00
commit 6e9459b63d
26 changed files with 344 additions and 123 deletions

View File

@ -21,20 +21,35 @@ You will see the Bible Importer window, click :guilabel:`Next`.
.. image:: pics/bibleimport01.png
After clicking :guilabel:`Next` you can select from the various types of
software that OpenLP will convert Bibles from.
After clicking :guilabel:`Next` you can select from the various types of
software that OpenLP will convert Bibles from. Click on the file folder icon to
choose the file(s) of the Bible database you want to import. See the sections
below for more information on the different formats that OpenLP will import.
Click :guilabel:`Next` to continue.
.. image:: pics/bibleimport02.png
Click on the file folder icon to choose the file of the Bible database you
want to import. See the following sections for information on the different
formats that OpenLP will import.
After selecting your file(s), you'll be asked to fill in the details of the
Bible you are importing. Remember to check what information you need to display
for your Bible's translation, as some of them have strict rules around the
copyright notice. Click :guilabel:`Next` to continue.
Importing from OpenLP Version 1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. image:: pics/bibleimportdetails1.png
Converting from OpenLP Version 1 is a simple process. First you will need to
locate your Version 1 Bibles.
After filling in the copyright details, OpenLP will start to import your Bible.
It may take some time to import your Bible so please be patient.
.. image:: pics/bibleimportfinished1.png
When the import has finished click :guilabel:`Finish` and you should be
ready to use your Bible in OpenLP.
Importing from openlp.org 1.x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Importing Bibles from openlp.org 1.x is a simple process. First you will need to
locate your version 1.x Bibles. Version 1.x Bibles have the `.bible` file
extension.
Windows XP::
@ -44,22 +59,15 @@ Windows Vista / Windows 7::
C:\ProgramData\openlp.org\Data\Bibles\
OpenLP Version 1 Bibles have the `.bible` file extension. After selecting
all of the OpenLP Version 1 Bibles you want to convert, click :guilabel:`Next`
.. image:: pics/bibleimportdetails1.png
Enter your Bible name and copyright details. Click :guilabel:`Next`. It may
take some time to convert your Bibles so please be patient.
.. image:: pics/bibleimportfinished1.png
When the import has finished click :guilabel:`Finish` and you should be
ready to use your OpenLP Version 1 Bibles.
After selecting all of the openlp.org 1.x Bibles you want to convert, click
:guilabel:`Next` to continue the import process.
Importing OSIS Bibles
^^^^^^^^^^^^^^^^^^^^^
Importing OSIS files is very simple. Select OSIS as your import source, select
your OSIS Bible file and continue the import process.
**About OSIS Formatted Bibles**
The OSIS XML standard was designed to provide a common format for distribution
@ -69,24 +77,11 @@ of electronic Bibles. More information can be found out at the `Bible Technologi
If you have any software installed that is part of the `Sword Project
<http://www.crosswire.org/sword/index.jsp>`_ it can be easily converted.
Importing OSIS files is very simple. Select your OSIS Bible file and click
:guilabel:`Next`
.. image:: pics/bibleimportdetails1.png
Enter you Bible name and copyright details. Click :guilabel:`Next`. It may take
some time to convert your Bibles so please be patient.
.. image:: pics/bibleimportfinished1.png
Click :guilabel:`Finish` and you should be ready to use your OpenLP Version
1 Bibles.
You can use the commands below convert Bibles from that software to OSIS format.
The following commands are used in all platforms and the commands are case
sensitive across all platforms. To convert a Bible using Command Prompt in
Windows or a Terminal in Linux or MAC you would type::
sensitive across all platforms. To convert a Bible using the command prompt in
Windows or a terminal in Linux or Mac OS X you would type::
mod2osis biblename > biblename.osis
@ -114,17 +109,9 @@ You may also import downloaded bibles from OpenSong. The process is the same,
except you will need to extract the bible from a zip file. This is usually done
by right clicking on the downloaded file and select `Extract` or `Extract Here`.
After selecting the OpenSong Bibles you want to convert, click :guilabel:`Next`
.. image:: pics/bibleimportdetails1.png
Enter your Bible name and copyright details. Click :guilabel:`Next`. It may
take some time to convert your Bibles so please be patient.
.. image:: pics/bibleimportfinished1.png
When the import has finished then click :guilabel:`Finish` and you should now be
ready to use your OpenSong Bibles.
After selecting the OpenSong Bibles you want to import, follow the rest of the
import process. When the import has finished you should be ready to use your
OpenSong Bibles.
Importing Web Download Bibles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -139,8 +126,6 @@ as another option and does require an internet connection.
To use the web download feature select web download from the import wizard.
.. image:: pics/bibleimport01.png
You can select from several options of location to download from and also
what Bible translation you need. You will probably want to choose the location
from where you get the best performance or has the translation you need.
@ -154,30 +139,20 @@ not be needed.
.. image:: pics/webbibleproxy1.png
After selecting your download location and the Bible you wish to use, click
:guilabel:`Next` When your import is completed click :guilabel:`Finish`
.. image:: pics/biblewebcomplete.png
You should now be ready to use the web bible.
:guilabel:`Next` to continue the import process. When your import is completed
you should now be ready to use the web bible.
Importing CSV formatted Bibles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you have a Bible in .csv format OpenLP can import it. CSV Bibles will
consist of two files a `books` file and a `verse` file.
Select CSV from the list of Bible types to import.
.. image:: pics/bibleimport02.png
consist of two files a `books` file and a `verse` file. Select CSV from the list
of Bible types to import.
You are now ready to select your .csv files. You will need to select both your
books and verse file location.
.. image:: pics/csvimport1.png
After you have selected the file locations you can click :guilabel:`Next`
.. image:: pics/bibleimportfinished1.png
Click :guilabel:`Finish` and you should now be ready to use your imported CSV
Bible
After you have selected the file locations you can continue with the import
process. Once it is complete you should be ready to use your imported CSV Bible.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -99,4 +99,134 @@ completed.
Press :guilabel:`Finish` and OpenLP will be ready to use your songs imported
from CCLI SongSelect.
Creating or editing a song slide
================================
If you want to create a new song slide or, once you have a song imported, you
want to edit and rearrange the Title & Lyrics, Author, Topics & Song Book,
assign a Theme, or edit Copyright Info & Comments, you will do this through the
`Song Editor`.
**Edit:** To edit an existing song you can either click on a song in the
`Media Manager` and then click the button to :guilabel:`Edit the selected song`
or right click a song from either the `Media Manager` or additionally from the
`Service Manager` and click :guilabel:`Edit item`. If you are adding a new song
click :guilabel:`Add a new Song` in the `Media Manager`.
.. image:: pics/song_edit_lyrics.png
**Title:** This is where you would name your song or edit a song name.
**Alternate title:**Alternate Title was for songs with two names
"Lord the Light" - "Shine Jesus Shine". You can also add a name in this box that
will bring up the song in Titles search. **Example:** You could use an alternate
title of "hymn" on all your hymn song titles for grouping. When you search "hymn"
it will show all the hymns that have "hymn" for the Alternate title.
**Lyrics:** The *Lyrics* window shows all lyrics imported or added. On the left
side of the lyrics you will see a capital letter followed by a number. A V1
would represent verse 1, C1 would be Chorus 1. You will use these letters and
numbers for the order to display the lyrics.
**Verse Order:** After you entered or edited your song, you will want OpenLP to
display the verses in the correct order you want them displayed. On the left side
of your lyrics you will see C1, V1, V2 etc. the way they were imported or added.
To put your lyrics in the correct order is as simple as typing in the
:guilabel:`Verse order box` at the bottom, the correct order you want them
displayed, with only a blank space in between each entry. The correct format will
look like this: V1 C1 V2 C1 V3 C1. If you forget to put a space in between the
order, or if you do not have the corresponding verse number, OpenLP will politely
tell you with a pop-up error message what is wrong so you can correct your
mistake and save it. Verse order is optional and if left blank the verses will
display in the order seen in *Lyrics*.
.. image:: pics/song_edit_verse_error.png
Adding or editing the lyrics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Add:** To Add a new verse, click on :guilabel:`Add`. The main window is where
you will type your lyrics. OpenLP is packaged with a spell checker for most
languages. If you misspell a word it will be underlined. Right click the
underlined word and left click *Spelling Suggestions* or you can ignore it and
continue typing. You also have the ability to format the font using *Formatting
Tags*. Highlight the word/words you want to format and right click the highlight.
Left click *Formatting Tags* and choose the format you want to apply to the font
and the format tags will be entered with your lyrics. These tags are not visible
when displayed. To remove the format, delete the tag on each end of the word or
sentence.
**Edit:** To edit an existing verse, click on the verse you wish to *Edit* then click on
:guilabel:`Edit`, make your changes and click :guilabel:`Save`.
**Edit All:** To edit the whole song at once, click on :guilabel:`Edit All`.
**Delete:** To delete a verse, click on the verse you want to delete and it will
highlight, click on the :guilabel:`Delete` button and it will be deleted.
**Warning:**, once you click the :guilabel:`Delete` button, you will not be
asked again, it will be deleted immediately.
.. image:: pics/song_edit_verse_type.png
**Verse type:** gives you 7 ways to classify your lyrics. Verse, Chorus, Bridge,
Pre-Chorus, Intro, Ending, Other.
If you have more than one verse, you would number them Verse 1, 2, 3 as needed.
If you find the verse has too many lines for your screen, you can edit and
shorten the verse and :guilabel:`Add` another slide.
Authors, Topics & Song Book
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Once your *Title & Lyrics* are added or edited the way you want them you must
add or enter the author or authors of the song. OpenLP requires all songs to
have an author entered. You can add a blank space for the author name.
.. image:: pics/song_edit_authors.png
**Authors:** Click the drop down arrow to view all authors or start typing a name
in the box and a list will appear. If the authors name has not been added, type
the authors name in the box and click :guilabel:`Add to Song`. The authors name
will appear below and will also be added to your database. If you accidently add
the wrong author you can click on the authors name and click :guilabel:`Remove`.
:guilabel:`Manage Authors, Topics, Song Books`: Clicking this button will bring
up your complete list of authors.
.. image:: pics/song_edit_maintenance.png
**Add:** Clicking the :guilabel:`Add` button will bring up a box where you will
add the Authors First name, Last name and Display name. Click :guilabel:`Save`
when you are finished.
.. image:: pics/song_edit_author_maintenance.png
**Edit:** The :guilabel:`Edit` button will bring up window where you can edit
the info that is already there.
**Delete:** The :guilabel:`Delete` button will remove the author you have
highlighted. Note: You cannot delete an author that is assigned to a song.
Authors names are displayed in the footer.
Theme, Copyright info & Comments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On this tab you can assign a *Theme* to a song, enter the *Copyright information*
and add the *CCLI number*. If you imported a song from SongSelect this
information will usually be entered.
.. image:: pics/song_edit_theme_copyright.png
**Theme:** Click the drop down arrow to display your list of themes or start
typing a theme name in the box and the list will appear. You can also create a
new theme by clicking the :guilabel:`New Theme` button.
**Copyright information:** Add or edit the copyright information in this box. If
you would like to use the © symbol click "guilabel:`©` button. This information
is displayed in the footer.
**CCLI number:** Enter the CCLI number in this box. Note: this is the CCLI number
of the song, not your contract number. This number is not displayed in the footer
**Comments:** You can add comments in this box. This information is not
dispayed in the footer.

View File

@ -159,14 +159,14 @@ class Plugin(QtCore.QObject):
self.status = PluginStatus.Inactive
# Set up logging
self.log = logging.getLogger(self.name)
self.previewController = pluginHelpers[u'preview']
self.liveController = pluginHelpers[u'live']
self.renderer = pluginHelpers[u'renderer']
self.serviceManager = pluginHelpers[u'service']
self.settingsForm = pluginHelpers[u'settings form']
self.mediadock = pluginHelpers[u'toolbox']
self.pluginManager = pluginHelpers[u'pluginmanager']
self.formparent = pluginHelpers[u'formparent']
self.previewController = plugin_helpers[u'preview']
self.liveController = plugin_helpers[u'live']
self.renderer = plugin_helpers[u'renderer']
self.serviceManager = plugin_helpers[u'service']
self.settingsForm = plugin_helpers[u'settings form']
self.mediadock = plugin_helpers[u'toolbox']
self.pluginManager = plugin_helpers[u'pluginmanager']
self.formparent = plugin_helpers[u'formparent']
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_add_service_item' % self.name),
self.processAddServiceEvent)

View File

@ -256,6 +256,7 @@ class Renderer(object):
"""
Builds a text block using the settings in ``theme``
and the size of the display screen.height.
Note the system has a 10 pixel border round the screen
``theme``
The theme to build a text block for.

View File

@ -323,7 +323,7 @@ def shortcut_action(parent, name, shortcuts, function, icon=None, checked=None,
action.setShortcutContext(context)
action_list = ActionList.get_instance()
action_list.add_action(action, category)
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), function)
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered(bool)'), function)
return action
def context_menu_action(base, icon, text, slot, shortcuts=None, category=None,
@ -356,7 +356,7 @@ def context_menu_action(base, icon, text, slot, shortcuts=None, category=None,
action = QtGui.QAction(text, base)
if icon:
action.setIcon(build_icon(icon))
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot)
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered(bool)'), slot)
if shortcuts is not None:
action.setShortcuts(shortcuts)
action.setShortcutContext(context)

View File

@ -140,6 +140,8 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
return FirstTimePage.Songs
elif self.currentId() == FirstTimePage.Progress:
return -1
elif self.currentId() == FirstTimePage.NoInternet:
return FirstTimePage.Progress
else:
return self.currentId() + 1
@ -147,11 +149,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard):
"""
Detects Page changes and updates as approprate.
"""
if pageId == FirstTimePage.NoInternet:
self.finishButton.setVisible(True)
self.finishButton.setEnabled(True)
self.nextButton.setVisible(False)
elif pageId == FirstTimePage.Defaults:
if pageId == FirstTimePage.Defaults:
self.themeComboBox.clear()
for iter in xrange(self.themesListWidget.count()):
item = self.themesListWidget.item(iter)

View File

@ -34,7 +34,7 @@ from PyQt4 import QtCore, QtGui, QtWebKit
from PyQt4.phonon import Phonon
from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \
build_icon, translate
translate
from openlp.core.ui import HideMode
@ -69,8 +69,6 @@ class MainDisplay(DisplayWidget):
self.hideMode = None
self.videoHide = False
self.override = {}
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
self.setWindowIcon(mainIcon)
self.retranslateUi()
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool |

View File

@ -71,7 +71,7 @@ class Ui_MainWindow(object):
mainWindow.setObjectName(u'MainWindow')
mainWindow.resize(self.settingsmanager.width,
self.settingsmanager.height)
mainWindow.setWindowIcon(build_icon(u':/icon/openlp-logo-16x16.png'))
mainWindow.setWindowIcon(build_icon(u':/icon/openlp-logo-64x64.png'))
mainWindow.setDockNestingEnabled(True)
# Set up the main container, which contains all the other form widgets.
self.MainContent = QtGui.QWidget(mainWindow)
@ -896,7 +896,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def toggleThemeManager(self):
self.themeManagerDock.setVisible(not self.themeManagerDock.isVisible())
def setPreviewPanelVisibility(self, visible=None):
def setPreviewPanelVisibility(self, visible):
"""
Sets the visibility of the preview panel including saving the setting
and updating the menu.
@ -906,14 +906,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
True - Visible
False - Hidden
"""
if visible is None:
visible = self.ViewPreviewPanel.isVisible()
self.previewController.panel.setVisible(visible)
QtCore.QSettings().setValue(u'user interface/preview panel',
QtCore.QVariant(visible))
self.ViewPreviewPanel.setChecked(visible)
def setLivePanelVisibility(self, visible=None):
def setLivePanelVisibility(self, visible):
"""
Sets the visibility of the live panel including saving the setting and
updating the menu.
@ -923,8 +921,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
True - Visible
False - Hidden
"""
if visible is None:
visible = self.ViewLivePanel.isVisible()
self.liveController.panel.setVisible(visible)
QtCore.QSettings().setValue(u'user interface/live panel',
QtCore.QVariant(visible))
@ -1011,4 +1007,4 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.recentFiles.insert(0, QtCore.QString(filename))
while self.recentFiles.count() > maxRecentFiles:
# Don't care what API says takeLast works, removeLast doesn't!
self.recentFiles.takeLast()
self.recentFiles.takeLast()

View File

@ -347,7 +347,8 @@ class ServiceManager(QtGui.QWidget):
has been modified.
"""
self._modified = modified
serviceFile = self.shortFileName() or u'Untitled Service'
serviceFile = self.shortFileName() or translate(
'OpenLP.ServiceManager', 'Untitled Service')
self.mainwindow.setServiceModified(modified, serviceFile)
def isModified(self):
@ -614,7 +615,7 @@ class ServiceManager(QtGui.QWidget):
u'%s' % fileName)
QtGui.QMessageBox.information(self,
translate('OpenLP.ServiceManager', 'Corrupt File'),
translate('OpenLP.ServiceManager', 'This file is either'
translate('OpenLP.ServiceManager', 'This file is either '
'corrupt or not an OpenLP 2.0 service file.'))
return
finally:

View File

@ -75,6 +75,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
Add a tab to the form at a specific location
"""
log.debug(u'Inserting %s tab' % tab.tabTitle)
# add the tab to get it to display in the correct part of the screen
pos = self.stackedLayout.addWidget(tab)
if is_active:
item_name = QtGui.QListWidgetItem(tab.tabTitleVisible)
@ -82,7 +83,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
item_name.setIcon(icon)
self.settingListWidget.insertItem(location, item_name)
else:
self.stackedLayout.takeAt(location)
# then remove tab to stop the UI displaying it even if
# it is not required.
self.stackedLayout.takeAt(pos)
def accept(self):
"""

View File

@ -280,6 +280,8 @@ class ThemeManager(QtGui.QWidget):
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
if self.fileRenameForm.exec_():
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
if oldThemeName == newThemeName:
return
if self.checkIfThemeExists(newThemeName):
oldThemeData = self.getThemeData(oldThemeName)
self.cloneThemeData(oldThemeData, newThemeName)
@ -333,6 +335,7 @@ class ThemeManager(QtGui.QWidget):
self.oldBackgroundImage = theme.background_filename
self.themeForm.theme = theme
self.themeForm.exec_(True)
self.oldBackgroundImage = None
def onDeleteTheme(self):
"""

View File

@ -61,6 +61,12 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
QtCore.QObject.connect(self.alertListWidget,
QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
def exec_(self):
self.displayButton.setEnabled(False)
self.displayCloseButton.setEnabled(False)
self.alertTextEdit.setText(u'')
return QtGui.QDialog.exec_(self)
def loadList(self):
"""
Loads the list with alerts.
@ -125,6 +131,12 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
# Only enable the button, if we are editing an item.
if self.item_id:
self.saveButton.setEnabled(True)
if self.alertTextEdit.text():
self.displayButton.setEnabled(True)
self.displayCloseButton.setEnabled(True)
else:
self.displayButton.setEnabled(False)
self.displayCloseButton.setEnabled(False)
def onDoubleClick(self):
"""

View File

@ -27,6 +27,8 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <io.h>
#include <direct.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -88,7 +90,12 @@ DllExport BOOL CheckInstalled()
char cmdLine[MAX_PATH * 2];
DEBUG("CheckInstalled\n");
return GetPPTViewerPath(cmdLine, sizeof(cmdLine));
BOOL found = GetPPTViewerPath(cmdLine, sizeof(cmdLine));
if(found)
{
DEBUG("Exe: %s\n", cmdLine);
}
return found;
}
// Open the PointPoint, count the slides and take a snapshot of each slide
@ -160,7 +167,7 @@ DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect,
pptView[id].rect.bottom = rect.bottom;
pptView[id].rect.right = rect.right;
}
strcat_s(cmdLine, MAX_PATH * 2, "/F /S \"");
strcat_s(cmdLine, MAX_PATH * 2, " /F /S \"");
strcat_s(cmdLine, MAX_PATH * 2, filename);
strcat_s(cmdLine, MAX_PATH * 2, "\"");
memset(&si, 0, sizeof(si));
@ -189,7 +196,7 @@ DllExport int OpenPPT(char *filename, HWND hParentWnd, RECT rect,
Sleep(10);
if (!CreateProcess(NULL, cmdLine, NULL, NULL, FALSE, 0, 0, NULL, &si, &pi))
{
DEBUG("OpenPPT: CreateProcess failed\n");
DEBUG("OpenPPT: CreateProcess failed: %s\n", cmdLine);
ClosePPT(id);
return -1;
}
@ -344,16 +351,71 @@ BOOL SavePPTInfo(int id)
// Get the path of the PowerPoint viewer from the registry
BOOL GetPPTViewerPath(char *pptViewerPath, int stringSize)
{
char cwd[MAX_PATH];
DEBUG("GetPPTViewerPath: start\n");
if(GetPPTViewerPathFromReg(pptViewerPath, stringSize))
{
if(_access(pptViewerPath, 0) != -1)
{
DEBUG("GetPPTViewerPath: exit registry\n");
return TRUE;
}
}
// This is where it gets ugly. PPT2007 it seems no longer stores its
// location in the registry. So we have to use the defaults which will
// upset those who like to put things somewhere else
// Viewer 2007 in 64bit Windows:
if(_access("C:\\Program Files (x86)\\Microsoft Office\\Office12\\PPTVIEW.EXE",
0) != -1)
{
strcpy_s(
"C:\\Program Files (x86)\\Microsoft Office\\Office12\\PPTVIEW.EXE",
stringSize, pptViewerPath);
DEBUG("GetPPTViewerPath: exit 64bit 2007\n");
return TRUE;
}
// Viewer 2007 in 32bit Windows:
if(_access("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE", 0)
!= -1)
{
strcpy_s("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE",
stringSize, pptViewerPath);
DEBUG("GetPPTViewerPath: exit 32bit 2007\n");
return TRUE;
}
// Give them the opportunity to place it in the same folder as the app
_getcwd(cwd, MAX_PATH);
strcat_s(cwd, MAX_PATH, "\\PPTVIEW.EXE");
if(_access(cwd, 0) != -1)
{
strcpy_s(pptViewerPath, stringSize, cwd);
DEBUG("GetPPTViewerPath: exit local\n");
return TRUE;
}
DEBUG("GetPPTViewerPath: exit fail\n");
return FALSE;
}
BOOL GetPPTViewerPathFromReg(char *pptViewerPath, int stringSize)
{
HKEY hKey;
DWORD dwType, dwSize;
LRESULT lResult;
DEBUG("GetPPTViewerPath: start\n");
// The following registry settings are for, respectively, (I think)
// PPT Viewer 2007 (older versions. Latest not in registry) & PPT Viewer 2010
// PPT Viewer 2003 (recent versions)
// PPT Viewer 2003 (older versions)
// PPT Viewer 97
if ((RegOpenKeyEx(HKEY_CLASSES_ROOT,
"PowerPointViewer.Show.12\\shell\\Show\\command", 0, KEY_READ, &hKey)
!= ERROR_SUCCESS)
&& (RegOpenKeyEx(HKEY_CLASSES_ROOT,
"PowerPointViewer.Show.11\\shell\\Show\\command", 0, KEY_READ, &hKey)
!= ERROR_SUCCESS)
&& (RegOpenKeyEx(HKEY_CLASSES_ROOT,
"Applications\\PPTVIEW.EXE\\shell\\open\\command", 0, KEY_READ, &hKey)
!= ERROR_SUCCESS)
&& (RegOpenKeyEx(HKEY_CLASSES_ROOT,
@ -373,7 +435,6 @@ BOOL GetPPTViewerPath(char *pptViewerPath, int stringSize)
}
// remove "%1" from end of key value
pptViewerPath[strlen(pptViewerPath) - 4] = '\0';
DEBUG("GetPPTViewerPath: exit ok\n");
return TRUE;
}

View File

@ -49,6 +49,7 @@ LRESULT CALLBACK CbtProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK CwpProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
BOOL GetPPTViewerPath(char *pptViewerPath, int stringSize);
BOOL GetPPTViewerPathFromReg(char *pptViewerPath, int stringSize);
HBITMAP CaptureWindow(HWND hWnd);
VOID SaveBitmap(CHAR* filename, HBITMAP hBmp) ;
VOID CaptureAndSaveWindow(HWND hWnd, CHAR* filename);

View File

@ -65,10 +65,12 @@ class SongsPlugin(Plugin):
def initialise(self):
log.info(u'Songs Initialising')
Plugin.initialise(self)
self.songImportItem.setVisible(True)
self.songExportItem.setVisible(True)
self.toolsReindexItem.setVisible(True)
action_list = ActionList.get_instance()
action_list.add_action(self.SongImportItem, UiStrings().Import)
action_list.add_action(self.SongExportItem, UiStrings().Export)
action_list.add_action(self.songImportItem, UiStrings().Import)
action_list.add_action(self.songExportItem, UiStrings().Export)
action_list.add_action(self.toolsReindexItem, UiStrings().Tools)
def addImportMenuItem(self, import_menu):
@ -81,13 +83,13 @@ class SongsPlugin(Plugin):
use it as their parent.
"""
# Main song import menu item - will eventually be the only one
self.SongImportItem = base_action(import_menu, u'SongImportItem')
self.SongImportItem.setText(translate('SongsPlugin', '&Song'))
self.SongImportItem.setToolTip(translate('SongsPlugin',
self.songImportItem = base_action(import_menu, u'songImportItem')
self.songImportItem.setText(translate('SongsPlugin', '&Song'))
self.songImportItem.setToolTip(translate('SongsPlugin',
'Import songs using the import wizard.'))
import_menu.addAction(self.SongImportItem)
import_menu.addAction(self.songImportItem)
# Signals and slots
QtCore.QObject.connect(self.SongImportItem,
QtCore.QObject.connect(self.songImportItem,
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
def addExportMenuItem(self, export_menu):
@ -100,13 +102,13 @@ class SongsPlugin(Plugin):
use it as their parent.
"""
# Main song import menu item - will eventually be the only one
self.SongExportItem = base_action(export_menu, u'SongExportItem')
self.SongExportItem.setText(translate('SongsPlugin', '&Song'))
self.SongExportItem.setToolTip(translate('SongsPlugin',
self.songExportItem = base_action(export_menu, u'songExportItem')
self.songExportItem.setText(translate('SongsPlugin', '&Song'))
self.songExportItem.setToolTip(translate('SongsPlugin',
'Exports songs using the export wizard.'))
export_menu.addAction(self.SongExportItem)
export_menu.addAction(self.songExportItem)
# Signals and slots
QtCore.QObject.connect(self.SongExportItem,
QtCore.QObject.connect(self.songExportItem,
QtCore.SIGNAL(u'triggered()'), self.onSongExportItemClicked)
def addToolsMenuItem(self, tools_menu):
@ -256,9 +258,12 @@ class SongsPlugin(Plugin):
"""
log.info(u'Songs Finalising')
self.manager.finalise()
self.songImportItem.setVisible(False)
self.songExportItem.setVisible(False)
self.toolsReindexItem.setVisible(False)
action_list = ActionList.get_instance()
action_list.remove_action(self.SongImportItem, UiStrings().Import)
action_list.remove_action(self.SongExportItem, UiStrings().Export)
action_list.remove_action(self.songImportItem, UiStrings().Import)
action_list.remove_action(self.songExportItem, UiStrings().Export)
action_list.remove_action(self.toolsReindexItem, UiStrings().Tools)
Plugin.finalise(self)
Plugin.finalise(self)

View File

@ -52,6 +52,12 @@ UPX
http://upx.sourceforge.net/, extract it into C:\%PROGRAMFILES%\UPX, and then
add that directory to your PATH environment variable.
Sphinx
This is used to build the documentation
HTML Help Workshop
This is used to create the help file
PyInstaller
PyInstaller should be a checkout of revision 844 of trunk, and in a
directory called, "pyinstaller" on the same level as OpenLP's Bazaar shared
@ -81,6 +87,10 @@ OpenLP
shared repository directory. This means your code should be in a directory
structure like this: "openlp\branch-name".
Visual C++ 2008 Express Edition
This is to build pptviewlib.dll, the library for controlling the
PowerPointViewer
windows-builder.py
This script, of course. It should be in the "scripts" directory of OpenLP.
@ -98,6 +108,8 @@ sphinx_exe = os.path.join(os.path.split(python_exe)[0], u'Scripts',
u'sphinx-build.exe')
hhc_exe = os.path.join(os.getenv(u'PROGRAMFILES'), 'HTML Help Workshop',
u'hhc.exe')
vcbuild_exe = os.path.join(os.getenv(u'PROGRAMFILES'),
u'Microsoft Visual Studio 9.0', u'VC', u'vcpackages', u'vcbuild.exe')
# Base paths
script_path = os.path.split(os.path.abspath(__file__))[0]
@ -119,6 +131,8 @@ winres_path = os.path.join(branch_path, u'resources', u'windows')
build_path = os.path.join(branch_path, u'build', u'pyi.win32', u'OpenLP')
dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
enchant_path = os.path.join(site_packages, u'enchant')
pptviewlib_path = os.path.join(source_path, u'plugins', u'presentations',
u'lib', u'pptviewlib')
def update_code():
os.chdir(branch_path)
@ -264,17 +278,40 @@ def run_innosetup():
if code != 0:
raise Exception(u'Error running Inno Setup')
def build_pptviewlib():
print u'Building PPTVIEWLIB.DLL...'
vcbuild = Popen((vcbuild_exe, u'/rebuild',
os.path.join(pptviewlib_path, u'pptviewlib.vcproj'), u'Release|Win32'))
code = vcbuild.wait()
if code != 0:
raise Exception(u'Error building pptviewlib.dll')
copy(os.path.join(pptviewlib_path, u'Release', u'pptviewlib.dll'),
pptviewlib_path)
def main():
skip_update = False
import sys
if len(sys.argv) > 1 and (sys.argv[1] == u'-v' or sys.argv[1] == u'--verbose'):
print "Script path:", script_path
print "Branch path:", branch_path
print "Source path:", source_path
print "\"dist\" path:", dist_path
print "PyInstaller:", pyi_build
print "Inno Setup path:", innosetup_path
print "Windows resources:", winres_path
update_code()
for arg in sys.argv:
if arg == u'-v' or arg == u'--verbose':
print "Script path:", script_path
print "Branch path:", branch_path
print "Source path:", source_path
print "\"dist\" path:", dist_path
print "PyInstaller:", pyi_build
print "Inno Setup path:", innosetup_exe
print "Windows resources:", winres_path
print "VCBuild path:", vcbuild_exe
print "PPTVIEWLIB path:", pptviewlib_path
elif arg == u'--skip-update':
skip_update = True
elif arg == u'/?' or arg == u'-h' or arg == u'--help':
print u'Command options:'
print u' -v --verbose : More verbose output'
print u' --skip-update : Do not update or revert current branch'
exit()
if not skip_update:
update_code()
build_pptviewlib()
run_pyinstaller()
write_version_file()
copy_enchant()