forked from openlp/openlp
Easyworship importer: improved recognition of slide divisions
merged with trunk
This commit is contained in:
commit
5df77e4ed6
|
@ -32,6 +32,7 @@ to wait for the conversion to happen.
|
|||
"""
|
||||
import logging
|
||||
import time
|
||||
import Queue
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
|
@ -42,8 +43,8 @@ log = logging.getLogger(__name__)
|
|||
|
||||
class ImageThread(QtCore.QThread):
|
||||
"""
|
||||
A special Qt thread class to speed up the display of text based frames.
|
||||
This is threaded so it loads the frames in background
|
||||
A special Qt thread class to speed up the display of images. This is
|
||||
threaded so it loads the frames and generates byte stream in background.
|
||||
"""
|
||||
def __init__(self, manager):
|
||||
QtCore.QThread.__init__(self, None)
|
||||
|
@ -53,15 +54,75 @@ class ImageThread(QtCore.QThread):
|
|||
"""
|
||||
Run the thread.
|
||||
"""
|
||||
self.imageManager.process()
|
||||
self.imageManager._process()
|
||||
|
||||
|
||||
class Priority(object):
|
||||
"""
|
||||
Enumeration class for different priorities.
|
||||
|
||||
``Lowest``
|
||||
Only the image's byte stream has to be generated. But neither the
|
||||
``QImage`` nor the byte stream has been requested yet.
|
||||
|
||||
``Low``
|
||||
Only the image's byte stream has to be generated. Because the image's
|
||||
``QImage`` has been requested previously it is reasonable to assume that
|
||||
the byte stream will be needed before the byte stream of other images
|
||||
whose ``QImage`` were not generated due to a request.
|
||||
|
||||
``Normal``
|
||||
The image's byte stream as well as the image has to be generated.
|
||||
Neither the ``QImage`` nor the byte stream has been requested yet.
|
||||
|
||||
``High``
|
||||
The image's byte stream as well as the image has to be generated. The
|
||||
``QImage`` for this image has been requested.
|
||||
**Note**, this priority is only set when the ``QImage`` has not been
|
||||
generated yet.
|
||||
|
||||
``Urgent``
|
||||
The image's byte stream as well as the image has to be generated. The
|
||||
byte stream for this image has been requested.
|
||||
**Note**, this priority is only set when the byte stream has not been
|
||||
generated yet.
|
||||
"""
|
||||
Lowest = 4
|
||||
Low = 3
|
||||
Normal = 2
|
||||
High = 1
|
||||
Urgent = 0
|
||||
|
||||
|
||||
class Image(object):
|
||||
name = ''
|
||||
path = ''
|
||||
dirty = True
|
||||
image = None
|
||||
image_bytes = None
|
||||
"""
|
||||
This class represents an image. To mark an image as *dirty* set the instance
|
||||
variables ``image`` and ``image_bytes`` to ``None`` and add the image object
|
||||
to the queue of images to process.
|
||||
"""
|
||||
def __init__(self, name='', path=''):
|
||||
self.name = name
|
||||
self.path = path
|
||||
self.image = None
|
||||
self.image_bytes = None
|
||||
self.priority = Priority.Normal
|
||||
|
||||
|
||||
class PriorityQueue(Queue.PriorityQueue):
|
||||
"""
|
||||
Customised ``Queue.PriorityQueue``.
|
||||
"""
|
||||
def remove(self, item):
|
||||
"""
|
||||
Removes the given ``item`` from the queue.
|
||||
|
||||
``item``
|
||||
The item to remove. This should be a tuple::
|
||||
|
||||
``(Priority, Image)``
|
||||
"""
|
||||
if item in self.queue:
|
||||
self.queue.remove(item)
|
||||
|
||||
|
||||
class ImageManager(QtCore.QObject):
|
||||
|
@ -76,96 +137,120 @@ class ImageManager(QtCore.QObject):
|
|||
self.width = current_screen[u'size'].width()
|
||||
self.height = current_screen[u'size'].height()
|
||||
self._cache = {}
|
||||
self._thread_running = False
|
||||
self._cache_dirty = False
|
||||
self.image_thread = ImageThread(self)
|
||||
self._imageThread = ImageThread(self)
|
||||
self._conversion_queue = PriorityQueue()
|
||||
|
||||
def update_display(self):
|
||||
"""
|
||||
Screen has changed size so rebuild the cache to new size
|
||||
Screen has changed size so rebuild the cache to new size.
|
||||
"""
|
||||
log.debug(u'update_display')
|
||||
current_screen = ScreenList.get_instance().current
|
||||
self.width = current_screen[u'size'].width()
|
||||
self.height = current_screen[u'size'].height()
|
||||
# mark the images as dirty for a rebuild
|
||||
for key in self._cache.keys():
|
||||
image = self._cache[key]
|
||||
image.dirty = True
|
||||
image.image = resize_image(image.path, self.width, self.height)
|
||||
self._cache_dirty = True
|
||||
# only one thread please
|
||||
if not self._thread_running:
|
||||
self.image_thread.start()
|
||||
# Mark the images as dirty for a rebuild by setting the image and byte
|
||||
# stream to None.
|
||||
self._conversion_queue = PriorityQueue()
|
||||
for key, image in self._cache.iteritems():
|
||||
image.priority = Priority.Normal
|
||||
image.image = None
|
||||
image.image_bytes = None
|
||||
self._conversion_queue.put((image.priority, image))
|
||||
# We want only one thread.
|
||||
if not self._imageThread.isRunning():
|
||||
self._imageThread.start()
|
||||
|
||||
def get_image(self, name):
|
||||
"""
|
||||
Return the Qimage from the cache
|
||||
Return the ``QImage`` from the cache. If not present wait for the
|
||||
background thread to process it.
|
||||
"""
|
||||
log.debug(u'get_image %s' % name)
|
||||
return self._cache[name].image
|
||||
image = self._cache[name]
|
||||
if image.image is None:
|
||||
self._conversion_queue.remove((image.priority, image))
|
||||
image.priority = Priority.High
|
||||
self._conversion_queue.put((image.priority, image))
|
||||
while image.image is None:
|
||||
log.debug(u'get_image - waiting')
|
||||
time.sleep(0.1)
|
||||
return image.image
|
||||
|
||||
def get_image_bytes(self, name):
|
||||
"""
|
||||
Returns the byte string for an image
|
||||
If not present wait for the background thread to process it.
|
||||
Returns the byte string for an image. If not present wait for the
|
||||
background thread to process it.
|
||||
"""
|
||||
log.debug(u'get_image_bytes %s' % name)
|
||||
if not self._cache[name].image_bytes:
|
||||
while self._cache[name].dirty:
|
||||
image = self._cache[name]
|
||||
if image.image_bytes is None:
|
||||
self._conversion_queue.remove((image.priority, image))
|
||||
image.priority = Priority.Urgent
|
||||
self._conversion_queue.put((image.priority, image))
|
||||
while image.image_bytes is None:
|
||||
log.debug(u'get_image_bytes - waiting')
|
||||
time.sleep(0.1)
|
||||
return self._cache[name].image_bytes
|
||||
return image.image_bytes
|
||||
|
||||
def del_image(self, name):
|
||||
"""
|
||||
Delete the Image from the Cache
|
||||
Delete the Image from the cache.
|
||||
"""
|
||||
log.debug(u'del_image %s' % name)
|
||||
if name in self._cache:
|
||||
self._conversion_queue.remove(
|
||||
(self._cache[name].priority, self._cache[name]))
|
||||
del self._cache[name]
|
||||
|
||||
def add_image(self, name, path):
|
||||
"""
|
||||
Add image to cache if it is not already there
|
||||
Add image to cache if it is not already there.
|
||||
"""
|
||||
log.debug(u'add_image %s:%s' % (name, path))
|
||||
if not name in self._cache:
|
||||
image = Image()
|
||||
image.name = name
|
||||
image.path = path
|
||||
image.image = resize_image(path, self.width, self.height)
|
||||
image = Image(name, path)
|
||||
self._cache[name] = image
|
||||
self._conversion_queue.put((image.priority, image))
|
||||
else:
|
||||
log.debug(u'Image in cache %s:%s' % (name, path))
|
||||
self._cache_dirty = True
|
||||
# only one thread please
|
||||
if not self._thread_running:
|
||||
self.image_thread.start()
|
||||
# We want only one thread.
|
||||
if not self._imageThread.isRunning():
|
||||
self._imageThread.start()
|
||||
|
||||
def process(self):
|
||||
def _process(self):
|
||||
"""
|
||||
Controls the processing called from a QThread
|
||||
Controls the processing called from a ``QtCore.QThread``.
|
||||
"""
|
||||
log.debug(u'process - started')
|
||||
self._thread_running = True
|
||||
self.clean_cache()
|
||||
# data loaded since we started ?
|
||||
while self._cache_dirty:
|
||||
log.debug(u'process - recycle')
|
||||
self.clean_cache()
|
||||
self._thread_running = False
|
||||
log.debug(u'process - ended')
|
||||
log.debug(u'_process - started')
|
||||
while not self._conversion_queue.empty():
|
||||
self._process_cache()
|
||||
log.debug(u'_process - ended')
|
||||
|
||||
def clean_cache(self):
|
||||
def _process_cache(self):
|
||||
"""
|
||||
Actually does the work.
|
||||
"""
|
||||
log.debug(u'clean_cache')
|
||||
# we will clean the cache now
|
||||
self._cache_dirty = False
|
||||
for key in self._cache.keys():
|
||||
image = self._cache[key]
|
||||
if image.dirty:
|
||||
image.image_bytes = image_to_byte(image.image)
|
||||
image.dirty = False
|
||||
log.debug(u'_process_cache')
|
||||
image = self._conversion_queue.get()[1]
|
||||
# Generate the QImage for the image.
|
||||
if image.image is None:
|
||||
image.image = resize_image(image.path, self.width, self.height)
|
||||
# Set the priority to Lowest and stop here as we need to process
|
||||
# more important images first.
|
||||
if image.priority == Priority.Normal:
|
||||
self._conversion_queue.remove((image.priority, image))
|
||||
image.priority = Priority.Lowest
|
||||
self._conversion_queue.put((image.priority, image))
|
||||
return
|
||||
# For image with high priority we set the priority to Low, as the
|
||||
# byte stream might be needed earlier the byte stream of image with
|
||||
# Normal priority. We stop here as we need to process more important
|
||||
# images first.
|
||||
elif image.priority == Priority.High:
|
||||
self._conversion_queue.remove((image.priority, image))
|
||||
image.priority = Priority.Low
|
||||
self._conversion_queue.put((image.priority, image))
|
||||
return
|
||||
# Generate the byte stream for the image.
|
||||
if image.image_bytes is None:
|
||||
image.image_bytes = image_to_byte(image.image)
|
||||
|
|
|
@ -29,6 +29,7 @@ import re
|
|||
try:
|
||||
import enchant
|
||||
from enchant import DictNotFoundError
|
||||
from enchant.errors import Error
|
||||
ENCHANT_AVAILABLE = True
|
||||
except ImportError:
|
||||
ENCHANT_AVAILABLE = False
|
||||
|
@ -56,7 +57,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||
self.dictionary = enchant.Dict()
|
||||
self.highlighter = Highlighter(self.document())
|
||||
self.highlighter.spellingDictionary = self.dictionary
|
||||
except DictNotFoundError:
|
||||
except Error, DictNotFoundError:
|
||||
ENCHANT_AVAILABLE = False
|
||||
log.debug(u'Could not load default dictionary')
|
||||
|
||||
|
|
|
@ -178,10 +178,6 @@ class HorizontalType(object):
|
|||
Center = 2
|
||||
|
||||
Names = [u'left', u'right', u'center']
|
||||
TranslatedNames = [
|
||||
translate('OpenLP.ThemeWizard', 'Left'),
|
||||
translate('OpenLP.ThemeWizard', 'Right'),
|
||||
translate('OpenLP.ThemeWizard', 'Center')]
|
||||
|
||||
|
||||
class VerticalType(object):
|
||||
|
@ -193,7 +189,6 @@ class VerticalType(object):
|
|||
Bottom = 2
|
||||
|
||||
Names = [u'top', u'middle', u'bottom']
|
||||
TranslatedNames = [UiStrings().Top, UiStrings().Middle, UiStrings().Bottom]
|
||||
|
||||
|
||||
BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow',
|
||||
|
|
|
@ -323,8 +323,9 @@ def shortcut_action(parent, name, shortcuts, function, icon=None, checked=None,
|
|||
if checked is not None:
|
||||
action.setCheckable(True)
|
||||
action.setChecked(checked)
|
||||
action.setShortcuts(shortcuts)
|
||||
action.setShortcutContext(context)
|
||||
if shortcuts:
|
||||
action.setShortcuts(shortcuts)
|
||||
action.setShortcutContext(context)
|
||||
action_list = ActionList.get_instance()
|
||||
action_list.add_action(action, category)
|
||||
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered(bool)'), function)
|
||||
|
|
|
@ -35,13 +35,10 @@ class Ui_DisplayTagDialog(object):
|
|||
def setupUi(self, displayTagDialog):
|
||||
displayTagDialog.setObjectName(u'displayTagDialog')
|
||||
displayTagDialog.resize(725, 548)
|
||||
self.widget = QtGui.QWidget(displayTagDialog)
|
||||
self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521))
|
||||
self.widget.setObjectName(u'widget')
|
||||
self.listdataGridLayout = QtGui.QGridLayout(self.widget)
|
||||
self.listdataGridLayout.setMargin(0)
|
||||
self.listdataGridLayout = QtGui.QGridLayout(displayTagDialog)
|
||||
self.listdataGridLayout.setMargin(8)
|
||||
self.listdataGridLayout.setObjectName(u'listdataGridLayout')
|
||||
self.tagTableWidget = QtGui.QTableWidget(self.widget)
|
||||
self.tagTableWidget = QtGui.QTableWidget(displayTagDialog)
|
||||
self.tagTableWidget.setHorizontalScrollBarPolicy(
|
||||
QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.tagTableWidget.setEditTriggers(
|
||||
|
@ -55,6 +52,7 @@ class Ui_DisplayTagDialog(object):
|
|||
self.tagTableWidget.setObjectName(u'tagTableWidget')
|
||||
self.tagTableWidget.setColumnCount(4)
|
||||
self.tagTableWidget.setRowCount(0)
|
||||
self.tagTableWidget.horizontalHeader().setStretchLastSection(True)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
self.tagTableWidget.setHorizontalHeaderItem(0, item)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
|
@ -69,11 +67,11 @@ class Ui_DisplayTagDialog(object):
|
|||
spacerItem = QtGui.QSpacerItem(40, 20,
|
||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
self.horizontalLayout.addItem(spacerItem)
|
||||
self.deletePushButton = QtGui.QPushButton(self.widget)
|
||||
self.deletePushButton = QtGui.QPushButton(displayTagDialog)
|
||||
self.deletePushButton.setObjectName(u'deletePushButton')
|
||||
self.horizontalLayout.addWidget(self.deletePushButton)
|
||||
self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
|
||||
self.editGroupBox = QtGui.QGroupBox(self.widget)
|
||||
self.editGroupBox = QtGui.QGroupBox(displayTagDialog)
|
||||
self.editGroupBox.setObjectName(u'editGroupBox')
|
||||
self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox)
|
||||
self.dataGridLayout.setObjectName(u'dataGridLayout')
|
||||
|
@ -115,9 +113,8 @@ class Ui_DisplayTagDialog(object):
|
|||
self.dataGridLayout.addWidget(self.savePushButton, 4, 2, 1, 1)
|
||||
self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
|
||||
self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog)
|
||||
closeButton = QtGui.QDialogButtonBox.Close
|
||||
self.buttonBox.setObjectName('displayTagDialogButtonBox')
|
||||
self.buttonBox.setStandardButtons(closeButton)
|
||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
|
||||
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(displayTagDialog)
|
||||
|
@ -148,6 +145,5 @@ class Ui_DisplayTagDialog(object):
|
|||
self.tagTableWidget.horizontalHeaderItem(3).setText(
|
||||
translate('OpenLP.DisplayTagDialog', 'End HTML'))
|
||||
self.tagTableWidget.setColumnWidth(0, 120)
|
||||
self.tagTableWidget.setColumnWidth(1, 40)
|
||||
self.tagTableWidget.setColumnWidth(2, 240)
|
||||
self.tagTableWidget.setColumnWidth(3, 240)
|
||||
self.tagTableWidget.setColumnWidth(1, 80)
|
||||
self.tagTableWidget.setColumnWidth(2, 330)
|
||||
|
|
|
@ -138,6 +138,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
|
|||
# Highlight new row
|
||||
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
|
||||
self.onRowSelected()
|
||||
self.tagTableWidget.scrollToBottom()
|
||||
|
||||
def onDeletePushed(self):
|
||||
"""
|
||||
|
|
|
@ -49,7 +49,10 @@ class MainDisplay(QtGui.QGraphicsView):
|
|||
This is the display screen.
|
||||
"""
|
||||
def __init__(self, parent, image_manager, live):
|
||||
QtGui.QGraphicsView.__init__(self, parent)
|
||||
if live:
|
||||
QtGui.QGraphicsView.__init__(self)
|
||||
else:
|
||||
QtGui.QGraphicsView.__init__(self, parent)
|
||||
self.isLive = live
|
||||
self.image_manager = image_manager
|
||||
self.screens = ScreenList.get_instance()
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from tempfile import gettempdir
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
@ -92,6 +93,8 @@ class Ui_MainWindow(object):
|
|||
self.previewController.panel.setVisible(previewVisible)
|
||||
liveVisible = QtCore.QSettings().value(u'user interface/live panel',
|
||||
QtCore.QVariant(True)).toBool()
|
||||
panelLocked = QtCore.QSettings().value(u'user interface/lock panel',
|
||||
QtCore.QVariant(False)).toBool()
|
||||
self.liveController.panel.setVisible(liveVisible)
|
||||
# Create menu
|
||||
self.menuBar = QtGui.QMenuBar(mainWindow)
|
||||
|
@ -212,11 +215,15 @@ class Ui_MainWindow(object):
|
|||
self.viewLivePanel = shortcut_action(mainWindow, u'viewLivePanel',
|
||||
[QtGui.QKeySequence(u'F12')], self.setLivePanelVisibility,
|
||||
checked=liveVisible, category=UiStrings().View)
|
||||
action_list.add_category(UiStrings().ViewMode, CategoryOrder.standardMenu)
|
||||
self.lockPanel = shortcut_action(mainWindow, u'lockPanel',
|
||||
None, self.setLockPanel,
|
||||
checked=panelLocked, category=None)
|
||||
action_list.add_category(UiStrings().ViewMode,
|
||||
CategoryOrder.standardMenu)
|
||||
self.modeDefaultItem = checkable_action(
|
||||
mainWindow, u'modeDefaultItem', category=UiStrings().ViewMode)
|
||||
self.modeSetupItem = checkable_action(
|
||||
mainWindow, u'modeLiveItem', category=UiStrings().ViewMode)
|
||||
mainWindow, u'modeSetupItem', category=UiStrings().ViewMode)
|
||||
self.modeLiveItem = checkable_action(
|
||||
mainWindow, u'modeLiveItem', True, UiStrings().ViewMode)
|
||||
self.modeGroup = QtGui.QActionGroup(mainWindow)
|
||||
|
@ -232,7 +239,8 @@ class Ui_MainWindow(object):
|
|||
category=UiStrings().Tools)
|
||||
self.updateThemeImages = base_action(mainWindow,
|
||||
u'updateThemeImages', category=UiStrings().Tools)
|
||||
action_list.add_category(UiStrings().Settings, CategoryOrder.standardMenu)
|
||||
action_list.add_category(UiStrings().Settings,
|
||||
CategoryOrder.standardMenu)
|
||||
self.settingsPluginListItem = shortcut_action(mainWindow,
|
||||
u'settingsPluginListItem', [QtGui.QKeySequence(u'Alt+F7')],
|
||||
self.onPluginItemClicked, u':/system/settings_plugin_list.png',
|
||||
|
@ -287,14 +295,22 @@ class Ui_MainWindow(object):
|
|||
add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),
|
||||
None, self.viewMediaManagerItem, self.viewServiceManagerItem,
|
||||
self.viewThemeManagerItem, None, self.viewPreviewPanel,
|
||||
self.viewLivePanel))
|
||||
self.viewLivePanel, None, self.lockPanel))
|
||||
# i18n add Language Actions
|
||||
add_actions(self.settingsLanguageMenu, (self.autoLanguageItem, None))
|
||||
add_actions(self.settingsLanguageMenu, self.languageGroup.actions())
|
||||
add_actions(self.settingsMenu, (self.settingsPluginListItem,
|
||||
self.settingsLanguageMenu.menuAction(), None,
|
||||
self.displayTagItem, self.settingsShortcutsItem,
|
||||
self.settingsConfigureItem))
|
||||
# Order things differently in OS X so that Preferences menu item in the
|
||||
# app menu is correct (this gets picked up automatically by Qt).
|
||||
if sys.platform == u'darwin':
|
||||
add_actions(self.settingsMenu, (self.settingsPluginListItem,
|
||||
self.settingsLanguageMenu.menuAction(), None,
|
||||
self.settingsConfigureItem, self.settingsShortcutsItem,
|
||||
self.displayTagItem))
|
||||
else:
|
||||
add_actions(self.settingsMenu, (self.settingsPluginListItem,
|
||||
self.settingsLanguageMenu.menuAction(), None,
|
||||
self.displayTagItem, self.settingsShortcutsItem,
|
||||
self.settingsConfigureItem))
|
||||
add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
|
||||
add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
|
||||
add_actions(self.toolsMenu, [self.updateThemeImages])
|
||||
|
@ -316,6 +332,7 @@ class Ui_MainWindow(object):
|
|||
self.importLanguageItem.setVisible(False)
|
||||
self.exportLanguageItem.setVisible(False)
|
||||
self.helpDocumentationItem.setVisible(False)
|
||||
self.setLockPanel(panelLocked)
|
||||
|
||||
def retranslateUi(self, mainWindow):
|
||||
"""
|
||||
|
@ -405,6 +422,10 @@ class Ui_MainWindow(object):
|
|||
translate('OpenLP.MainWindow', '&Live Panel'))
|
||||
self.viewLivePanel.setToolTip(
|
||||
translate('OpenLP.MainWindow', 'Toggle Live Panel'))
|
||||
self.lockPanel.setText(
|
||||
translate('OpenLP.MainWindow', 'L&ock Panels'))
|
||||
self.lockPanel.setStatusTip(
|
||||
translate('OpenLP.MainWindow', 'Prevent the panels being moved.'))
|
||||
self.viewLivePanel.setStatusTip(translate('OpenLP.MainWindow',
|
||||
'Toggle the visibility of the live panel.'))
|
||||
self.settingsPluginListItem.setText(translate('OpenLP.MainWindow',
|
||||
|
@ -644,7 +665,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||
QtCore.QVariant(False)).toBool():
|
||||
self.serviceManagerContents.loadLastFile()
|
||||
view_mode = QtCore.QSettings().value(u'%s/view mode' % \
|
||||
self.generalSettingsSection, u'default')
|
||||
self.generalSettingsSection, u'default').toString()
|
||||
if view_mode == u'default':
|
||||
self.modeDefaultItem.setChecked(True)
|
||||
elif view_mode == u'setup':
|
||||
|
@ -927,7 +948,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||
self.mediaManagerDock.setVisible(not self.mediaManagerDock.isVisible())
|
||||
|
||||
def toggleServiceManager(self):
|
||||
self.serviceManagerDock.setVisible(not self.serviceManagerDock.isVisible())
|
||||
self.serviceManagerDock.setVisible(
|
||||
not self.serviceManagerDock.isVisible())
|
||||
|
||||
def toggleThemeManager(self):
|
||||
self.themeManagerDock.setVisible(not self.themeManagerDock.isVisible())
|
||||
|
@ -947,6 +969,37 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||
QtCore.QVariant(visible))
|
||||
self.viewPreviewPanel.setChecked(visible)
|
||||
|
||||
def setLockPanel(self, lock):
|
||||
"""
|
||||
Sets the ability to stop the toolbars being changed.
|
||||
"""
|
||||
if lock:
|
||||
self.themeManagerDock.setFeatures(
|
||||
QtGui.QDockWidget.NoDockWidgetFeatures)
|
||||
self.serviceManagerDock.setFeatures(
|
||||
QtGui.QDockWidget.NoDockWidgetFeatures)
|
||||
self.mediaManagerDock.setFeatures(
|
||||
QtGui.QDockWidget.NoDockWidgetFeatures)
|
||||
self.viewMediaManagerItem.setEnabled(False)
|
||||
self.viewServiceManagerItem.setEnabled(False)
|
||||
self.viewThemeManagerItem.setEnabled(False)
|
||||
self.viewPreviewPanel.setEnabled(False)
|
||||
self.viewLivePanel.setEnabled(False)
|
||||
else:
|
||||
self.themeManagerDock.setFeatures(
|
||||
QtGui.QDockWidget.AllDockWidgetFeatures)
|
||||
self.serviceManagerDock.setFeatures(
|
||||
QtGui.QDockWidget.AllDockWidgetFeatures)
|
||||
self.mediaManagerDock.setFeatures(
|
||||
QtGui.QDockWidget.AllDockWidgetFeatures)
|
||||
self.viewMediaManagerItem.setEnabled(True)
|
||||
self.viewServiceManagerItem.setEnabled(True)
|
||||
self.viewThemeManagerItem.setEnabled(True)
|
||||
self.viewPreviewPanel.setEnabled(True)
|
||||
self.viewLivePanel.setEnabled(True)
|
||||
QtCore.QSettings().setValue(u'user interface/lock panel',
|
||||
QtCore.QVariant(lock))
|
||||
|
||||
def setLivePanelVisibility(self, visible):
|
||||
"""
|
||||
Sets the visibility of the live panel including saving the setting and
|
||||
|
|
|
@ -41,11 +41,6 @@ class ZoomSize(object):
|
|||
Fifty = 4
|
||||
TwentyFive = 5
|
||||
|
||||
Sizes = [
|
||||
translate('OpenLP.PrintServiceDialog', 'Fit Page'),
|
||||
translate('OpenLP.PrintServiceDialog', 'Fit Width'),
|
||||
u'100%', u'75%', u'50%', u'25%']
|
||||
|
||||
|
||||
class Ui_PrintServiceDialog(object):
|
||||
def setupUi(self, printServiceDialog):
|
||||
|
@ -59,18 +54,14 @@ class Ui_PrintServiceDialog(object):
|
|||
self.toolbar.setIconSize(QtCore.QSize(22, 22))
|
||||
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.printButton = self.toolbar.addAction(
|
||||
build_icon(u':/general/general_print.png'), 'Print')
|
||||
build_icon(u':/general/general_print.png'),
|
||||
translate('OpenLP.PrintServiceForm', 'Print'))
|
||||
self.optionsButton = QtGui.QToolButton(self.toolbar)
|
||||
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
|
||||
'Options'))
|
||||
self.optionsButton.setToolButtonStyle(
|
||||
QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.optionsButton.setIcon(build_icon(u':/system/system_configure.png'))
|
||||
self.optionsButton.setCheckable(True)
|
||||
self.toolbar.addWidget(self.optionsButton)
|
||||
self.closeButton = self.toolbar.addAction(
|
||||
build_icon(u':/system/system_close.png'),
|
||||
translate('OpenLP.PrintServiceForm', 'Close'))
|
||||
self.toolbar.addSeparator()
|
||||
self.plainCopy = self.toolbar.addAction(
|
||||
build_icon(u':/system/system_edit_copy.png'),
|
||||
|
@ -81,24 +72,18 @@ class Ui_PrintServiceDialog(object):
|
|||
self.toolbar.addSeparator()
|
||||
self.zoomInButton = QtGui.QToolButton(self.toolbar)
|
||||
self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png'))
|
||||
self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom In'))
|
||||
self.zoomInButton.setObjectName(u'zoomInButton')
|
||||
self.zoomInButton.setIconSize(QtCore.QSize(22, 22))
|
||||
self.toolbar.addWidget(self.zoomInButton)
|
||||
self.zoomOutButton = QtGui.QToolButton(self.toolbar)
|
||||
self.zoomOutButton.setIcon(
|
||||
build_icon(u':/general/general_zoom_out.png'))
|
||||
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom Out'))
|
||||
self.zoomOutButton.setObjectName(u'zoomOutButton')
|
||||
self.zoomOutButton.setIconSize(QtCore.QSize(22, 22))
|
||||
self.toolbar.addWidget(self.zoomOutButton)
|
||||
self.zoomOriginalButton = QtGui.QToolButton(self.toolbar)
|
||||
self.zoomOriginalButton.setIcon(
|
||||
build_icon(u':/general/general_zoom_original.png'))
|
||||
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom Original'))
|
||||
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
|
||||
self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22))
|
||||
self.toolbar.addWidget(self.zoomOriginalButton)
|
||||
|
@ -116,20 +101,17 @@ class Ui_PrintServiceDialog(object):
|
|||
self.optionsLayout.setContentsMargins(8, 8, 8, 8)
|
||||
self.titleLabel = QtGui.QLabel(self.optionsWidget)
|
||||
self.titleLabel.setObjectName(u'titleLabel')
|
||||
self.titleLabel.setText(u'Title:')
|
||||
self.optionsLayout.addWidget(self.titleLabel)
|
||||
self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget)
|
||||
self.titleLineEdit.setObjectName(u'titleLineEdit')
|
||||
self.optionsLayout.addWidget(self.titleLineEdit)
|
||||
self.footerLabel = QtGui.QLabel(self.optionsWidget)
|
||||
self.footerLabel.setObjectName(u'footerLabel')
|
||||
self.footerLabel.setText(u'Custom Footer Text:')
|
||||
self.optionsLayout.addWidget(self.footerLabel)
|
||||
self.footerTextEdit = SpellTextEdit(self.optionsWidget)
|
||||
self.footerTextEdit.setObjectName(u'footerTextEdit')
|
||||
self.optionsLayout.addWidget(self.footerTextEdit)
|
||||
self.optionsGroupBox = QtGui.QGroupBox(
|
||||
translate('OpenLP.PrintServiceForm','Other Options'))
|
||||
self.optionsGroupBox = QtGui.QGroupBox()
|
||||
self.groupLayout = QtGui.QVBoxLayout()
|
||||
self.slideTextCheckBox = QtGui.QCheckBox()
|
||||
self.groupLayout.addWidget(self.slideTextCheckBox)
|
||||
|
@ -150,6 +132,19 @@ class Ui_PrintServiceDialog(object):
|
|||
|
||||
def retranslateUi(self, printServiceDialog):
|
||||
printServiceDialog.setWindowTitle(UiStrings().PrintService)
|
||||
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom Out'))
|
||||
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom Original'))
|
||||
self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
||||
'Zoom In'))
|
||||
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
|
||||
'Options'))
|
||||
self.titleLabel.setText(translate('OpenLP.PrintServiceForm', 'Title:'))
|
||||
self.footerLabel.setText(translate('OpenLP.PrintServiceForm',
|
||||
'Custom Footer Text:'))
|
||||
self.optionsGroupBox.setTitle(
|
||||
translate('OpenLP.PrintServiceForm','Other Options'))
|
||||
self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
||||
'Include slide text if available'))
|
||||
self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm',
|
||||
|
@ -160,10 +155,13 @@ class Ui_PrintServiceDialog(object):
|
|||
'Include play length of media items'))
|
||||
self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm',
|
||||
'Service Sheet'))
|
||||
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page])
|
||||
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width])
|
||||
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred])
|
||||
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive])
|
||||
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty])
|
||||
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive])
|
||||
# Do not change the order.
|
||||
self.zoomComboBox.addItems([
|
||||
translate('OpenLP.PrintServiceDialog', 'Fit Page'),
|
||||
translate('OpenLP.PrintServiceDialog', 'Fit Width'),
|
||||
u'100%',
|
||||
u'75%',
|
||||
u'50%',
|
||||
u'25%']
|
||||
)
|
||||
|
||||
|
|
|
@ -137,8 +137,6 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
|||
# Signals
|
||||
QtCore.QObject.connect(self.printButton,
|
||||
QtCore.SIGNAL(u'triggered()'), self.printServiceOrder)
|
||||
QtCore.QObject.connect(self.closeButton,
|
||||
QtCore.SIGNAL(u'triggered()'), self.accept)
|
||||
QtCore.QObject.connect(self.zoomOutButton,
|
||||
QtCore.SIGNAL(u'clicked()'), self.zoomOut)
|
||||
QtCore.QObject.connect(self.zoomInButton,
|
||||
|
@ -326,8 +324,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
|||
"""
|
||||
Copies the display text to the clipboard as plain text
|
||||
"""
|
||||
self.mainWindow.clipboard.setText(
|
||||
self.document.toPlainText())
|
||||
self.mainWindow.clipboard.setText(self.document.toPlainText())
|
||||
|
||||
def copyHtmlText(self):
|
||||
"""
|
||||
|
|
|
@ -98,6 +98,9 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog):
|
|||
if event.modifiers() & QtCore.Qt.ShiftModifier == \
|
||||
QtCore.Qt.ShiftModifier:
|
||||
key_string = u'Shift+' + key_string
|
||||
if event.modifiers() & QtCore.Qt.MetaModifier == \
|
||||
QtCore.Qt.MetaModifier:
|
||||
key_string = u'Meta+' + key_string
|
||||
key_sequence = QtGui.QKeySequence(key_string)
|
||||
if self._validiate_shortcut(self._currentItemAction(), key_sequence):
|
||||
if self.primaryPushButton.isChecked():
|
||||
|
|
|
@ -500,7 +500,9 @@ class SlideController(QtGui.QWidget):
|
|||
"""
|
||||
Allows the live toolbar to be customised
|
||||
"""
|
||||
self.toolbar.setVisible(True)
|
||||
# Work-around for OS X, hide and then show the toolbar
|
||||
# See bug #791050
|
||||
self.toolbar.hide()
|
||||
self.mediabar.setVisible(False)
|
||||
self.toolbar.makeWidgetsInvisible([u'Song Menu'])
|
||||
self.toolbar.makeWidgetsInvisible(self.loopList)
|
||||
|
@ -515,12 +517,18 @@ class SlideController(QtGui.QWidget):
|
|||
if item.is_media():
|
||||
self.toolbar.setVisible(False)
|
||||
self.mediabar.setVisible(True)
|
||||
else:
|
||||
# Work-around for OS X, hide and then show the toolbar
|
||||
# See bug #791050
|
||||
self.toolbar.show()
|
||||
|
||||
def enablePreviewToolBar(self, item):
|
||||
"""
|
||||
Allows the Preview toolbar to be customised
|
||||
"""
|
||||
self.toolbar.setVisible(True)
|
||||
# Work-around for OS X, hide and then show the toolbar
|
||||
# See bug #791050
|
||||
self.toolbar.hide()
|
||||
self.mediabar.setVisible(False)
|
||||
self.toolbar.makeWidgetsInvisible(self.songEditList)
|
||||
if item.is_capable(ItemCapabilities.AllowsEdit) and item.from_plugin:
|
||||
|
@ -529,6 +537,10 @@ class SlideController(QtGui.QWidget):
|
|||
self.toolbar.setVisible(False)
|
||||
self.mediabar.setVisible(True)
|
||||
self.volumeSlider.setAudioOutput(self.audio)
|
||||
if not item.is_media():
|
||||
# Work-around for OS X, hide and then show the toolbar
|
||||
# See bug #791050
|
||||
self.toolbar.show()
|
||||
|
||||
def refreshServiceItem(self):
|
||||
"""
|
||||
|
|
|
@ -298,7 +298,10 @@ class ThemeManager(QtGui.QWidget):
|
|||
Copies an existing theme to a new name
|
||||
"""
|
||||
item = self.themeListWidget.currentItem()
|
||||
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
oldThemeName = unicode(
|
||||
translate('OpenLP.ThemeManager', 'Copy of %s',
|
||||
'Copy of <theme name>')) % unicode(
|
||||
item.data(QtCore.Qt.UserRole).toString())
|
||||
self.fileRenameForm.fileNameEdit.setText(oldThemeName)
|
||||
if self.fileRenameForm.exec_(True):
|
||||
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
|
||||
|
|
|
@ -190,6 +190,14 @@ class OpenLPWizard(QtGui.QWizard):
|
|||
self.preWizard()
|
||||
self.performWizard()
|
||||
self.postWizard()
|
||||
else:
|
||||
self.customPageChanged(pageId)
|
||||
|
||||
def customPageChanged(self, pageId):
|
||||
"""
|
||||
Called when changing to a page other than the progress page
|
||||
"""
|
||||
pass
|
||||
|
||||
def onErrorCopyToButtonClicked(self):
|
||||
"""
|
||||
|
|
|
@ -68,6 +68,8 @@ class Ui_EditSongDialog(object):
|
|||
QtCore.Qt.AlignTop)
|
||||
self.verseListWidget = QtGui.QTableWidget(self.lyricsTab)
|
||||
self.verseListWidget.horizontalHeader().setVisible(False)
|
||||
self.verseListWidget.horizontalHeader().setStretchLastSection(True)
|
||||
self.verseListWidget.horizontalHeader().setMinimumSectionSize(16)
|
||||
self.verseListWidget.setAlternatingRowColors(True)
|
||||
self.verseListWidget.setColumnCount(1)
|
||||
self.verseListWidget.setSelectionBehavior(
|
||||
|
|
|
@ -233,7 +233,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||
# lazy xml migration for now
|
||||
self.verseListWidget.clear()
|
||||
self.verseListWidget.setRowCount(0)
|
||||
self.verseListWidget.setColumnWidth(0, self.width)
|
||||
# This is just because occasionally the lyrics come back as a "buffer"
|
||||
if isinstance(self.song.lyrics, buffer):
|
||||
self.song.lyrics = unicode(self.song.lyrics)
|
||||
|
|
|
@ -343,6 +343,13 @@ class SongImportForm(OpenLPWizard):
|
|||
self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
|
||||
def customPageChanged(self, pageId):
|
||||
"""
|
||||
Called when changing to a page other than the progress page
|
||||
"""
|
||||
if self.page(pageId) == self.sourcePage:
|
||||
self.onCurrentIndexChanged(self.formatStack.currentIndex())
|
||||
|
||||
def validateCurrentPage(self):
|
||||
"""
|
||||
Validate the current page before moving on to the next page.
|
||||
|
|
|
@ -73,15 +73,21 @@ class EasiSlidesImport(SongImport):
|
|||
def _parse_song(self, song):
|
||||
self._success = True
|
||||
self._add_unicode_attribute(u'title', song.Title1, True)
|
||||
self._add_unicode_attribute(u'alternate_title', song.Title2)
|
||||
self._add_unicode_attribute(u'song_number', song.SongNumber)
|
||||
if hasattr(song, u'Title2'):
|
||||
self._add_unicode_attribute(u'alternate_title', song.Title2)
|
||||
if hasattr(song, u'SongNumber'):
|
||||
self._add_unicode_attribute(u'song_number', song.SongNumber)
|
||||
if self.song_number == u'0':
|
||||
self.song_number = u''
|
||||
self._add_authors(song)
|
||||
self._add_copyright(song.Copyright)
|
||||
self._add_copyright(song.LicenceAdmin1)
|
||||
self._add_copyright(song.LicenceAdmin2)
|
||||
self._add_unicode_attribute(u'song_book_name', song.BookReference)
|
||||
if hasattr(song, u'Copyright'):
|
||||
self._add_copyright(song.Copyright)
|
||||
if hasattr(song, u'LicenceAdmin1'):
|
||||
self._add_copyright(song.LicenceAdmin1)
|
||||
if hasattr(song, u'LicenceAdmin2'):
|
||||
self._add_copyright(song.LicenceAdmin2)
|
||||
if hasattr(song, u'BookReference'):
|
||||
self._add_unicode_attribute(u'song_book_name', song.BookReference)
|
||||
self._parse_and_add_lyrics(song)
|
||||
if self._success:
|
||||
if not self.finish():
|
||||
|
|
|
@ -259,11 +259,15 @@ class EasyWorshipSongImport(SongImport):
|
|||
self.add_author(author_name.strip())
|
||||
if words:
|
||||
# Format the lyrics
|
||||
words = strip_rtf(words, self.encoding)
|
||||
for verse in words.split(u'\n\n'):
|
||||
# TODO: recognize note-part as well and put into comments-section
|
||||
words = strip_rtf(words, self.encoding) # TODO: convert rtf instead of stripping?
|
||||
p = re.compile(r'\n *?\n[\n ]*') # at least two newlines, with zero or more space characters between them
|
||||
for verse in p.split(words):
|
||||
#for verse in words.split(u'\n\n'):
|
||||
# ew tags: verse, chorus, pre-chorus, bridge, tag, intro, ending, slide
|
||||
verse_split = verse.strip().split(u'\n', 1)
|
||||
verse = verse.strip()
|
||||
if len(verse) == 0:
|
||||
continue
|
||||
verse_split = verse.split(u'\n', 1)
|
||||
verse_type = VerseType.Tags[VerseType.Verse]
|
||||
first_line_is_tag = False
|
||||
for type in VerseType.Names+['tag', 'slide']: # doesnt cover tag, slide
|
||||
|
@ -281,14 +285,14 @@ class EasyWorshipSongImport(SongImport):
|
|||
if m:
|
||||
number = m.group()
|
||||
verse_type +=number
|
||||
|
||||
|
||||
p = re.compile(r'\(.*\)')
|
||||
m = re.search(p, ew_tag)
|
||||
if m:
|
||||
self.comments += ew_tag+'\n'
|
||||
break
|
||||
self.add_verse(
|
||||
verse_split[-1].strip() if first_line_is_tag else verse.strip(), # TODO: hacky: -1
|
||||
verse_split[-1].strip() if first_line_is_tag else verse, # TODO: hacky: -1
|
||||
verse_type)
|
||||
if len(self.comments) > 5:
|
||||
self.comments += unicode(translate('SongsPlugin.EasyWorshipSongImport',
|
||||
|
|
|
@ -467,23 +467,20 @@ class SongMediaItem(MediaManagerItem):
|
|||
search_results = self.plugin.manager.get_all_objects(Song,
|
||||
Song.search_title == item.data_string[u'title'],
|
||||
Song.search_title.asc())
|
||||
author_list = item.data_string[u'authors'].split(u', ')
|
||||
editId = 0
|
||||
add_song = True
|
||||
if search_results:
|
||||
for song in search_results:
|
||||
author_list = item.data_string[u'authors']
|
||||
same_authors = True
|
||||
# If the author counts are different, we do not have to do any
|
||||
# further checking.
|
||||
if len(song.authors) == len(author_list):
|
||||
for author in song.authors:
|
||||
if author.display_name not in author_list:
|
||||
same_authors = False
|
||||
else:
|
||||
same_authors = False
|
||||
# All authors are the same, so we can stop here and the song
|
||||
# does not have to be saved.
|
||||
if same_authors:
|
||||
for author in song.authors:
|
||||
if author.display_name in author_list:
|
||||
author_list = author_list.replace(author.display_name,
|
||||
u'', 1)
|
||||
else:
|
||||
same_authors = False
|
||||
break
|
||||
if same_authors and author_list.strip(u', ') == u'':
|
||||
add_song = False
|
||||
editId = song.id
|
||||
break
|
||||
|
|
|
@ -37,14 +37,16 @@ log = logging.getLogger(__name__)
|
|||
|
||||
if os.name == u'nt':
|
||||
from win32com.client import Dispatch
|
||||
PAGE_BEFORE = 4
|
||||
PAGE_AFTER = 5
|
||||
PAGE_BOTH = 6
|
||||
NoConnectException = Exception
|
||||
else:
|
||||
import uno
|
||||
from com.sun.star.connection import NoConnectException
|
||||
try:
|
||||
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
|
||||
except ImportError:
|
||||
PAGE_BEFORE = 4
|
||||
PAGE_AFTER = 5
|
||||
PAGE_BOTH = 6
|
||||
|
||||
class OooImport(SongImport):
|
||||
"""
|
||||
|
|
|
@ -70,10 +70,12 @@ class OpenLyricsExport(object):
|
|||
song.title)
|
||||
xml = openLyrics.song_to_xml(song)
|
||||
tree = etree.ElementTree(etree.fromstring(xml))
|
||||
filename = u'%s (%s).xml' % (song.title,
|
||||
filename = u'%s (%s)' % (song.title,
|
||||
u', '.join([author.display_name for author in song.authors]))
|
||||
filename = re.sub(
|
||||
r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_')
|
||||
# Ensure the filename isn't too long for some filesystems
|
||||
filename = u'%s.xml' % filename[0:250 - len(self.save_path)]
|
||||
# Pass a file object, because lxml does not cope with some special
|
||||
# characters in the path (see lp:757673 and lp:744337).
|
||||
tree.write(open(os.path.join(self.save_path, filename), u'w'),
|
||||
|
|
|
@ -41,20 +41,23 @@ from oooimport import OooImport
|
|||
log = logging.getLogger(__name__)
|
||||
|
||||
if os.name == u'nt':
|
||||
BOLD = 150.0
|
||||
ITALIC = 2
|
||||
from oooimport import PAGE_BEFORE, PAGE_AFTER, PAGE_BOTH
|
||||
RuntimeException = Exception
|
||||
else:
|
||||
try:
|
||||
from com.sun.star.awt.FontWeight import BOLD
|
||||
from com.sun.star.awt.FontSlant import ITALIC
|
||||
from com.sun.star.style.BreakType import PAGE_BEFORE, PAGE_AFTER, \
|
||||
PAGE_BOTH
|
||||
from com.sun.star.uno import RuntimeException
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
try:
|
||||
from com.sun.star.awt.FontWeight import BOLD
|
||||
except ImportError:
|
||||
BOLD = 150.0
|
||||
try:
|
||||
from com.sun.star.awt.FontSlant import ITALIC
|
||||
except ImportError:
|
||||
ITALIC = 2
|
||||
|
||||
class SofImport(OooImport):
|
||||
"""
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,295 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DisplaysDialog</class>
|
||||
<widget class="QWidget" name="DisplaysDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>620</width>
|
||||
<height>716</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Amend Display Settings</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>40</y>
|
||||
<width>241</width>
|
||||
<height>79</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="CurrentGroupBox">
|
||||
<property name="title">
|
||||
<string>Default Settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="XLabel">
|
||||
<property name="text">
|
||||
<string>X</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="Xpos">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="YLabel">
|
||||
<property name="text">
|
||||
<string>Y</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="Ypos">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<widget class="QLabel" name="HeightLabel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Height</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="Height">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QLabel" name="WidthLabel">
|
||||
<property name="text">
|
||||
<string>Width</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="Width">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="CurrentGroupBox_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>130</y>
|
||||
<width>248</width>
|
||||
<height>87</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Amend Settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="XAmendLabel">
|
||||
<property name="text">
|
||||
<string>X</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="XposEdit">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="YAmendLabel">
|
||||
<property name="text">
|
||||
<string>Y</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="YposEdit">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="HeightAmendLabel">
|
||||
<property name="text">
|
||||
<string>Height</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="HeightEdit">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinimumSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="WidthAmendLabel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Width</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="WidthEdit">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>layoutWidget</zorder>
|
||||
<zorder>YAmendLabel</zorder>
|
||||
<zorder>HeightAmendLabel</zorder>
|
||||
<zorder>WidthAmendLabel</zorder>
|
||||
<zorder>YAmendLabel</zorder>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="OverrideCheckBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>191</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Override Output Display</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Binary file not shown.
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 199 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 12 KiB |
Loading…
Reference in New Issue