forked from openlp/openlp
r1673
This commit is contained in:
commit
b68751835f
|
@ -65,6 +65,12 @@ MEDIA_MANAGER_STYLE = """
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
PROGRESSBAR_STYLE = """
|
||||||
|
QProgressBar{
|
||||||
|
height: 10px;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
class Ui_MainWindow(object):
|
class Ui_MainWindow(object):
|
||||||
def setupUi(self, mainWindow):
|
def setupUi(self, mainWindow):
|
||||||
"""
|
"""
|
||||||
|
@ -130,6 +136,7 @@ class Ui_MainWindow(object):
|
||||||
self.statusBar.addPermanentWidget(self.loadProgressBar)
|
self.statusBar.addPermanentWidget(self.loadProgressBar)
|
||||||
self.loadProgressBar.hide()
|
self.loadProgressBar.hide()
|
||||||
self.loadProgressBar.setValue(0)
|
self.loadProgressBar.setValue(0)
|
||||||
|
self.loadProgressBar.setStyleSheet(PROGRESSBAR_STYLE)
|
||||||
self.defaultThemeLabel = QtGui.QLabel(self.statusBar)
|
self.defaultThemeLabel = QtGui.QLabel(self.statusBar)
|
||||||
self.defaultThemeLabel.setObjectName(u'defaultThemeLabel')
|
self.defaultThemeLabel.setObjectName(u'defaultThemeLabel')
|
||||||
self.statusBar.addPermanentWidget(self.defaultThemeLabel)
|
self.statusBar.addPermanentWidget(self.defaultThemeLabel)
|
||||||
|
@ -276,6 +283,18 @@ class Ui_MainWindow(object):
|
||||||
self.helpAboutItem = shortcut_action(mainWindow, u'helpAboutItem',
|
self.helpAboutItem = shortcut_action(mainWindow, u'helpAboutItem',
|
||||||
[QtGui.QKeySequence(u'Ctrl+F1')], self.onHelpAboutItemClicked,
|
[QtGui.QKeySequence(u'Ctrl+F1')], self.onHelpAboutItemClicked,
|
||||||
u':/system/system_about.png', category=UiStrings().Help)
|
u':/system/system_about.png', category=UiStrings().Help)
|
||||||
|
if os.name == u'nt':
|
||||||
|
self.localHelpFile = os.path.join(
|
||||||
|
AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm')
|
||||||
|
self.helpLocalHelpItem = shortcut_action(
|
||||||
|
mainWindow, u'helpLocalHelpItem', [QtGui.QKeySequence(u'F1')],
|
||||||
|
self.onHelpLocalHelpClicked, u':/system/system_about.png',
|
||||||
|
category=UiStrings().Help)
|
||||||
|
self.helpOnlineHelpItem = shortcut_action(
|
||||||
|
mainWindow, u'helpOnlineHelpItem', [QtGui.QKeySequence(u'Alt+F1')],
|
||||||
|
self.onHelpOnlineHelpClicked, u':/system/system_online_help.png',
|
||||||
|
category=UiStrings().Help)
|
||||||
|
else:
|
||||||
self.helpOnlineHelpItem = shortcut_action(
|
self.helpOnlineHelpItem = shortcut_action(
|
||||||
mainWindow, u'helpOnlineHelpItem', [QtGui.QKeySequence(u'F1')],
|
mainWindow, u'helpOnlineHelpItem', [QtGui.QKeySequence(u'F1')],
|
||||||
self.onHelpOnlineHelpClicked, u':/system/system_online_help.png',
|
self.onHelpOnlineHelpClicked, u':/system/system_online_help.png',
|
||||||
|
@ -314,9 +333,14 @@ class Ui_MainWindow(object):
|
||||||
add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
|
add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
|
||||||
add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
|
add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
|
||||||
add_actions(self.toolsMenu, [self.updateThemeImages])
|
add_actions(self.toolsMenu, [self.updateThemeImages])
|
||||||
add_actions(self.helpMenu, (self.helpDocumentationItem,
|
add_actions(self.helpMenu, (self.helpDocumentationItem, None))
|
||||||
|
if os.name == u'nt':
|
||||||
|
add_actions(self.helpMenu, (self.helpLocalHelpItem,
|
||||||
self.helpOnlineHelpItem, None, self.helpWebSiteItem,
|
self.helpOnlineHelpItem, None, self.helpWebSiteItem,
|
||||||
self.helpAboutItem))
|
self.helpAboutItem))
|
||||||
|
else:
|
||||||
|
add_actions(self.helpMenu, (self.helpOnlineHelpItem, None,
|
||||||
|
self.helpWebSiteItem, self.helpAboutItem))
|
||||||
add_actions(self.menuBar, (self.fileMenu.menuAction(),
|
add_actions(self.menuBar, (self.fileMenu.menuAction(),
|
||||||
self.viewMenu.menuAction(), self.toolsMenu.menuAction(),
|
self.viewMenu.menuAction(), self.toolsMenu.menuAction(),
|
||||||
self.settingsMenu.menuAction(), self.helpMenu.menuAction()))
|
self.settingsMenu.menuAction(), self.helpMenu.menuAction()))
|
||||||
|
@ -437,6 +461,9 @@ class Ui_MainWindow(object):
|
||||||
self.helpAboutItem.setText(translate('OpenLP.MainWindow', '&About'))
|
self.helpAboutItem.setText(translate('OpenLP.MainWindow', '&About'))
|
||||||
self.helpAboutItem.setStatusTip(
|
self.helpAboutItem.setStatusTip(
|
||||||
translate('OpenLP.MainWindow', 'More information about OpenLP'))
|
translate('OpenLP.MainWindow', 'More information about OpenLP'))
|
||||||
|
if os.name == u'nt':
|
||||||
|
self.helpLocalHelpItem.setText(
|
||||||
|
translate('OpenLP.MainWindow', '&Help'))
|
||||||
self.helpOnlineHelpItem.setText(
|
self.helpOnlineHelpItem.setText(
|
||||||
translate('OpenLP.MainWindow', '&Online Help'))
|
translate('OpenLP.MainWindow', '&Online Help'))
|
||||||
self.helpWebSiteItem.setText(
|
self.helpWebSiteItem.setText(
|
||||||
|
@ -735,6 +762,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
import webbrowser
|
import webbrowser
|
||||||
webbrowser.open_new(u'http://openlp.org/')
|
webbrowser.open_new(u'http://openlp.org/')
|
||||||
|
|
||||||
|
def onHelpLocalHelpClicked(self):
|
||||||
|
"""
|
||||||
|
Load the local OpenLP help file
|
||||||
|
"""
|
||||||
|
os.startfile(self.localHelpFile)
|
||||||
|
|
||||||
def onHelpOnlineHelpClicked(self):
|
def onHelpOnlineHelpClicked(self):
|
||||||
"""
|
"""
|
||||||
Load the online OpenLP manual
|
Load the online OpenLP manual
|
||||||
|
@ -1030,6 +1063,13 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
self.restoreGeometry(
|
self.restoreGeometry(
|
||||||
settings.value(u'main window geometry').toByteArray())
|
settings.value(u'main window geometry').toByteArray())
|
||||||
self.restoreState(settings.value(u'main window state').toByteArray())
|
self.restoreState(settings.value(u'main window state').toByteArray())
|
||||||
|
self.liveController.splitter.restoreState(
|
||||||
|
settings.value(u'live splitter geometry').toByteArray())
|
||||||
|
self.previewController.splitter.restoreState(
|
||||||
|
settings.value(u'preview splitter geometry').toByteArray())
|
||||||
|
self.controlSplitter.restoreState(
|
||||||
|
settings.value(u'mainwindow splitter geometry').toByteArray())
|
||||||
|
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def saveSettings(self):
|
def saveSettings(self):
|
||||||
|
@ -1050,6 +1090,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
QtCore.QVariant(self.saveState()))
|
QtCore.QVariant(self.saveState()))
|
||||||
settings.setValue(u'main window geometry',
|
settings.setValue(u'main window geometry',
|
||||||
QtCore.QVariant(self.saveGeometry()))
|
QtCore.QVariant(self.saveGeometry()))
|
||||||
|
settings.setValue(u'live splitter geometry',
|
||||||
|
QtCore.QVariant(self.liveController.splitter.saveState()))
|
||||||
|
settings.setValue(u'preview splitter geometry',
|
||||||
|
QtCore.QVariant(self.previewController.splitter.saveState()))
|
||||||
|
settings.setValue(u'mainwindow splitter geometry',
|
||||||
|
QtCore.QVariant(self.controlSplitter.saveState()))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
def updateFileMenu(self):
|
def updateFileMenu(self):
|
||||||
|
|
|
@ -35,6 +35,8 @@ class Ui_ServiceItemEditDialog(object):
|
||||||
def setupUi(self, serviceItemEditDialog):
|
def setupUi(self, serviceItemEditDialog):
|
||||||
serviceItemEditDialog.setObjectName(u'serviceItemEditDialog')
|
serviceItemEditDialog.setObjectName(u'serviceItemEditDialog')
|
||||||
self.dialogLayout = QtGui.QGridLayout(serviceItemEditDialog)
|
self.dialogLayout = QtGui.QGridLayout(serviceItemEditDialog)
|
||||||
|
self.dialogLayout.setContentsMargins(8, 8, 8, 8)
|
||||||
|
self.dialogLayout.setSpacing(8)
|
||||||
self.dialogLayout.setObjectName(u'dialogLayout')
|
self.dialogLayout.setObjectName(u'dialogLayout')
|
||||||
self.listWidget = QtGui.QListWidget(serviceItemEditDialog)
|
self.listWidget = QtGui.QListWidget(serviceItemEditDialog)
|
||||||
self.listWidget.setAlternatingRowColors(True)
|
self.listWidget.setAlternatingRowColors(True)
|
||||||
|
|
|
@ -688,7 +688,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
QtGui.QAction, serviceItem[u'service_item'].theme)
|
QtGui.QAction, serviceItem[u'service_item'].theme)
|
||||||
if themeAction is not None:
|
if themeAction is not None:
|
||||||
themeAction.setChecked(True)
|
themeAction.setChecked(True)
|
||||||
action = self.menu.exec_(self.serviceManagerList.mapToGlobal(point))
|
self.menu.exec_(self.serviceManagerList.mapToGlobal(point))
|
||||||
|
|
||||||
def onServiceItemNoteForm(self):
|
def onServiceItemNoteForm(self):
|
||||||
item = self.findServiceItem()[0]
|
item = self.findServiceItem()[0]
|
||||||
|
@ -832,7 +832,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
for item in self.serviceItems:
|
for item in self.serviceItems:
|
||||||
item[u'expanded'] = False
|
item[u'expanded'] = False
|
||||||
self.regenerateServiceItems()
|
self.serviceManagerList.collapseAll()
|
||||||
|
|
||||||
def collapsed(self, item):
|
def collapsed(self, item):
|
||||||
"""
|
"""
|
||||||
|
@ -848,7 +848,7 @@ class ServiceManager(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
for item in self.serviceItems:
|
for item in self.serviceItems:
|
||||||
item[u'expanded'] = True
|
item[u'expanded'] = True
|
||||||
self.regenerateServiceItems()
|
self.serviceManagerList.expandAll()
|
||||||
|
|
||||||
def expanded(self, item):
|
def expanded(self, item):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -49,6 +49,8 @@ class ServiceNoteForm(QtGui.QDialog):
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'serviceNoteEdit')
|
self.setObjectName(u'serviceNoteEdit')
|
||||||
self.dialogLayout = QtGui.QVBoxLayout(self)
|
self.dialogLayout = QtGui.QVBoxLayout(self)
|
||||||
|
self.dialogLayout.setContentsMargins(8, 8, 8, 8)
|
||||||
|
self.dialogLayout.setSpacing(8)
|
||||||
self.dialogLayout.setObjectName(u'verticalLayout')
|
self.dialogLayout.setObjectName(u'verticalLayout')
|
||||||
self.textEdit = QtGui.QTextEdit(self)
|
self.textEdit = QtGui.QTextEdit(self)
|
||||||
self.textEdit.setObjectName(u'textEdit')
|
self.textEdit.setObjectName(u'textEdit')
|
||||||
|
|
|
@ -39,7 +39,8 @@ from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \
|
||||||
check_directory_exists
|
check_directory_exists
|
||||||
from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \
|
from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \
|
||||||
BackgroundGradientType
|
BackgroundGradientType
|
||||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
|
||||||
|
context_menu_action, context_menu_separator
|
||||||
from openlp.core.theme import Theme
|
from openlp.core.theme import Theme
|
||||||
from openlp.core.ui import FileRenameForm, ThemeForm
|
from openlp.core.ui import FileRenameForm, ThemeForm
|
||||||
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \
|
||||||
|
@ -104,25 +105,29 @@ class ThemeManager(QtGui.QWidget):
|
||||||
self.contextMenu)
|
self.contextMenu)
|
||||||
# build the context menu
|
# build the context menu
|
||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
self.editAction = self.menu.addAction(
|
self.editAction = context_menu_action(
|
||||||
translate('OpenLP.ThemeManager', '&Edit Theme'))
|
self.menu, u':/themes/theme_edit.png',
|
||||||
self.editAction.setIcon(build_icon(u':/themes/theme_edit.png'))
|
translate('OpenLP.ThemeManager', '&Edit Theme'), self.onEditTheme)
|
||||||
self.copyAction = self.menu.addAction(
|
self.copyAction = context_menu_action(
|
||||||
translate('OpenLP.ThemeManager', '&Copy Theme'))
|
self.menu, u':/themes/theme_edit.png',
|
||||||
self.copyAction.setIcon(build_icon(u':/themes/theme_edit.png'))
|
translate('OpenLP.ThemeManager', '&Copy Theme'), self.onCopyTheme)
|
||||||
self.renameAction = self.menu.addAction(
|
self.renameAction = context_menu_action(
|
||||||
translate('OpenLP.ThemeManager', '&Rename Theme'))
|
self.menu, u':/themes/theme_edit.png',
|
||||||
self.renameAction.setIcon(build_icon(u':/themes/theme_edit.png'))
|
translate('OpenLP.ThemeManager', '&Rename Theme'),
|
||||||
self.deleteAction = self.menu.addAction(
|
self.onRenameTheme)
|
||||||
translate('OpenLP.ThemeManager', '&Delete Theme'))
|
self.deleteAction = context_menu_action(
|
||||||
self.deleteAction.setIcon(build_icon(u':/general/general_delete.png'))
|
self.menu, u':/general/general_delete.png',
|
||||||
self.separator = self.menu.addSeparator()
|
translate('OpenLP.ThemeManager', '&Delete Theme'),
|
||||||
self.globalAction = self.menu.addAction(
|
self.onDeleteTheme)
|
||||||
translate('OpenLP.ThemeManager', 'Set As &Global Default'))
|
context_menu_separator(self.menu)
|
||||||
self.globalAction.setIcon(build_icon(u':/general/general_export.png'))
|
self.globalAction = context_menu_action(
|
||||||
self.exportAction = self.menu.addAction(
|
self.menu, u':/general/general_export.png',
|
||||||
translate('OpenLP.ThemeManager', '&Export Theme'))
|
translate('OpenLP.ThemeManager', 'Set As &Global Default'),
|
||||||
self.exportAction.setIcon(build_icon(u':/general/general_export.png'))
|
self.changeGlobalFromScreen)
|
||||||
|
self.exportAction = context_menu_action(
|
||||||
|
self.menu, u':/general/general_export.png',
|
||||||
|
translate('OpenLP.ThemeManager', '&Export Theme'),
|
||||||
|
self.onExportTheme)
|
||||||
# Signals
|
# Signals
|
||||||
QtCore.QObject.connect(self.themeListWidget,
|
QtCore.QObject.connect(self.themeListWidget,
|
||||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||||
|
@ -198,19 +203,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
self.deleteAction.setVisible(True)
|
self.deleteAction.setVisible(True)
|
||||||
self.renameAction.setVisible(True)
|
self.renameAction.setVisible(True)
|
||||||
self.globalAction.setVisible(True)
|
self.globalAction.setVisible(True)
|
||||||
action = self.menu.exec_(self.themeListWidget.mapToGlobal(point))
|
self.menu.exec_(self.themeListWidget.mapToGlobal(point))
|
||||||
if action == self.editAction:
|
|
||||||
self.onEditTheme()
|
|
||||||
if action == self.copyAction:
|
|
||||||
self.onCopyTheme()
|
|
||||||
if action == self.renameAction:
|
|
||||||
self.onRenameTheme()
|
|
||||||
if action == self.deleteAction:
|
|
||||||
self.onDeleteTheme()
|
|
||||||
if action == self.globalAction:
|
|
||||||
self.changeGlobalFromScreen()
|
|
||||||
if action == self.exportAction:
|
|
||||||
self.onExportTheme()
|
|
||||||
|
|
||||||
def changeGlobalFromTab(self, themeName):
|
def changeGlobalFromTab(self, themeName):
|
||||||
"""
|
"""
|
||||||
|
@ -298,11 +291,10 @@ class ThemeManager(QtGui.QWidget):
|
||||||
Copies an existing theme to a new name
|
Copies an existing theme to a new name
|
||||||
"""
|
"""
|
||||||
item = self.themeListWidget.currentItem()
|
item = self.themeListWidget.currentItem()
|
||||||
oldThemeName = unicode(
|
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
translate('OpenLP.ThemeManager', 'Copy of %s',
|
self.fileRenameForm.fileNameEdit.setText(
|
||||||
'Copy of <theme name>')) % unicode(
|
unicode(translate('OpenLP.ThemeManager',
|
||||||
item.data(QtCore.Qt.UserRole).toString())
|
'Copy of %s','Copy of <theme name>')) % oldThemeName)
|
||||||
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
|
||||||
if self.fileRenameForm.exec_(True):
|
if self.fileRenameForm.exec_(True):
|
||||||
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
||||||
if self.checkIfThemeExists(newThemeName):
|
if self.checkIfThemeExists(newThemeName):
|
||||||
|
|
|
@ -93,7 +93,6 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
||||||
self.titleEdit.setText(u'')
|
self.titleEdit.setText(u'')
|
||||||
self.creditEdit.setText(u'')
|
self.creditEdit.setText(u'')
|
||||||
self.themeComboBox.setCurrentIndex(0)
|
self.themeComboBox.setCurrentIndex(0)
|
||||||
self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason)
|
|
||||||
else:
|
else:
|
||||||
self.customSlide = self.manager.get_object(CustomSlide, id)
|
self.customSlide = self.manager.get_object(CustomSlide, id)
|
||||||
self.titleEdit.setText(self.customSlide.title)
|
self.titleEdit.setText(self.customSlide.title)
|
||||||
|
@ -104,10 +103,9 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
||||||
self.slideListView.addItem(slide[1])
|
self.slideListView.addItem(slide[1])
|
||||||
theme = self.customSlide.theme_name
|
theme = self.customSlide.theme_name
|
||||||
find_and_set_in_combo_box(self.themeComboBox, theme)
|
find_and_set_in_combo_box(self.themeComboBox, theme)
|
||||||
|
self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason)
|
||||||
# If not preview hide the preview button.
|
# If not preview hide the preview button.
|
||||||
self.previewButton.setVisible(False)
|
self.previewButton.setVisible(preview)
|
||||||
if preview:
|
|
||||||
self.previewButton.setVisible(True)
|
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
Receiver.send_message(u'custom_edit_clear')
|
Receiver.send_message(u'custom_edit_clear')
|
||||||
|
|
|
@ -209,9 +209,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||||
self.alternativeEdit.setText(u'')
|
self.alternativeEdit.setText(u'')
|
||||||
if self.song.song_book_id != 0:
|
if self.song.song_book_id != 0:
|
||||||
book_name = self.manager.get_object(Book, self.song.song_book_id)
|
book_name = self.manager.get_object(Book, self.song.song_book_id)
|
||||||
find_and_set_in_combo_box(self.songBookComboBox, unicode(book_name.name))
|
find_and_set_in_combo_box(
|
||||||
|
self.songBookComboBox, unicode(book_name.name))
|
||||||
if self.song.theme_name:
|
if self.song.theme_name:
|
||||||
find_and_set_in_combo_box(self.themeComboBox, unicode(self.song.theme_name))
|
find_and_set_in_combo_box(
|
||||||
|
self.themeComboBox, unicode(self.song.theme_name))
|
||||||
if self.song.copyright:
|
if self.song.copyright:
|
||||||
self.copyrightEdit.setText(self.song.copyright)
|
self.copyrightEdit.setText(self.song.copyright)
|
||||||
else:
|
else:
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 97 KiB |
|
@ -0,0 +1,6 @@
|
||||||
|
OpenLP.ico
|
||||||
|
|
||||||
|
This Windows icon contains several images with different resolution.
|
||||||
|
It can be recreated by command:
|
||||||
|
|
||||||
|
icotool -c -o OpenLP.ico openlp-logo-16x16.png openlp-logo-32x32.png openlp-logo-48x48.png openlp-logo-64x64.png openlp-logo-128x128.png
|
|
@ -1,14 +0,0 @@
|
||||||
# -*- mode: python -*-
|
|
||||||
a = Analysis([
|
|
||||||
os.path.join(HOMEPATH, 'support\\_mountzlib.py'),
|
|
||||||
os.path.join(HOMEPATH, 'support\\useUnicode.py'),
|
|
||||||
os.path.abspath('openlp.pyw')],
|
|
||||||
pathex=[os.path.abspath('.')])
|
|
||||||
pyz = PYZ(a.pure)
|
|
||||||
exe = EXE(pyz, a.scripts, exclude_binaries=1,
|
|
||||||
name=os.path.abspath(os.path.join('build', 'pyi.win32', 'OpenLP',
|
|
||||||
'OpenLP.exe')),
|
|
||||||
debug=False, strip=False, upx=True, console=False,
|
|
||||||
icon=os.path.abspath(os.path.join('resources', 'images', 'OpenLP.ico')))
|
|
||||||
coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True,
|
|
||||||
name=os.path.abspath(os.path.join('dist', 'OpenLP')))
|
|
|
@ -32,8 +32,7 @@ Windows Build Script
|
||||||
This script is used to build the Windows binary and the accompanying installer.
|
This script is used to build the Windows binary and the accompanying installer.
|
||||||
For this script to work out of the box, it depends on a number of things:
|
For this script to work out of the box, it depends on a number of things:
|
||||||
|
|
||||||
Python 2.6
|
Python 2.6/2.7
|
||||||
This build script only works with Python 2.6.
|
|
||||||
|
|
||||||
PyQt4
|
PyQt4
|
||||||
You should already have this installed, OpenLP doesn't work without it. The
|
You should already have this installed, OpenLP doesn't work without it. The
|
||||||
|
@ -49,7 +48,7 @@ Inno Setup 5
|
||||||
|
|
||||||
UPX
|
UPX
|
||||||
This is used to compress DLLs and EXEs so that they take up less space, but
|
This is used to compress DLLs and EXEs so that they take up less space, but
|
||||||
still function exactly the same. To install UPS, download it from
|
still function exactly the same. To install UPX, download it from
|
||||||
http://upx.sourceforge.net/, extract it into C:\%PROGRAMFILES%\UPX, and then
|
http://upx.sourceforge.net/, extract it into C:\%PROGRAMFILES%\UPX, and then
|
||||||
add that directory to your PATH environment variable.
|
add that directory to your PATH environment variable.
|
||||||
|
|
||||||
|
@ -61,7 +60,7 @@ HTML Help Workshop
|
||||||
This is used to create the help file
|
This is used to create the help file
|
||||||
|
|
||||||
PyInstaller
|
PyInstaller
|
||||||
PyInstaller should be a checkout of revision 844 of trunk, and in a
|
PyInstaller should be a checkout of revision 1470 of trunk, and in a
|
||||||
directory called, "pyinstaller" on the same level as OpenLP's Bazaar shared
|
directory called, "pyinstaller" on the same level as OpenLP's Bazaar shared
|
||||||
repository directory. The revision is very important as there is currently
|
repository directory. The revision is very important as there is currently
|
||||||
a major regression in HEAD.
|
a major regression in HEAD.
|
||||||
|
@ -73,13 +72,8 @@ PyInstaller
|
||||||
http://svn.pyinstaller.org/trunk
|
http://svn.pyinstaller.org/trunk
|
||||||
|
|
||||||
Then you need to copy the two hook-*.py files from the "pyinstaller"
|
Then you need to copy the two hook-*.py files from the "pyinstaller"
|
||||||
subdirectory in OpenLP's "resources" directory into PyInstaller's "hooks"
|
subdirectory in OpenLP's "resources" directory into PyInstaller's
|
||||||
directory.
|
"PyInstaller/hooks" directory.
|
||||||
|
|
||||||
Once you've done that, open a command prompt (DOS shell), navigate to the
|
|
||||||
PyInstaller directory and run::
|
|
||||||
|
|
||||||
C:\Projects\pyinstaller>python Configure.py
|
|
||||||
|
|
||||||
Bazaar
|
Bazaar
|
||||||
You need the command line "bzr" client installed.
|
You need the command line "bzr" client installed.
|
||||||
|
@ -137,9 +131,11 @@ site_packages = os.path.join(os.path.split(python_exe)[0], u'Lib',
|
||||||
|
|
||||||
# Files and executables
|
# Files and executables
|
||||||
pyi_build = os.path.abspath(os.path.join(branch_path, u'..', u'..',
|
pyi_build = os.path.abspath(os.path.join(branch_path, u'..', u'..',
|
||||||
u'pyinstaller', u'Build.py'))
|
u'pyinstaller', u'pyinstaller.py'))
|
||||||
|
openlp_main_script = os.path.abspath(os.path.join(branch_path, 'openlp.pyw'))
|
||||||
lrelease_exe = os.path.join(site_packages, u'PyQt4', u'bin', u'lrelease.exe')
|
lrelease_exe = os.path.join(site_packages, u'PyQt4', u'bin', u'lrelease.exe')
|
||||||
i18n_utils = os.path.join(script_path, u'translation_utils.py')
|
i18n_utils = os.path.join(script_path, u'translation_utils.py')
|
||||||
|
win32_icon = os.path.join(branch_path, u'resources', u'images', 'OpenLP.ico')
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
source_path = os.path.join(branch_path, u'openlp')
|
source_path = os.path.join(branch_path, u'openlp')
|
||||||
|
@ -148,9 +144,8 @@ manual_build_path = os.path.join(manual_path, u'build')
|
||||||
helpfile_path = os.path.join(manual_build_path, u'htmlhelp')
|
helpfile_path = os.path.join(manual_build_path, u'htmlhelp')
|
||||||
i18n_path = os.path.join(branch_path, u'resources', u'i18n')
|
i18n_path = os.path.join(branch_path, u'resources', u'i18n')
|
||||||
winres_path = os.path.join(branch_path, u'resources', u'windows')
|
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')
|
build_path = os.path.join(branch_path, u'build')
|
||||||
dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
|
dist_path = os.path.join(build_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',
|
pptviewlib_path = os.path.join(source_path, u'plugins', u'presentations',
|
||||||
u'lib', u'pptviewlib')
|
u'lib', u'pptviewlib')
|
||||||
|
|
||||||
|
@ -174,8 +169,15 @@ def update_code():
|
||||||
def run_pyinstaller():
|
def run_pyinstaller():
|
||||||
print u'Running PyInstaller...'
|
print u'Running PyInstaller...'
|
||||||
os.chdir(branch_path)
|
os.chdir(branch_path)
|
||||||
pyinstaller = Popen((python_exe, pyi_build, u'-y', u'-o', build_path,
|
pyinstaller = Popen((python_exe, pyi_build,
|
||||||
os.path.join(winres_path, u'OpenLP.spec')), stdout=PIPE)
|
u'--noconfirm',
|
||||||
|
u'--windowed',
|
||||||
|
u'-o', build_path,
|
||||||
|
u'-i', win32_icon,
|
||||||
|
u'-p', branch_path,
|
||||||
|
u'-n', 'OpenLP',
|
||||||
|
openlp_main_script),
|
||||||
|
stdout=PIPE)
|
||||||
output, error = pyinstaller.communicate()
|
output, error = pyinstaller.communicate()
|
||||||
code = pyinstaller.wait()
|
code = pyinstaller.wait()
|
||||||
if code != 0:
|
if code != 0:
|
||||||
|
@ -208,19 +210,6 @@ def write_version_file():
|
||||||
f.write(versionstring)
|
f.write(versionstring)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def copy_enchant():
|
|
||||||
print u'Copying enchant/pyenchant...'
|
|
||||||
source = enchant_path
|
|
||||||
dest = os.path.join(dist_path, u'enchant')
|
|
||||||
for root, dirs, files in os.walk(source):
|
|
||||||
for filename in files:
|
|
||||||
if not filename.endswith(u'.pyc') and not filename.endswith(u'.pyo'):
|
|
||||||
dest_path = os.path.join(dest, root[len(source) + 1:])
|
|
||||||
if not os.path.exists(dest_path):
|
|
||||||
os.makedirs(dest_path)
|
|
||||||
copy(os.path.join(root, filename),
|
|
||||||
os.path.join(dest_path, filename))
|
|
||||||
|
|
||||||
def copy_plugins():
|
def copy_plugins():
|
||||||
print u'Copying plugins...'
|
print u'Copying plugins...'
|
||||||
source = os.path.join(source_path, u'plugins')
|
source = os.path.join(source_path, u'plugins')
|
||||||
|
@ -242,10 +231,10 @@ def copy_windows_files():
|
||||||
os.path.join(dist_path, u'LICENSE.txt'))
|
os.path.join(dist_path, u'LICENSE.txt'))
|
||||||
copy(os.path.join(winres_path, u'psvince.dll'),
|
copy(os.path.join(winres_path, u'psvince.dll'),
|
||||||
os.path.join(dist_path, u'psvince.dll'))
|
os.path.join(dist_path, u'psvince.dll'))
|
||||||
if os.path.isfile(os.path.join(helpfile_path, u'Openlp.chm')):
|
if os.path.isfile(os.path.join(helpfile_path, u'OpenLP.chm')):
|
||||||
print u' Windows help file found'
|
print u' Windows help file found'
|
||||||
copy(os.path.join(helpfile_path, u'Openlp.chm'),
|
copy(os.path.join(helpfile_path, u'OpenLP.chm'),
|
||||||
os.path.join(dist_path, u'Openlp.chm'))
|
os.path.join(dist_path, u'OpenLP.chm'))
|
||||||
else:
|
else:
|
||||||
print u' WARNING ---- Windows help file not found ---- WARNING'
|
print u' WARNING ---- Windows help file not found ---- WARNING'
|
||||||
|
|
||||||
|
@ -353,7 +342,6 @@ def main():
|
||||||
build_pptviewlib()
|
build_pptviewlib()
|
||||||
run_pyinstaller()
|
run_pyinstaller()
|
||||||
write_version_file()
|
write_version_file()
|
||||||
copy_enchant()
|
|
||||||
copy_plugins()
|
copy_plugins()
|
||||||
if os.path.exists(manual_path):
|
if os.path.exists(manual_path):
|
||||||
run_sphinx()
|
run_sphinx()
|
||||||
|
|
Loading…
Reference in New Issue