openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #18502
[Merge] lp:~trb143/openlp/style into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/style into lp:openlp.
Requested reviews:
Jonathan Corwin (j-corwin)
For more details, see:
https://code.launchpad.net/~trb143/openlp/style/+merge/141461
Complete openlp.core 120 line conversions.
No code behavior changes
--
https://code.launchpad.net/~trb143/openlp/style/+merge/141461
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py 2012-12-27 17:00:40 +0000
+++ openlp/core/lib/__init__.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -114,8 +114,7 @@
def __init__(self, *args):
if not args and Settings.__filePath__ and \
Settings.defaultFormat() == Settings.IniFormat:
- QtCore.QSettings.__init__(self, Settings.__filePath__,
- Settings.IniFormat)
+ QtCore.QSettings.__init__(self, Settings.__filePath__, Settings.IniFormat)
else:
QtCore.QSettings.__init__(self, *args)
@@ -236,14 +235,11 @@
button_icon = icon
elif isinstance(icon, basestring):
if icon.startswith(u':/'):
- button_icon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal,
- QtGui.QIcon.Off)
+ button_icon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off)
else:
- button_icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
- QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ button_icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off)
elif isinstance(icon, QtGui.QImage):
- button_icon.addPixmap(QtGui.QPixmap.fromImage(icon),
- QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ button_icon.addPixmap(QtGui.QPixmap.fromImage(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off)
return button_icon
@@ -361,12 +357,10 @@
real_width = preview.width()
real_height = preview.height()
# and move it to the centre of the preview space
- new_image = QtGui.QImage(width, height,
- QtGui.QImage.Format_ARGB32_Premultiplied)
+ new_image = QtGui.QImage(width, height, QtGui.QImage.Format_ARGB32_Premultiplied)
painter = QtGui.QPainter(new_image)
painter.fillRect(new_image.rect(), QtGui.QColor(background))
- painter.drawImage(
- (width - real_width) / 2, (height - real_height) / 2, preview)
+ painter.drawImage((width - real_width) / 2, (height - real_height) / 2, preview)
return new_image
=== modified file 'openlp/core/lib/db.py'
--- openlp/core/lib/db.py 2012-12-04 21:50:14 +0000
+++ openlp/core/lib/db.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -36,8 +36,7 @@
from PyQt4 import QtCore
from sqlalchemy import Table, MetaData, Column, types, create_engine
-from sqlalchemy.exc import SQLAlchemyError, InvalidRequestError, DBAPIError, \
- OperationalError
+from sqlalchemy.exc import SQLAlchemyError, InvalidRequestError, DBAPIError, OperationalError
from sqlalchemy.orm import scoped_session, sessionmaker, mapper
from sqlalchemy.pool import NullPool
@@ -111,8 +110,7 @@
while hasattr(upgrade, u'upgrade_%d' % version):
log.debug(u'Running upgrade_%d', version)
try:
- getattr(upgrade, u'upgrade_%d' % version) \
- (session, metadata, tables)
+ getattr(upgrade, u'upgrade_%d' % version) (session, metadata, tables)
except (SQLAlchemyError, DBAPIError):
log.exception(u'Could not run database upgrade script '
'"upgrade_%s", upgrade process has been halted.', version)
@@ -140,11 +138,9 @@
"""
db_file_path = None
if db_file_name:
- db_file_path = os.path.join(
- AppLocation.get_section_data_path(plugin_name), db_file_name)
+ db_file_path = os.path.join(AppLocation.get_section_data_path(plugin_name), db_file_name)
else:
- db_file_path = os.path.join(
- AppLocation.get_section_data_path(plugin_name), plugin_name)
+ db_file_path = os.path.join(AppLocation.get_section_data_path(plugin_name), plugin_name)
return delete_file(db_file_path)
@@ -193,12 +189,9 @@
db_type = settings.value(u'db type', u'sqlite')
if db_type == u'sqlite':
if db_file_name:
- self.db_url = u'sqlite:///%s/%s' % (
- AppLocation.get_section_data_path(plugin_name),
- db_file_name)
+ self.db_url = u'sqlite:///%s/%s' % (AppLocation.get_section_data_path(plugin_name), db_file_name)
else:
- self.db_url = u'sqlite:///%s/%s.sqlite' % (
- AppLocation.get_section_data_path(plugin_name), plugin_name)
+ self.db_url = u'sqlite:///%s/%s.sqlite' % (AppLocation.get_section_data_path(plugin_name), plugin_name)
else:
self.db_url = u'%s://%s:%s@%s/%s' % (db_type,
urlquote(settings.value(u'db username', u'')),
@@ -226,10 +219,8 @@
self.session = init_schema(self.db_url)
except (SQLAlchemyError, DBAPIError):
log.exception(u'Error loading database: %s', self.db_url)
- critical_error_message_box(
- translate('OpenLP.Manager', 'Database Error'),
- translate('OpenLP.Manager', 'OpenLP cannot load your '
- 'database.\n\nDatabase: %s') % self.db_url
+ critical_error_message_box(translate('OpenLP.Manager', 'Database Error'),
+ translate('OpenLP.Manager', 'OpenLP cannot load your database.\n\nDatabase: %s') % self.db_url
)
def save_object(self, object_instance, commit=True):
=== modified file 'openlp/core/lib/dockwidget.py'
--- openlp/core/lib/dockwidget.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/dockwidget.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/lib/eventreceiver.py'
--- openlp/core/lib/eventreceiver.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/eventreceiver.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/lib/formattingtags.py'
--- openlp/core/lib/formattingtags.py 2012-12-27 16:27:59 +0000
+++ openlp/core/lib/formattingtags.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -69,8 +69,7 @@
if isinstance(tag[element], unicode):
tag[element] = tag[element].encode('utf8')
# Formatting Tags were also known as display tags.
- Settings().setValue(u'displayTags/html_tags',
- cPickle.dumps(tags) if tags else u'')
+ Settings().setValue(u'displayTags/html_tags', cPickle.dumps(tags) if tags else u'')
@staticmethod
def load_tags():
=== modified file 'openlp/core/lib/htmlbuilder.py'
--- openlp/core/lib/htmlbuilder.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/htmlbuilder.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -31,8 +31,7 @@
from PyQt4 import QtWebKit
-from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, \
- VerticalType, HorizontalType
+from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, VerticalType, HorizontalType
log = logging.getLogger(__name__)
@@ -258,8 +257,7 @@
css_additions,
build_footer_css(item, height),
build_lyrics_css(item, webkitvers),
- u'true' if theme and theme.display_slide_transition and islive \
- else u'false',
+ u'true' if theme and theme.display_slide_transition and islive else u'false',
js_additions,
bgimage_src, image_src,
html_additions,
@@ -290,49 +288,26 @@
theme = item.themedata
background = u'background-color: black'
if theme:
- if theme.background_type == \
- BackgroundType.to_string(BackgroundType.Transparent):
+ if theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
background = u''
- elif theme.background_type == \
- BackgroundType.to_string(BackgroundType.Solid):
+ elif theme.background_type == BackgroundType.to_string(BackgroundType.Solid):
background = u'background-color: %s' % theme.background_color
else:
- if theme.background_direction == BackgroundGradientType.to_string \
- (BackgroundGradientType.Horizontal):
- background = \
- u'background: ' \
- u'-webkit-gradient(linear, left top, left bottom, ' \
- 'from(%s), to(%s)) fixed' % (theme.background_start_color,
- theme.background_end_color)
- elif theme.background_direction == \
- BackgroundGradientType.to_string( \
- BackgroundGradientType.LeftTop):
- background = \
- u'background: ' \
- u'-webkit-gradient(linear, left top, right bottom, ' \
- 'from(%s), to(%s)) fixed' % (theme.background_start_color,
- theme.background_end_color)
- elif theme.background_direction == \
- BackgroundGradientType.to_string \
- (BackgroundGradientType.LeftBottom):
- background = \
- u'background: ' \
- u'-webkit-gradient(linear, left bottom, right top, ' \
- 'from(%s), to(%s)) fixed' % (theme.background_start_color,
- theme.background_end_color)
- elif theme.background_direction == \
- BackgroundGradientType.to_string \
- (BackgroundGradientType.Vertical):
- background = \
- u'background: -webkit-gradient(linear, left top, ' \
- u'right top, from(%s), to(%s)) fixed' % \
+ if theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.Horizontal):
+ background = u'background: -webkit-gradient(linear, left top, left bottom, from(%s), to(%s)) fixed' \
+ % (theme.background_start_color, theme.background_end_color)
+ elif theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.LeftTop):
+ background = u'background: -webkit-gradient(linear, left top, right bottom, from(%s), to(%s)) fixed' \
+ % (theme.background_start_color, theme.background_end_color)
+ elif theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.LeftBottom):
+ background = u'background: -webkit-gradient(linear, left bottom, right top, from(%s), to(%s)) fixed' \
+ % (theme.background_start_color, theme.background_end_color)
+ elif theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.Vertical):
+ background = u'background: -webkit-gradient(linear, left top, right top, from(%s), to(%s)) fixed' % \
(theme.background_start_color, theme.background_end_color)
else:
- background = \
- u'background: -webkit-gradient(radial, %s 50%%, 100, %s ' \
- u'50%%, %s, from(%s), to(%s)) fixed' % (width, width,
- width, theme.background_start_color,
- theme.background_end_color)
+ background = u'background: -webkit-gradient(radial, %s 50%%, 100, %s 50%%, %s, from(%s), to(%s)) fixed'\
+ % (width, width, width, theme.background_start_color, theme.background_end_color)
return background
def build_lyrics_css(item, webkitvers):
@@ -376,8 +351,7 @@
shadow = u''
if theme and item.main:
lyricstable = u'left: %spx; top: %spx;' % (item.main.x(), item.main.y())
- lyrics = build_lyrics_format_css(theme, item.main.width(),
- item.main.height())
+ lyrics = build_lyrics_format_css(theme, item.main.width(), item.main.height())
# For performance reasons we want to show as few DIV's as possible,
# especially when animating/transitions.
# However some bugs in older versions of qtwebkit mean we need to
@@ -400,9 +374,8 @@
if theme.font_main_shadow:
if theme.font_main_outline and webkitvers <= 534.3:
shadow = u'padding-left: %spx; padding-top: %spx;' % \
- (int(theme.font_main_shadow_size) +
- (int(theme.font_main_outline_size) * 2),
- theme.font_main_shadow_size)
+ (int(theme.font_main_shadow_size) + (int(theme.font_main_outline_size) * 2),
+ theme.font_main_shadow_size)
shadow += build_lyrics_outline_css(theme, True)
else:
lyricsmain += u' text-shadow: %s %spx %spx;' % \
@@ -430,8 +403,7 @@
else:
fill_color = theme.font_main_color
outline_color = theme.font_main_outline_color
- return u' -webkit-text-stroke: %sem %s; ' \
- u'-webkit-text-fill-color: %s; ' % (size, outline_color, fill_color)
+ return u' -webkit-text-stroke: %sem %s; -webkit-text-fill-color: %s; ' % (size, outline_color, fill_color)
else:
return u''
@@ -467,11 +439,9 @@
lyrics = u'%s word-wrap: break-word; ' \
'text-align: %s; vertical-align: %s; font-family: %s; ' \
'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
- 'padding: 0; padding-bottom: %s; padding-left: %spx; width: %spx;' \
- 'height: %spx; ' % \
+ 'padding: 0; padding-bottom: %s; padding-left: %spx; width: %spx; height: %spx; ' % \
(justify, align, valign, theme.font_main_name, theme.font_main_size,
- theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
- padding_bottom, left_margin, width, height)
+ theme.font_main_color, 100 + int(theme.font_main_line_adjustment), padding_bottom, left_margin, width, height)
if theme.font_main_outline:
if webkit_version() <= 534.3:
lyrics += u' letter-spacing: 1px;'
@@ -531,7 +501,6 @@
if not theme or not item.footer:
return u''
bottom = height - int(item.footer.y()) - int(item.footer.height())
- lyrics_html = style % (item.footer.x(), bottom,
- item.footer.width(), theme.font_footer_name,
- theme.font_footer_size, theme.font_footer_color)
+ lyrics_html = style % (item.footer.x(), bottom, item.footer.width(),
+ theme.font_footer_name, theme.font_footer_size, theme.font_footer_color)
return lyrics_html
=== modified file 'openlp/core/lib/imagemanager.py'
--- openlp/core/lib/imagemanager.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/imagemanager.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -190,8 +190,7 @@
self.imageThread = ImageThread(self)
self._conversionQueue = PriorityQueue()
self.stopManager = False
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_updated'), self.processUpdates)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.processUpdates)
def updateDisplay(self):
"""
@@ -293,14 +292,12 @@
if not (path, source) in self._cache:
image = Image(path, source, background)
self._cache[(path, source)] = image
- self._conversionQueue.put(
- (image.priority, image.secondary_priority, image))
+ self._conversionQueue.put((image.priority, image.secondary_priority, image))
# Check if the there are any images with the same path and check if the
# timestamp has changed.
for image in self._cache.values():
if os.path.exists(path):
- if image.path == path and \
- image.timestamp != os.stat(path).st_mtime:
+ if image.path == path and image.timestamp != os.stat(path).st_mtime:
image.timestamp = os.stat(path).st_mtime
self._resetImage(image)
# We want only one thread.
@@ -324,8 +321,7 @@
image = self._conversionQueue.get()[2]
# Generate the QImage for the image.
if image.image is None:
- image.image = resize_image(image.path, self.width, self.height,
- image.background)
+ image.image = resize_image(image.path, self.width, self.height, image.background)
# Set the priority to Lowest and stop here as we need to process
# more important images first.
if image.priority == Priority.Normal:
=== modified file 'openlp/core/lib/listwidgetwithdnd.py'
--- openlp/core/lib/listwidgetwithdnd.py 2012-12-04 21:50:14 +0000
+++ openlp/core/lib/listwidgetwithdnd.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -53,8 +53,7 @@
"""
self.setAcceptDrops(True)
self.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'%s_dnd' % self.mimeDataText),
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_dnd' % self.mimeDataText),
self.parent().loadFile)
def mouseMoveEvent(self, event):
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2012-12-27 16:27:59 +0000
+++ openlp/core/lib/mediamanageritem.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -35,12 +35,10 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import SettingsManager, OpenLPToolbar, ServiceItem, \
- StringContent, build_icon, translate, Receiver, ListWidgetWithDnD, \
- ServiceItemContext, Settings
+from openlp.core.lib import SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, translate, \
+ Receiver, ListWidgetWithDnD, ServiceItemContext, Settings
from openlp.core.lib.searchedit import SearchEdit
-from openlp.core.lib.ui import UiStrings, create_widget_action, \
- critical_error_message_box
+from openlp.core.lib.ui import UiStrings, create_widget_action, critical_error_message_box
log = logging.getLogger(__name__)
@@ -116,8 +114,7 @@
self.setupUi()
self.retranslateUi()
self.autoSelectId = -1
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'%s_service_load' % self.plugin.name),
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_service_load' % self.plugin.name),
self.serviceLoad)
def requiredIcons(self):
@@ -204,8 +201,7 @@
for action in toolbar_actions:
if action[0] == StringContent.Preview:
self.toolbar.addSeparator()
- self.toolbar.addToolbarAction(
- u'%s%sAction' % (self.plugin.name, action[0]),
+ self.toolbar.addToolbarAction(u'%s%sAction' % (self.plugin.name, action[0]),
text=self.plugin.getString(action[1])[u'title'], icon=action[2],
tooltip=self.plugin.getString(action[1])[u'tooltip'],
triggers=action[3])
@@ -217,8 +213,7 @@
# Add the List widget
self.listView = ListWidgetWithDnD(self, self.plugin.name)
self.listView.setSpacing(1)
- self.listView.setSelectionMode(
- QtGui.QAbstractItemView.ExtendedSelection)
+ self.listView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.listView.setAlternatingRowColors(True)
self.listView.setObjectName(u'%sListView' % self.plugin.name)
# Add to pageLayout
@@ -255,22 +250,19 @@
triggers=self.onAddClick)
if self.addToServiceItem:
create_widget_action(self.listView, separator=True)
- create_widget_action(self.listView, text=translate(
- 'OpenLP.MediaManagerItem', '&Add to selected Service Item'),
+ create_widget_action(self.listView,
+ text=translate('OpenLP.MediaManagerItem', '&Add to selected Service Item'),
icon=u':/general/general_add.png',
triggers=self.onAddEditClick)
self.addCustomContextActions()
# Create the context menu and add all actions from the listView.
self.menu = QtGui.QMenu()
self.menu.addActions(self.listView.actions())
- QtCore.QObject.connect(self.listView,
- QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
+ QtCore.QObject.connect(self.listView, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onDoubleClicked)
- QtCore.QObject.connect(self.listView,
- QtCore.SIGNAL(u'itemSelectionChanged()'),
+ QtCore.QObject.connect(self.listView, QtCore.SIGNAL(u'itemSelectionChanged()'),
self.onSelectionChange)
- QtCore.QObject.connect(self.listView,
- QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
+ QtCore.QObject.connect(self.listView, QtCore.SIGNAL(u'customContextMenuRequested(QPoint)'),
self.contextMenu)
def addSearchToToolBar(self):
@@ -299,12 +291,9 @@
self.searchLayout.addLayout(self.searchButtonLayout)
self.pageLayout.addWidget(self.searchWidget)
# Signals and slots
- QtCore.QObject.connect(self.searchTextEdit,
- QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClicked)
- QtCore.QObject.connect(self.searchTextButton,
- QtCore.SIGNAL(u'clicked()'), self.onSearchTextButtonClicked)
- QtCore.QObject.connect(self.searchTextEdit,
- QtCore.SIGNAL(u'textChanged(const QString&)'),
+ QtCore.QObject.connect(self.searchTextEdit, QtCore.SIGNAL(u'returnPressed()'), self.onSearchTextButtonClicked)
+ QtCore.QObject.connect(self.searchTextButton, QtCore.SIGNAL(u'clicked()'), self.onSearchTextButtonClicked)
+ QtCore.QObject.connect(self.searchTextEdit, QtCore.SIGNAL(u'textChanged(const QString&)'),
self.onSearchTextEditChanged)
def addCustomContextActions(self):
@@ -337,10 +326,8 @@
"""
Add a file to the list widget to make it available for showing
"""
- files = QtGui.QFileDialog.getOpenFileNames(
- self, self.onNewPrompt,
- SettingsManager.get_last_dir(self.settingsSection),
- self.onNewFileMasks)
+ files = QtGui.QFileDialog.getOpenFileNames(self, self.onNewPrompt,
+ SettingsManager.get_last_dir(self.settingsSection), self.onNewFileMasks)
log.info(u'New files(s) %s', files)
if files:
Receiver.send_message(u'cursor_busy')
@@ -361,11 +348,8 @@
type = file.split(u'.')[-1]
if type.lower() not in self.onNewFileMasks:
if not error_shown:
- critical_error_message_box(
- translate('OpenLP.MediaManagerItem',
- 'Invalid File Type'),
- translate('OpenLP.MediaManagerItem',
- 'Invalid File %s.\nSuffix not supported') % file)
+ critical_error_message_box(translate('OpenLP.MediaManagerItem', 'Invalid File Type'),
+ translate('OpenLP.MediaManagerItem', 'Invalid File %s.\nSuffix not supported') % file)
error_shown = True
else:
new_files.append(file)
@@ -402,10 +386,8 @@
SettingsManager.set_list(self.settingsSection,
self.settingsSection, self.getFileList())
if duplicates_found:
- critical_error_message_box(
- UiStrings().Duplicate,
- translate('OpenLP.MediaManagerItem',
- 'Duplicate files were found on import and were ignored.'))
+ critical_error_message_box(UiStrings().Duplicate,
+ translate('OpenLP.MediaManagerItem', 'Duplicate files were found on import and were ignored.'))
def contextMenu(self, point):
item = self.listView.itemAt(point)
@@ -430,8 +412,7 @@
return file_list
def loadList(self, list):
- raise NotImplementedError(u'MediaManagerItem.loadList needs to be '
- u'defined by the plugin')
+ raise NotImplementedError(u'MediaManagerItem.loadList needs to be defined by the plugin')
def onNewClick(self):
"""
@@ -446,8 +427,7 @@
pass
def onDeleteClick(self):
- raise NotImplementedError(u'MediaManagerItem.onDeleteClick needs to '
- u'be defined by the plugin')
+ raise NotImplementedError(u'MediaManagerItem.onDeleteClick needs to be defined by the plugin')
def onFocus(self):
"""
@@ -458,8 +438,7 @@
def generateSlideData(self, serviceItem, item=None, xmlVersion=False,
remote=False, context=ServiceItemContext.Live):
- raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
- u'to be defined by the plugin')
+ raise NotImplementedError(u'MediaManagerItem.generateSlideData needs to be defined by the plugin')
def onDoubleClicked(self):
"""
@@ -474,10 +453,8 @@
"""
Allows the change of current item in the list to be actioned
"""
- if Settings().value(u'advanced/single click preview',
- False) and self.quickPreviewAllowed \
- and self.listView.selectedIndexes() \
- and self.autoSelectId == -1:
+ if Settings().value(u'advanced/single click preview', False) and self.quickPreviewAllowed \
+ and self.listView.selectedIndexes() and self.autoSelectId == -1:
self.onPreviewClick(True)
def onPreviewClick(self, keepFocus=False):
@@ -487,8 +464,7 @@
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self, UiStrings().NISp,
- translate('OpenLP.MediaManagerItem',
- 'You must select one or more items to preview.'))
+ translate('OpenLP.MediaManagerItem', 'You must select one or more items to preview.'))
else:
log.debug(u'%s Preview requested', self.plugin.name)
serviceItem = self.buildServiceItem()
@@ -505,8 +481,7 @@
"""
if not self.listView.selectedIndexes():
QtGui.QMessageBox.information(self, UiStrings().NISp,
- translate('OpenLP.MediaManagerItem',
- 'You must select one or more items to send live.'))
+ translate('OpenLP.MediaManagerItem', 'You must select one or more items to send live.'))
else:
self.goLive()
@@ -534,8 +509,7 @@
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self, UiStrings().NISp,
- translate('OpenLP.MediaManagerItem',
- 'You must select one or more items to add.'))
+ translate('OpenLP.MediaManagerItem', 'You must select one or more items to add.'))
else:
# Is it posssible to process multiple list items to generate
# multiple service items?
@@ -548,12 +522,10 @@
self.addToService(item)
def addToService(self, item=None, replace=None, remote=False):
- serviceItem = self.buildServiceItem(item, True, remote=remote,
- context=ServiceItemContext.Service)
+ serviceItem = self.buildServiceItem(item, True, remote=remote, context=ServiceItemContext.Service)
if serviceItem:
serviceItem.from_plugin = False
- self.plugin.serviceManager.addServiceItem(serviceItem,
- replace=replace)
+ self.plugin.serviceManager.addServiceItem(serviceItem, replace=replace)
def onAddEditClick(self):
"""
@@ -561,29 +533,22 @@
"""
if not self.listView.selectedIndexes() and not self.remoteTriggered:
QtGui.QMessageBox.information(self, UiStrings().NISp,
- translate('OpenLP.MediaManagerItem',
- 'You must select one or more items.'))
+ translate('OpenLP.MediaManagerItem', 'You must select one or more items.'))
else:
log.debug(u'%s Add requested', self.plugin.name)
serviceItem = self.plugin.serviceManager.getServiceItem()
if not serviceItem:
QtGui.QMessageBox.information(self, UiStrings().NISs,
- translate('OpenLP.MediaManagerItem',
- 'You must select an existing service item to add to.'))
+ translate('OpenLP.MediaManagerItem', 'You must select an existing service item to add to.'))
elif self.plugin.name == serviceItem.name:
self.generateSlideData(serviceItem)
- self.plugin.serviceManager.addServiceItem(serviceItem,
- replace=True)
+ self.plugin.serviceManager.addServiceItem(serviceItem, replace=True)
else:
# Turn off the remote edit update message indicator
- QtGui.QMessageBox.information(self,
- translate('OpenLP.MediaManagerItem',
- 'Invalid Service Item'),
- translate('OpenLP.MediaManagerItem',
- 'You must select a %s service item.') % self.title)
+ QtGui.QMessageBox.information(self, translate('OpenLP.MediaManagerItem', 'Invalid Service Item'),
+ translate('OpenLP.MediaManagerItem', 'You must select a %s service item.') % self.title)
- def buildServiceItem(self, item=None, xmlVersion=False, remote=False,
- context=ServiceItemContext.Live):
+ def buildServiceItem(self, item=None, xmlVersion=False, remote=False, context=ServiceItemContext.Live):
"""
Common method for generating a service item
"""
@@ -652,5 +617,4 @@
"""
Performs a plugin specific search for items containing ``string``
"""
- raise NotImplementedError(
- u'Plugin.search needs to be defined by the plugin')
+ raise NotImplementedError(u'Plugin.search needs to be defined by the plugin')
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2012-12-27 16:27:59 +0000
+++ openlp/core/lib/plugin.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -172,11 +172,9 @@
self.pluginManager = plugin_helpers[u'pluginmanager']
self.formParent = plugin_helpers[u'formparent']
self.mediaController = plugin_helpers[u'mediacontroller']
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'%s_add_service_item' % self.name),
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_add_service_item' % self.name),
self.processAddServiceEvent)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'%s_config_updated' % self.name),
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_config_updated' % self.name),
self.configUpdated)
def checkPreConditions(self):
@@ -192,8 +190,7 @@
"""
Sets the status of the plugin
"""
- self.status = Settings().value(
- self.settingsSection + u'/status', PluginStatus.Inactive)
+ self.status = Settings().value(self.settingsSection + u'/status', PluginStatus.Inactive)
def toggleStatus(self, new_status):
"""
@@ -220,8 +217,7 @@
you need, and return it for integration into OpenLP.
"""
if self.mediaItemClass:
- self.mediaItem = self.mediaItemClass(self.mediaDock.media_dock,
- self, self.icon)
+ self.mediaItem = self.mediaItemClass(self.mediaDock.media_dock, self, self.icon)
def addImportMenuItem(self, importMenu):
"""
@@ -257,8 +253,7 @@
"""
if self.settingsTabClass:
self.settingsTab = self.settingsTabClass(parent, self.name,
- self.getString(StringContent.VisibleName)[u'title'],
- self.iconPath)
+ self.getString(StringContent.VisibleName)[u'title'], self.iconPath)
def addToMenu(self, menubar):
"""
@@ -273,8 +268,7 @@
"""
Generic Drag and drop handler triggered from service_manager.
"""
- log.debug(u'processAddServiceEvent event called for plugin %s' %
- self.name)
+ log.debug(u'processAddServiceEvent event called for plugin %s' % self.name)
if replace:
self.mediaItem.onAddEditClick()
else:
@@ -285,8 +279,7 @@
Show a dialog when the user clicks on the 'About' button in the plugin
manager.
"""
- raise NotImplementedError(
- u'Plugin.about needs to be defined by the plugin')
+ raise NotImplementedError(u'Plugin.about needs to be defined by the plugin')
def initialise(self):
"""
@@ -305,7 +298,7 @@
def appStartup(self):
"""
- Perform tasks on application starup
+ Perform tasks on application startup
"""
pass
@@ -340,29 +333,21 @@
Called to define all translatable texts of the plugin
"""
## Load Action ##
- self.__setNameTextString(StringContent.Load,
- UiStrings().Load, tooltips[u'load'])
+ self.__setNameTextString(StringContent.Load, UiStrings().Load, tooltips[u'load'])
## Import Action ##
- self.__setNameTextString(StringContent.Import,
- UiStrings().Import, tooltips[u'import'])
+ self.__setNameTextString(StringContent.Import, UiStrings().Import, tooltips[u'import'])
## New Action ##
- self.__setNameTextString(StringContent.New,
- UiStrings().Add, tooltips[u'new'])
+ self.__setNameTextString(StringContent.New, UiStrings().Add, tooltips[u'new'])
## Edit Action ##
- self.__setNameTextString(StringContent.Edit,
- UiStrings().Edit, tooltips[u'edit'])
+ self.__setNameTextString(StringContent.Edit, UiStrings().Edit, tooltips[u'edit'])
## Delete Action ##
- self.__setNameTextString(StringContent.Delete,
- UiStrings().Delete, tooltips[u'delete'])
+ self.__setNameTextString(StringContent.Delete, UiStrings().Delete, tooltips[u'delete'])
## Preview Action ##
- self.__setNameTextString(StringContent.Preview,
- UiStrings().Preview, tooltips[u'preview'])
+ self.__setNameTextString(StringContent.Preview, UiStrings().Preview, tooltips[u'preview'])
## Send Live Action ##
- self.__setNameTextString(StringContent.Live,
- UiStrings().Live, tooltips[u'live'])
+ self.__setNameTextString(StringContent.Live, UiStrings().Live, tooltips[u'live'])
## Add to Service Action ##
- self.__setNameTextString(StringContent.Service,
- UiStrings().Service, tooltips[u'service'])
+ self.__setNameTextString(StringContent.Service, UiStrings().Service, tooltips[u'service'])
def __setNameTextString(self, name, title, tooltip):
"""
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/pluginmanager.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -107,13 +107,12 @@
modulename = modulename[len(prefix) + 1:]
modulename = modulename.replace(os.path.sep, '.')
# import the modules
- log.debug(u'Importing %s from %s. Depth %d',
- modulename, path, thisdepth)
+ log.debug(u'Importing %s from %s. Depth %d', modulename, path, thisdepth)
try:
__import__(modulename, globals(), locals(), [])
except ImportError, e:
- log.exception(u'Failed to import module %s on path %s '
- 'for reason %s', modulename, path, e.args[0])
+ log.exception(u'Failed to import module %s on path %s for reason %s',
+ modulename, path, e.args[0])
plugin_classes = Plugin.__subclasses__()
plugin_objects = []
for p in plugin_classes:
@@ -197,8 +196,7 @@
"""
log.info(u'Initialise Plugins - Started')
for plugin in self.plugins:
- log.info(u'initialising plugins %s in a %s state'
- % (plugin.name, plugin.isActive()))
+ log.info(u'initialising plugins %s in a %s state' % (plugin.name, plugin.isActive()))
if plugin.isActive():
plugin.initialise()
log.info(u'Initialisation Complete for %s ' % plugin.name)
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/renderer.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -31,8 +31,7 @@
from PyQt4 import QtGui, QtCore, QtWebKit
-from openlp.core.lib import ServiceItem, expand_tags, \
- build_lyrics_format_css, build_lyrics_outline_css, Receiver, \
+from openlp.core.lib import ServiceItem, expand_tags, build_lyrics_format_css, build_lyrics_outline_css, Receiver, \
ItemCapabilities, FormattingTags, ImageSource
from openlp.core.lib.theme import ThemeLevel
from openlp.core.ui import MainDisplay, ScreenList
@@ -81,8 +80,7 @@
self.display.setup()
self._theme_dimensions = {}
self._calculate_default()
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'theme_update_global'), self.set_global_theme)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_update_global'), self.set_global_theme)
self.web = QtWebKit.QWebView()
self.web.setVisible(False)
self.web_frame = self.web.page().mainFrame()
@@ -115,8 +113,7 @@
Only remove the given ``theme_name`` from the ``_theme_dimensions``
list. This can be used when a theme is permanently deleted.
"""
- if old_theme_name is not None and \
- old_theme_name in self._theme_dimensions:
+ if old_theme_name is not None and old_theme_name in self._theme_dimensions:
del self._theme_dimensions[old_theme_name]
if theme_name in self._theme_dimensions:
del self._theme_dimensions[theme_name]
@@ -134,16 +131,13 @@
theme_data = self.theme_manager.getThemeData(theme_name)
main_rect = self.get_main_rectangle(theme_data)
footer_rect = self.get_footer_rectangle(theme_data)
- self._theme_dimensions[theme_name] = \
- [theme_data, main_rect, footer_rect]
+ self._theme_dimensions[theme_name] = [theme_data, main_rect, footer_rect]
else:
- theme_data, main_rect, footer_rect = \
- self._theme_dimensions[theme_name]
+ theme_data, main_rect, footer_rect = self._theme_dimensions[theme_name]
# if No file do not update cache
if theme_data.background_filename:
self.image_manager.addImage(theme_data.background_filename,
- ImageSource.Theme,
- QtGui.QColor(theme_data.background_border_color))
+ ImageSource.Theme, QtGui.QColor(theme_data.background_border_color))
def pre_render(self, override_theme_data=None):
"""
@@ -172,8 +166,7 @@
if override_theme_data is None:
if theme_to_use not in self._theme_dimensions:
self._set_theme(theme_to_use)
- theme_data, main_rect, footer_rect = \
- self._theme_dimensions[theme_to_use]
+ theme_data, main_rect, footer_rect = self._theme_dimensions[theme_to_use]
else:
# Ignore everything and use own theme data.
theme_data = override_theme_data
@@ -305,13 +298,11 @@
text_contains_split = u'[---]' in text
if text_contains_split:
try:
- text_to_render, text = \
- text.split(u'\n[---]\n', 1)
+ text_to_render, text = text.split(u'\n[---]\n', 1)
except ValueError:
text_to_render = text.split(u'\n[---]\n')[0]
text = u''
- text_to_render, raw_tags, html_tags = \
- self._get_start_tags(text_to_render)
+ text_to_render, raw_tags, html_tags = self._get_start_tags(text_to_render)
if text:
text = raw_tags + text
else:
@@ -504,9 +495,8 @@
# the line will not fit as a whole.
raw_words = self._words_split(line)
html_words = map(expand_tags, raw_words)
- previous_html, previous_raw = self._binary_chop(
- formatted, previous_html, previous_raw, html_words,
- raw_words, u' ', line_end)
+ previous_html, previous_raw = \
+ self._binary_chop(formatted, previous_html, previous_raw, html_words, raw_words, u' ', line_end)
else:
previous_html += html_line + line_end
previous_raw += line + line_end
@@ -537,13 +527,9 @@
for tag in FormattingTags.get_html_tags():
if tag[u'start tag'] == u'{br}':
continue
- if raw_text.count(tag[u'start tag']) != \
- raw_text.count(tag[u'end tag']):
- raw_tags.append(
- (raw_text.find(tag[u'start tag']), tag[u'start tag'],
- tag[u'end tag']))
- html_tags.append(
- (raw_text.find(tag[u'start tag']), tag[u'start html']))
+ if raw_text.count(tag[u'start tag']) != raw_text.count(tag[u'end tag']):
+ raw_tags.append((raw_text.find(tag[u'start tag']), tag[u'start tag'], tag[u'end tag']))
+ html_tags.append((raw_text.find(tag[u'start tag']), tag[u'start html']))
# Sort the lists, so that the tags which were opened first on the first
# slide (the text we are checking) will be opened first on the next
# slide as well.
@@ -558,11 +544,9 @@
end_tags.reverse()
# Remove the indexes.
html_tags = [tag[1] for tag in html_tags]
- return raw_text + u''.join(end_tags), u''.join(start_tags), \
- u''.join(html_tags)
+ return raw_text + u''.join(end_tags), u''.join(start_tags), u''.join(html_tags)
- def _binary_chop(self, formatted, previous_html, previous_raw, html_list,
- raw_list, separator, line_end):
+ def _binary_chop(self, formatted, previous_html, previous_raw, html_list, raw_list, separator, line_end):
"""
This implements the binary chop algorithm for faster rendering. This
algorithm works line based (line by line) and word based (word by word).
@@ -612,8 +596,7 @@
# We found the number of words which will fit.
if smallest_index == index or highest_index == index:
index = smallest_index
- text = previous_raw.rstrip(u'<br>') + \
- separator.join(raw_list[:index + 1])
+ text = previous_raw.rstrip(u'<br>') + separator.join(raw_list[:index + 1])
text, raw_tags, html_tags = self._get_start_tags(text)
formatted.append(text)
previous_html = u''
@@ -627,10 +610,8 @@
# Check if the remaining elements fit on the slide.
if self._text_fits_on_slide(
html_tags + separator.join(html_list[index + 1:]).strip()):
- previous_html = html_tags + separator.join(
- html_list[index + 1:]).strip() + line_end
- previous_raw = raw_tags + separator.join(
- raw_list[index + 1:]).strip() + line_end
+ previous_html = html_tags + separator.join(html_list[index + 1:]).strip() + line_end
+ previous_raw = raw_tags + separator.join(raw_list[index + 1:]).strip() + line_end
break
else:
# The remaining elements do not fit, thus reset the indexes,
@@ -652,8 +633,7 @@
``text``
The text to check. It may contain HTML tags.
"""
- self.web_frame.evaluateJavaScript(u'show_text("%s")' %
- text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
+ self.web_frame.evaluateJavaScript(u'show_text("%s")' % text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
return self.web_frame.contentsSize().height() <= self.empty_height
def _words_split(self, line):
=== modified file 'openlp/core/lib/searchedit.py'
--- openlp/core/lib/searchedit.py 2012-12-04 21:50:14 +0000
+++ openlp/core/lib/searchedit.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -54,16 +54,8 @@
u'QToolButton { border: none; padding: 0px; }')
self.clearButton.resize(18, 18)
self.clearButton.hide()
- QtCore.QObject.connect(
- self.clearButton,
- QtCore.SIGNAL(u'clicked()'),
- self._onClearButtonClicked
- )
- QtCore.QObject.connect(
- self,
- QtCore.SIGNAL(u'textChanged(const QString&)'),
- self._onSearchEditTextChanged
- )
+ QtCore.QObject.connect(self.clearButton, QtCore.SIGNAL(u'clicked()'), self._onClearButtonClicked)
+ QtCore.QObject.connect(self, QtCore.SIGNAL(u'textChanged(const QString&)'), self._onSearchEditTextChanged)
self._updateStyleSheet()
self.setAcceptDrops(False)
@@ -72,24 +64,16 @@
Internal method to update the stylesheet depending on which widgets are
available and visible.
"""
- frameWidth = self.style().pixelMetric(
- QtGui.QStyle.PM_DefaultFrameWidth)
+ frameWidth = self.style().pixelMetric(QtGui.QStyle.PM_DefaultFrameWidth)
rightPadding = self.clearButton.width() + frameWidth
if hasattr(self, u'menuButton'):
leftPadding = self.menuButton.width()
- self.setStyleSheet(
- u'QLineEdit { padding-left: %spx; padding-right: %spx; } ' %
- (leftPadding, rightPadding))
+ self.setStyleSheet(u'QLineEdit { padding-left: %spx; padding-right: %spx; } ' % (leftPadding, rightPadding))
else:
- self.setStyleSheet(u'QLineEdit { padding-right: %spx; } ' %
- rightPadding)
+ self.setStyleSheet(u'QLineEdit { padding-right: %spx; } ' % rightPadding)
msz = self.minimumSizeHint()
- self.setMinimumSize(
- max(msz.width(),
- self.clearButton.width() + (frameWidth * 2) + 2),
- max(msz.height(),
- self.clearButton.height() + (frameWidth * 2) + 2)
- )
+ self.setMinimumSize(max(msz.width(), self.clearButton.width() + (frameWidth * 2) + 2),
+ max(msz.height(), self.clearButton.height() + (frameWidth * 2) + 2))
def resizeEvent(self, event):
"""
@@ -99,14 +83,12 @@
The event that happened.
"""
size = self.clearButton.size()
- frameWidth = self.style().pixelMetric(
- QtGui.QStyle.PM_DefaultFrameWidth)
+ frameWidth = self.style().pixelMetric(QtGui.QStyle.PM_DefaultFrameWidth)
self.clearButton.move(self.rect().right() - frameWidth - size.width(),
(self.rect().bottom() + 1 - size.height()) / 2)
if hasattr(self, u'menuButton'):
size = self.menuButton.size()
- self.menuButton.move(self.rect().left() + frameWidth + 2,
- (self.rect().bottom() + 1 - size.height()) / 2)
+ self.menuButton.move(self.rect().left() + frameWidth + 2, (self.rect().bottom() + 1 - size.height()) / 2)
def currentSearchType(self):
"""
@@ -215,9 +197,7 @@
# setPlaceholderText has been implemented in Qt 4.7 and in at least
# PyQt 4.9 (I am not sure, if it was implemented in PyQt 4.8).
try:
- self.setPlaceholderText(
- self.menuButton.defaultAction().placeholderText)
+ self.setPlaceholderText(self.menuButton.defaultAction().placeholderText)
except AttributeError:
pass
- self.emit(QtCore.SIGNAL(u'searchTypeChanged(int)'),
- self._currentSearchType)
+ self.emit(QtCore.SIGNAL(u'searchTypeChanged(int)'), self._currentSearchType)
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2012-12-20 12:09:12 +0000
+++ openlp/core/lib/serviceitem.py 2012-12-29 18:15:31 +0000
@@ -570,12 +570,10 @@
start = None
end = None
if self.start_time != 0:
- start = translate('OpenLP.ServiceItem',
- '<strong>Start</strong>: %s') % \
+ start = translate('OpenLP.ServiceItem', '<strong>Start</strong>: %s') % \
unicode(datetime.timedelta(seconds=self.start_time))
if self.media_length != 0:
- end = translate('OpenLP.ServiceItem',
- '<strong>Length</strong>: %s') % \
+ end = translate('OpenLP.ServiceItem', '<strong>Length</strong>: %s') % \
unicode(datetime.timedelta(seconds=self.media_length))
if not start and not end:
return u''
=== modified file 'openlp/core/lib/settingsmanager.py'
--- openlp/core/lib/settingsmanager.py 2012-12-27 16:27:59 +0000
+++ openlp/core/lib/settingsmanager.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/settingstab.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -81,10 +81,8 @@
if event:
QtGui.QWidget.resizeEvent(self, event)
width = self.width() - self.tabLayout.spacing() - \
- self.tabLayout.contentsMargins().left() - \
- self.tabLayout.contentsMargins().right()
- left_width = min(width - self.rightColumn.minimumSizeHint().width(),
- width / 2)
+ self.tabLayout.contentsMargins().left() - self.tabLayout.contentsMargins().right()
+ left_width = min(width - self.rightColumn.minimumSizeHint().width(), width / 2)
left_width = max(left_width, self.leftColumn.minimumSizeHint().width())
self.leftColumn.setFixedWidth(left_width)
=== modified file 'openlp/core/lib/spelltextedit.py'
--- openlp/core/lib/spelltextedit.py 2012-12-04 21:50:14 +0000
+++ openlp/core/lib/spelltextedit.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -28,6 +28,7 @@
###############################################################################
import logging
import re
+
try:
import enchant
from enchant import DictNotFoundError
@@ -72,8 +73,7 @@
# Rewrite the mouse event to a left button event so the cursor is
# moved to the location of the pointer.
event = QtGui.QMouseEvent(QtCore.QEvent.MouseButtonPress,
- event.pos(), QtCore.Qt.LeftButton, QtCore.Qt.LeftButton,
- QtCore.Qt.NoModifier)
+ event.pos(), QtCore.Qt.LeftButton, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier)
QtGui.QPlainTextEdit.mousePressEvent(self, event)
def contextMenuEvent(self, event):
@@ -92,20 +92,17 @@
lang_menu = QtGui.QMenu(
translate('OpenLP.SpellTextEdit', 'Language:'))
for lang in enchant.list_languages():
- action = create_action(lang_menu, lang, text=lang,
- checked=lang == self.dictionary.tag)
+ action = create_action(lang_menu, lang, text=lang, checked=lang == self.dictionary.tag)
lang_menu.addAction(action)
popupMenu.insertSeparator(popupMenu.actions()[0])
popupMenu.insertMenu(popupMenu.actions()[0], lang_menu)
- QtCore.QObject.connect(lang_menu,
- QtCore.SIGNAL(u'triggered(QAction*)'), self.setLanguage)
+ QtCore.QObject.connect(lang_menu, QtCore.SIGNAL(u'triggered(QAction*)'), self.setLanguage)
# Check if the selected word is misspelled and offer spelling
# suggestions if it is.
if ENCHANT_AVAILABLE and self.textCursor().hasSelection():
text = self.textCursor().selectedText()
if not self.dictionary.check(text):
- spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit',
- 'Spelling Suggestions'))
+ spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit', 'Spelling Suggestions'))
for word in self.dictionary.suggest(text):
action = SpellAction(word, spell_menu)
action.correct.connect(self.correctWord)
@@ -114,8 +111,7 @@
# suggestions.
if spell_menu.actions():
popupMenu.insertMenu(popupMenu.actions()[0], spell_menu)
- tagMenu = QtGui.QMenu(translate('OpenLP.SpellTextEdit',
- 'Formatting Tags'))
+ tagMenu = QtGui.QMenu(translate('OpenLP.SpellTextEdit', 'Formatting Tags'))
if self.formattingTagsAllowed:
for html in FormattingTags.get_html_tags():
action = SpellAction(html[u'desc'], tagMenu)
=== modified file 'openlp/core/lib/theme.py'
--- openlp/core/lib/theme.py 2012-12-01 07:57:54 +0000
+++ openlp/core/lib/theme.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -478,8 +478,7 @@
Pull out the XML string formatted for human consumption
"""
self._build_xml_from_attrs()
- return self.theme_xml.toprettyxml(indent=u' ', newl=u'\n',
- encoding=u'utf-8')
+ return self.theme_xml.toprettyxml(indent=u' ', newl=u'\n', encoding=u'utf-8')
def parse(self, xml):
"""
@@ -512,18 +511,15 @@
if element.tag == u'background':
if element.attrib:
for attr in element.attrib:
- self._create_attr(element.tag, attr, \
- element.attrib[attr])
+ self._create_attr(element.tag, attr, element.attrib[attr])
parent = element.getparent()
if parent is not None:
if parent.tag == u'font':
master = parent.tag + u'_' + parent.attrib[u'type']
# set up Outline and Shadow Tags and move to font_main
if parent.tag == u'display':
- if element.tag.startswith(u'shadow') or \
- element.tag.startswith(u'outline'):
- self._create_attr(u'font_main', element.tag,
- element.text)
+ if element.tag.startswith(u'shadow') or element.tag.startswith(u'outline'):
+ self._create_attr(u'font_main', element.tag, element.text)
master = parent.tag
if parent.tag == u'background':
master = parent.tag
@@ -533,12 +529,10 @@
for attr in element.attrib:
base_element = attr
# correction for the shadow and outline tags
- if element.tag == u'shadow' or \
- element.tag == u'outline':
+ if element.tag == u'shadow' or element.tag == u'outline':
if not attr.startswith(element.tag):
base_element = element.tag + u'_' + attr
- self._create_attr(master, base_element,
- element.attrib[attr])
+ self._create_attr(master, base_element, element.attrib[attr])
else:
if element.tag == u'name':
self._create_attr(u'theme', element.tag, element.text)
@@ -570,8 +564,7 @@
"""
Create the attributes with the correct data types and name format
"""
- reject, master, element, value = \
- self._translate_tags(master, element, value)
+ reject, master, element, value = self._translate_tags(master, element, value)
if reject:
return
field = self._de_hump(element)
@@ -611,21 +604,17 @@
Build the XML from the varables in the object
"""
self._new_document(self.theme_name)
- if self.background_type == \
- BackgroundType.to_string(BackgroundType.Solid):
+ if self.background_type == BackgroundType.to_string(BackgroundType.Solid):
self.add_background_solid(self.background_color)
- elif self.background_type == \
- BackgroundType.to_string(BackgroundType.Gradient):
+ elif self.background_type == BackgroundType.to_string(BackgroundType.Gradient):
self.add_background_gradient(
self.background_start_color,
self.background_end_color,
self.background_direction)
- elif self.background_type == \
- BackgroundType.to_string(BackgroundType.Image):
+ elif self.background_type == BackgroundType.to_string(BackgroundType.Image):
filename = os.path.split(self.background_filename)[1]
self.add_background_image(filename, self.background_border_color)
- elif self.background_type == \
- BackgroundType.to_string(BackgroundType.Transparent):
+ elif self.background_type == BackgroundType.to_string(BackgroundType.Transparent):
self.add_background_transparent()
self.add_font(self.font_main_name,
self.font_main_color,
=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py 2012-12-04 21:50:14 +0000
+++ openlp/core/lib/toolbar.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/lib/ui.py'
--- openlp/core/lib/ui.py 2012-12-27 21:41:11 +0000
+++ openlp/core/lib/ui.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -80,13 +80,10 @@
self.Error = translate('OpenLP.Ui', 'Error')
self.Export = translate('OpenLP.Ui', 'Export')
self.File = translate('OpenLP.Ui', 'File')
- self.FontSizePtUnit = translate('OpenLP.Ui', 'pt',
- 'Abbreviated font pointsize unit')
+ self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font pointsize unit')
self.Help = translate('OpenLP.Ui', 'Help')
- self.Hours = translate('OpenLP.Ui', 'h',
- 'The abbreviated unit for hours')
- self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected',
- 'Singular')
+ self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours')
+ self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected', 'Singular')
self.IFSs = translate('OpenLP.Ui', 'Invalid File Selected', 'Singular')
self.IFSp = translate('OpenLP.Ui', 'Invalid Files Selected', 'Plural')
self.Image = translate('OpenLP.Ui', 'Image')
@@ -96,8 +93,7 @@
self.LiveBGError = translate('OpenLP.Ui', 'Live Background Error')
self.LiveToolbar = translate('OpenLP.Ui', 'Live Toolbar')
self.Load = translate('OpenLP.Ui', 'Load')
- self.Minutes = translate('OpenLP.Ui', 'm',
- 'The abbreviated unit for minutes')
+ self.Minutes = translate('OpenLP.Ui', 'm', 'The abbreviated unit for minutes')
self.Middle = translate('OpenLP.Ui', 'Middle')
self.New = translate('OpenLP.Ui', 'New')
self.NewService = translate('OpenLP.Ui', 'New Service')
@@ -111,8 +107,7 @@
self.OLPV1 = translate('OpenLP.Ui', 'openlp.org 1.x')
self.OLPV2 = translate('OpenLP.Ui', 'OpenLP 2')
self.OLPV2x = translate('OpenLP.Ui', 'OpenLP 2.1')
- self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. '
- 'Do you wish to continue?')
+ self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you wish to continue?')
self.OpenService = translate('OpenLP.Ui', 'Open service.')
self.PlaySlidesInLoop = translate('OpenLP.Ui','Play Slides in Loop')
self.PlaySlidesToEnd = translate('OpenLP.Ui','Play Slides to End')
@@ -122,27 +117,21 @@
self.ReplaceLiveBG = translate('OpenLP.Ui', 'Replace live background.')
self.ResetBG = translate('OpenLP.Ui', 'Reset Background')
self.ResetLiveBG = translate('OpenLP.Ui', 'Reset live background.')
- self.Seconds = translate('OpenLP.Ui', 's',
- 'The abbreviated unit for seconds')
+ self.Seconds = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds')
self.SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview')
self.Search = translate('OpenLP.Ui', 'Search')
- self.SearchThemes = translate(
- 'OpenLP.Ui', 'Search Themes...', 'Search bar place holder text ')
- self.SelectDelete = translate('OpenLP.Ui', 'You must select an item '
- 'to delete.')
- self.SelectEdit = translate('OpenLP.Ui', 'You must select an item to '
- 'edit.')
+ self.SearchThemes = translate('OpenLP.Ui', 'Search Themes...', 'Search bar place holder text ')
+ self.SelectDelete = translate('OpenLP.Ui', 'You must select an item to delete.')
+ self.SelectEdit = translate('OpenLP.Ui', 'You must select an item to edit.')
self.Settings = translate('OpenLP.Ui', 'Settings')
self.SaveService = translate('OpenLP.Ui', 'Save Service')
self.Service = translate('OpenLP.Ui', 'Service')
self.Split = translate('OpenLP.Ui', 'Optional &Split')
- self.SplitToolTip = translate('OpenLP.Ui', 'Split a slide into two '
- 'only if it does not fit on the screen as one slide.')
+ self.SplitToolTip = translate('OpenLP.Ui',
+ 'Split a slide into two only if it does not fit on the screen as one slide.')
self.StartTimeCode = translate('OpenLP.Ui', 'Start %s')
- self.StopPlaySlidesInLoop = translate('OpenLP.Ui',
- 'Stop Play Slides in Loop')
- self.StopPlaySlidesToEnd = translate('OpenLP.Ui',
- 'Stop Play Slides to End')
+ self.StopPlaySlidesInLoop = translate('OpenLP.Ui', 'Stop Play Slides in Loop')
+ self.StopPlaySlidesToEnd = translate('OpenLP.Ui', 'Stop Play Slides to End')
self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular')
self.Themes = translate('OpenLP.Ui', 'Themes', 'Plural')
self.Tools = translate('OpenLP.Ui', 'Tools')
@@ -166,8 +155,7 @@
A splash image for the wizard.
"""
parent.welcomePage = QtGui.QWizardPage()
- parent.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap,
- QtGui.QPixmap(image))
+ parent.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(image))
parent.welcomePage.setObjectName(u'WelcomePage')
parent.welcomeLayout = QtGui.QVBoxLayout(parent.welcomePage)
parent.welcomeLayout.setObjectName(u'WelcomeLayout')
@@ -223,15 +211,12 @@
button_box.addButton(button, QtGui.QDialogButtonBox.ActionRole)
else:
button_box.addButton(*button)
- QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'),
- dialog.accept)
- QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'),
- dialog.reject)
+ QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'), dialog.accept)
+ QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'), dialog.reject)
return button_box
-def critical_error_message_box(title=None, message=None, parent=None,
- question=False):
+def critical_error_message_box(title=None, message=None, parent=None, question=False):
"""
Provides a standard critical message box for errors that OpenLP displays
to users.
@@ -250,8 +235,7 @@
"""
if question:
return QtGui.QMessageBox.critical(parent, UiStrings().Error, message,
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
data = {u'message': message}
data[u'title'] = title if title else UiStrings().Error
return Receiver.send_message(u'openlp_error_message', data)
@@ -306,16 +290,13 @@
role = kwargs.pop(u'role')
if role == u'delete':
kwargs.setdefault(u'text', UiStrings().Delete)
- kwargs.setdefault(u'tooltip',
- translate('OpenLP.Ui', 'Delete the selected item.'))
+ kwargs.setdefault(u'tooltip', translate('OpenLP.Ui', 'Delete the selected item.'))
elif role == u'up':
kwargs.setdefault(u'icon', u':/services/service_up.png')
- kwargs.setdefault(u'tooltip',
- translate('OpenLP.Ui', 'Move selection up one position.'))
+ kwargs.setdefault(u'tooltip', translate('OpenLP.Ui', 'Move selection up one position.'))
elif role == u'down':
kwargs.setdefault(u'icon', u':/services/service_down.png')
- kwargs.setdefault(u'tooltip',
- translate('OpenLP.Ui', 'Move selection down one position.'))
+ kwargs.setdefault(u'tooltip', translate('OpenLP.Ui', 'Move selection down one position.'))
else:
log.warn(u'The role "%s" is not defined in create_push_button().',
role)
@@ -333,8 +314,7 @@
if not kwargs.pop(u'enabled', True):
button.setEnabled(False)
if kwargs.get(u'click'):
- QtCore.QObject.connect(button, QtCore.SIGNAL(u'clicked()'),
- kwargs.pop(u'click'))
+ QtCore.QObject.connect(button, QtCore.SIGNAL(u'clicked()'), kwargs.pop(u'click'))
for key in kwargs.keys():
if key not in [u'text', u'icon', u'tooltip', u'click']:
log.warn(u'Parameter %s was not consumed in create_button().', key)
@@ -423,8 +403,7 @@
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered(bool)'),
kwargs.pop(u'triggers'))
for key in kwargs.keys():
- if key not in [u'text', u'icon', u'tooltip', u'statustip', u'checked',
- u'shortcuts', u'category', u'triggers']:
+ if key not in [u'text', u'icon', u'tooltip', u'statustip', u'checked', u'shortcuts', u'category', u'triggers']:
log.warn(u'Parameter %s was not consumed in create_action().', key)
return action
@@ -469,8 +448,7 @@
label = QtGui.QLabel(parent)
label.setText(translate('OpenLP.Ui', '&Vertical Align:'))
combo_box = QtGui.QComboBox(parent)
- combo_box.addItems(
- [UiStrings().Top, UiStrings().Middle, UiStrings().Bottom])
+ combo_box.addItems([UiStrings().Top, UiStrings().Middle, UiStrings().Bottom])
label.setBuddy(combo_box)
return label, combo_box
=== modified file 'openlp/core/theme/__init__.py'
--- openlp/core/theme/__init__.py 2012-12-01 07:57:54 +0000
+++ openlp/core/theme/__init__.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/theme/theme.py'
--- openlp/core/theme/theme.py 2012-12-01 07:57:54 +0000
+++ openlp/core/theme/theme.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -194,8 +194,7 @@
``xml``
The data to apply to the theme
"""
- root = ElementTree(element=XML(xml.encode(u'ascii',
- u'xmlcharrefreplace')))
+ root = ElementTree(element=XML(xml.encode(u'ascii', u'xmlcharrefreplace')))
xml_iter = root.getiterator()
for element in xml_iter:
delphi_color_change = False
@@ -219,16 +218,13 @@
val = int(element_text)
except ValueError:
val = element_text
- if (element.tag.find(u'Color') > 0 or
- (element.tag.find(u'BackgroundParameter') == 0 and
+ if (element.tag.find(u'Color') > 0 or (element.tag.find(u'BackgroundParameter') == 0 and
isinstance(val, int))):
# convert to a wx.Colour
if not delphi_color_change:
- val = QtGui.QColor(
- val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF)
+ val = QtGui.QColor(val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF)
else:
- val = QtGui.QColor(
- (val>>16)&0xFF, (val>>8)&0xFF, val&0xFF)
+ val = QtGui.QColor((val>>16)&0xFF, (val>>8)&0xFF, val&0xFF)
setattr(self, element.tag, val)
def __str__(self):
=== modified file 'openlp/core/ui/__init__.py'
--- openlp/core/ui/__init__.py 2012-12-03 19:19:10 +0000
+++ openlp/core/ui/__init__.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/ui/aboutdialog.py'
--- openlp/core/ui/aboutdialog.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/aboutdialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -39,8 +39,7 @@
self.aboutDialogLayout = QtGui.QVBoxLayout(aboutDialog)
self.aboutDialogLayout.setObjectName(u'aboutDialogLayout')
self.logoLabel = QtGui.QLabel(aboutDialog)
- self.logoLabel.setPixmap(
- QtGui.QPixmap(u':/graphics/openlp-about-logo.png'))
+ self.logoLabel.setPixmap(QtGui.QPixmap(u':/graphics/openlp-about-logo.png'))
self.logoLabel.setObjectName(u'logoLabel')
self.aboutDialogLayout.addWidget(self.logoLabel)
self.aboutNotebook = QtGui.QTabWidget(aboutDialog)
@@ -73,10 +72,8 @@
self.licenseTabLayout.addWidget(self.licenseTextEdit)
self.aboutNotebook.addTab(self.licenseTab, u'')
self.aboutDialogLayout.addWidget(self.aboutNotebook)
- self.volunteerButton = create_button(None, u'volunteerButton',
- icon=u':/system/system_volunteer.png')
- self.buttonBox = create_button_box(aboutDialog, u'buttonBox',
- [u'close'], [self.volunteerButton])
+ self.volunteerButton = create_button(None, u'volunteerButton', icon=u':/system/system_volunteer.png')
+ self.buttonBox = create_button_box(aboutDialog, u'buttonBox', [u'close'], [self.volunteerButton])
self.aboutDialogLayout.addWidget(self.buttonBox)
self.retranslateUi(aboutDialog)
self.aboutNotebook.setCurrentIndex(0)
@@ -99,8 +96,7 @@
'like to see more free Christian software being written, please '
'consider volunteering by using the button below.'
))
- self.aboutNotebook.setTabText(
- self.aboutNotebook.indexOf(self.aboutTab), UiStrings().About)
+ self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.aboutTab), UiStrings().About)
lead = u'Raoul "superfly" Snyman'
developers = [u'Tim "TRB143" Bentley', u'Jonathan "gushie" Corwin',
u'Michael "cocooncrash" Gorven',
@@ -261,8 +257,7 @@
u'\n '.join(translators[u'ta_LK']),
u'\n '.join(translators[u'zh_CN']),
u'\n '.join(documentors)))
- self.aboutNotebook.setTabText(
- self.aboutNotebook.indexOf(self.creditsTab),
+ self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.creditsTab),
translate('OpenLP.AboutForm', 'Credits'))
copyright = translate('OpenLP.AboutForm',
'Copyright \xa9 2004-2012 %s\n'
@@ -656,10 +651,7 @@
'linking proprietary applications with the library. If this is '
'what you want to do, use the GNU Lesser General Public License '
'instead of this License.')
- self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' %
- (copyright, licence, disclaimer, gpltext))
- self.aboutNotebook.setTabText(
- self.aboutNotebook.indexOf(self.licenseTab),
+ self.licenseTextEdit.setPlainText(u'%s\n\n%s\n\n%s\n\n\n%s' % (copyright, licence, disclaimer, gpltext))
+ self.aboutNotebook.setTabText(self.aboutNotebook.indexOf(self.licenseTab),
translate('OpenLP.AboutForm', 'License'))
- self.volunteerButton.setText(translate('OpenLP.AboutForm',
- 'Volunteer'))
+ self.volunteerButton.setText(translate('OpenLP.AboutForm', 'Volunteer'))
=== modified file 'openlp/core/ui/aboutform.py'
--- openlp/core/ui/aboutform.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/aboutform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -46,17 +46,14 @@
applicationVersion = get_application_version()
self.setupUi(self)
about_text = self.aboutTextEdit.toPlainText()
- about_text = about_text.replace(u'<version>',
- applicationVersion[u'version'])
+ about_text = about_text.replace(u'<version>', applicationVersion[u'version'])
if applicationVersion[u'build']:
- build_text = translate('OpenLP.AboutForm', ' build %s') % \
- applicationVersion[u'build']
+ build_text = translate('OpenLP.AboutForm', ' build %s') % applicationVersion[u'build']
else:
build_text = u''
about_text = about_text.replace(u'<revision>', build_text)
self.aboutTextEdit.setPlainText(about_text)
- QtCore.QObject.connect(self.volunteerButton,
- QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked)
+ QtCore.QObject.connect(self.volunteerButton, QtCore.SIGNAL(u'clicked()'), self.onVolunteerButtonClicked)
def onVolunteerButtonClicked(self):
"""
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py 2012-12-27 16:33:38 +0000
+++ openlp/core/ui/advancedtab.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -36,8 +36,7 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import SettingsTab, translate, build_icon, Receiver, \
- Settings
+from openlp.core.lib import SettingsTab, translate, build_icon, Receiver, Settings
from openlp.core.lib.ui import UiStrings
from openlp.core.utils import get_images_filter, AppLocation, format_time
from openlp.core.lib import SlideLimits
@@ -95,12 +94,10 @@
self.doubleClickLiveCheckBox.setObjectName(u'doubleClickLiveCheckBox')
self.uiLayout.addRow(self.doubleClickLiveCheckBox)
self.singleClickPreviewCheckBox = QtGui.QCheckBox(self.uiGroupBox)
- self.singleClickPreviewCheckBox.setObjectName(
- u'singleClickPreviewCheckBox')
+ self.singleClickPreviewCheckBox.setObjectName(u'singleClickPreviewCheckBox')
self.uiLayout.addRow(self.singleClickPreviewCheckBox)
self.expandServiceItemCheckBox = QtGui.QCheckBox(self.uiGroupBox)
- self.expandServiceItemCheckBox.setObjectName(
- u'expandServiceItemCheckBox')
+ self.expandServiceItemCheckBox.setObjectName(u'expandServiceItemCheckBox')
self.uiLayout.addRow(self.expandServiceItemCheckBox)
self.enableAutoCloseCheckBox = QtGui.QCheckBox(self.uiGroupBox)
self.enableAutoCloseCheckBox.setObjectName(u'enableAutoCloseCheckBox')
@@ -125,33 +122,25 @@
self.serviceNameTimeHBox.setObjectName(u'serviceNameTimeHBox')
self.serviceNameTimeHBox.addWidget(self.serviceNameDay)
self.serviceNameTimeHBox.addWidget(self.serviceNameTime)
- self.serviceNameLayout.addRow(self.serviceNameTimeLabel,
- self.serviceNameTimeHBox)
+ self.serviceNameLayout.addRow(self.serviceNameTimeLabel, self.serviceNameTimeHBox)
self.serviceNameLabel = QtGui.QLabel(self.serviceNameGroupBox)
self.serviceNameLabel.setObjectName(u'serviceNameLabel')
self.serviceNameEdit = QtGui.QLineEdit(self.serviceNameGroupBox)
self.serviceNameEdit.setObjectName(u'serviceNameEdit')
- self.serviceNameEdit.setValidator(QtGui.QRegExpValidator(
- QtCore.QRegExp(r'[^/\\?*|<>\[\]":+]+'), self))
- self.serviceNameRevertButton = QtGui.QToolButton(
- self.serviceNameGroupBox)
- self.serviceNameRevertButton.setObjectName(
- u'serviceNameRevertButton')
- self.serviceNameRevertButton.setIcon(
- build_icon(u':/general/general_revert.png'))
+ self.serviceNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":+]+'), self))
+ self.serviceNameRevertButton = QtGui.QToolButton(self.serviceNameGroupBox)
+ self.serviceNameRevertButton.setObjectName(u'serviceNameRevertButton')
+ self.serviceNameRevertButton.setIcon(build_icon(u':/general/general_revert.png'))
self.serviceNameHBox = QtGui.QHBoxLayout()
self.serviceNameHBox.setObjectName(u'serviceNameHBox')
self.serviceNameHBox.addWidget(self.serviceNameEdit)
self.serviceNameHBox.addWidget(self.serviceNameRevertButton)
- self.serviceNameLayout.addRow(self.serviceNameLabel,
- self.serviceNameHBox)
+ self.serviceNameLayout.addRow(self.serviceNameLabel, self.serviceNameHBox)
self.serviceNameExampleLabel = QtGui.QLabel(self.serviceNameGroupBox)
- self.serviceNameExampleLabel.setObjectName(
- u'serviceNameExampleLabel')
+ self.serviceNameExampleLabel.setObjectName(u'serviceNameExampleLabel')
self.serviceNameExample = QtGui.QLabel(self.serviceNameGroupBox)
self.serviceNameExample.setObjectName(u'serviceNameExample')
- self.serviceNameLayout.addRow(self.serviceNameExampleLabel,
- self.serviceNameExample)
+ self.serviceNameLayout.addRow(self.serviceNameExampleLabel, self.serviceNameExample)
self.leftLayout.addWidget(self.serviceNameGroupBox)
# Data Directory
self.dataDirectoryGroupBox = QtGui.QGroupBox(self.leftColumn)
@@ -159,8 +148,7 @@
self.dataDirectoryLayout = QtGui.QFormLayout(self.dataDirectoryGroupBox)
self.dataDirectoryLayout.setObjectName(u'dataDirectoryLayout')
self.dataDirectoryCurrentLabel = QtGui.QLabel(self.dataDirectoryGroupBox)
- self.dataDirectoryCurrentLabel.setObjectName(
- u'dataDirectoryCurrentLabel')
+ self.dataDirectoryCurrentLabel.setObjectName( u'dataDirectoryCurrentLabel')
self.dataDirectoryLabel = QtGui.QLabel(self.dataDirectoryGroupBox)
self.dataDirectoryLabel.setObjectName(u'dataDirectoryLabel')
self.dataDirectoryNewLabel = QtGui.QLabel(self.dataDirectoryGroupBox)
@@ -168,52 +156,32 @@
self.newDataDirectoryEdit = QtGui.QLineEdit(self.dataDirectoryGroupBox)
self.newDataDirectoryEdit.setObjectName(u'newDataDirectoryEdit')
self.newDataDirectoryEdit.setReadOnly(True)
- self.newDataDirectoryHasFilesLabel = QtGui.QLabel(
- self.dataDirectoryGroupBox)
- self.newDataDirectoryHasFilesLabel.setObjectName(
- u'newDataDirectoryHasFilesLabel')
+ self.newDataDirectoryHasFilesLabel = QtGui.QLabel(self.dataDirectoryGroupBox)
+ self.newDataDirectoryHasFilesLabel.setObjectName(u'newDataDirectoryHasFilesLabel')
self.newDataDirectoryHasFilesLabel.setWordWrap(True)
- self.dataDirectoryBrowseButton = QtGui.QToolButton(
- self.dataDirectoryGroupBox)
- self.dataDirectoryBrowseButton.setObjectName(
- u'dataDirectoryBrowseButton')
- self.dataDirectoryBrowseButton.setIcon(
- build_icon(u':/general/general_open.png'))
- self.dataDirectoryDefaultButton = QtGui.QToolButton(
- self.dataDirectoryGroupBox)
- self.dataDirectoryDefaultButton.setObjectName(
- u'dataDirectoryDefaultButton')
- self.dataDirectoryDefaultButton.setIcon(
- build_icon(u':/general/general_revert.png'))
- self.dataDirectoryCancelButton = QtGui.QToolButton(
- self.dataDirectoryGroupBox)
- self.dataDirectoryCancelButton.setObjectName(
- u'dataDirectoryCancelButton')
- self.dataDirectoryCancelButton.setIcon(
- build_icon(u':/general/general_delete.png'))
+ self.dataDirectoryBrowseButton = QtGui.QToolButton(self.dataDirectoryGroupBox)
+ self.dataDirectoryBrowseButton.setObjectName(u'dataDirectoryBrowseButton')
+ self.dataDirectoryBrowseButton.setIcon(build_icon(u':/general/general_open.png'))
+ self.dataDirectoryDefaultButton = QtGui.QToolButton(self.dataDirectoryGroupBox)
+ self.dataDirectoryDefaultButton.setObjectName(u'dataDirectoryDefaultButton')
+ self.dataDirectoryDefaultButton.setIcon(build_icon(u':/general/general_revert.png'))
+ self.dataDirectoryCancelButton = QtGui.QToolButton(self.dataDirectoryGroupBox)
+ self.dataDirectoryCancelButton.setObjectName(u'dataDirectoryCancelButton')
+ self.dataDirectoryCancelButton.setIcon(build_icon(u':/general/general_delete.png'))
self.newDataDirectoryLabelHBox = QtGui.QHBoxLayout()
- self.newDataDirectoryLabelHBox.setObjectName(
- u'newDataDirectoryLabelHBox')
+ self.newDataDirectoryLabelHBox.setObjectName(u'newDataDirectoryLabelHBox')
self.newDataDirectoryLabelHBox.addWidget(self.newDataDirectoryEdit)
self.newDataDirectoryLabelHBox.addWidget(self.dataDirectoryBrowseButton)
- self.newDataDirectoryLabelHBox.addWidget(
- self.dataDirectoryDefaultButton)
+ self.newDataDirectoryLabelHBox.addWidget(self.dataDirectoryDefaultButton)
self.dataDirectoryCopyCheckHBox = QtGui.QHBoxLayout()
- self.dataDirectoryCopyCheckHBox.setObjectName(
- u'dataDirectoryCopyCheckHBox')
- self.dataDirectoryCopyCheckBox = QtGui.QCheckBox(
- self.dataDirectoryGroupBox)
- self.dataDirectoryCopyCheckBox.setObjectName(
- u'dataDirectoryCopyCheckBox')
- self.dataDirectoryCopyCheckHBox.addWidget(
- self.dataDirectoryCopyCheckBox)
+ self.dataDirectoryCopyCheckHBox.setObjectName(u'dataDirectoryCopyCheckHBox')
+ self.dataDirectoryCopyCheckBox = QtGui.QCheckBox(self.dataDirectoryGroupBox)
+ self.dataDirectoryCopyCheckBox.setObjectName(u'dataDirectoryCopyCheckBox')
+ self.dataDirectoryCopyCheckHBox.addWidget(self.dataDirectoryCopyCheckBox)
self.dataDirectoryCopyCheckHBox.addStretch()
- self.dataDirectoryCopyCheckHBox.addWidget(
- self.dataDirectoryCancelButton)
- self.dataDirectoryLayout.addRow(self.dataDirectoryCurrentLabel,
- self.dataDirectoryLabel)
- self.dataDirectoryLayout.addRow(self.dataDirectoryNewLabel,
- self.newDataDirectoryLabelHBox)
+ self.dataDirectoryCopyCheckHBox.addWidget(self.dataDirectoryCancelButton)
+ self.dataDirectoryLayout.addRow(self.dataDirectoryCurrentLabel, self.dataDirectoryLabel)
+ self.dataDirectoryLayout.addRow(self.dataDirectoryNewLabel, self.newDataDirectoryLabelHBox)
self.dataDirectoryLayout.addRow(self.dataDirectoryCopyCheckHBox)
self.dataDirectoryLayout.addRow(self.newDataDirectoryHasFilesLabel)
self.leftLayout.addWidget(self.dataDirectoryGroupBox)
@@ -227,27 +195,23 @@
self.defaultColorLabel.setObjectName(u'defaultColorLabel')
self.defaultColorButton = QtGui.QPushButton(self.defaultImageGroupBox)
self.defaultColorButton.setObjectName(u'defaultColorButton')
- self.defaultImageLayout.addRow(self.defaultColorLabel,
- self.defaultColorButton)
+ self.defaultImageLayout.addRow(self.defaultColorLabel, self.defaultColorButton)
self.defaultFileLabel = QtGui.QLabel(self.defaultImageGroupBox)
self.defaultFileLabel.setObjectName(u'defaultFileLabel')
self.defaultFileEdit = QtGui.QLineEdit(self.defaultImageGroupBox)
self.defaultFileEdit.setObjectName(u'defaultFileEdit')
self.defaultBrowseButton = QtGui.QToolButton(self.defaultImageGroupBox)
self.defaultBrowseButton.setObjectName(u'defaultBrowseButton')
- self.defaultBrowseButton.setIcon(
- build_icon(u':/general/general_open.png'))
+ self.defaultBrowseButton.setIcon(build_icon(u':/general/general_open.png'))
self.defaultRevertButton = QtGui.QToolButton(self.defaultImageGroupBox)
self.defaultRevertButton.setObjectName(u'defaultRevertButton')
- self.defaultRevertButton.setIcon(
- build_icon(u':/general/general_revert.png'))
+ self.defaultRevertButton.setIcon(build_icon(u':/general/general_revert.png'))
self.defaultFileLayout = QtGui.QHBoxLayout()
self.defaultFileLayout.setObjectName(u'defaultFileLayout')
self.defaultFileLayout.addWidget(self.defaultFileEdit)
self.defaultFileLayout.addWidget(self.defaultBrowseButton)
self.defaultFileLayout.addWidget(self.defaultRevertButton)
- self.defaultImageLayout.addRow(self.defaultFileLabel,
- self.defaultFileLayout)
+ self.defaultImageLayout.addRow(self.defaultFileLabel, self.defaultFileLayout)
self.rightLayout.addWidget(self.defaultImageGroupBox)
# Hide mouse
self.hideMouseGroupBox = QtGui.QGroupBox(self.rightColumn)
@@ -286,46 +250,31 @@
self.rightLayout.addWidget(self.x11GroupBox)
self.rightLayout.addStretch()
self.shouldUpdateServiceNameExample = False
- QtCore.QObject.connect(self.serviceNameCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.serviceNameCheckBoxToggled)
- QtCore.QObject.connect(self.serviceNameDay,
- QtCore.SIGNAL(u'currentIndexChanged(int)'),
+ QtCore.QObject.connect(self.serviceNameCheckBox, QtCore.SIGNAL(u'toggled(bool)'),
+ self.serviceNameCheckBoxToggled)
+ QtCore.QObject.connect(self.serviceNameDay, QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onServiceNameDayChanged)
- QtCore.QObject.connect(self.serviceNameTime,
- QtCore.SIGNAL(u'timeChanged(QTime)'),
- self.updateServiceNameExample)
- QtCore.QObject.connect(self.serviceNameEdit,
- QtCore.SIGNAL(u'textChanged(QString)'),
- self.updateServiceNameExample)
- QtCore.QObject.connect(self.serviceNameRevertButton,
- QtCore.SIGNAL(u'clicked()'),
+ QtCore.QObject.connect(self.serviceNameTime, QtCore.SIGNAL(u'timeChanged(QTime)'),
+ self.updateServiceNameExample)
+ QtCore.QObject.connect(self.serviceNameEdit, QtCore.SIGNAL(u'textChanged(QString)'),
+ self.updateServiceNameExample)
+ QtCore.QObject.connect(self.serviceNameRevertButton, QtCore.SIGNAL(u'clicked()'),
self.onServiceNameRevertButtonClicked)
- QtCore.QObject.connect(self.defaultColorButton,
- QtCore.SIGNAL(u'clicked()'), self.onDefaultColorButtonClicked)
- QtCore.QObject.connect(self.defaultBrowseButton,
- QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked)
- QtCore.QObject.connect(self.defaultRevertButton,
- QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked)
- QtCore.QObject.connect(self.x11BypassCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
- QtCore.QObject.connect(self.dataDirectoryBrowseButton,
- QtCore.SIGNAL(u'clicked()'),
+ QtCore.QObject.connect(self.defaultColorButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultColorButtonClicked)
+ QtCore.QObject.connect(self.defaultBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked)
+ QtCore.QObject.connect(self.defaultRevertButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked)
+ QtCore.QObject.connect(self.x11BypassCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
+ QtCore.QObject.connect(self.dataDirectoryBrowseButton, QtCore.SIGNAL(u'clicked()'),
self.onDataDirectoryBrowseButtonClicked)
- QtCore.QObject.connect(self.dataDirectoryDefaultButton,
- QtCore.SIGNAL(u'clicked()'),
+ QtCore.QObject.connect(self.dataDirectoryDefaultButton, QtCore.SIGNAL(u'clicked()'),
self.onDataDirectoryDefaultButtonClicked)
- QtCore.QObject.connect(self.dataDirectoryCancelButton,
- QtCore.SIGNAL(u'clicked()'),
+ QtCore.QObject.connect(self.dataDirectoryCancelButton, QtCore.SIGNAL(u'clicked()'),
self.onDataDirectoryCancelButtonClicked)
- QtCore.QObject.connect(self.dataDirectoryCopyCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'),
+ QtCore.QObject.connect(self.dataDirectoryCopyCheckBox, QtCore.SIGNAL(u'toggled(bool)'),
self.onDataDirectoryCopyCheckBoxToggled)
- QtCore.QObject.connect(self.endSlideRadioButton,
- QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked)
- QtCore.QObject.connect(self.wrapSlideRadioButton,
- QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked)
- QtCore.QObject.connect(self.nextItemRadioButton,
- QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked)
+ QtCore.QObject.connect(self.endSlideRadioButton, QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked)
+ QtCore.QObject.connect(self.wrapSlideRadioButton, QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked)
+ QtCore.QObject.connect(self.nextItemRadioButton, QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked)
def retranslateUi(self):
"""
@@ -333,11 +282,8 @@
"""
self.tabTitleVisible = UiStrings().Advanced
self.uiGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings'))
- self.dataDirectoryGroupBox.setTitle(
- translate('OpenLP.AdvancedTab', 'Data Location'))
- self.recentLabel.setText(
- translate('OpenLP.AdvancedTab',
- 'Number of recent files to display:'))
+ self.dataDirectoryGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Data Location'))
+ self.recentLabel.setText(translate('OpenLP.AdvancedTab', 'Number of recent files to display:'))
self.mediaPluginCheckBox.setText(translate('OpenLP.AdvancedTab',
'Remember active media manager tab on startup'))
self.doubleClickLiveCheckBox.setText(translate('OpenLP.AdvancedTab',
@@ -348,96 +294,54 @@
'Expand new service items on creation'))
self.enableAutoCloseCheckBox.setText(translate('OpenLP.AdvancedTab',
'Enable application exit confirmation'))
- self.serviceNameGroupBox.setTitle(
- translate('OpenLP.AdvancedTab', 'Default Service Name'))
- self.serviceNameCheckBox.setText(
- translate('OpenLP.AdvancedTab', 'Enable default service name'))
- self.serviceNameTimeLabel.setText(
- translate('OpenLP.AdvancedTab', 'Date and Time:'))
- self.serviceNameDay.setItemText(0,
- translate('OpenLP.AdvancedTab', 'Monday'))
- self.serviceNameDay.setItemText(1,
- translate('OpenLP.AdvancedTab', 'Tuesday'))
- self.serviceNameDay.setItemText(2,
- translate('OpenLP.AdvancedTab', 'Wednesday'))
- self.serviceNameDay.setItemText(3,
- translate('OpenLP.AdvancedTab', 'Thurdsday'))
- self.serviceNameDay.setItemText(4,
- translate('OpenLP.AdvancedTab', 'Friday'))
- self.serviceNameDay.setItemText(5,
- translate('OpenLP.AdvancedTab', 'Saturday'))
- self.serviceNameDay.setItemText(6,
- translate('OpenLP.AdvancedTab', 'Sunday'))
- self.serviceNameDay.setItemText(7,
- translate('OpenLP.AdvancedTab', 'Now'))
+ self.serviceNameGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Default Service Name'))
+ self.serviceNameCheckBox.setText(translate('OpenLP.AdvancedTab', 'Enable default service name'))
+ self.serviceNameTimeLabel.setText(translate('OpenLP.AdvancedTab', 'Date and Time:'))
+ self.serviceNameDay.setItemText(0, translate('OpenLP.AdvancedTab', 'Monday'))
+ self.serviceNameDay.setItemText(1, translate('OpenLP.AdvancedTab', 'Tuesday'))
+ self.serviceNameDay.setItemText(2, translate('OpenLP.AdvancedTab', 'Wednesday'))
+ self.serviceNameDay.setItemText(3, translate('OpenLP.AdvancedTab', 'Thurdsday'))
+ self.serviceNameDay.setItemText(4, translate('OpenLP.AdvancedTab', 'Friday'))
+ self.serviceNameDay.setItemText(5, translate('OpenLP.AdvancedTab', 'Saturday'))
+ self.serviceNameDay.setItemText(6, translate('OpenLP.AdvancedTab', 'Sunday'))
+ self.serviceNameDay.setItemText(7, translate('OpenLP.AdvancedTab', 'Now'))
self.serviceNameTime.setToolTip(translate('OpenLP.AdvancedTab',
'Time when usual service starts.'))
- self.serviceNameLabel.setText(
- translate('OpenLP.AdvancedTab', 'Name:'))
- self.serviceNameEdit.setToolTip(translate('OpenLP.AdvancedTab',
- 'Consult the OpenLP manual for usage.'))
+ self.serviceNameLabel.setText(translate('OpenLP.AdvancedTab', 'Name:'))
+ self.serviceNameEdit.setToolTip(translate('OpenLP.AdvancedTab', 'Consult the OpenLP manual for usage.'))
self.serviceNameRevertButton.setToolTip(
- translate('OpenLP.AdvancedTab',
- 'Revert to the default service name "%s".') %
- self.defaultServiceName)
- self.serviceNameExampleLabel.setText(translate('OpenLP.AdvancedTab',
- 'Example:'))
- self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab',
- 'Mouse Cursor'))
- self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
- 'Hide mouse cursor when over display window'))
- self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab',
- 'Default Image'))
- self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab',
- 'Background color:'))
- self.defaultColorButton.setToolTip(translate('OpenLP.AdvancedTab',
- 'Click to select a color.'))
- self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab',
- 'Image file:'))
- self.defaultBrowseButton.setToolTip(translate('OpenLP.AdvancedTab',
- 'Browse for an image file to display.'))
- self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab',
- 'Revert to the default OpenLP logo.'))
- self.dataDirectoryCurrentLabel.setText(translate('OpenLP.AdvancedTab',
- 'Current path:'))
- self.dataDirectoryNewLabel.setText(translate('OpenLP.AdvancedTab',
- 'Custom path:'))
- self.dataDirectoryBrowseButton.setToolTip(
- translate('OpenLP.AdvancedTab',
- 'Browse for new data file location.'))
+ translate('OpenLP.AdvancedTab', 'Revert to the default service name "%s".') % self.defaultServiceName)
+ self.serviceNameExampleLabel.setText(translate('OpenLP.AdvancedTab', 'Example:'))
+ self.hideMouseGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor'))
+ self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab', 'Hide mouse cursor when over display window'))
+ self.defaultImageGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Default Image'))
+ self.defaultColorLabel.setText(translate('OpenLP.AdvancedTab', 'Background color:'))
+ self.defaultColorButton.setToolTip(translate('OpenLP.AdvancedTab', 'Click to select a color.'))
+ self.defaultFileLabel.setText(translate('OpenLP.AdvancedTab', 'Image file:'))
+ self.defaultBrowseButton.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for an image file to display.'))
+ self.defaultRevertButton.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.'))
+ self.dataDirectoryCurrentLabel.setText(translate('OpenLP.AdvancedTab', 'Current path:'))
+ self.dataDirectoryNewLabel.setText(translate('OpenLP.AdvancedTab', 'Custom path:'))
+ self.dataDirectoryBrowseButton.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for new data file location.'))
self.dataDirectoryDefaultButton.setToolTip(
- translate('OpenLP.AdvancedTab',
- 'Set the data location to the default.'))
- self.dataDirectoryCancelButton.setText(
- translate('OpenLP.AdvancedTab',
- 'Cancel'))
+ translate('OpenLP.AdvancedTab', 'Set the data location to the default.'))
+ self.dataDirectoryCancelButton.setText(translate('OpenLP.AdvancedTab', 'Cancel'))
self.dataDirectoryCancelButton.setToolTip(
- translate('OpenLP.AdvancedTab',
- 'Cancel OpenLP data directory location change.'))
- self.dataDirectoryCopyCheckBox.setText(
- translate('OpenLP.AdvancedTab',
- 'Copy data to new location.'))
- self.dataDirectoryCopyCheckBox.setToolTip(
- translate('OpenLP.AdvancedTab',
- 'Copy the OpenLP data files to the new location.'))
+ translate('OpenLP.AdvancedTab', 'Cancel OpenLP data directory location change.'))
+ self.dataDirectoryCopyCheckBox.setText(translate('OpenLP.AdvancedTab', 'Copy data to new location.'))
+ self.dataDirectoryCopyCheckBox.setToolTip(translate(
+ 'OpenLP.AdvancedTab', 'Copy the OpenLP data files to the new location.'))
self.newDataDirectoryHasFilesLabel.setText(
- translate('OpenLP.AdvancedTab',
- '<strong>WARNING:</strong> New data directory location contains '
- 'OpenLP data files. These files WILL be replaced during a copy.'))
+ translate('OpenLP.AdvancedTab', '<strong>WARNING:</strong> New data directory location contains '
+ 'OpenLP data files. These files WILL be replaced during a copy.'))
self.x11GroupBox.setTitle(translate('OpenLP.AdvancedTab', 'X11'))
- self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab',
- 'Bypass X11 Window Manager'))
+ self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab','Bypass X11 Window Manager'))
# Slide Limits
- self.slideGroupBox.setTitle(
- translate('OpenLP.GeneralTab', 'Service Item Slide Limits'))
- self.slideLabel.setText(translate('OpenLP.GeneralTab',
- 'Behavior of next/previous on the last/first slide:'))
- self.endSlideRadioButton.setText(
- translate('OpenLP.GeneralTab', '&Remain on Slide'))
- self.wrapSlideRadioButton.setText(
- translate('OpenLP.GeneralTab', '&Wrap around'))
- self.nextItemRadioButton.setText(translate('OpenLP.GeneralTab',
- '&Move to next/previous service item'))
+ self.slideGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Service Item Slide Limits'))
+ self.slideLabel.setText(translate('OpenLP.GeneralTab', 'Behavior of next/previous on the last/first slide:'))
+ self.endSlideRadioButton.setText(translate('OpenLP.GeneralTab', '&Remain on Slide'))
+ self.wrapSlideRadioButton.setText(translate('OpenLP.GeneralTab', '&Wrap around'))
+ self.nextItemRadioButton.setText(translate('OpenLP.GeneralTab', '&Move to next/previous service item'))
def load(self):
"""
@@ -450,28 +354,19 @@
# 20 will always be used.
self.recentSpinBox.setMaximum(settings.value(u'max recent files', 20))
self.recentSpinBox.setValue(settings.value(u'recent file count', 4))
- self.mediaPluginCheckBox.setChecked(
- settings.value(u'save current plugin', False))
- self.doubleClickLiveCheckBox.setChecked(
- settings.value(u'double click live', False))
- self.singleClickPreviewCheckBox.setChecked(
- settings.value(u'single click preview', False))
- self.expandServiceItemCheckBox.setChecked(
- settings.value(u'expand service item', False))
- self.enableAutoCloseCheckBox.setChecked(
- settings.value(u'enable exit confirmation', True))
+ self.mediaPluginCheckBox.setChecked(settings.value(u'save current plugin', False))
+ self.doubleClickLiveCheckBox.setChecked(settings.value(u'double click live', False))
+ self.singleClickPreviewCheckBox.setChecked(settings.value(u'single click preview', False))
+ self.expandServiceItemCheckBox.setChecked(settings.value(u'expand service item', False))
+ self.enableAutoCloseCheckBox.setChecked(settings.value(u'enable exit confirmation', True))
self.hideMouseCheckBox.setChecked(settings.value(u'hide mouse', True))
- self.serviceNameDay.setCurrentIndex(
- settings.value(u'default service day', self.defaultServiceDay))
- self.serviceNameTime.setTime(QtCore.QTime(
- settings.value(u'default service hour', self.defaultServiceHour),
- settings.value(u'default service minute',
- self.defaultServiceMinute)))
+ self.serviceNameDay.setCurrentIndex(settings.value(u'default service day', self.defaultServiceDay))
+ self.serviceNameTime.setTime(QtCore.QTime(settings.value(u'default service hour', self.defaultServiceHour),
+ settings.value(u'default service minute',self.defaultServiceMinute)))
self.shouldUpdateServiceNameExample = True
self.serviceNameEdit.setText(settings.value(u'default service name',
self.defaultServiceName))
- default_service_enabled = settings.value(
- u'default service enabled', True)
+ default_service_enabled = settings.value(u'default service enabled', True)
self.serviceNameCheckBox.setChecked(default_service_enabled)
self.serviceNameCheckBoxToggled(default_service_enabled)
# Fix for bug #1014422.
@@ -483,11 +378,9 @@
# Default to False on XFce
if os.environ.get(u'DESKTOP_SESSION') == u'xfce':
x11_bypass_default = False
- self.x11BypassCheckBox.setChecked(
- settings.value(u'x11 bypass wm', x11_bypass_default))
+ self.x11BypassCheckBox.setChecked(settings.value(u'x11 bypass wm', x11_bypass_default))
self.defaultColor = settings.value(u'default color', u'#ffffff')
- self.defaultFileEdit.setText(settings.value(u'default image',
- u':/graphics/openlp-splash-screen.png'))
+ self.defaultFileEdit.setText(settings.value(u'default image', u':/graphics/openlp-splash-screen.png'))
self.slide_limits = settings.value(u'slide limits', SlideLimits.End)
if self.slide_limits == SlideLimits.End:
self.endSlideRadioButton.setChecked(True)
@@ -526,11 +419,9 @@
# Set data location to default.
settings.remove(u'advanced/data path')
self.currentDataPath = AppLocation.get_data_path()
- log.warning(u'User requested data path set to default %s'
- % self.currentDataPath)
+ log.warning(u'User requested data path set to default %s' % self.currentDataPath)
self.dataDirectoryLabel.setText(os.path.abspath(self.currentDataPath))
- self.defaultColorButton.setStyleSheet(
- u'background-color: %s' % self.defaultColor)
+ self.defaultColorButton.setStyleSheet(u'background-color: %s' % self.defaultColor)
# Don't allow data directory move if running portable.
if settings.value(u'advanced/is portable', False):
self.dataDirectoryGroupBox.hide()
@@ -550,23 +441,15 @@
self.serviceNameEdit.setText(service_name)
else:
settings.setValue(u'default service name', service_name)
- settings.setValue(u'default service day',
- self.serviceNameDay.currentIndex())
- settings.setValue(u'default service hour',
- self.serviceNameTime.time().hour())
- settings.setValue(u'default service minute',
- self.serviceNameTime.time().minute())
+ settings.setValue(u'default service day', self.serviceNameDay.currentIndex())
+ settings.setValue(u'default service hour', self.serviceNameTime.time().hour())
+ settings.setValue(u'default service minute', self.serviceNameTime.time().minute())
settings.setValue(u'recent file count', self.recentSpinBox.value())
- settings.setValue(u'save current plugin',
- self.mediaPluginCheckBox.isChecked())
- settings.setValue(u'double click live',
- self.doubleClickLiveCheckBox.isChecked())
- settings.setValue(u'single click preview',
- self.singleClickPreviewCheckBox.isChecked())
- settings.setValue(u'expand service item',
- self.expandServiceItemCheckBox.isChecked())
- settings.setValue(u'enable exit confirmation',
- self.enableAutoCloseCheckBox.isChecked())
+ settings.setValue(u'save current plugin', self.mediaPluginCheckBox.isChecked())
+ settings.setValue(u'double click live', self.doubleClickLiveCheckBox.isChecked())
+ settings.setValue(u'single click preview', self.singleClickPreviewCheckBox.isChecked())
+ settings.setValue(u'expand service item', self.expandServiceItemCheckBox.isChecked())
+ settings.setValue(u'enable exit confirmation', self.enableAutoCloseCheckBox.isChecked())
settings.setValue(u'hide mouse', self.hideMouseCheckBox.isChecked())
settings.setValue(u'x11 bypass wm', self.x11BypassCheckBox.isChecked())
settings.setValue(u'default color', self.defaultColor)
@@ -585,8 +468,7 @@
def serviceNameCheckBoxToggled(self, default_service_enabled):
self.serviceNameDay.setEnabled(default_service_enabled)
- time_enabled = default_service_enabled and \
- self.serviceNameDay.currentIndex() is not 7
+ time_enabled = default_service_enabled and self.serviceNameDay.currentIndex() is not 7
self.serviceNameTime.setEnabled(time_enabled)
self.serviceNameEdit.setEnabled(default_service_enabled)
self.serviceNameRevertButton.setEnabled(default_service_enabled)
@@ -604,12 +486,10 @@
local_time = time.replace(hour = self.serviceNameTime.time().hour(),
minute = self.serviceNameTime.time().minute())
try:
- service_name_example = format_time(unicode(
- self.serviceNameEdit.text()), local_time)
+ service_name_example = format_time(unicode(self.serviceNameEdit.text()), local_time)
except ValueError:
preset_is_valid = False
- service_name_example = translate('OpenLP.AdvancedTab',
- 'Syntax error.')
+ service_name_example = translate('OpenLP.AdvancedTab', 'Syntax error.')
return preset_is_valid, service_name_example
def updateServiceNameExample(self, returned_value):
@@ -631,8 +511,7 @@
QtGui.QColor(self.defaultColor), self)
if new_color.isValid():
self.defaultColor = new_color.name()
- self.defaultColorButton.setStyleSheet(
- u'background-color: %s' % self.defaultColor)
+ self.defaultColorButton.setStyleSheet(u'background-color: %s' % self.defaultColor)
def onDefaultBrowseButtonClicked(self):
file_filters = u'%s;;%s (*.*) (*)' % (get_images_filter(),
@@ -650,8 +529,7 @@
old_root_path = unicode(self.dataDirectoryLabel.text())
# Get the new directory location.
new_data_path = unicode(QtGui.QFileDialog.getExistingDirectory(self,
- translate('OpenLP.AdvancedTab',
- 'Select Data Directory Location'), old_root_path,
+ translate('OpenLP.AdvancedTab', 'Select Data Directory Location'), old_root_path,
options = QtGui.QFileDialog.ShowDirsOnly))
# Set the new data path.
if new_data_path:
@@ -664,15 +542,10 @@
# Make sure they want to change the data.
answer = QtGui.QMessageBox.question(self,
translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'),
- translate('OpenLP.AdvancedTab',
- 'Are you sure you want to change the location of the OpenLP '
- 'data directory to:\n\n%s\n\n'
- 'The data directory will be changed when OpenLP is closed.'
- ).replace('%s', new_data_path),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No),
- QtGui.QMessageBox.No)
+ translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP '
+ 'data directory to:\n\n%s\n\n '
+ 'The data directory will be changed when OpenLP is closed.').replace('%s', new_data_path),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No)
if answer != QtGui.QMessageBox.Yes:
return
# Check if data already exists here.
@@ -692,14 +565,9 @@
# default.
answer = QtGui.QMessageBox.question(self,
translate('OpenLP.AdvancedTab', 'Reset Data Directory'),
- translate('OpenLP.AdvancedTab',
- 'Are you sure you want to change the location of the OpenLP '
- 'data directory to the default location?\n\n'
- 'This location will be used after OpenLP is closed.'),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No),
- QtGui.QMessageBox.No)
+ translate('OpenLP.AdvancedTab', 'Are you sure you want to change the location of the OpenLP '
+ 'data directory to the default location?\n\nThis location will be used after OpenLP is closed.'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No)
if answer != QtGui.QMessageBox.Yes:
return
self.checkDataOverwrite(new_data_path)
@@ -728,16 +596,10 @@
# Check is they want to replace existing data.
answer = QtGui.QMessageBox.warning(self,
translate('OpenLP.AdvancedTab', 'Overwrite Existing Data'),
- translate('OpenLP.AdvancedTab',
- 'WARNING: \n\n'
- 'The location you have selected \n\n%s\n\n'
- 'appears to contain OpenLP data files. Do you wish to replace '
- 'these files with the current data files?'
+ translate('OpenLP.AdvancedTab', 'WARNING: \n\nThe location you have selected \n\n%s\n\n'
+ 'appears to contain OpenLP data files. Do you wish to replace these files with the current data files?'
).replace('%s', os.path.abspath(data_path,)),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No),
- QtGui.QMessageBox.No)
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.Yes:
self.dataDirectoryCopyCheckBox.setChecked(True)
self.newDataDirectoryHasFilesLabel.show()
=== modified file 'openlp/core/ui/exceptiondialog.py'
--- openlp/core/ui/exceptiondialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/exceptiondialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -42,8 +42,7 @@
self.messageLayout.addSpacing(12)
self.bugLabel = QtGui.QLabel(exceptionDialog)
self.bugLabel.setPixmap(QtGui.QPixmap(u':/graphics/exception.png'))
- self.bugLabel.setSizePolicy(QtGui.QSizePolicy.Fixed,
- QtGui.QSizePolicy.Fixed)
+ self.bugLabel.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
self.bugLabel.setObjectName(u'bugLabel')
self.messageLayout.addWidget(self.bugLabel)
self.messageLayout.addSpacing(12)
@@ -65,18 +64,14 @@
self.exceptionTextEdit.setReadOnly(True)
self.exceptionTextEdit.setObjectName(u'exceptionTextEdit')
self.exceptionLayout.addWidget(self.exceptionTextEdit)
- self.sendReportButton = create_button(exceptionDialog,
- u'sendReportButton', icon=u':/general/general_email.png',
- click=self.onSendReportButtonClicked)
- self.saveReportButton = create_button(exceptionDialog,
- u'saveReportButton', icon=u':/general/general_save.png',
- click=self.onSaveReportButtonClicked)
- self.attachFileButton = create_button(exceptionDialog,
- u'attachFileButton', icon=u':/general/general_open.png',
- click=self.onAttachFileButtonClicked)
+ self.sendReportButton = create_button(exceptionDialog, u'sendReportButton',
+ icon=u':/general/general_email.png', click=self.onSendReportButtonClicked)
+ self.saveReportButton = create_button(exceptionDialog,u'saveReportButton',
+ icon=u':/general/general_save.png', click=self.onSaveReportButtonClicked)
+ self.attachFileButton = create_button(exceptionDialog, u'attachFileButton',
+ icon=u':/general/general_open.png', click=self.onAttachFileButtonClicked)
self.buttonBox = create_button_box(exceptionDialog, u'buttonBox',
- [u'close'], [self.sendReportButton, self.saveReportButton,
- self.attachFileButton])
+ [u'close'], [self.sendReportButton, self.saveReportButton, self.attachFileButton])
self.exceptionLayout.addWidget(self.buttonBox)
self.retranslateUi(exceptionDialog)
@@ -84,8 +79,7 @@
QtCore.SIGNAL(u'textChanged()'), self.onDescriptionUpdated)
def retranslateUi(self, exceptionDialog):
- exceptionDialog.setWindowTitle(
- translate('OpenLP.ExceptionDialog', 'Error Occurred'))
+ exceptionDialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred'))
self.descriptionExplanation.setText(translate('OpenLP.ExceptionDialog',
'Please enter a description of what you were doing to cause this '
'error \n(Minimum 20 characters)'))
=== modified file 'openlp/core/ui/exceptionform.py'
--- openlp/core/ui/exceptionform.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/exceptionform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -72,10 +72,8 @@
arg.Name = u'nodepath'
arg.Value = u'/org.openoffice.Setup/Product'
context = uno.getComponentContext()
- provider = context.ServiceManager.createInstance(
- u'com.sun.star.configuration.ConfigurationProvider')
- node = provider.createInstanceWithArguments(
- u'com.sun.star.configuration.ConfigurationAccess', (arg,))
+ provider = context.ServiceManager.createInstance(u'com.sun.star.configuration.ConfigurationProvider')
+ node = provider.createInstanceWithArguments(u'com.sun.star.configuration.ConfigurationAccess', (arg,))
UNO_VERSION = node.getByName(u'ooSetupVersion')
except ImportError:
UNO_VERSION = u'-'
@@ -114,8 +112,7 @@
openlp_version = get_application_version()
description = self.descriptionTextEdit.toPlainText()
traceback = self.exceptionTextEdit.toPlainText()
- system = translate('OpenLP.ExceptionForm',
- 'Platform: %s\n') % platform.platform()
+ system = translate('OpenLP.ExceptionForm', 'Platform: %s\n') % platform.platform()
libraries = u'Python: %s\n' % platform.python_version() + \
u'Qt4: %s\n' % Qt.qVersion() + \
u'Phonon: %s\n' % PHONON_VERSION + \
@@ -139,7 +136,7 @@
def onSaveReportButtonClicked(self):
"""
- Saving exception log and system informations to a file.
+ Saving exception log and system information to a file.
"""
report_text = translate('OpenLP.ExceptionForm',
'**OpenLP Bug Report**\n'
@@ -155,8 +152,7 @@
'Text files (*.txt *.log *.text)'))
if filename:
filename = unicode(filename).replace(u'/', os.path.sep)
- SettingsManager.set_last_dir(self.settingsSection, os.path.dirname(
- filename))
+ SettingsManager.set_last_dir(self.settingsSection, os.path.dirname(filename))
report_text = report_text % self._createReport()
try:
report_file = open(filename, u'w')
@@ -211,14 +207,12 @@
else:
self.__buttonState(False)
self.descriptionWordCount.setText(
- translate('OpenLP.ExceptionDialog',
- 'Description characters to enter : %s') % count)
+ translate('OpenLP.ExceptionDialog', 'Description characters to enter : %s') % count)
def onAttachFileButtonClicked(self):
files = QtGui.QFileDialog.getOpenFileName(
self, translate('ImagePlugin.ExceptionDialog', 'Select Attachment'),
- SettingsManager.get_last_dir(u'exceptions'),
- u'%s (*.*) (*)' % UiStrings().AllFiles)
+ SettingsManager.get_last_dir(u'exceptions'), u'%s (*.*) (*)' % UiStrings().AllFiles)
log.info(u'New files(s) %s', unicode(files))
if files:
self.fileAttachment = unicode(files)
=== modified file 'openlp/core/ui/filerenamedialog.py'
--- openlp/core/ui/filerenamedialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/filerenamedialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -42,16 +42,13 @@
self.fileNameLabel.setObjectName(u'fileNameLabel')
self.dialogLayout.addWidget(self.fileNameLabel, 0, 0)
self.fileNameEdit = QtGui.QLineEdit(fileRenameDialog)
- self.fileNameEdit.setValidator(QtGui.QRegExpValidator(
- QtCore.QRegExp(r'[^/\\?*|<>\[\]":+%]+'), self))
+ self.fileNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":+%]+'), self))
self.fileNameEdit.setObjectName(u'fileNameEdit')
self.dialogLayout.addWidget(self.fileNameEdit, 0, 1)
- self.buttonBox = create_button_box(fileRenameDialog, u'buttonBox',
- [u'cancel', u'ok'])
+ self.buttonBox = create_button_box(fileRenameDialog, u'buttonBox', [u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
self.retranslateUi(fileRenameDialog)
self.setMaximumHeight(self.sizeHint().height())
def retranslateUi(self, fileRenameDialog):
- self.fileNameLabel.setText(translate('OpenLP.FileRenameForm',
- 'New File Name:'))
+ self.fileNameLabel.setText(translate('OpenLP.FileRenameForm', 'New File Name:'))
=== modified file 'openlp/core/ui/filerenameform.py'
--- openlp/core/ui/filerenameform.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/filerenameform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -46,9 +46,7 @@
Run the Dialog with correct heading.
"""
if copy:
- self.setWindowTitle(translate('OpenLP.FileRenameForm',
- 'File Copy'))
+ self.setWindowTitle(translate('OpenLP.FileRenameForm', 'File Copy'))
else:
- self.setWindowTitle(translate('OpenLP.FileRenameForm',
- 'File Rename'))
+ self.setWindowTitle(translate('OpenLP.FileRenameForm', 'File Rename'))
return QtGui.QDialog.exec_(self)
=== modified file 'openlp/core/ui/firsttimeform.py'
--- openlp/core/ui/firsttimeform.py 2012-12-27 16:27:59 +0000
+++ openlp/core/ui/firsttimeform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -39,8 +39,7 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, \
- check_directory_exists, Settings
+from openlp.core.lib import translate, PluginStatus, Receiver, build_icon, check_directory_exists, Settings
from openlp.core.utils import get_web_page, AppLocation, get_filesystem_encoding
from firsttimewizard import Ui_FirstTimeWizard, FirstTimePage
@@ -65,8 +64,7 @@
filename = config.get(u'theme_%s' % theme, u'filename')
screenshot = config.get(u'theme_%s' % theme, u'screenshot')
urllib.urlretrieve(u'%s%s' % (self.parent().web, screenshot),
- os.path.join(unicode(gettempdir(), get_filesystem_encoding()),
- u'openlp', screenshot))
+ os.path.join(unicode(gettempdir(), get_filesystem_encoding()), u'openlp', screenshot))
item = QtGui.QListWidgetItem(title, self.parent().themesListWidget)
item.setData(QtCore.Qt.UserRole, filename)
item.setCheckState(QtCore.Qt.Unchecked)
@@ -93,16 +91,14 @@
self.config.readfp(io.BytesIO(files))
self.updateScreenListCombo()
self.downloadCancelled = False
- self.downloading = translate('OpenLP.FirstTimeWizard',
- 'Downloading %s...')
+ self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading %s...')
QtCore.QObject.connect(self.cancelButton, QtCore.SIGNAL('clicked()'),
self.onCancelButtonClicked)
- QtCore.QObject.connect(self.noInternetFinishButton,
- QtCore.SIGNAL('clicked()'), self.onNoInternetFinishButtonClicked)
- QtCore.QObject.connect(self,
- QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_screen_changed'), self.updateScreenListCombo)
+ QtCore.QObject.connect(self.noInternetFinishButton, QtCore.SIGNAL('clicked()'),
+ self.onNoInternetFinishButtonClicked)
+ QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'),
+ self.updateScreenListCombo)
def exec_(self):
"""
@@ -126,10 +122,8 @@
songs = self.config.get(u'songs', u'languages')
songs = songs.split(u',')
for song in songs:
- title = unicode(self.config.get(
- u'songs_%s' % song, u'title'), u'utf8')
- filename = unicode(self.config.get(
- u'songs_%s' % song, u'filename'), u'utf8')
+ title = unicode(self.config.get(u'songs_%s' % song, u'title'), u'utf8')
+ filename = unicode(self.config.get(u'songs_%s' % song, u'filename'), u'utf8')
item = QtGui.QListWidgetItem(title, self.songsListWidget)
item.setData(QtCore.Qt.UserRole, filename)
item.setCheckState(QtCore.Qt.Unchecked)
@@ -137,17 +131,13 @@
bible_languages = self.config.get(u'bibles', u'languages')
bible_languages = bible_languages.split(u',')
for lang in bible_languages:
- language = unicode(self.config.get(
- u'bibles_%s' % lang, u'title'), u'utf8')
- langItem = QtGui.QTreeWidgetItem(
- self.biblesTreeWidget, [language])
+ language = unicode(self.config.get(u'bibles_%s' % lang, u'title'), u'utf8')
+ langItem = QtGui.QTreeWidgetItem(self.biblesTreeWidget, [language])
bibles = self.config.get(u'bibles_%s' % lang, u'translations')
bibles = bibles.split(u',')
for bible in bibles:
- title = unicode(self.config.get(
- u'bible_%s' % bible, u'title'), u'utf8')
- filename = unicode(self.config.get(
- u'bible_%s' % bible, u'filename'))
+ title = unicode(self.config.get(u'bible_%s' % bible, u'title'), u'utf8')
+ filename = unicode(self.config.get(u'bible_%s' % bible, u'filename'))
item = QtGui.QTreeWidgetItem(langItem, [title])
item.setData(0, QtCore.Qt.UserRole, filename)
item.setCheckState(0, QtCore.Qt.Unchecked)
@@ -199,8 +189,7 @@
if self.hasRunWizard:
self.noInternetLabel.setText(self.noInternetText)
else:
- self.noInternetLabel.setText(self.noInternetText +
- self.cancelWizardText)
+ self.noInternetLabel.setText(self.noInternetText + self.cancelWizardText)
elif pageId == FirstTimePage.Defaults:
self.themeComboBox.clear()
for iter in xrange(self.themesListWidget.count()):
@@ -249,7 +238,7 @@
Process the triggering of the cancel button.
"""
if self.lastId == FirstTimePage.NoInternet or \
- (self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard):
+ (self.lastId <= FirstTimePage.Plugins and not self.hasRunWizard):
QtCore.QCoreApplication.exit()
sys.exit()
self.downloadCancelled = True
@@ -304,8 +293,8 @@
item = self.themesListWidget.item(index)
if item.data(QtCore.Qt.UserRole) == filename:
break
- item.setIcon(build_icon(os.path.join(unicode(gettempdir(),
- get_filesystem_encoding()), u'openlp', screenshot)))
+ item.setIcon(build_icon(os.path.join(unicode(gettempdir(), get_filesystem_encoding()), u'openlp',
+ screenshot)))
def _getFileSize(self, url):
site = urllib.urlopen(url)
@@ -372,15 +361,12 @@
self.progressBar.setValue(0)
self.progressBar.setMinimum(0)
self.progressBar.setMaximum(self.max_progress)
- self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Setting Up And Downloading'))
- self.progressPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
- 'Please wait while OpenLP is set up '
- 'and your data is downloaded.'))
+ self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Setting Up And Downloading'))
+ self.progressPage.setSubTitle(
+ translate('OpenLP.FirstTimeWizard', 'Please wait while OpenLP is set up and your data is downloaded.'))
else:
self.progressBar.setVisible(False)
- self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Setting Up'))
+ self.progressPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Setting Up'))
self.progressPage.setSubTitle(u'Setup complete.')
self.repaint()
Receiver.send_message(u'openlp_process_events')
@@ -395,12 +381,10 @@
self.progressBar.setValue(self.progressBar.maximum())
if self.hasRunWizard:
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
- 'Download complete.'
- ' Click the finish button to return to OpenLP.'))
+ 'Download complete. Click the finish button to return to OpenLP.'))
else:
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
- 'Download complete.'
- ' Click the finish button to start OpenLP.'))
+ 'Download complete. Click the finish button to start OpenLP.'))
else:
if self.hasRunWizard:
self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
@@ -419,15 +403,13 @@
Run the tasks in the wizard.
"""
# Set plugin states
- self._incrementProgressBar(translate('OpenLP.FirstTimeWizard',
- 'Enabling selected plugins...'))
+ self._incrementProgressBar(translate('OpenLP.FirstTimeWizard', 'Enabling selected plugins...'))
self._setPluginStatus(self.songsCheckBox, u'songs/status')
self._setPluginStatus(self.bibleCheckBox, u'bibles/status')
# TODO Presentation plugin is not yet working on Mac OS X.
# For now just ignore it.
if sys.platform != 'darwin':
- self._setPluginStatus(self.presentationCheckBox,
- u'presentations/status')
+ self._setPluginStatus(self.presentationCheckBox, u'presentations/status')
self._setPluginStatus(self.imageCheckBox, u'images/status')
self._setPluginStatus(self.mediaCheckBox, u'media/status')
self._setPluginStatus(self.remoteCheckBox, u'remotes/status')
@@ -447,8 +429,7 @@
filename = item.data(QtCore.Qt.UserRole)
self._incrementProgressBar(self.downloading % filename, 0)
self.previous_size = 0
- destination = os.path.join(songs_destination,
- unicode(filename))
+ destination = os.path.join(songs_destination, unicode(filename))
self.urlGetFile(u'%s%s' % (self.web, filename), destination)
# Download Bibles
bibles_iterator = QtGui.QTreeWidgetItemIterator(
@@ -459,8 +440,7 @@
bible = item.data(0, QtCore.Qt.UserRole)
self._incrementProgressBar(self.downloading % bible, 0)
self.previous_size = 0
- self.urlGetFile(u'%s%s' % (self.web, bible),
- os.path.join(bibles_destination, bible))
+ self.urlGetFile(u'%s%s' % (self.web, bible), os.path.join(bibles_destination, bible))
bibles_iterator += 1
# Download themes
for i in xrange(self.themesListWidget.count()):
@@ -469,20 +449,15 @@
theme = item.data(QtCore.Qt.UserRole)
self._incrementProgressBar(self.downloading % theme, 0)
self.previous_size = 0
- self.urlGetFile(u'%s%s' % (self.web, theme),
- os.path.join(themes_destination, theme))
+ self.urlGetFile(u'%s%s' % (self.web, theme), os.path.join(themes_destination, theme))
# Set Default Display
if self.displayComboBox.currentIndex() != -1:
- Settings().setValue(u'General/monitor',
- self.displayComboBox.currentIndex())
- self.screens.set_current_display(
- self.displayComboBox.currentIndex())
+ Settings().setValue(u'General/monitor', self.displayComboBox.currentIndex())
+ self.screens.set_current_display(self.displayComboBox.currentIndex())
# Set Global Theme
if self.themeComboBox.currentIndex() != -1:
- Settings().setValue(u'themes/global theme',
- self.themeComboBox.currentText())
+ Settings().setValue(u'themes/global theme', self.themeComboBox.currentText())
def _setPluginStatus(self, field, tag):
- status = PluginStatus.Active if field.checkState() \
- == QtCore.Qt.Checked else PluginStatus.Inactive
+ status = PluginStatus.Active if field.checkState() == QtCore.Qt.Checked else PluginStatus.Inactive
Settings().setValue(tag, status)
=== modified file 'openlp/core/ui/firsttimelanguagedialog.py'
--- openlp/core/ui/firsttimelanguagedialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/firsttimelanguagedialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -49,22 +49,17 @@
self.languageLabel.setObjectName(u'languageLabel')
self.languageLayout.addWidget(self.languageLabel)
self.languageComboBox = QtGui.QComboBox(languageDialog)
- self.languageComboBox.setSizeAdjustPolicy(
- QtGui.QComboBox.AdjustToContents)
+ self.languageComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.languageComboBox.setObjectName("languageComboBox")
self.languageLayout.addWidget(self.languageComboBox)
self.dialogLayout.addLayout(self.languageLayout)
- self.buttonBox = create_button_box(languageDialog, u'buttonBox',
- [u'cancel', u'ok'])
+ self.buttonBox = create_button_box(languageDialog, u'buttonBox', [u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox)
-
self.retranslateUi(languageDialog)
self.setMaximumHeight(self.sizeHint().height())
def retranslateUi(self, languageDialog):
- self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm',
- 'Select Translation'))
- self.infoLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
- 'Choose the translation you\'d like to use in OpenLP.'))
- self.languageLabel.setText(translate('OpenLP.FirstTimeLanguageForm',
- 'Translation:'))
+ self.setWindowTitle(translate('OpenLP.FirstTimeLanguageForm', 'Select Translation'))
+ self.infoLabel.setText(
+ translate('OpenLP.FirstTimeLanguageForm', 'Choose the translation you\'d like to use in OpenLP.'))
+ self.languageLabel.setText(translate('OpenLP.FirstTimeLanguageForm', 'Translation:'))
=== modified file 'openlp/core/ui/firsttimelanguageform.py'
--- openlp/core/ui/firsttimelanguageform.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/firsttimelanguageform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/ui/firsttimewizard.py'
--- openlp/core/ui/firsttimewizard.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/firsttimewizard.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -51,10 +51,8 @@
FirstTimeWizard.resize(550, 386)
FirstTimeWizard.setModal(True)
FirstTimeWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
- FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages |
- QtGui.QWizard.NoBackButtonOnStartPage |
- QtGui.QWizard.NoBackButtonOnLastPage |
- QtGui.QWizard.HaveCustomButton1)
+ FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage |
+ QtGui.QWizard.NoBackButtonOnLastPage |QtGui.QWizard.HaveCustomButton1)
self.finishButton = self.button(QtGui.QWizard.FinishButton)
self.noInternetFinishButton = self.button(QtGui.QWizard.CustomButton1)
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
@@ -175,8 +173,7 @@
self.themeComboBox = QtGui.QComboBox(self.defaultsPage)
self.themeComboBox.setEditable(False)
self.themeComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
- self.themeComboBox.setSizeAdjustPolicy(
- QtGui.QComboBox.AdjustToContents)
+ self.themeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
self.themeComboBox.setObjectName(u'themeComboBox')
self.defaultsLayout.addRow(self.themeLabel, self.themeComboBox)
FirstTimeWizard.setPage(FirstTimePage.Defaults, self.defaultsPage)
@@ -198,41 +195,27 @@
def retranslateUi(self, FirstTimeWizard):
FirstTimeWizard.setWindowTitle(translate(
'OpenLP.FirstTimeWizard', 'First Time Wizard'))
- self.titleLabel.setText(
- u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
- translate('OpenLP.FirstTimeWizard',
- 'Welcome to the First Time Wizard'))
+ self.titleLabel.setText(u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
+ translate('OpenLP.FirstTimeWizard', 'Welcome to the First Time Wizard'))
self.informationLabel.setText(translate('OpenLP.FirstTimeWizard',
'This wizard will help you to configure OpenLP for initial use.'
' Click the next button below to start.'))
- self.pluginPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Activate required Plugins'))
- self.pluginPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
- 'Select the Plugins you wish to use. '))
+ self.pluginPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Activate required Plugins'))
+ self.pluginPage.setSubTitle(translate('OpenLP.FirstTimeWizard','Select the Plugins you wish to use. '))
self.songsCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Songs'))
- self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Custom Slides'))
+ self.customCheckBox.setText(translate('OpenLP.FirstTimeWizard','Custom Slides'))
self.bibleCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Bible'))
- self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Images'))
+ self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Images'))
# TODO Presentation plugin is not yet working on Mac OS X.
# For now just ignore it.
if sys.platform != 'darwin':
- self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Presentations'))
- self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Media (Audio and Video)'))
- self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Allow remote access'))
- self.songUsageCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Monitor Song Usage'))
- self.alertCheckBox.setText(translate('OpenLP.FirstTimeWizard',
- 'Allow Alerts'))
- self.noInternetPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'No Internet Connection'))
- self.noInternetPage.setSubTitle(translate(
- 'OpenLP.FirstTimeWizard',
- 'Unable to detect an Internet connection.'))
+ self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Presentations'))
+ self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Media (Audio and Video)'))
+ self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Allow remote access'))
+ self.songUsageCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Monitor Song Usage'))
+ self.alertCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Allow Alerts'))
+ self.noInternetPage.setTitle(translate('OpenLP.FirstTimeWizard', 'No Internet Connection'))
+ self.noInternetPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.'))
self.noInternetText = translate('OpenLP.FirstTimeWizard',
'No Internet connection was found. The First Time Wizard needs an '
'Internet connection in order to be able to download sample '
@@ -244,27 +227,16 @@
self.cancelWizardText = translate('OpenLP.FirstTimeWizard',
'\n\nTo cancel the First Time Wizard completely (and not start '
'OpenLP), click the Cancel button now.')
- self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Sample Songs'))
- self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
- 'Select and download public domain songs.'))
- self.biblesPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Sample Bibles'))
- self.biblesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
- 'Select and download free Bibles.'))
- self.themesPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Sample Themes'))
- self.themesPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
- 'Select and download sample themes.'))
- self.defaultsPage.setTitle(translate('OpenLP.FirstTimeWizard',
- 'Default Settings'))
+ self.songsPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Songs'))
+ self.songsPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download public domain songs.'))
+ self.biblesPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Bibles'))
+ self.biblesPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download free Bibles.'))
+ self.themesPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Sample Themes'))
+ self.themesPage.setSubTitle(translate('OpenLP.FirstTimeWizard', 'Select and download sample themes.'))
+ self.defaultsPage.setTitle(translate('OpenLP.FirstTimeWizard', 'Default Settings'))
self.defaultsPage.setSubTitle(translate('OpenLP.FirstTimeWizard',
'Set up default settings to be used by OpenLP.'))
- self.displayLabel.setText(translate('OpenLP.FirstTimeWizard',
- 'Default output display:'))
- self.themeLabel.setText(translate('OpenLP.FirstTimeWizard',
- 'Select default theme:'))
- self.progressLabel.setText(translate('OpenLP.FirstTimeWizard',
- 'Starting configuration process...'))
- FirstTimeWizard.setButtonText(QtGui.QWizard.CustomButton1,
- translate('OpenLP.FirstTimeWizard', 'Finish'))
+ self.displayLabel.setText(translate('OpenLP.FirstTimeWizard', 'Default output display:'))
+ self.themeLabel.setText(translate('OpenLP.FirstTimeWizard', 'Select default theme:'))
+ self.progressLabel.setText(translate('OpenLP.FirstTimeWizard', 'Starting configuration process...'))
+ FirstTimeWizard.setButtonText(QtGui.QWizard.CustomButton1, translate('OpenLP.FirstTimeWizard', 'Finish'))
=== modified file 'openlp/core/ui/formattingtagdialog.py'
--- openlp/core/ui/formattingtagdialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/formattingtagdialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -41,15 +41,11 @@
self.listdataGridLayout.setMargin(8)
self.listdataGridLayout.setObjectName(u'listdataGridLayout')
self.tagTableWidget = QtGui.QTableWidget(formattingTagDialog)
- self.tagTableWidget.setHorizontalScrollBarPolicy(
- QtCore.Qt.ScrollBarAlwaysOff)
- self.tagTableWidget.setEditTriggers(
- QtGui.QAbstractItemView.NoEditTriggers)
+ self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
+ self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.tagTableWidget.setAlternatingRowColors(True)
- self.tagTableWidget.setSelectionMode(
- QtGui.QAbstractItemView.SingleSelection)
- self.tagTableWidget.setSelectionBehavior(
- QtGui.QAbstractItemView.SelectRows)
+ self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
+ self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.tagTableWidget.setCornerButtonEnabled(False)
self.tagTableWidget.setObjectName(u'tagTableWidget')
self.tagTableWidget.setColumnCount(4)
@@ -66,8 +62,7 @@
self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(u'horizontalLayout')
- spacerItem = QtGui.QSpacerItem(40, 20,
- QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.deletePushButton = QtGui.QPushButton(formattingTagDialog)
self.deletePushButton.setObjectName(u'deletePushButton')
@@ -114,36 +109,25 @@
self.savePushButton.setObjectName(u'savePushButton')
self.dataGridLayout.addWidget(self.savePushButton, 4, 2, 1, 1)
self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1)
- self.buttonBox = create_button_box(formattingTagDialog, 'buttonBox',
- [u'close'])
+ self.buttonBox = create_button_box(formattingTagDialog, u'buttonBox', [u'close'])
self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1)
self.retranslateUi(formattingTagDialog)
def retranslateUi(self, formattingTagDialog):
- formattingTagDialog.setWindowTitle(translate(
- 'OpenLP.FormattingTagDialog', 'Configure Formatting Tags'))
- self.editGroupBox.setTitle(
- translate('OpenLP.FormattingTagDialog', 'Edit Selection'))
- self.savePushButton.setText(
- translate('OpenLP.FormattingTagDialog', 'Save'))
- self.descriptionLabel.setText(
- translate('OpenLP.FormattingTagDialog', 'Description'))
+ formattingTagDialog.setWindowTitle(translate('OpenLP.FormattingTagDialog', 'Configure Formatting Tags'))
+ self.editGroupBox.setTitle(translate('OpenLP.FormattingTagDialog', 'Edit Selection'))
+ self.savePushButton.setText(translate('OpenLP.FormattingTagDialog', 'Save'))
+ self.descriptionLabel.setText(translate('OpenLP.FormattingTagDialog', 'Description'))
self.tagLabel.setText(translate('OpenLP.FormattingTagDialog', 'Tag'))
- self.startTagLabel.setText(
- translate('OpenLP.FormattingTagDialog', 'Start HTML'))
- self.endTagLabel.setText(
- translate('OpenLP.FormattingTagDialog', 'End HTML'))
+ self.startTagLabel.setText(translate('OpenLP.FormattingTagDialog', 'Start HTML'))
+ self.endTagLabel.setText(translate('OpenLP.FormattingTagDialog', 'End HTML'))
self.deletePushButton.setText(UiStrings().Delete)
self.newPushButton.setText(UiStrings().New)
- self.tagTableWidget.horizontalHeaderItem(0).setText(
- translate('OpenLP.FormattingTagDialog', 'Description'))
- self.tagTableWidget.horizontalHeaderItem(1).setText(
- translate('OpenLP.FormattingTagDialog', 'Tag'))
- self.tagTableWidget.horizontalHeaderItem(2).setText(
- translate('OpenLP.FormattingTagDialog', 'Start HTML'))
- self.tagTableWidget.horizontalHeaderItem(3).setText(
- translate('OpenLP.FormattingTagDialog', 'End HTML'))
+ self.tagTableWidget.horizontalHeaderItem(0).setText(translate('OpenLP.FormattingTagDialog', 'Description'))
+ self.tagTableWidget.horizontalHeaderItem(1).setText(translate('OpenLP.FormattingTagDialog', 'Tag'))
+ self.tagTableWidget.horizontalHeaderItem(2).setText(translate('OpenLP.FormattingTagDialog', 'Start HTML'))
+ self.tagTableWidget.horizontalHeaderItem(3).setText(translate('OpenLP.FormattingTagDialog', 'End HTML'))
self.tagTableWidget.setColumnWidth(0, 120)
self.tagTableWidget.setColumnWidth(1, 80)
self.tagTableWidget.setColumnWidth(2, 330)
=== modified file 'openlp/core/ui/formattingtagform.py'
--- openlp/core/ui/formattingtagform.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/formattingtagform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -49,24 +49,15 @@
"""
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
- QtCore.QObject.connect(self.tagTableWidget,
- QtCore.SIGNAL(u'itemSelectionChanged()'),self.onRowSelected)
- QtCore.QObject.connect(self.newPushButton,
- QtCore.SIGNAL(u'clicked()'), self.onNewClicked)
- QtCore.QObject.connect(self.savePushButton,
- QtCore.SIGNAL(u'clicked()'), self.onSavedClicked)
- QtCore.QObject.connect(self.deletePushButton,
- QtCore.SIGNAL(u'clicked()'), self.onDeleteClicked)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
- self.close)
- QtCore.QObject.connect(self.descriptionLineEdit,
- QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
- QtCore.QObject.connect(self.tagLineEdit,
- QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
- QtCore.QObject.connect(self.startTagLineEdit,
- QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
- QtCore.QObject.connect(self.endTagLineEdit,
- QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
+ QtCore.QObject.connect(self.tagTableWidget, QtCore.SIGNAL(u'itemSelectionChanged()'),self.onRowSelected)
+ QtCore.QObject.connect(self.newPushButton, QtCore.SIGNAL(u'clicked()'), self.onNewClicked)
+ QtCore.QObject.connect(self.savePushButton, QtCore.SIGNAL(u'clicked()'), self.onSavedClicked)
+ QtCore.QObject.connect(self.deletePushButton, QtCore.SIGNAL(u'clicked()'), self.onDeleteClicked)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), self.close)
+ QtCore.QObject.connect(self.descriptionLineEdit, QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
+ QtCore.QObject.connect(self.tagLineEdit, QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
+ QtCore.QObject.connect(self.startTagLineEdit, QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
+ QtCore.QObject.connect(self.endTagLineEdit, QtCore.SIGNAL(u'textEdited(QString)'), self.onTextEdited)
# Forces reloading of tags from openlp configuration.
FormattingTags.load_tags()
@@ -118,8 +109,7 @@
if self._strip(html[u'start tag']) == u'n':
critical_error_message_box(
translate('OpenLP.FormattingTagForm', 'Update Error'),
- translate('OpenLP.FormattingTagForm',
- 'Tag "n" already defined.'))
+ translate('OpenLP.FormattingTagForm', 'Tag "n" already defined.'))
return
# Add new tag to list
tag = {
@@ -162,12 +152,10 @@
html = html_expands[self.selected]
tag = self.tagLineEdit.text()
for linenumber, html1 in enumerate(html_expands):
- if self._strip(html1[u'start tag']) == tag and \
- linenumber != self.selected:
+ if self._strip(html1[u'start tag']) == tag and linenumber != self.selected:
critical_error_message_box(
translate('OpenLP.FormattingTagForm', 'Update Error'),
- translate('OpenLP.FormattingTagForm',
- 'Tag %s already defined.') % tag)
+ translate('OpenLP.FormattingTagForm', 'Tag %s already defined.') % tag)
return
html[u'desc'] = self.descriptionLineEdit.text()
html[u'start html'] = self.startTagLineEdit.text()
@@ -191,14 +179,10 @@
self.deletePushButton.setEnabled(False)
for linenumber, html in enumerate(FormattingTags.get_html_tags()):
self.tagTableWidget.setRowCount(self.tagTableWidget.rowCount() + 1)
- self.tagTableWidget.setItem(linenumber, 0,
- QtGui.QTableWidgetItem(html[u'desc']))
- self.tagTableWidget.setItem(linenumber, 1,
- QtGui.QTableWidgetItem(self._strip(html[u'start tag'])))
- self.tagTableWidget.setItem(linenumber, 2,
- QtGui.QTableWidgetItem(html[u'start html']))
- self.tagTableWidget.setItem(linenumber, 3,
- QtGui.QTableWidgetItem(html[u'end html']))
+ self.tagTableWidget.setItem(linenumber, 0, QtGui.QTableWidgetItem(html[u'desc']))
+ self.tagTableWidget.setItem(linenumber, 1, QtGui.QTableWidgetItem(self._strip(html[u'start tag'])))
+ self.tagTableWidget.setItem(linenumber, 2, QtGui.QTableWidgetItem(html[u'start html']))
+ self.tagTableWidget.setItem(linenumber, 3, QtGui.QTableWidgetItem(html[u'end html']))
# Permanent (persistent) tags do not have this key.
if u'temporary' not in html:
html[u'temporary'] = False
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/generaltab.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -189,21 +189,15 @@
self.rightLayout.addWidget(self.settingsGroupBox)
self.rightLayout.addStretch()
# Signals and slots
- QtCore.QObject.connect(self.overrideRadioButton,
- QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideRadioButtonPressed)
- QtCore.QObject.connect(self.customHeightValueEdit,
- QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
- QtCore.QObject.connect(self.customWidthValueEdit,
- QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
- QtCore.QObject.connect(self.customYValueEdit,
- QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
- QtCore.QObject.connect(self.customXValueEdit,
- QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
- QtCore.QObject.connect(self.monitorComboBox,
- QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged)
+ QtCore.QObject.connect(self.overrideRadioButton, QtCore.SIGNAL(u'toggled(bool)'),
+ self.onOverrideRadioButtonPressed)
+ QtCore.QObject.connect(self.customHeightValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
+ QtCore.QObject.connect(self.customWidthValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
+ QtCore.QObject.connect(self.customYValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
+ QtCore.QObject.connect(self.customXValueEdit, QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayChanged)
+ QtCore.QObject.connect(self.monitorComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onDisplayChanged)
# Reload the tab, as the screen resolution/count may have changed.
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_screen_changed'), self.load)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'), self.load)
# Remove for now
self.usernameLabel.setVisible(False)
self.usernameEdit.setVisible(False)
@@ -215,40 +209,25 @@
Translate the general settings tab to the currently selected language
"""
self.tabTitleVisible = translate('OpenLP.GeneralTab', 'General')
- self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab',
- 'Monitors'))
- self.monitorRadioButton.setText(translate('OpenLP.GeneralTab',
- 'Select monitor for output display:'))
- self.displayOnMonitorCheck.setText(
- translate('OpenLP.GeneralTab', 'Display if a single screen'))
- self.startupGroupBox.setTitle(
- translate('OpenLP.GeneralTab', 'Application Startup'))
- self.warningCheckBox.setText(
- translate('OpenLP.GeneralTab', 'Show blank screen warning'))
- self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab',
- 'Automatically open the last service'))
- self.showSplashCheckBox.setText(
- translate('OpenLP.GeneralTab', 'Show the splash screen'))
- self.checkForUpdatesCheckBox.setText(
- translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
- self.settingsGroupBox.setTitle(
- translate('OpenLP.GeneralTab', 'Application Settings'))
+ self.monitorGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Monitors'))
+ self.monitorRadioButton.setText(translate('OpenLP.GeneralTab', 'Select monitor for output display:'))
+ self.displayOnMonitorCheck.setText(translate('OpenLP.GeneralTab', 'Display if a single screen'))
+ self.startupGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Application Startup'))
+ self.warningCheckBox.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning'))
+ self.autoOpenCheckBox.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service'))
+ self.showSplashCheckBox.setText(translate('OpenLP.GeneralTab', 'Show the splash screen'))
+ self.checkForUpdatesCheckBox.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
+ self.settingsGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Application Settings'))
self.saveCheckServiceCheckBox.setText(translate('OpenLP.GeneralTab',
'Prompt to save before starting a new service'))
- self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab',
- 'Unblank display when adding new live item'))
- self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
- 'Automatically preview next item in service'))
- self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
- 'Timed slide interval:'))
+ self.autoUnblankCheckBox.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item'))
+ self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service'))
+ self.timeoutLabel.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
- self.ccliGroupBox.setTitle(
- translate('OpenLP.GeneralTab', 'CCLI Details'))
+ self.ccliGroupBox.setTitle(translate('OpenLP.GeneralTab', 'CCLI Details'))
self.numberLabel.setText(UiStrings().CCLINumberLabel)
- self.usernameLabel.setText(
- translate('OpenLP.GeneralTab', 'SongSelect username:'))
- self.passwordLabel.setText(
- translate('OpenLP.GeneralTab', 'SongSelect password:'))
+ self.usernameLabel.setText(translate('OpenLP.GeneralTab', 'SongSelect username:'))
+ self.passwordLabel.setText(translate('OpenLP.GeneralTab', 'SongSelect password:'))
# Moved from display tab
self.overrideRadioButton.setText(translate('OpenLP.GeneralTab',
'Override display position:'))
@@ -256,12 +235,9 @@
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
- self.audioGroupBox.setTitle(
- translate('OpenLP.GeneralTab', 'Background Audio'))
- self.startPausedCheckBox.setText(
- translate('OpenLP.GeneralTab', 'Start background audio paused'))
- self.repeatListCheckBox.setText(
- translate('OpenLP.GeneralTab', 'Repeat track list'))
+ self.audioGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Background Audio'))
+ self.startPausedCheckBox.setText(translate('OpenLP.GeneralTab', 'Start background audio paused'))
+ self.repeatListCheckBox.setText(translate('OpenLP.GeneralTab', 'Repeat track list'))
def load(self):
"""
@@ -271,49 +247,34 @@
settings.beginGroup(self.settingsSection)
self.monitorComboBox.clear()
self.monitorComboBox.addItems(self.screens.get_screen_list())
- monitorNumber = settings.value(
- u'monitor', self.screens.display_count - 1)
+ monitorNumber = settings.value(u'monitor', self.screens.display_count - 1)
self.monitorComboBox.setCurrentIndex(monitorNumber)
self.numberEdit.setText(settings.value(u'ccli number', u''))
self.usernameEdit.setText(settings.value(u'songselect username', u''))
self.passwordEdit.setText(settings.value(u'songselect password', u''))
- self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt',
- False))
- self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank',
- False))
+ self.saveCheckServiceCheckBox.setChecked(settings.value(u'save prompt', False))
+ self.autoUnblankCheckBox.setChecked(settings.value(u'auto unblank', False))
self.displayOnMonitorCheck.setChecked(self.screens.display)
self.warningCheckBox.setChecked(settings.value(u'blank warning', False))
self.autoOpenCheckBox.setChecked(settings.value(u'auto open', False))
self.showSplashCheckBox.setChecked(settings.value(u'show splash', True))
- self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check',
- True))
- self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview',
- False))
+ self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check', True))
+ self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview', False))
self.timeoutSpinBox.setValue(settings.value(u'loop delay', 5))
- self.monitorRadioButton.setChecked(
- not settings.value(u'override position', False))
- self.overrideRadioButton.setChecked(settings.value(u'override position',
- False))
- self.customXValueEdit.setValue(settings.value(u'x position',
- self.screens.current[u'size'].x()))
- self.customYValueEdit.setValue(settings.value(u'y position',
- self.screens.current[u'size'].y()))
- self.customHeightValueEdit.setValue(settings.value(u'height',
- self.screens.current[u'size'].height()))
- self.customWidthValueEdit.setValue(settings.value(u'width',
- self.screens.current[u'size'].width()))
- self.startPausedCheckBox.setChecked(settings.value(
- u'audio start paused', True))
- self.repeatListCheckBox.setChecked(settings.value(
- u'audio repeat list', False))
+ self.monitorRadioButton.setChecked(not settings.value(u'override position', False))
+ self.overrideRadioButton.setChecked(settings.value(u'override position', False))
+ self.customXValueEdit.setValue(settings.value(u'x position', self.screens.current[u'size'].x()))
+ self.customYValueEdit.setValue(settings.value(u'y position', self.screens.current[u'size'].y()))
+ self.customHeightValueEdit.setValue(settings.value(u'height', self.screens.current[u'size'].height()))
+ self.customWidthValueEdit.setValue(settings.value(u'width', self.screens.current[u'size'].width()))
+ self.startPausedCheckBox.setChecked(settings.value(u'audio start paused', True))
+ self.repeatListCheckBox.setChecked(settings.value(u'audio repeat list', False))
settings.endGroup()
self.monitorComboBox.setDisabled(self.overrideRadioButton.isChecked())
self.customXValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.customYValueEdit.setEnabled(self.overrideRadioButton.isChecked())
- self.customHeightValueEdit.setEnabled(
- self.overrideRadioButton.isChecked())
- self.customWidthValueEdit.setEnabled(
- self.overrideRadioButton.isChecked())
+ self.customHeightValueEdit.setEnabled(self.overrideRadioButton.isChecked())
+ self.customWidthValueEdit.setEnabled(self.overrideRadioButton.isChecked())
self.display_changed = False
settings.beginGroup(self.settingsSection)
@@ -324,33 +285,25 @@
settings = Settings()
settings.beginGroup(self.settingsSection)
settings.setValue(u'monitor', self.monitorComboBox.currentIndex())
- settings.setValue(u'display on monitor',
- self.displayOnMonitorCheck.isChecked())
+ settings.setValue(u'display on monitor', self.displayOnMonitorCheck.isChecked())
settings.setValue(u'blank warning', self.warningCheckBox.isChecked())
settings.setValue(u'auto open', self.autoOpenCheckBox.isChecked())
settings.setValue(u'show splash', self.showSplashCheckBox.isChecked())
- settings.setValue(u'update check',
- self.checkForUpdatesCheckBox.isChecked())
- settings.setValue(u'save prompt',
- self.saveCheckServiceCheckBox.isChecked())
+ settings.setValue(u'update check', self.checkForUpdatesCheckBox.isChecked())
+ settings.setValue(u'save prompt', self.saveCheckServiceCheckBox.isChecked())
settings.setValue(u'auto unblank', self.autoUnblankCheckBox.isChecked())
settings.setValue(u'auto preview', self.autoPreviewCheckBox.isChecked())
settings.setValue(u'loop delay', self.timeoutSpinBox.value())
settings.setValue(u'ccli number', self.numberEdit.displayText())
- settings.setValue(u'songselect username',
- self.usernameEdit.displayText())
- settings.setValue(u'songselect password',
- self.passwordEdit.displayText())
+ settings.setValue(u'songselect username', self.usernameEdit.displayText())
+ settings.setValue(u'songselect password', self.passwordEdit.displayText())
settings.setValue(u'x position', self.customXValueEdit.value())
settings.setValue(u'y position', self.customYValueEdit.value())
settings.setValue(u'height', self.customHeightValueEdit.value())
settings.setValue(u'width', self.customWidthValueEdit.value())
- settings.setValue(u'override position',
- self.overrideRadioButton.isChecked())
- settings.setValue(u'audio start paused',
- self.startPausedCheckBox.isChecked())
- settings.setValue(u'audio repeat list',
- self.repeatListCheckBox.isChecked())
+ settings.setValue(u'override position', self.overrideRadioButton.isChecked())
+ settings.setValue(u'audio start paused', self.startPausedCheckBox.isChecked())
+ settings.setValue(u'audio repeat list', self.repeatListCheckBox.isChecked())
settings.endGroup()
# On save update the screens as well
self.postSetUp(True)
@@ -360,8 +313,7 @@
Apply settings after settings tab has loaded and most of the
system so must be delayed
"""
- Receiver.send_message(u'slidecontroller_live_spin_delay',
- self.timeoutSpinBox.value())
+ Receiver.send_message(u'slidecontroller_live_spin_delay', self.timeoutSpinBox.value())
# Do not continue on start up.
if not postUpdate:
return
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2012-12-27 16:33:38 +0000
+++ openlp/core/ui/maindisplay.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -38,8 +38,8 @@
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
from PyQt4.phonon import Phonon
-from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \
- translate, PluginManager, expand_tags, Settings, ImageSource
+from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, translate, PluginManager, expand_tags,\
+ Settings, ImageSource
from openlp.core.lib.theme import BackgroundType
from openlp.core.ui import HideMode, ScreenList, AlertLocation
@@ -81,10 +81,8 @@
self.setGeometry(self.screen[u'size'])
log.debug(u'Setup webView')
self.webView = QtWebKit.QWebView(self)
- self.webView.setGeometry(0, 0,
- self.screen[u'size'].width(), self.screen[u'size'].height())
- self.webView.settings().setAttribute(
- QtWebKit.QWebSettings.PluginsEnabled, True)
+ self.webView.setGeometry(0, 0, self.screen[u'size'].width(), self.screen[u'size'].height())
+ self.webView.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True)
palette = self.webView.palette()
palette.setBrush(QtGui.QPalette.Base, QtCore.Qt.transparent)
self.webView.page().setPalette(palette)
@@ -92,8 +90,7 @@
self.page = self.webView.page()
self.frame = self.page.mainFrame()
if self.isLive and log.getEffectiveLevel() == logging.DEBUG:
- self.webView.settings().setAttribute(
- QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
+ self.webView.settings().setAttribute(QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
QtCore.QObject.connect(self.webView,
QtCore.SIGNAL(u'loadFinished(bool)'), self.isWebLoaded)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
@@ -161,14 +158,10 @@
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setTransparency(False)
if self.isLive:
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'live_display_hide'), self.hideDisplay)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'live_display_show'), self.showDisplay)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'update_display_css'), self.cssChanged)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_updated'), self.configChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_display_hide'), self.hideDisplay)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_display_show'), self.showDisplay)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'update_display_css'), self.cssChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.configChanged)
def setTransparency(self, enabled):
if enabled:
@@ -211,12 +204,10 @@
if self.isLive:
# Build the initial frame.
background_color = QtGui.QColor()
- background_color.setNamedColor(Settings().value(
- u'advanced/default color', u'#ffffff'))
+ background_color.setNamedColor(Settings().value(u'advanced/default color', u'#ffffff'))
if not background_color.isValid():
background_color = QtCore.Qt.white
- image_file = Settings().value(u'advanced/default image',
- u':/graphics/openlp-splash-screen.png')
+ image_file = Settings().value(u'advanced/default image', u':/graphics/openlp-splash-screen.png')
splash_image = QtGui.QImage(image_file)
self.initialFrame = QtGui.QImage(
self.screen[u'size'].width(),
@@ -252,8 +243,7 @@
Receiver.send_message(u'openlp_process_events')
self.setGeometry(self.screen[u'size'])
if animate:
- self.frame.evaluateJavaScript(u'show_text("%s")' %
- slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
+ self.frame.evaluateJavaScript(u'show_text("%s")' % slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
else:
# This exists for https://bugs.launchpad.net/openlp/+bug/1016843
# For unknown reasons if evaluateJavaScript is called
@@ -274,10 +264,8 @@
log.debug(u'alert to display')
# First we convert <>& marks to html variants, then apply
# formattingtags, finally we double all backslashes for JavaScript.
- text_prepared = expand_tags(
- cgi.escape(text)).replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')
- if self.height() != self.screen[u'size'].height() or not \
- self.isVisible():
+ text_prepared = expand_tags(cgi.escape(text)).replace(u'\\', u'\\\\').replace(u'\"', u'\\\"')
+ if self.height() != self.screen[u'size'].height() or not self.isVisible():
shrink = True
js = u'show_alert("%s", "%s")' % (text_prepared, u'top')
else:
@@ -290,11 +278,9 @@
self.resize(self.width(), alert_height)
self.setVisible(True)
if location == AlertLocation.Middle:
- self.move(self.screen[u'size'].left(),
- (self.screen[u'size'].height() - alert_height) / 2)
+ self.move(self.screen[u'size'].left(), (self.screen[u'size'].height() - alert_height) / 2)
elif location == AlertLocation.Bottom:
- self.move(self.screen[u'size'].left(),
- self.screen[u'size'].height() - alert_height)
+ self.move(self.screen[u'size'].left(), self.screen[u'size'].height() - alert_height)
else:
self.setVisible(False)
self.setGeometry(self.screen[u'size'])
@@ -363,10 +349,8 @@
if self.isLive and hasattr(self, u'serviceItem'):
# Wait for the fade to finish before geting the preview.
# Important otherwise preview will have incorrect text if at all!
- if self.serviceItem.themedata and \
- self.serviceItem.themedata.display_slide_transition:
- while self.frame.evaluateJavaScript(u'show_text_complete()') \
- == u'false':
+ if self.serviceItem.themedata and self.serviceItem.themedata.display_slide_transition:
+ while self.frame.evaluateJavaScript(u'show_text_complete()') == u'false':
Receiver.send_message(u'openlp_process_events')
# Wait for the webview to update before getting the preview.
# Important otherwise first preview will miss the background !
@@ -403,27 +387,22 @@
Receiver.send_message(u'video_background_replaced')
self.override = {}
# We have a different theme.
- elif self.override[u'theme'] != \
- serviceItem.themedata.background_filename:
+ elif self.override[u'theme'] != serviceItem.themedata.background_filename:
Receiver.send_message(u'live_theme_changed')
self.override = {}
else:
# replace the background
- background = self.imageManager.getImageBytes(
- self.override[u'image'], ImageSource.ImagePlugin)
+ background = self.imageManager.getImageBytes(self.override[u'image'], ImageSource.ImagePlugin)
self.setTransparency(self.serviceItem.themedata.background_type ==
BackgroundType.to_string(BackgroundType.Transparent))
if self.serviceItem.themedata.background_filename:
self.serviceItem.bg_image_bytes = self.imageManager.getImageBytes(
- self.serviceItem.themedata.background_filename,
- ImageSource.Theme)
+ self.serviceItem.themedata.background_filename,ImageSource.Theme)
if image_path:
- image_bytes = self.imageManager.getImageBytes(
- image_path, ImageSource.ImagePlugin)
+ image_bytes = self.imageManager.getImageBytes(image_path, ImageSource.ImagePlugin)
else:
image_bytes = None
- html = build_html(self.serviceItem, self.screen, self.isLive,
- background, image_bytes, self.plugins)
+ html = build_html(self.serviceItem, self.screen, self.isLive, background, image_bytes, self.plugins)
log.debug(u'buildHtml - pre setHtml')
self.webView.setHtml(html)
log.debug(u'buildHtml - post setHtml')
@@ -442,8 +421,7 @@
Display the Footer
"""
log.debug(u'footer')
- js = u'show_footer(\'' + \
- text.replace(u'\\', u'\\\\').replace(u'\'', u'\\\'') + u'\')'
+ js = u'show_footer(\'' + text.replace(u'\\', u'\\\\').replace(u'\'', u'\\\'') + u'\')'
self.frame.evaluateJavaScript(js)
def hideDisplay(self, mode=HideMode.Screen):
@@ -523,10 +501,8 @@
self.mediaObject.setTickInterval(100)
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
Phonon.createPath(self.mediaObject, self.audioObject)
- QtCore.QObject.connect(self.mediaObject,
- QtCore.SIGNAL(u'aboutToFinish()'), self.onAboutToFinish)
- QtCore.QObject.connect(self.mediaObject,
- QtCore.SIGNAL(u'finished()'), self.onFinished)
+ QtCore.QObject.connect(self.mediaObject, QtCore.SIGNAL(u'aboutToFinish()'), self.onAboutToFinish)
+ QtCore.QObject.connect(self.mediaObject, QtCore.SIGNAL(u'finished()'), self.onFinished)
def __del__(self):
"""
@@ -621,5 +597,6 @@
if isPlaying:
self.mediaObject.play()
+ #@todo is this used?
def connectSlot(self, signal, slot):
QtCore.QObject.connect(self.mediaObject, signal, slot)
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2012-12-27 17:00:40 +0000
+++ openlp/core/ui/mainwindow.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -39,16 +39,15 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, \
- PluginManager, Receiver, translate, ImageManager, PluginStatus
+from openlp.core.lib import Renderer, build_icon, OpenLPDockWidget, PluginManager, Receiver, translate, ImageManager, \
+ PluginStatus
from openlp.core.lib.ui import UiStrings, create_action
from openlp.core.lib import SlideLimits, Settings
-from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
- ThemeManager, SlideController, PluginForm, MediaDockManager, \
- ShortcutListForm, FormattingTagForm
+from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, SlideController, PluginForm, \
+ MediaDockManager, ShortcutListForm, FormattingTagForm
from openlp.core.ui.media import MediaController
-from openlp.core.utils import AppLocation, add_actions, LanguageManager, \
- get_application_version, get_filesystem_encoding
+from openlp.core.utils import AppLocation, add_actions, LanguageManager, get_application_version, \
+ get_filesystem_encoding
from openlp.core.utils.actions import ActionList, CategoryOrder
from openlp.core.ui.firsttimeform import FirstTimeForm
from openlp.core.ui import ScreenList
@@ -150,36 +149,28 @@
self.defaultThemeLabel.setObjectName(u'defaultThemeLabel')
self.statusBar.addPermanentWidget(self.defaultThemeLabel)
# Create the MediaManager
- self.mediaManagerDock = OpenLPDockWidget(mainWindow,
- u'mediaManagerDock', u':/system/system_mediamanager.png')
+ self.mediaManagerDock = OpenLPDockWidget(mainWindow,u'mediaManagerDock', u':/system/system_mediamanager.png')
self.mediaManagerDock.setStyleSheet(MEDIA_MANAGER_STYLE)
# Create the media toolbox
self.mediaToolBox = QtGui.QToolBox(self.mediaManagerDock)
self.mediaToolBox.setObjectName(u'mediaToolBox')
self.mediaManagerDock.setWidget(self.mediaToolBox)
- mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea,
- self.mediaManagerDock)
+ mainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.mediaManagerDock)
# Create the service manager
- self.serviceManagerDock = OpenLPDockWidget(mainWindow,
- u'serviceManagerDock', u':/system/system_servicemanager.png')
- self.serviceManagerContents = ServiceManager(mainWindow,
- self.serviceManagerDock)
+ self.serviceManagerDock = OpenLPDockWidget(mainWindow, u'serviceManagerDock',
+ u':/system/system_servicemanager.png')
+ self.serviceManagerContents = ServiceManager(mainWindow, self.serviceManagerDock)
self.serviceManagerDock.setWidget(self.serviceManagerContents)
- mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
- self.serviceManagerDock)
+ mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.serviceManagerDock)
# Create the theme manager
- self.themeManagerDock = OpenLPDockWidget(mainWindow,
- u'themeManagerDock', u':/system/system_thememanager.png')
- self.themeManagerContents = ThemeManager(mainWindow,
- self.themeManagerDock)
+ self.themeManagerDock = OpenLPDockWidget(mainWindow, u'themeManagerDock', u':/system/system_thememanager.png')
+ self.themeManagerContents = ThemeManager(mainWindow, self.themeManagerDock)
self.themeManagerContents.setObjectName(u'themeManagerContents')
self.themeManagerDock.setWidget(self.themeManagerContents)
- mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea,
- self.themeManagerDock)
+ mainWindow.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.themeManagerDock)
# Create the menu items
action_list = ActionList.get_instance()
- action_list.add_category(UiStrings().File,
- CategoryOrder.standardMenu)
+ action_list.add_category(UiStrings().File, CategoryOrder.standardMenu)
self.fileNewItem = create_action(mainWindow, u'fileNewItem',
icon=u':/general/general_new.png',
shortcuts=[QtGui.QKeySequence(u'Ctrl+N')],
@@ -209,20 +200,13 @@
category=UiStrings().File, triggers=mainWindow.close)
# Give QT Extra Hint that this is the Exit Menu Item
self.fileExitItem.setMenuRole(QtGui.QAction.QuitRole)
- action_list.add_category(UiStrings().Import,
- CategoryOrder.standardMenu)
- self.importThemeItem = create_action(mainWindow,
- u'importThemeItem', category=UiStrings().Import)
- self.importLanguageItem = create_action(mainWindow,
- u'importLanguageItem')#, category=UiStrings().Import)
- action_list.add_category(UiStrings().Export,
- CategoryOrder.standardMenu)
- self.exportThemeItem = create_action(mainWindow,
- u'exportThemeItem', category=UiStrings().Export)
- self.exportLanguageItem = create_action(mainWindow,
- u'exportLanguageItem')#, category=UiStrings().Export)
- action_list.add_category(UiStrings().View,
- CategoryOrder.standardMenu)
+ action_list.add_category(UiStrings().Import, CategoryOrder.standardMenu)
+ self.importThemeItem = create_action(mainWindow, u'importThemeItem', category=UiStrings().Import)
+ self.importLanguageItem = create_action(mainWindow, u'importLanguageItem')
+ action_list.add_category(UiStrings().Export, CategoryOrder.standardMenu)
+ self.exportThemeItem = create_action(mainWindow, u'exportThemeItem', category=UiStrings().Export)
+ self.exportLanguageItem = create_action(mainWindow, u'exportLanguageItem')
+ action_list.add_category(UiStrings().View, CategoryOrder.standardMenu)
self.viewMediaManagerItem = create_action(mainWindow,
u'viewMediaManagerItem', shortcuts=[QtGui.QKeySequence(u'F8')],
icon=u':/system/system_mediamanager.png',
@@ -248,12 +232,10 @@
checked=panelLocked, triggers=self.setLockPanel)
action_list.add_category(UiStrings().ViewMode,
CategoryOrder.standardMenu)
- self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem',
- checked=False, category=UiStrings().ViewMode)
- self.modeSetupItem = create_action(mainWindow, u'modeSetupItem',
- checked=False, category=UiStrings().ViewMode)
- self.modeLiveItem = create_action(mainWindow, u'modeLiveItem',
- checked=True, category=UiStrings().ViewMode)
+ self.modeDefaultItem = create_action(mainWindow, u'modeDefaultItem', checked=False,
+ category=UiStrings().ViewMode)
+ self.modeSetupItem = create_action(mainWindow, u'modeSetupItem', checked=False, category=UiStrings().ViewMode)
+ self.modeLiveItem = create_action(mainWindow, u'modeLiveItem', checked=True, category=UiStrings().ViewMode)
self.modeGroup = QtGui.QActionGroup(mainWindow)
self.modeGroup.addAction(self.modeDefaultItem)
self.modeGroup.addAction(self.modeSetupItem)
@@ -288,29 +270,21 @@
qmList = LanguageManager.get_qm_list()
savedLanguage = LanguageManager.get_language()
for key in sorted(qmList.keys()):
- languageItem = create_action(mainWindow, key,
- checked=qmList[key] == savedLanguage)
+ languageItem = create_action(mainWindow, key, checked=qmList[key] == savedLanguage)
add_actions(self.languageGroup, [languageItem])
- self.settingsShortcutsItem = create_action(mainWindow,
- u'settingsShortcutsItem',
- icon=u':/system/system_configure_shortcuts.png',
- category=UiStrings().Settings)
+ self.settingsShortcutsItem = create_action(mainWindow, u'settingsShortcutsItem',
+ icon=u':/system/system_configure_shortcuts.png', category=UiStrings().Settings)
# Formatting Tags were also known as display tags.
- self.formattingTagItem = create_action(mainWindow,
- u'displayTagItem', icon=u':/system/tag_editor.png',
- category=UiStrings().Settings)
- self.settingsConfigureItem = create_action(mainWindow,
- u'settingsConfigureItem', icon=u':/system/system_settings.png',
- category=UiStrings().Settings)
+ self.formattingTagItem = create_action(mainWindow, u'displayTagItem',
+ icon=u':/system/tag_editor.png', category=UiStrings().Settings)
+ self.settingsConfigureItem = create_action(mainWindow, u'settingsConfigureItem',
+ icon=u':/system/system_settings.png', category=UiStrings().Settings)
# Give QT Extra Hint that this is the Preferences Menu Item
self.settingsConfigureItem.setMenuRole(QtGui.QAction.PreferencesRole)
- self.settingsImportItem = create_action(mainWindow,
- u'settingsImportItem', category=UiStrings().Settings)
- self.settingsExportItem = create_action(mainWindow,
- u'settingsExportItem', category=UiStrings().Settings)
+ self.settingsImportItem = create_action(mainWindow, u'settingsImportItem', category=UiStrings().Settings)
+ self.settingsExportItem = create_action(mainWindow, u'settingsExportItem', category=UiStrings().Settings)
action_list.add_category(UiStrings().Help, CategoryOrder.standardMenu)
- self.aboutItem = create_action(mainWindow, u'aboutItem',
- icon=u':/system/system_about.png',
+ self.aboutItem = create_action(mainWindow, u'aboutItem', icon=u':/system/system_about.png',
shortcuts=[QtGui.QKeySequence(u'Ctrl+F1')],
category=UiStrings().Help, triggers=self.onAboutItemClicked)
# Give QT Extra Hint that this is an About Menu Item
@@ -326,22 +300,16 @@
icon=u':/system/system_online_help.png',
shortcuts=[QtGui.QKeySequence(u'Alt+F1')],
category=UiStrings().Help, triggers=self.onOnlineHelpClicked)
- self.webSiteItem = create_action(mainWindow,
- u'webSiteItem', category=UiStrings().Help)
- add_actions(self.fileImportMenu, (self.settingsImportItem, None,
- self.importThemeItem, self.importLanguageItem))
- add_actions(self.fileExportMenu, (self.settingsExportItem, None,
- self.exportThemeItem, self.exportLanguageItem))
+ self.webSiteItem = create_action(mainWindow, u'webSiteItem', category=UiStrings().Help)
+ add_actions(self.fileImportMenu, (self.settingsImportItem, None, self.importThemeItem, self.importLanguageItem))
+ add_actions(self.fileExportMenu, (self.settingsExportItem, None, self.exportThemeItem, self.exportLanguageItem))
add_actions(self.fileMenu, (self.fileNewItem, self.fileOpenItem,
- self.fileSaveItem, self.fileSaveAsItem,
- self.recentFilesMenu.menuAction(), None,
- self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(),
- None, self.printServiceOrderItem, self.fileExitItem))
- add_actions(self.viewModeMenu, (self.modeDefaultItem,
- self.modeSetupItem, self.modeLiveItem))
- add_actions(self.viewMenu, (self.viewModeMenu.menuAction(),
- None, self.viewMediaManagerItem, self.viewServiceManagerItem,
- self.viewThemeManagerItem, None, self.viewPreviewPanel,
+ self.fileSaveItem, self.fileSaveAsItem, self.recentFilesMenu.menuAction(), None,
+ self.fileImportMenu.menuAction(), self.fileExportMenu.menuAction(), None, self.printServiceOrderItem,
+ self.fileExitItem))
+ add_actions(self.viewModeMenu, (self.modeDefaultItem, self.modeSetupItem, self.modeLiveItem))
+ add_actions(self.viewMenu, (self.viewModeMenu.menuAction(), None, self.viewMediaManagerItem,
+ self.viewServiceManagerItem, self.viewThemeManagerItem, None, self.viewPreviewPanel,
self.viewLivePanel, None, self.lockPanel))
# i18n add Language Actions
add_actions(self.settingsLanguageMenu, (self.autoLanguageItem, None))
@@ -349,35 +317,27 @@
# 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.formattingTagItem))
+ add_actions(self.settingsMenu, (self.settingsPluginListItem, self.settingsLanguageMenu.menuAction(), None,
+ self.settingsConfigureItem, self.settingsShortcutsItem, self.formattingTagItem))
else:
- add_actions(self.settingsMenu, (self.settingsPluginListItem,
- self.settingsLanguageMenu.menuAction(), None,
- self.formattingTagItem, self.settingsShortcutsItem,
- self.settingsConfigureItem))
+ add_actions(self.settingsMenu, (self.settingsPluginListItem, self.settingsLanguageMenu.menuAction(), None,
+ self.formattingTagItem, self.settingsShortcutsItem, self.settingsConfigureItem))
add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
add_actions(self.toolsMenu, (self.toolsFirstTimeWizard, None))
add_actions(self.toolsMenu, [self.updateThemeImages])
if os.name == u'nt':
- add_actions(self.helpMenu, (self.offlineHelpItem,
- self.onlineHelpItem, None, self.webSiteItem,
- self.aboutItem))
+ add_actions(self.helpMenu, (self.offlineHelpItem, self.onlineHelpItem, None, self.webSiteItem,
+ self.aboutItem))
else:
- add_actions(self.helpMenu, (self.onlineHelpItem, None,
- self.webSiteItem, self.aboutItem))
- add_actions(self.menuBar, (self.fileMenu.menuAction(),
- self.viewMenu.menuAction(), self.toolsMenu.menuAction(),
+ add_actions(self.helpMenu, (self.onlineHelpItem, None, self.webSiteItem, self.aboutItem))
+ add_actions(self.menuBar, (self.fileMenu.menuAction(), self.viewMenu.menuAction(), self.toolsMenu.menuAction(),
self.settingsMenu.menuAction(), self.helpMenu.menuAction()))
# Initialise the translation
self.retranslateUi(mainWindow)
self.mediaToolBox.setCurrentIndex(0)
# Connect up some signals and slots
- QtCore.QObject.connect(self.fileMenu,
- QtCore.SIGNAL(u'aboutToShow()'), self.updateRecentFilesMenu)
+ QtCore.QObject.connect(self.fileMenu, QtCore.SIGNAL(u'aboutToShow()'), self.updateRecentFilesMenu)
# Hide the entry, as it does not have any functionality yet.
self.toolsAddToolItem.setVisible(False)
self.importLanguageItem.setVisible(False)
@@ -394,152 +354,94 @@
self.fileMenu.setTitle(translate('OpenLP.MainWindow', '&File'))
self.fileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import'))
self.fileExportMenu.setTitle(translate('OpenLP.MainWindow', '&Export'))
- self.recentFilesMenu.setTitle(
- translate('OpenLP.MainWindow', '&Recent Files'))
+ self.recentFilesMenu.setTitle(translate('OpenLP.MainWindow', '&Recent Files'))
self.viewMenu.setTitle(translate('OpenLP.MainWindow', '&View'))
self.viewModeMenu.setTitle(translate('OpenLP.MainWindow', 'M&ode'))
self.toolsMenu.setTitle(translate('OpenLP.MainWindow', '&Tools'))
self.settingsMenu.setTitle(translate('OpenLP.MainWindow', '&Settings'))
- self.settingsLanguageMenu.setTitle(translate('OpenLP.MainWindow',
- '&Language'))
+ self.settingsLanguageMenu.setTitle(translate('OpenLP.MainWindow', '&Language'))
self.helpMenu.setTitle(translate('OpenLP.MainWindow', '&Help'))
- self.mediaManagerDock.setWindowTitle(
- translate('OpenLP.MainWindow', 'Media Manager'))
- self.serviceManagerDock.setWindowTitle(
- translate('OpenLP.MainWindow', 'Service Manager'))
- self.themeManagerDock.setWindowTitle(
- translate('OpenLP.MainWindow', 'Theme Manager'))
+ self.mediaManagerDock.setWindowTitle(translate('OpenLP.MainWindow', 'Media Manager'))
+ self.serviceManagerDock.setWindowTitle(translate('OpenLP.MainWindow', 'Service Manager'))
+ self.themeManagerDock.setWindowTitle(translate('OpenLP.MainWindow', 'Theme Manager'))
self.fileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
self.fileNewItem.setToolTip(UiStrings().NewService)
self.fileNewItem.setStatusTip(UiStrings().CreateService)
self.fileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
self.fileOpenItem.setToolTip(UiStrings().OpenService)
- self.fileOpenItem.setStatusTip(
- translate('OpenLP.MainWindow', 'Open an existing service.'))
+ self.fileOpenItem.setStatusTip(translate('OpenLP.MainWindow', 'Open an existing service.'))
self.fileSaveItem.setText(translate('OpenLP.MainWindow', '&Save'))
self.fileSaveItem.setToolTip(UiStrings().SaveService)
- self.fileSaveItem.setStatusTip(
- translate('OpenLP.MainWindow', 'Save the current service to disk.'))
- self.fileSaveAsItem.setText(
- translate('OpenLP.MainWindow', 'Save &As...'))
- self.fileSaveAsItem.setToolTip(
- translate('OpenLP.MainWindow', 'Save Service As'))
- self.fileSaveAsItem.setStatusTip(translate('OpenLP.MainWindow',
- 'Save the current service under a new name.'))
+ self.fileSaveItem.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service to disk.'))
+ self.fileSaveAsItem.setText(translate('OpenLP.MainWindow', 'Save &As...'))
+ self.fileSaveAsItem.setToolTip(translate('OpenLP.MainWindow', 'Save Service As'))
+ self.fileSaveAsItem.setStatusTip(translate('OpenLP.MainWindow', 'Save the current service under a new name.'))
self.printServiceOrderItem.setText(UiStrings().PrintService)
- self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
- 'Print the current service.'))
- self.fileExitItem.setText(
- translate('OpenLP.MainWindow', 'E&xit'))
- self.fileExitItem.setStatusTip(
- translate('OpenLP.MainWindow', 'Quit OpenLP'))
- self.importThemeItem.setText(
- translate('OpenLP.MainWindow', '&Theme'))
- self.importLanguageItem.setText(
- translate('OpenLP.MainWindow', '&Language'))
- self.exportThemeItem.setText(
- translate('OpenLP.MainWindow', '&Theme'))
- self.exportLanguageItem.setText(
- translate('OpenLP.MainWindow', '&Language'))
- self.settingsShortcutsItem.setText(
- translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
- self.formattingTagItem.setText(
- translate('OpenLP.MainWindow', 'Configure &Formatting Tags...'))
- self.settingsConfigureItem.setText(
- translate('OpenLP.MainWindow', '&Configure OpenLP...'))
+ self.printServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow', 'Print the current service.'))
+ self.fileExitItem.setText(translate('OpenLP.MainWindow', 'E&xit'))
+ self.fileExitItem.setStatusTip(translate('OpenLP.MainWindow', 'Quit OpenLP'))
+ self.importThemeItem.setText(translate('OpenLP.MainWindow', '&Theme'))
+ self.importLanguageItem.setText(translate('OpenLP.MainWindow', '&Language'))
+ self.exportThemeItem.setText(translate('OpenLP.MainWindow', '&Theme'))
+ self.exportLanguageItem.setText(translate('OpenLP.MainWindow', '&Language'))
+ self.settingsShortcutsItem.setText(translate('OpenLP.MainWindow', 'Configure &Shortcuts...'))
+ self.formattingTagItem.setText(translate('OpenLP.MainWindow', 'Configure &Formatting Tags...'))
+ self.settingsConfigureItem.setText(translate('OpenLP.MainWindow', '&Configure OpenLP...'))
self.settingsExportItem.setStatusTip(translate('OpenLP.MainWindow',
'Export OpenLP settings to a specified *.config file'))
- self.settingsExportItem.setText(
- translate('OpenLP.MainWindow', 'Settings'))
+ self.settingsExportItem.setText(translate('OpenLP.MainWindow', 'Settings'))
self.settingsImportItem.setStatusTip(translate('OpenLP.MainWindow',
- 'Import OpenLP settings from a specified *.config file previously '
- 'exported on this or another machine'))
- self.settingsImportItem.setText(
- translate('OpenLP.MainWindow', 'Settings'))
- self.viewMediaManagerItem.setText(
- translate('OpenLP.MainWindow', '&Media Manager'))
- self.viewMediaManagerItem.setToolTip(
- translate('OpenLP.MainWindow', 'Toggle Media Manager'))
+ 'Import OpenLP settings from a specified *.config file previously exported on this or another machine'))
+ self.settingsImportItem.setText(translate('OpenLP.MainWindow', 'Settings'))
+ self.viewMediaManagerItem.setText(translate('OpenLP.MainWindow', '&Media Manager'))
+ self.viewMediaManagerItem.setToolTip(translate('OpenLP.MainWindow', 'Toggle Media Manager'))
self.viewMediaManagerItem.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the media manager.'))
- self.viewThemeManagerItem.setText(
- translate('OpenLP.MainWindow', '&Theme Manager'))
- self.viewThemeManagerItem.setToolTip(
- translate('OpenLP.MainWindow', 'Toggle Theme Manager'))
+ self.viewThemeManagerItem.setText(translate('OpenLP.MainWindow', '&Theme Manager'))
+ self.viewThemeManagerItem.setToolTip(translate('OpenLP.MainWindow', 'Toggle Theme Manager'))
self.viewThemeManagerItem.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the theme manager.'))
- self.viewServiceManagerItem.setText(
- translate('OpenLP.MainWindow', '&Service Manager'))
- self.viewServiceManagerItem.setToolTip(
- translate('OpenLP.MainWindow', 'Toggle Service Manager'))
+ self.viewServiceManagerItem.setText(translate('OpenLP.MainWindow', '&Service Manager'))
+ self.viewServiceManagerItem.setToolTip(translate('OpenLP.MainWindow', 'Toggle Service Manager'))
self.viewServiceManagerItem.setStatusTip(translate('OpenLP.MainWindow',
'Toggle the visibility of the service manager.'))
- self.viewPreviewPanel.setText(
- translate('OpenLP.MainWindow', '&Preview Panel'))
- self.viewPreviewPanel.setToolTip(
- translate('OpenLP.MainWindow', 'Toggle Preview Panel'))
- self.viewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow',
- 'Toggle the visibility of the preview panel.'))
- self.viewLivePanel.setText(
- 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',
- '&Plugin List'))
- self.settingsPluginListItem.setStatusTip(
- translate('OpenLP.MainWindow', 'List the Plugins'))
+ self.viewPreviewPanel.setText(translate('OpenLP.MainWindow', '&Preview Panel'))
+ self.viewPreviewPanel.setToolTip(translate('OpenLP.MainWindow', 'Toggle Preview Panel'))
+ self.viewPreviewPanel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the preview panel.'))
+ self.viewLivePanel.setText(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', '&Plugin List'))
+ self.settingsPluginListItem.setStatusTip(translate('OpenLP.MainWindow', 'List the Plugins'))
self.aboutItem.setText(translate('OpenLP.MainWindow', '&About'))
- self.aboutItem.setStatusTip(
- translate('OpenLP.MainWindow', 'More information about OpenLP'))
+ self.aboutItem.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP'))
if os.name == u'nt':
- self.offlineHelpItem.setText(
- translate('OpenLP.MainWindow', '&User Guide'))
- self.onlineHelpItem.setText(
- translate('OpenLP.MainWindow', '&Online Help'))
- self.webSiteItem.setText(
- translate('OpenLP.MainWindow', '&Web Site'))
+ self.offlineHelpItem.setText(translate('OpenLP.MainWindow', '&User Guide'))
+ self.onlineHelpItem.setText(translate('OpenLP.MainWindow', '&Online Help'))
+ self.webSiteItem.setText(translate('OpenLP.MainWindow', '&Web Site'))
for item in self.languageGroup.actions():
item.setText(item.objectName())
- item.setStatusTip(translate('OpenLP.MainWindow',
- 'Set the interface language to %s') % item.objectName())
- self.autoLanguageItem.setText(
- translate('OpenLP.MainWindow', '&Autodetect'))
- self.autoLanguageItem.setStatusTip(translate('OpenLP.MainWindow',
- 'Use the system language, if available.'))
- self.toolsAddToolItem.setText(
- translate('OpenLP.MainWindow', 'Add &Tool...'))
- self.toolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow',
- 'Add an application to the list of tools.'))
- self.toolsOpenDataFolder.setText(
- translate('OpenLP.MainWindow', 'Open &Data Folder...'))
+ item.setStatusTip(translate('OpenLP.MainWindow', 'Set the interface language to %s') % item.objectName())
+ self.autoLanguageItem.setText(translate('OpenLP.MainWindow', '&Autodetect'))
+ self.autoLanguageItem.setStatusTip(translate('OpenLP.MainWindow', 'Use the system language, if available.'))
+ self.toolsAddToolItem.setText(translate('OpenLP.MainWindow', 'Add &Tool...'))
+ self.toolsAddToolItem.setStatusTip(translate('OpenLP.MainWindow', 'Add an application to the list of tools.'))
+ self.toolsOpenDataFolder.setText(translate('OpenLP.MainWindow', 'Open &Data Folder...'))
self.toolsOpenDataFolder.setStatusTip(translate('OpenLP.MainWindow',
'Open the folder where songs, bibles and other data resides.'))
- self.toolsFirstTimeWizard.setText(
- translate('OpenLP.MainWindow', 'Re-run First Time Wizard'))
+ self.toolsFirstTimeWizard.setText(translate('OpenLP.MainWindow', 'Re-run First Time Wizard'))
self.toolsFirstTimeWizard.setStatusTip(translate('OpenLP.MainWindow',
- 'Re-run the First Time Wizard, importing songs, Bibles and '
- 'themes.'))
- self.updateThemeImages.setText(
- translate('OpenLP.MainWindow', 'Update Theme Images'))
- self.updateThemeImages.setStatusTip(
- translate('OpenLP.MainWindow', 'Update the preview images for all '
- 'themes.'))
- self.modeDefaultItem.setText(
- translate('OpenLP.MainWindow', '&Default'))
- self.modeDefaultItem.setStatusTip(translate('OpenLP.MainWindow',
- 'Set the view mode back to the default.'))
+ 'Re-run the First Time Wizard, importing songs, Bibles and themes.'))
+ self.updateThemeImages.setText(translate('OpenLP.MainWindow', 'Update Theme Images'))
+ self.updateThemeImages.setStatusTip(translate('OpenLP.MainWindow', 'Update the preview images for all themes.'))
+ self.modeDefaultItem.setText(translate('OpenLP.MainWindow', '&Default'))
+ self.modeDefaultItem.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode back to the default.'))
self.modeSetupItem.setText(translate('OpenLP.MainWindow', '&Setup'))
- self.modeSetupItem.setStatusTip(
- translate('OpenLP.MainWindow', 'Set the view mode to Setup.'))
+ self.modeSetupItem.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode to Setup.'))
self.modeLiveItem.setText(translate('OpenLP.MainWindow', '&Live'))
- self.modeLiveItem.setStatusTip(
- translate('OpenLP.MainWindow', 'Set the view mode to Live.'))
+ self.modeLiveItem.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode to Live.'))
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
@@ -592,75 +494,50 @@
self.newDataPath = u''
self.copyData = False
# Set up signals and slots
- QtCore.QObject.connect(self.importThemeItem,
- QtCore.SIGNAL(u'triggered()'),
+ QtCore.QObject.connect(self.importThemeItem, QtCore.SIGNAL(u'triggered()'),
self.themeManagerContents.onImportTheme)
- QtCore.QObject.connect(self.exportThemeItem,
- QtCore.SIGNAL(u'triggered()'),
+ QtCore.QObject.connect(self.exportThemeItem, QtCore.SIGNAL(u'triggered()'),
self.themeManagerContents.onExportTheme)
- QtCore.QObject.connect(self.mediaManagerDock,
- QtCore.SIGNAL(u'visibilityChanged(bool)'),
+ QtCore.QObject.connect(self.mediaManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.viewMediaManagerItem.setChecked)
- QtCore.QObject.connect(self.serviceManagerDock,
- QtCore.SIGNAL(u'visibilityChanged(bool)'),
+ QtCore.QObject.connect(self.serviceManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.viewServiceManagerItem.setChecked)
- QtCore.QObject.connect(self.themeManagerDock,
- QtCore.SIGNAL(u'visibilityChanged(bool)'),
+ QtCore.QObject.connect(self.themeManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.viewThemeManagerItem.setChecked)
- QtCore.QObject.connect(self.webSiteItem,
- QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
- QtCore.QObject.connect(self.toolsOpenDataFolder,
- QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked)
- QtCore.QObject.connect(self.toolsFirstTimeWizard,
- QtCore.SIGNAL(u'triggered()'), self.onFirstTimeWizardClicked)
- QtCore.QObject.connect(self.updateThemeImages,
- QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
- QtCore.QObject.connect(self.formattingTagItem,
- QtCore.SIGNAL(u'triggered()'), self.onFormattingTagItemClicked)
- QtCore.QObject.connect(self.settingsConfigureItem,
- QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked)
- QtCore.QObject.connect(self.settingsShortcutsItem,
- QtCore.SIGNAL(u'triggered()'), self.onSettingsShortcutsItemClicked)
- QtCore.QObject.connect(self.settingsImportItem,
- QtCore.SIGNAL(u'triggered()'), self.onSettingsImportItemClicked)
- QtCore.QObject.connect(self.settingsExportItem,
- QtCore.SIGNAL(u'triggered()'), self.onSettingsExportItemClicked)
+ QtCore.QObject.connect(self.webSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked)
+ QtCore.QObject.connect(self.toolsOpenDataFolder, QtCore.SIGNAL(u'triggered()'),
+ self.onToolsOpenDataFolderClicked)
+ QtCore.QObject.connect(self.toolsFirstTimeWizard, QtCore.SIGNAL(u'triggered()'), self.onFirstTimeWizardClicked)
+ QtCore.QObject.connect(self.updateThemeImages, QtCore.SIGNAL(u'triggered()'), self.onUpdateThemeImages)
+ QtCore.QObject.connect(self.formattingTagItem, QtCore.SIGNAL(u'triggered()'), self.onFormattingTagItemClicked)
+ QtCore.QObject.connect(self.settingsConfigureItem, QtCore.SIGNAL(u'triggered()'),
+ self.onSettingsConfigureItemClicked)
+ QtCore.QObject.connect(self.settingsShortcutsItem, QtCore.SIGNAL(u'triggered()'),
+ self.onSettingsShortcutsItemClicked)
+ QtCore.QObject.connect(self.settingsImportItem, QtCore.SIGNAL(u'triggered()'),
+ self.onSettingsImportItemClicked)
+ QtCore.QObject.connect(self.settingsExportItem,QtCore.SIGNAL(u'triggered()'), self.onSettingsExportItemClicked)
# i18n set signals for languages
self.languageGroup.triggered.connect(LanguageManager.set_language)
- QtCore.QObject.connect(self.modeDefaultItem,
- QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
- QtCore.QObject.connect(self.modeSetupItem,
- QtCore.SIGNAL(u'triggered()'), self.onModeSetupItemClicked)
- QtCore.QObject.connect(self.modeLiveItem,
- QtCore.SIGNAL(u'triggered()'), self.onModeLiveItemClicked)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'openlp_version_check'), self.versionNotice)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'live_display_blank_check'), self.blankCheck)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'mainwindow_status_text'), self.showStatusMessage)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'cleanup'), self.cleanUp)
+ QtCore.QObject.connect(self.modeDefaultItem, QtCore.SIGNAL(u'triggered()'), self.onModeDefaultItemClicked)
+ QtCore.QObject.connect(self.modeSetupItem, QtCore.SIGNAL(u'triggered()'), self.onModeSetupItemClicked)
+ QtCore.QObject.connect(self.modeLiveItem, QtCore.SIGNAL(u'triggered()'), self.onModeLiveItemClicked)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_version_check'), self.versionNotice)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'live_display_blank_check'), self.blankCheck)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'mainwindow_status_text'), self.showStatusMessage)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'cleanup'), self.cleanUp)
# Media Manager
- QtCore.QObject.connect(self.mediaToolBox,
- QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
+ QtCore.QObject.connect(self.mediaToolBox, QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
Receiver.send_message(u'cursor_busy')
# Simple message boxes
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'openlp_error_message'), self.onErrorMessage)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'openlp_warning_message'), self.onWarningMessage)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'openlp_information_message'),
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_error_message'), self.onErrorMessage)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_warning_message'), self.onWarningMessage)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'openlp_information_message'),
self.onInformationMessage)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'set_new_data_path'), self.setNewDataPath)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'set_copy_data'), self.setCopyData)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'set_new_data_path'), self.setNewDataPath)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'set_copy_data'), self.setCopyData)
# warning cyclic dependency
# renderer needs to call ThemeManager and
# ThemeManager needs to call Renderer
@@ -729,13 +606,11 @@
Notifies the user that a newer version of OpenLP is available.
Triggered by delay thread.
"""
- version_text = translate('OpenLP.MainWindow',
- 'Version %s of OpenLP is now available for download (you are '
- 'currently running version %s). \n\nYou can download the latest '
- 'version from http://openlp.org/.')
+ version_text = translate('OpenLP.MainWindow', 'Version %s of OpenLP is now available for download (you are '
+ 'currently running version %s). \n\nYou can download the latest version from http://openlp.org/.')
QtGui.QMessageBox.question(self,
translate('OpenLP.MainWindow', 'OpenLP Version Updated'),
- version_text % (version, get_application_version()[u'full']))
+ version_text % (version, get_application_version()[u'full']))
def show(self):
"""
@@ -756,8 +631,7 @@
elif Settings().value(
self.generalSettingsSection + u'/auto open', False):
self.serviceManagerContents.loadLastFile()
- view_mode = Settings().value(u'%s/view mode' %
- self.generalSettingsSection, u'default')
+ view_mode = Settings().value(u'%s/view mode' % self.generalSettingsSection, u'default')
if view_mode == u'default':
self.modeDefaultItem.setChecked(True)
elif view_mode == u'setup':
@@ -797,15 +671,12 @@
"""
answer = QtGui.QMessageBox.warning(self,
translate('OpenLP.MainWindow', 'Re-run First Time Wizard?'),
- translate('OpenLP.MainWindow',
- 'Are you sure you want to re-run the First Time Wizard?\n\n'
- 'Re-running this wizard may make changes to your current '
- 'OpenLP configuration and possibly add songs to your '
- 'existing songs list and change your default theme.'),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No),
- QtGui.QMessageBox.No)
+ translate('OpenLP.MainWindow', 'Are you sure you want to re-run the First Time Wizard?\n\n'
+ 'Re-running this wizard may make changes to your current '
+ 'OpenLP configuration and possibly add songs to your '
+ 'existing songs list and change your default theme.'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
+ QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
return
Receiver.send_message(u'cursor_busy')
@@ -827,8 +698,7 @@
self.activePlugin.toggleStatus(PluginStatus.Inactive)
self.themeManagerContents.configUpdated()
self.themeManagerContents.loadThemes(True)
- Receiver.send_message(u'theme_update_global',
- self.themeManagerContents.global_theme)
+ Receiver.send_message(u'theme_update_global', self.themeManagerContents.global_theme)
# Check if any Bibles downloaded. If there are, they will be
# processed.
Receiver.send_message(u'bibles_load_list', True)
@@ -843,11 +713,8 @@
False):
if settings.value(u'%s/blank warning' % self.generalSettingsSection,
False):
- QtGui.QMessageBox.question(self,
- translate('OpenLP.MainWindow',
- 'OpenLP Main Display Blanked'),
- translate('OpenLP.MainWindow',
- 'The Main Display has been blanked out'))
+ QtGui.QMessageBox.question(self, translate('OpenLP.MainWindow', 'OpenLP Main Display Blanked'),
+ translate('OpenLP.MainWindow', 'The Main Display has been blanked out'))
def onErrorMessage(self, data):
Receiver.send_message(u'close_splash')
@@ -937,24 +804,16 @@
"""
Import settings from an export INI file
"""
- answer = QtGui.QMessageBox.critical(self,
- translate('OpenLP.MainWindow', 'Import settings?'),
- translate('OpenLP.MainWindow',
- 'Are you sure you want to import settings?\n\n'
- 'Importing settings will make permanent changes to your current '
- 'OpenLP configuration.\n\n'
- 'Importing incorrect settings may cause erratic behaviour or '
- 'OpenLP to terminate abnormally.'),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No),
- QtGui.QMessageBox.No)
+ answer = QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'Import settings?'),
+ translate('OpenLP.MainWindow', 'Are you sure you want to import settings?\n\n'
+ 'Importing settings will make permanent changes to your current OpenLP configuration.\n\n'
+ 'Importing incorrect settings may cause erratic behaviour or OpenLP to terminate abnormally.'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
+ QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
return
- import_file_name = QtGui.QFileDialog.getOpenFileName(self,
- translate('OpenLP.MainWindow', 'Open File'), '',
- translate('OpenLP.MainWindow',
- 'OpenLP Export Settings Files (*.conf)'))
+ import_file_name = QtGui.QFileDialog.getOpenFileName(self,translate('OpenLP.MainWindow', 'Open File'), '',
+ translate('OpenLP.MainWindow', 'OpenLP Export Settings Files (*.conf)'))
if not import_file_name:
return
setting_sections = []
@@ -987,16 +846,11 @@
section_key = section + "/" + key
# Make sure it's a valid section for us.
if not section in setting_sections:
- QtGui.QMessageBox.critical(self,
- translate('OpenLP.MainWindow', 'Import settings'),
- translate('OpenLP.MainWindow',
- 'The file you selected does appear to be a valid OpenLP '
- 'settings file.\n\n'
- 'Section [%s] is not valid \n\n'
- 'Processing has terminated and no changed have been made.'
- ).replace('%s', section),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Ok))
+ QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'Import settings'),
+ translate('OpenLP.MainWindow', 'The file you selected does appear to be a valid OpenLP '
+ 'settings file.\n\nSection [%s] is not valid \n\n'
+ 'Processing has terminated and no changed have been made.').replace('%s', section),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return
# We have a good file, import it.
for section_key in import_keys:
@@ -1012,13 +866,10 @@
# We must do an immediate restart or current configuration will
# overwrite what was just imported when application terminates
# normally. We need to exit without saving configuration.
- QtGui.QMessageBox.information(self,
- translate('OpenLP.MainWindow', 'Import settings'),
- translate('OpenLP.MainWindow',
- 'OpenLP will now close. Imported settings will '
- 'be applied the next time you start OpenLP.'),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Ok))
+ QtGui.QMessageBox.information(self, translate('OpenLP.MainWindow', 'Import settings'),
+ translate('OpenLP.MainWindow', 'OpenLP will now close. Imported settings will '
+ 'be applied the next time you start OpenLP.'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.settingsImported = True
self.cleanUp()
QtCore.QCoreApplication.exit()
@@ -1029,8 +880,7 @@
"""
export_file_name = QtGui.QFileDialog.getSaveFileName(self,
translate('OpenLP.MainWindow', 'Export Settings File'), '',
- translate('OpenLP.MainWindow',
- 'OpenLP Export Settings File (*.conf)'))
+ translate('OpenLP.MainWindow', 'OpenLP Export Settings File (*.conf)'))
if not export_file_name:
return
# Make sure it's a .conf file.
@@ -1120,8 +970,7 @@
"""
if mode:
settings = Settings()
- settings.setValue(u'%s/view mode' % self.generalSettingsSection,
- mode)
+ settings.setValue(u'%s/view mode' % self.generalSettingsSection, mode)
self.mediaManagerDock.setVisible(media)
self.serviceManagerDock.setVisible(service)
self.themeManagerDock.setVisible(theme)
@@ -1171,12 +1020,9 @@
event.ignore()
else:
if Settings().value(u'advanced/enable exit confirmation', True):
- ret = QtGui.QMessageBox.question(self,
- translate('OpenLP.MainWindow', 'Close OpenLP'),
- translate('OpenLP.MainWindow',
- 'Are you sure you want to close OpenLP?'),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
+ ret = QtGui.QMessageBox.question(self, translate('OpenLP.MainWindow', 'Close OpenLP'),
+ translate('OpenLP.MainWindow', 'Are you sure you want to close OpenLP?'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.Yes)
if ret == QtGui.QMessageBox.Yes:
self.cleanUp()
@@ -1201,8 +1047,7 @@
self.serviceManagerContents.cleanUp()
if save_settings:
if Settings().value(u'advanced/save current plugin', False):
- Settings().setValue(u'advanced/current media plugin',
- self.mediaToolBox.currentIndex())
+ Settings().setValue(u'advanced/current media plugin', self.mediaToolBox.currentIndex())
# Call the cleanup method to shutdown plugins.
log.info(u'cleanup plugins')
self.pluginManager.finalise_plugins()
@@ -1262,15 +1107,13 @@
self.statusBar.showMessage(message)
def defaultThemeChanged(self, theme):
- self.defaultThemeLabel.setText(
- translate('OpenLP.MainWindow', 'Default Theme: %s') % theme)
+ self.defaultThemeLabel.setText(translate('OpenLP.MainWindow', 'Default Theme: %s') % theme)
def toggleMediaManager(self):
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())
@@ -1294,24 +1137,18 @@
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.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.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)
@@ -1339,17 +1176,12 @@
"""
log.debug(u'Loading QSettings')
# Migrate Wrap Settings to Slide Limits Settings
- if Settings().contains(self.generalSettingsSection +
- u'/enable slide loop'):
- if Settings().value(self.generalSettingsSection +
- u'/enable slide loop', True):
- Settings().setValue(self.advancedSettingsSection +
- u'/slide limits', SlideLimits.Wrap)
+ if Settings().contains(self.generalSettingsSection + u'/enable slide loop'):
+ if Settings().value(self.generalSettingsSection + u'/enable slide loop', True):
+ Settings().setValue(self.advancedSettingsSection + u'/slide limits', SlideLimits.Wrap)
else:
- Settings().setValue(self.advancedSettingsSection +
- u'/slide limits', SlideLimits.End)
- Settings().remove(self.generalSettingsSection +
- u'/enable slide loop')
+ Settings().setValue(self.advancedSettingsSection + u'/slide limits', SlideLimits.End)
+ Settings().remove(self.generalSettingsSection + u'/enable slide loop')
Receiver.send_message(u'slidecontroller_update_slide_limits')
settings = Settings()
# Remove obsolete entries.
@@ -1360,16 +1192,11 @@
settings.endGroup()
settings.beginGroup(self.uiSettingsSection)
self.move(settings.value(u'main window position', QtCore.QPoint(0, 0)))
- self.restoreGeometry(
- settings.value(u'main window geometry', QtCore.QByteArray()))
- self.restoreState(
- settings.value(u'main window state', QtCore.QByteArray()))
- self.liveController.splitter.restoreState(
- settings.value(u'live splitter geometry', QtCore.QByteArray()))
- self.previewController.splitter.restoreState(
- settings.value(u'preview splitter geometry', QtCore.QByteArray()))
- self.controlSplitter.restoreState(settings.value(
- u'mainwindow splitter geometry', QtCore.QByteArray()))
+ self.restoreGeometry(settings.value(u'main window geometry', QtCore.QByteArray()))
+ self.restoreState(settings.value(u'main window state', QtCore.QByteArray()))
+ self.liveController.splitter.restoreState(settings.value(u'live splitter geometry', QtCore.QByteArray()))
+ self.previewController.splitter.restoreState(settings.value(u'preview splitter geometry', QtCore.QByteArray()))
+ self.controlSplitter.restoreState(settings.value(u'mainwindow splitter geometry', QtCore.QByteArray()))
settings.endGroup()
def saveSettings(self):
@@ -1388,12 +1215,9 @@
settings.setValue(u'main window position', self.pos())
settings.setValue(u'main window state', self.saveState())
settings.setValue(u'main window geometry', self.saveGeometry())
- settings.setValue(u'live splitter geometry',
- self.liveController.splitter.saveState())
- settings.setValue(u'preview splitter geometry',
- self.previewController.splitter.saveState())
- settings.setValue(u'mainwindow splitter geometry',
- self.controlSplitter.saveState())
+ settings.setValue(u'live splitter geometry', self.liveController.splitter.saveState())
+ settings.setValue(u'preview splitter geometry', self.previewController.splitter.saveState())
+ settings.setValue(u'mainwindow splitter geometry', self.controlSplitter.saveState())
settings.endGroup()
def updateRecentFilesMenu(self):
@@ -1414,10 +1238,8 @@
triggers=self.serviceManagerContents.onRecentServiceClicked)
self.recentFilesMenu.addAction(action)
clearRecentFilesAction = create_action(self, u'',
- text=translate('OpenLP.MainWindow', 'Clear List',
- 'Clear List of recent files'),
- statustip=translate('OpenLP.MainWindow',
- 'Clear the list of recent files.'),
+ text=translate('OpenLP.MainWindow', 'Clear List', 'Clear List of recent files'),
+ statustip=translate('OpenLP.MainWindow', 'Clear the list of recent files.'),
enabled=bool(self.recentFiles),
triggers=self.clearRecentFileMenu)
add_actions(self.recentFilesMenu, (None, clearRecentFilesAction))
@@ -1500,22 +1322,17 @@
Receiver.send_message(u'openlp_process_events')
Receiver.send_message(u'cursor_busy')
self.showStatusMessage(
- translate('OpenLP.MainWindow',
- 'Copying OpenLP data to new data directory location - %s '
- '- Please wait for copy to finish'
- ).replace('%s', self.newDataPath))
+ translate('OpenLP.MainWindow', 'Copying OpenLP data to new data directory location - %s '
+ '- Please wait for copy to finish').replace('%s', self.newDataPath))
dir_util.copy_tree(old_data_path, self.newDataPath)
log.info(u'Copy sucessful')
except (IOError, os.error, DistutilsFileError), why:
Receiver.send_message(u'cursor_normal')
log.exception(u'Data copy failed %s' % unicode(why))
- QtGui.QMessageBox.critical(self,
- translate('OpenLP.MainWindow', 'New Data Directory Error'),
+ QtGui.QMessageBox.critical(self, translate('OpenLP.MainWindow', 'New Data Directory Error'),
translate('OpenLP.MainWindow',
- 'OpenLP Data directory copy failed\n\n%s'
- ).replace('%s', unicode(why)),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Ok))
+ 'OpenLP Data directory copy failed\n\n%s').replace('%s', unicode(why)),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return False
else:
log.info(u'No data copy requested')
=== modified file 'openlp/core/ui/media/playertab.py'
--- openlp/core/ui/media/playertab.py 2012-12-20 12:09:12 +0000
+++ openlp/core/ui/media/playertab.py 2012-12-29 18:15:31 +0000
@@ -87,8 +87,7 @@
self.playerOrderGroupBox.setObjectName(u'playerOrderGroupBox')
self.playerOrderLayout = QtGui.QHBoxLayout(self.playerOrderGroupBox)
self.playerOrderLayout.setObjectName(u'playerOrderLayout')
- self.playerOrderlistWidget = QtGui.QListWidget(
- self.playerOrderGroupBox)
+ self.playerOrderlistWidget = QtGui.QListWidget(self.playerOrderGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
=== modified file 'openlp/core/ui/media/webkitplayer.py'
--- openlp/core/ui/media/webkitplayer.py 2012-12-27 16:27:59 +0000
+++ openlp/core/ui/media/webkitplayer.py 2012-12-29 18:15:31 +0000
@@ -373,19 +373,16 @@
if display.hasAudio:
vol = float(vol) / float(100)
if not controller.media_info.is_flash:
- display.frame.evaluateJavaScript(
- u'show_video(null, null, %s);' % str(vol))
+ display.frame.evaluateJavaScript(u'show_video(null, null, %s);' % str(vol))
def seek(self, display, seekVal):
controller = display.controller
if controller.media_info.is_flash:
seek = seekVal
- display.frame.evaluateJavaScript(
- u'show_flash("seek", null, null, "%s");' % (seek))
+ display.frame.evaluateJavaScript(u'show_flash("seek", null, null, "%s");' % (seek))
else:
seek = float(seekVal) / 1000
- display.frame.evaluateJavaScript(
- u'show_video("seek", null, null, null, "%f");' % (seek))
+ display.frame.evaluateJavaScript(u'show_video("seek", null, null, null, "%f");' % (seek))
def reset(self, display):
controller = display.controller
@@ -412,11 +409,9 @@
currentTime = display.frame.evaluateJavaScript(u'show_flash("currentTime");')
length = display.frame.evaluateJavaScript(u'show_flash("length");')
else:
- if display.frame.evaluateJavaScript(
- u'show_video("isEnded");') == 'true':
+ if display.frame.evaluateJavaScript(u'show_video("isEnded");') == 'true':
self.stop(display)
- (currentTime, ok) = display.frame.evaluateJavaScript(
- u'show_video("currentTime");')
+ (currentTime, ok) = display.frame.evaluateJavaScript(u'show_video("currentTime");')
# check if conversion was ok and value is not 'NaN'
if ok and currentTime != float('inf'):
currentTime = int(currentTime * 1000)
=== modified file 'openlp/core/ui/mediadockmanager.py'
--- openlp/core/ui/mediadockmanager.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/mediadockmanager.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -67,8 +67,7 @@
log.debug(u'Inserting %s dock' % visible_title[u'title'])
match = False
for dock_index in range(self.media_dock.count()):
- if self.media_dock.widget(dock_index).settingsSection == \
- media_item.plugin.name:
+ if self.media_dock.widget(dock_index).settingsSection == media_item.plugin.name:
match = True
break
if not match:
@@ -85,7 +84,6 @@
log.debug(u'remove %s dock' % visible_title[u'title'])
for dock_index in range(self.media_dock.count()):
if self.media_dock.widget(dock_index):
- if self.media_dock.widget(dock_index).settingsSection == \
- media_item.plugin.name:
+ if self.media_dock.widget(dock_index).settingsSection == media_item.plugin.name:
self.media_dock.widget(dock_index).setVisible(False)
self.media_dock.removeItem(dock_index)
=== modified file 'openlp/core/ui/plugindialog.py'
--- openlp/core/ui/plugindialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/plugindialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -61,27 +61,20 @@
self.aboutLabel = QtGui.QLabel(self.pluginInfoGroupBox)
self.aboutLabel.setObjectName(u'aboutLabel')
self.aboutTextBrowser = QtGui.QTextBrowser(self.pluginInfoGroupBox)
- self.aboutTextBrowser.setTextInteractionFlags(
- QtCore.Qt.LinksAccessibleByMouse)
+ self.aboutTextBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse)
self.aboutTextBrowser.setObjectName(u'aboutTextBrowser')
self.pluginInfoLayout.addRow(self.aboutLabel, self.aboutTextBrowser)
self.listLayout.addWidget(self.pluginInfoGroupBox)
self.pluginLayout.addLayout(self.listLayout)
- self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox',
- [u'ok'])
+ self.buttonBox = create_button_box(pluginViewDialog, u'buttonBox', [u'ok'])
self.pluginLayout.addWidget(self.buttonBox)
self.retranslateUi(pluginViewDialog)
def retranslateUi(self, pluginViewDialog):
- pluginViewDialog.setWindowTitle(
- translate('OpenLP.PluginForm', 'Plugin List'))
- self.pluginInfoGroupBox.setTitle(
- translate('OpenLP.PluginForm', 'Plugin Details'))
+ pluginViewDialog.setWindowTitle(translate('OpenLP.PluginForm', 'Plugin List'))
+ self.pluginInfoGroupBox.setTitle(translate('OpenLP.PluginForm', 'Plugin Details'))
self.versionLabel.setText(u'%s:' % UiStrings().Version)
self.aboutLabel.setText(u'%s:' % UiStrings().About)
- self.statusLabel.setText(
- translate('OpenLP.PluginForm', 'Status:'))
- self.statusComboBox.setItemText(0,
- translate('OpenLP.PluginForm', 'Active'))
- self.statusComboBox.setItemText(1,
- translate('OpenLP.PluginForm', 'Inactive'))
+ self.statusLabel.setText(translate('OpenLP.PluginForm', 'Status:'))
+ self.statusComboBox.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
+ self.statusComboBox.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/pluginform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -48,13 +48,9 @@
self.load()
self._clearDetails()
# Right, now let's put some signals and slots together!
- QtCore.QObject.connect(
- self.pluginListWidget,
- QtCore.SIGNAL(u'itemSelectionChanged()'),
+ QtCore.QObject.connect(self.pluginListWidget, QtCore.SIGNAL(u'itemSelectionChanged()'),
self.onPluginListWidgetSelectionChanged)
- QtCore.QObject.connect(
- self.statusComboBox,
- QtCore.SIGNAL(u'currentIndexChanged(int)'),
+ QtCore.QObject.connect(self.statusComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onStatusComboBoxChanged)
def load(self):
@@ -85,10 +81,8 @@
item.setIcon(plugin.icon)
self.pluginListWidget.addItem(item)
pluginListWidth = max(pluginListWidth, self.fontMetrics().width(
- translate('OpenLP.PluginForm', '%s (Inactive)') %
- plugin.nameStrings[u'singular']))
- self.pluginListWidget.setFixedWidth(pluginListWidth +
- self.pluginListWidget.iconSize().width() + 48)
+ translate('OpenLP.PluginForm', '%s (Inactive)') % plugin.nameStrings[u'singular']))
+ self.pluginListWidget.setFixedWidth(pluginListWidth + self.pluginListWidget.iconSize().width() + 48)
def _clearDetails(self):
self.statusComboBox.setCurrentIndex(-1)
=== modified file 'openlp/core/ui/printservicedialog.py'
--- openlp/core/ui/printservicedialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/printservicedialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -55,21 +55,17 @@
self.toolbar = QtGui.QToolBar(printServiceDialog)
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'),
+ self.printButton = self.toolbar.addAction(build_icon(u':/general/general_print.png'),
translate('OpenLP.PrintServiceForm', 'Print'))
self.optionsButton = QtGui.QToolButton(self.toolbar)
- self.optionsButton.setToolButtonStyle(
- QtCore.Qt.ToolButtonTextBesideIcon)
+ 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.toolbar.addSeparator()
- self.plainCopy = self.toolbar.addAction(
- build_icon(u':/system/system_edit_copy.png'),
+ self.plainCopy = self.toolbar.addAction(build_icon(u':/system/system_edit_copy.png'),
translate('OpenLP.PrintServiceForm', 'Copy'))
- self.htmlCopy = self.toolbar.addAction(
- build_icon(u':/system/system_edit_copy.png'),
+ self.htmlCopy = self.toolbar.addAction(build_icon(u':/system/system_edit_copy.png'),
translate('OpenLP.PrintServiceForm', 'Copy as HTML'))
self.toolbar.addSeparator()
self.zoomInButton = QtGui.QToolButton(self.toolbar)
@@ -78,14 +74,12 @@
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.setIcon(build_icon(u':/general/general_zoom_out.png'))
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.setIcon(build_icon(u':/general/general_zoom_original.png'))
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22))
self.toolbar.addWidget(self.zoomOriginalButton)
@@ -128,34 +122,22 @@
self.optionsLayout.addWidget(self.optionsGroupBox)
self.retranslateUi(printServiceDialog)
- QtCore.QObject.connect(self.optionsButton,
- QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
+ QtCore.QObject.connect(self.optionsButton,QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
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.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',
- 'Add page break before each text item'))
- self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm',
- 'Include service item notes'))
- self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm',
- 'Include play length of media items'))
- self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm',
- 'Service Sheet'))
+ 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', 'Add page break before each text item'))
+ self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include service item notes'))
+ self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items'))
+ self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm', 'Service Sheet'))
# Do not change the order.
self.zoomComboBox.addItems([
translate('OpenLP.PrintServiceDialog', 'Fit Page'),
=== modified file 'openlp/core/ui/printserviceform.py'
--- openlp/core/ui/printserviceform.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/printserviceform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -124,37 +124,24 @@
# Load the settings for the dialog.
settings = Settings()
settings.beginGroup(u'advanced')
- self.slideTextCheckBox.setChecked(settings.value(
- u'print slide text', False))
- self.pageBreakAfterText.setChecked(settings.value(
- u'add page break', False))
+ self.slideTextCheckBox.setChecked(settings.value(u'print slide text', False))
+ self.pageBreakAfterText.setChecked(settings.value(u'add page break', False))
if not self.slideTextCheckBox.isChecked():
self.pageBreakAfterText.setDisabled(True)
- self.metaDataCheckBox.setChecked(settings.value(
- u'print file meta data', False))
+ self.metaDataCheckBox.setChecked(settings.value(u'print file meta data', False))
self.notesCheckBox.setChecked(settings.value(u'print notes', False))
self.zoomComboBox.setCurrentIndex(settings.value(u'display size', 0))
settings.endGroup()
# Signals
- QtCore.QObject.connect(self.printButton,
- QtCore.SIGNAL(u'triggered()'), self.printServiceOrder)
- QtCore.QObject.connect(self.zoomOutButton,
- QtCore.SIGNAL(u'clicked()'), self.zoomOut)
- QtCore.QObject.connect(self.zoomInButton,
- QtCore.SIGNAL(u'clicked()'), self.zoomIn)
- QtCore.QObject.connect(self.zoomOriginalButton,
- QtCore.SIGNAL(u'clicked()'), self.zoomOriginal)
- QtCore.QObject.connect(self.previewWidget,
- QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested)
- QtCore.QObject.connect(self.zoomComboBox,
- QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged)
- QtCore.QObject.connect(self.plainCopy,
- QtCore.SIGNAL(u'triggered()'), self.copyText)
- QtCore.QObject.connect(self.htmlCopy,
- QtCore.SIGNAL(u'triggered()'), self.copyHtmlText)
- QtCore.QObject.connect(self.slideTextCheckBox,
- QtCore.SIGNAL(u'stateChanged(int)'),
- self.onSlideTextCheckBoxChanged)
+ QtCore.QObject.connect(self.printButton, QtCore.SIGNAL(u'triggered()'), self.printServiceOrder)
+ QtCore.QObject.connect(self.zoomOutButton, QtCore.SIGNAL(u'clicked()'), self.zoomOut)
+ QtCore.QObject.connect(self.zoomInButton, QtCore.SIGNAL(u'clicked()'), self.zoomIn)
+ QtCore.QObject.connect(self.zoomOriginalButton, QtCore.SIGNAL(u'clicked()'), self.zoomOriginal)
+ QtCore.QObject.connect(self.previewWidget, QtCore.SIGNAL(u'paintRequested(QPrinter *)'), self.paintRequested)
+ QtCore.QObject.connect(self.zoomComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.displaySizeChanged)
+ QtCore.QObject.connect(self.plainCopy, QtCore.SIGNAL(u'triggered()'), self.copyText)
+ QtCore.QObject.connect(self.htmlCopy, QtCore.SIGNAL(u'triggered()'), self.copyHtmlText)
+ QtCore.QObject.connect(self.slideTextCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onSlideTextCheckBoxChanged)
self.updatePreviewText()
def toggleOptions(self, checked):
@@ -175,8 +162,7 @@
html_data = self._addElement(u'html')
self._addElement(u'head', parent=html_data)
self._addElement(u'title', self.titleLineEdit.text(), html_data.head)
- css_path = os.path.join(
- AppLocation.get_data_path(), u'service_print.css')
+ css_path = os.path.join(AppLocation.get_data_path(), u'service_print.css')
custom_css = get_text_file_string(css_path)
if not custom_css:
custom_css = DEFAULT_CSS
@@ -189,13 +175,10 @@
self._addPreviewItem(html_data.body, item[u'service_item'], index)
# Add the custom service notes:
if self.footerTextEdit.toPlainText():
- div = self._addElement(u'div', parent=html_data.body,
- classId=u'customNotes')
- self._addElement(u'span', translate('OpenLP.ServiceManager',
- 'Custom Service Notes: '), div, classId=u'customNotesTitle')
- self._addElement(u'span',
- cgi.escape(self.footerTextEdit.toPlainText()),
- div, classId=u'customNotesText')
+ div = self._addElement(u'div', parent=html_data.body, classId=u'customNotes')
+ self._addElement(u'span', translate('OpenLP.ServiceManager', 'Custom Service Notes: '), div,
+ classId=u'customNotesTitle')
+ self._addElement(u'span', cgi.escape(self.footerTextEdit.toPlainText()), div, classId=u'customNotesText')
self.document.setHtml(html.tostring(html_data))
self.previewWidget.updatePreview()
@@ -203,18 +186,15 @@
div = self._addElement(u'div', classId=u'item', parent=body)
# Add the title of the service item.
item_title = self._addElement(u'h2', parent=div, classId=u'itemTitle')
- self._addElement(u'img', parent=item_title,
- attribute=(u'src', item.icon))
- self._addElement(u'span',
- u' ' + cgi.escape(item.get_display_title()), item_title)
+ self._addElement(u'img', parent=item_title, attribute=(u'src', item.icon))
+ self._addElement(u'span', u' ' + cgi.escape(item.get_display_title()), item_title)
if self.slideTextCheckBox.isChecked():
# Add the text of the service item.
if item.is_text():
verse_def = None
for slide in item.get_frames():
if not verse_def or verse_def != slide[u'verseTag']:
- text_div = self._addElement(u'div', parent=div,
- classId=u'itemText')
+ text_div = self._addElement(u'div', parent=div, classId=u'itemText')
else:
self._addElement(u'br', parent=text_div)
self._addElement(u'span', slide[u'html'], text_div)
@@ -232,26 +212,22 @@
foot_text = foot_text.partition(u'<br>')[2]
if foot_text:
foot_text = cgi.escape(foot_text.replace(u'<br>', u'\n'))
- self._addElement(u'div', foot_text.replace(u'\n', u'<br>'),
- parent=div, classId=u'itemFooter')
+ self._addElement(u'div', foot_text.replace(u'\n', u'<br>'), parent=div, classId=u'itemFooter')
# Add service items' notes.
if self.notesCheckBox.isChecked():
if item.notes:
p = self._addElement(u'div', classId=u'itemNotes', parent=div)
- self._addElement(u'span',
- translate('OpenLP.ServiceManager', 'Notes: '), p,
+ self._addElement(u'span', translate('OpenLP.ServiceManager', 'Notes: '), p,
classId=u'itemNotesTitle')
- self._addElement(u'span',
- cgi.escape(item.notes).replace(u'\n', u'<br>'), p,
- classId=u'itemNotesText')
+ self._addElement(u'span', cgi.escape(item.notes).replace(u'\n', u'<br>'), p, classId=u'itemNotesText')
# Add play length of media files.
if item.is_media() and self.metaDataCheckBox.isChecked():
tme = item.media_length
if item.end_time > 0:
tme = item.end_time - item.start_time
title = self._addElement(u'div', classId=u'media', parent=div)
- self._addElement(u'span', translate('OpenLP.ServiceManager',
- 'Playing time: '), title, classId=u'mediaTitle')
+ self._addElement(u'span', translate('OpenLP.ServiceManager', 'Playing time: '), title,
+ classId=u'mediaTitle')
self._addElement(u'span', unicode(datetime.timedelta(seconds=tme)),
title, classId=u'mediaText')
@@ -407,12 +383,9 @@
# Save the settings for this dialog.
settings = Settings()
settings.beginGroup(u'advanced')
- settings.setValue(u'print slide text',
- self.slideTextCheckBox.isChecked())
- settings.setValue(u'add page break',
- self.pageBreakAfterText.isChecked())
- settings.setValue(u'print file meta data',
- self.metaDataCheckBox.isChecked())
+ settings.setValue(u'print slide text', self.slideTextCheckBox.isChecked())
+ settings.setValue(u'add page break', self.pageBreakAfterText.isChecked())
+ settings.setValue(u'print file meta data', self.metaDataCheckBox.isChecked())
settings.setValue(u'print notes', self.notesCheckBox.isChecked())
settings.endGroup()
@@ -422,5 +395,4 @@
return
for item in self.serviceManager.serviceItems:
# Trigger Audit requests
- Receiver.send_message(u'print_service_started',
- [item[u'service_item']])
+ Receiver.send_message(u'print_service_started', [item[u'service_item']])
=== modified file 'openlp/core/ui/screen.py'
--- openlp/core/ui/screen.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/screen.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -70,12 +70,8 @@
screen_list.display_count = 0
screen_list.screen_count_changed()
screen_list._load_screen_settings()
- QtCore.QObject.connect(desktop,
- QtCore.SIGNAL(u'resized(int)'),
- screen_list.screen_resolution_changed)
- QtCore.QObject.connect(desktop,
- QtCore.SIGNAL(u'screenCountChanged(int)'),
- screen_list.screen_count_changed)
+ QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'resized(int)'), screen_list.screen_resolution_changed)
+ QtCore.QObject.connect(desktop, QtCore.SIGNAL(u'screenCountChanged(int)'), screen_list.screen_count_changed)
return screen_list
def screen_resolution_changed(self, number):
@@ -142,8 +138,7 @@
screen_name = u'%s %d' % (translate('OpenLP.ScreenList', 'Screen'),
screen[u'number'] + 1)
if screen[u'primary']:
- screen_name = u'%s (%s)' % (screen_name,
- translate('OpenLP.ScreenList', 'primary'))
+ screen_name = u'%s (%s)' % (screen_name, translate('OpenLP.ScreenList', 'primary'))
screen_list.append(screen_name)
return screen_list
@@ -160,8 +155,7 @@
u'size': PyQt4.QtCore.QRect(0, 0, 1024, 768)
}
"""
- log.info(u'Screen %d found with resolution %s',
- screen[u'number'], screen[u'size'])
+ log.info(u'Screen %d found with resolution %s', screen[u'number'], screen[u'size'])
if screen[u'primary']:
self.current = screen
self.override = copy.deepcopy(self.current)
@@ -249,8 +243,7 @@
"""
settings = Settings()
settings.beginGroup(u'general')
- self.set_current_display(settings.value(u'monitor',
- self.display_count - 1))
+ self.set_current_display(settings.value(u'monitor', self.display_count - 1))
self.display = settings.value(u'display on monitor', True)
override_display = settings.value(u'override position', False)
x = settings.value(u'x position', self.current[u'size'].x())
=== modified file 'openlp/core/ui/serviceitemeditdialog.py'
--- openlp/core/ui/serviceitemeditdialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/serviceitemeditdialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -45,23 +45,20 @@
self.dialogLayout.addWidget(self.listWidget, 0, 0)
self.buttonLayout = QtGui.QVBoxLayout()
self.buttonLayout.setObjectName(u'buttonLayout')
- self.deleteButton = create_button(serviceItemEditDialog,
- u'deleteButton', role=u'delete',
+ self.deleteButton = create_button(serviceItemEditDialog, u'deleteButton', role=u'delete',
click=serviceItemEditDialog.onDeleteButtonClicked)
self.buttonLayout.addWidget(self.deleteButton)
self.buttonLayout.addStretch()
- self.upButton = create_button(serviceItemEditDialog, u'upButton',
- role=u'up', click=serviceItemEditDialog.onUpButtonClicked)
- self.downButton = create_button(serviceItemEditDialog, u'downButton',
- role=u'down', click=serviceItemEditDialog.onDownButtonClicked)
+ self.upButton = create_button(serviceItemEditDialog, u'upButton', role=u'up',
+ click=serviceItemEditDialog.onUpButtonClicked)
+ self.downButton = create_button(serviceItemEditDialog, u'downButton', role=u'down',
+ click=serviceItemEditDialog.onDownButtonClicked)
self.buttonLayout.addWidget(self.upButton)
self.buttonLayout.addWidget(self.downButton)
self.dialogLayout.addLayout(self.buttonLayout, 0, 1)
- self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox',
- [u'cancel', u'save'])
+ self.buttonBox = create_button_box(serviceItemEditDialog, u'buttonBox', [u'cancel', u'save'])
self.dialogLayout.addWidget(self.buttonBox, 1, 0, 1, 2)
self.retranslateUi(serviceItemEditDialog)
def retranslateUi(self, serviceItemEditDialog):
- serviceItemEditDialog.setWindowTitle(
- translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item'))
+ serviceItemEditDialog.setWindowTitle(translate('OpenLP.ServiceItemEditForm', 'Reorder Service Item'))
=== modified file 'openlp/core/ui/serviceitemeditform.py'
--- openlp/core/ui/serviceitemeditform.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/serviceitemeditform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -42,8 +42,7 @@
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
self.itemList = []
- QtCore.QObject.connect(self.listWidget,
- QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
+ QtCore.QObject.connect(self.listWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
def setServiceItem(self, item):
self.item = item
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2012-12-27 16:27:59 +0000
+++ openlp/core/ui/servicemanager.py 2012-12-29 18:15:31 +0000
@@ -234,11 +234,9 @@
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
# build the drag and drop context menu
self.dndMenu = QtGui.QMenu()
- self.newAction = self.dndMenu.addAction(
- translate('OpenLP.ServiceManager', '&Add New Item'))
+ self.newAction = self.dndMenu.addAction(translate('OpenLP.ServiceManager', '&Add New Item'))
self.newAction.setIcon(build_icon(u':/general/general_edit.png'))
- self.addToAction = self.dndMenu.addAction(
- translate('OpenLP.ServiceManager', '&Add to Selected Item'))
+ self.addToAction = self.dndMenu.addAction(translate('OpenLP.ServiceManager', '&Add to Selected Item'))
self.addToAction.setIcon(build_icon(u':/general/general_edit.png'))
# build the context menu
self.menu = QtGui.QMenu()
@@ -420,9 +418,7 @@
basename = os.path.splitext(file_name)[0]
service_file_name = '%s.osd' % basename
log.debug(u'ServiceManager.saveFile - %s', path_file_name)
- SettingsManager.set_last_dir(
- self.mainwindow.serviceManagerSettingsSection,
- path)
+ SettingsManager.set_last_dir(self.mainwindow.serviceManagerSettingsSection, path)
service = []
write_list = []
missing_list = []
@@ -1289,9 +1285,7 @@
if self.serviceItems[item][u'service_item'].is_valid:
self.mainwindow.liveController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], child)
- if Settings().value(
- self.mainwindow.generalSettingsSection + u'/auto preview',
- False):
+ if Settings().value(self.mainwindow.generalSettingsSection + u'/auto preview', False):
item += 1
if self.serviceItems and item < len(self.serviceItems) and \
self.serviceItems[item][u'service_item'].is_capable(ItemCapabilities.CanPreview):
=== modified file 'openlp/core/ui/servicenoteform.py'
--- openlp/core/ui/servicenoteform.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/servicenoteform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -57,10 +57,8 @@
self.textEdit = SpellTextEdit(self, False)
self.textEdit.setObjectName(u'textEdit')
self.dialogLayout.addWidget(self.textEdit)
- self.buttonBox = create_button_box(self, u'buttonBox',
- [u'cancel', u'save'])
+ self.buttonBox = create_button_box(self, u'buttonBox', [u'cancel', u'save'])
self.dialogLayout.addWidget(self.buttonBox)
def retranslateUi(self):
- self.setWindowTitle(
- translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
+ self.setWindowTitle(translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
=== modified file 'openlp/core/ui/settingsdialog.py'
--- openlp/core/ui/settingsdialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/settingsdialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -36,29 +36,23 @@
def setupUi(self, settingsDialog):
settingsDialog.setObjectName(u'settingsDialog')
settingsDialog.resize(800, 500)
- settingsDialog.setWindowIcon(
- build_icon(u':/system/system_settings.png'))
+ settingsDialog.setWindowIcon(build_icon(u':/system/system_settings.png'))
self.dialogLayout = QtGui.QGridLayout(settingsDialog)
self.dialogLayout.setObjectName(u'dialogLayout')
self.dialogLayout.setMargin(8)
self.settingListWidget = QtGui.QListWidget(settingsDialog)
self.settingListWidget.setUniformItemSizes(True)
self.settingListWidget.setMinimumSize(QtCore.QSize(150, 0))
- self.settingListWidget.setHorizontalScrollBarPolicy(
- QtCore.Qt.ScrollBarAlwaysOff)
+ self.settingListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.settingListWidget.setObjectName(u'settingListWidget')
self.dialogLayout.addWidget(self.settingListWidget, 0, 0, 1, 1)
self.stackedLayout = QtGui.QStackedLayout()
self.stackedLayout.setObjectName(u'stackedLayout')
self.dialogLayout.addLayout(self.stackedLayout, 0, 1, 1, 1)
- self.buttonBox = create_button_box(settingsDialog, u'buttonBox',
- [u'cancel', u'ok'])
+ self.buttonBox = create_button_box(settingsDialog, u'buttonBox', [u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
self.retranslateUi(settingsDialog)
- QtCore.QObject.connect(self.settingListWidget,
- QtCore.SIGNAL(u'currentRowChanged(int)'),
- self.tabChanged)
+ QtCore.QObject.connect(self.settingListWidget, QtCore.SIGNAL(u'currentRowChanged(int)'), self.tabChanged)
def retranslateUi(self, settingsDialog):
- settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm',
- 'Configure OpenLP'))
+ settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', 'Configure OpenLP'))
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2012-12-03 19:19:10 +0000
+++ openlp/core/ui/settingsform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/ui/shortcutlistdialog.py'
--- openlp/core/ui/shortcutlistdialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/shortcutlistdialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -81,27 +81,23 @@
self.primaryPushButton = CaptureShortcutButton(shortcutListDialog)
self.primaryPushButton.setObjectName(u'primaryPushButton')
self.primaryPushButton.setMinimumSize(QtCore.QSize(84, 0))
- self.primaryPushButton.setIcon(
- build_icon(u':/system/system_configure_shortcuts.png'))
+ self.primaryPushButton.setIcon(build_icon(u':/system/system_configure_shortcuts.png'))
self.primaryLayout.addWidget(self.primaryPushButton)
self.clearPrimaryButton = QtGui.QToolButton(shortcutListDialog)
self.clearPrimaryButton.setObjectName(u'clearPrimaryButton')
self.clearPrimaryButton.setMinimumSize(QtCore.QSize(0, 16))
- self.clearPrimaryButton.setIcon(
- build_icon(u':/system/clear_shortcut.png'))
+ self.clearPrimaryButton.setIcon(build_icon(u':/system/clear_shortcut.png'))
self.primaryLayout.addWidget(self.clearPrimaryButton)
self.detailsLayout.addLayout(self.primaryLayout, 1, 1, 1, 1)
self.alternateLayout = QtGui.QHBoxLayout()
self.alternateLayout.setObjectName(u'alternateLayout')
self.alternatePushButton = CaptureShortcutButton(shortcutListDialog)
self.alternatePushButton.setObjectName(u'alternatePushButton')
- self.alternatePushButton.setIcon(
- build_icon(u':/system/system_configure_shortcuts.png'))
+ self.alternatePushButton.setIcon(build_icon(u':/system/system_configure_shortcuts.png'))
self.alternateLayout.addWidget(self.alternatePushButton)
self.clearAlternateButton = QtGui.QToolButton(shortcutListDialog)
self.clearAlternateButton.setObjectName(u'clearAlternateButton')
- self.clearAlternateButton.setIcon(
- build_icon(u':/system/clear_shortcut.png'))
+ self.clearAlternateButton.setIcon(build_icon(u':/system/clear_shortcut.png'))
self.alternateLayout.addWidget(self.clearAlternateButton)
self.detailsLayout.addLayout(self.alternateLayout, 1, 2, 1, 1)
self.primaryLabel = QtGui.QLabel(shortcutListDialog)
@@ -111,33 +107,24 @@
self.alternateLabel.setObjectName(u'alternateLabel')
self.detailsLayout.addWidget(self.alternateLabel, 0, 2, 1, 1)
self.shortcutListLayout.addLayout(self.detailsLayout)
- self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox',
- [u'cancel', u'ok', u'defaults'])
+ self.buttonBox = create_button_box(shortcutListDialog, u'buttonBox', [u'cancel', u'ok', u'defaults'])
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.shortcutListLayout.addWidget(self.buttonBox)
self.retranslateUi(shortcutListDialog)
def retranslateUi(self, shortcutListDialog):
- shortcutListDialog.setWindowTitle(
- translate('OpenLP.ShortcutListDialog', 'Configure Shortcuts'))
- self.descriptionLabel.setText(translate('OpenLP.ShortcutListDialog',
- 'Select an action and click one of the buttons below to start '
- 'capturing a new primary or alternate shortcut, respectively.'))
- self.treeWidget.setHeaderLabels([
- translate('OpenLP.ShortcutListDialog', 'Action'),
+ shortcutListDialog.setWindowTitle(translate('OpenLP.ShortcutListDialog', 'Configure Shortcuts'))
+ self.descriptionLabel.setText(
+ translate('OpenLP.ShortcutListDialog', 'Select an action and click one of the buttons below to start '
+ 'capturing a new primary or alternate shortcut, respectively.'))
+ self.treeWidget.setHeaderLabels([translate('OpenLP.ShortcutListDialog', 'Action'),
translate('OpenLP.ShortcutListDialog', 'Shortcut'),
translate('OpenLP.ShortcutListDialog', 'Alternate')])
- self.defaultRadioButton.setText(
- translate('OpenLP.ShortcutListDialog', 'Default'))
- self.customRadioButton.setText(
- translate('OpenLP.ShortcutListDialog', 'Custom'))
- self.primaryPushButton.setToolTip(
- translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
- self.alternatePushButton.setToolTip(
- translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
- self.clearPrimaryButton.setToolTip(
- translate('OpenLP.ShortcutListDialog',
+ self.defaultRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Default'))
+ self.customRadioButton.setText(translate('OpenLP.ShortcutListDialog', 'Custom'))
+ self.primaryPushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
+ self.alternatePushButton.setToolTip(translate('OpenLP.ShortcutListDialog', 'Capture shortcut.'))
+ self.clearPrimaryButton.setToolTip(translate('OpenLP.ShortcutListDialog',
'Restore the default shortcut of this action.'))
- self.clearAlternateButton.setToolTip(
- translate('OpenLP.ShortcutListDialog',
+ self.clearAlternateButton.setToolTip(translate('OpenLP.ShortcutListDialog',
'Restore the default shortcut of this action.'))
=== modified file 'openlp/core/ui/shortcutlistform.py'
--- openlp/core/ui/shortcutlistform.py 2012-12-05 21:10:20 +0000
+++ openlp/core/ui/shortcutlistform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -51,57 +51,49 @@
self.setupUi(self)
self.changedActions = {}
self.action_list = ActionList.get_instance()
- QtCore.QObject.connect(self.primaryPushButton,
- QtCore.SIGNAL(u'toggled(bool)'), self.onPrimaryPushButtonClicked)
- QtCore.QObject.connect(self.alternatePushButton,
- QtCore.SIGNAL(u'toggled(bool)'), self.onAlternatePushButtonClicked)
- QtCore.QObject.connect(self.treeWidget, QtCore.SIGNAL(
- u'currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)'),
- self.onCurrentItemChanged)
+ QtCore.QObject.connect(self.primaryPushButton, QtCore.SIGNAL(u'toggled(bool)'),
+ self.onPrimaryPushButtonClicked)
+ QtCore.QObject.connect(self.alternatePushButton, QtCore.SIGNAL(u'toggled(bool)'),
+ self.onAlternatePushButtonClicked)
QtCore.QObject.connect(self.treeWidget,
- QtCore.SIGNAL(u'itemDoubleClicked(QTreeWidgetItem*, int)'),
+ QtCore.SIGNAL(u'currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)'), self.onCurrentItemChanged)
+ QtCore.QObject.connect(self.treeWidget, QtCore.SIGNAL(u'itemDoubleClicked(QTreeWidgetItem*, int)'),
self.onItemDoubleClicked)
- QtCore.QObject.connect(self.clearPrimaryButton,
- QtCore.SIGNAL(u'clicked(bool)'), self.onClearPrimaryButtonClicked)
- QtCore.QObject.connect(self.clearAlternateButton,
- QtCore.SIGNAL(u'clicked(bool)'), self.onClearAlternateButtonClicked)
- QtCore.QObject.connect(self.buttonBox,
- QtCore.SIGNAL(u'clicked(QAbstractButton*)'),
+ QtCore.QObject.connect(self.clearPrimaryButton, QtCore.SIGNAL(u'clicked(bool)'),
+ self.onClearPrimaryButtonClicked)
+ QtCore.QObject.connect(self.clearAlternateButton, QtCore.SIGNAL(u'clicked(bool)'),
+ self.onClearAlternateButtonClicked)
+ QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'clicked(QAbstractButton*)'),
self.onRestoreDefaultsClicked)
- QtCore.QObject.connect(self.defaultRadioButton,
- QtCore.SIGNAL(u'clicked(bool)'), self.onDefaultRadioButtonClicked)
- QtCore.QObject.connect(self.customRadioButton,
- QtCore.SIGNAL(u'clicked(bool)'), self.onCustomRadioButtonClicked)
+ QtCore.QObject.connect(self.defaultRadioButton, QtCore.SIGNAL(u'clicked(bool)'),
+ self.onDefaultRadioButtonClicked)
+ QtCore.QObject.connect(self.customRadioButton, QtCore.SIGNAL(u'clicked(bool)'),
+ self.onCustomRadioButtonClicked)
def keyPressEvent(self, event):
if event.key() == QtCore.Qt.Key_Space:
self.keyReleaseEvent(event)
- elif self.primaryPushButton.isChecked() or \
- self.alternatePushButton.isChecked():
+ elif self.primaryPushButton.isChecked() or self.alternatePushButton.isChecked():
event.ignore()
elif event.key() == QtCore.Qt.Key_Escape:
event.accept()
self.close()
def keyReleaseEvent(self, event):
- if not self.primaryPushButton.isChecked() and \
- not self.alternatePushButton.isChecked():
+ if not self.primaryPushButton.isChecked() and not self.alternatePushButton.isChecked():
return
key = event.key()
if key == QtCore.Qt.Key_Shift or key == QtCore.Qt.Key_Control or \
key == QtCore.Qt.Key_Meta or key == QtCore.Qt.Key_Alt:
return
key_string = QtGui.QKeySequence(key).toString()
- if event.modifiers() & QtCore.Qt.ControlModifier == \
- QtCore.Qt.ControlModifier:
+ if event.modifiers() & QtCore.Qt.ControlModifier == QtCore.Qt.ControlModifier:
key_string = u'Ctrl+' + key_string
if event.modifiers() & QtCore.Qt.AltModifier == QtCore.Qt.AltModifier:
key_string = u'Alt+' + key_string
- if event.modifiers() & QtCore.Qt.ShiftModifier == \
- QtCore.Qt.ShiftModifier:
+ if event.modifiers() & QtCore.Qt.ShiftModifier == QtCore.Qt.ShiftModifier:
key_string = u'Shift+' + key_string
- if event.modifiers() & QtCore.Qt.MetaModifier == \
- QtCore.Qt.MetaModifier:
+ 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):
@@ -272,8 +264,7 @@
# been triggered by a signal.
if item is None:
return
- if primary_label_text == primary_text and \
- alternate_label_text == alternate_text:
+ if primary_label_text == primary_text and alternate_label_text == alternate_text:
self.defaultRadioButton.toggle()
else:
self.customRadioButton.toggle()
@@ -282,15 +273,12 @@
"""
Restores all default shortcuts.
"""
- if self.buttonBox.buttonRole(button) != \
- QtGui.QDialogButtonBox.ResetRole:
+ if self.buttonBox.buttonRole(button) != QtGui.QDialogButtonBox.ResetRole:
return
- if QtGui.QMessageBox.question(self,
- translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
+ if QtGui.QMessageBox.question(self, translate('OpenLP.ShortcutListDialog', 'Restore Default Shortcuts'),
translate('OpenLP.ShortcutListDialog', 'Do you want to restore all '
- 'shortcuts to their defaults?'), QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No)) == QtGui.QMessageBox.No:
+ 'shortcuts to their defaults?'),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) == QtGui.QMessageBox.No:
return
self._adjustButton(self.primaryPushButton, False, text=u'')
self._adjustButton(self.alternatePushButton, False, text=u'')
@@ -372,8 +360,7 @@
# shortcut (not the default one) will become primary shortcut, thus
# the check will assume that an action were going to have the same
# shortcut twice.
- if not self._validiate_shortcut(action, new_shortcuts[0]) and \
- new_shortcuts[0] != shortcuts[0]:
+ if not self._validiate_shortcut(action, new_shortcuts[0]) and new_shortcuts[0] != shortcuts[0]:
return
if len(shortcuts) == 2:
new_shortcuts.append(shortcuts[1])
@@ -421,11 +408,9 @@
if key_sequence not in shortcuts:
continue
if action is changing_action:
- if self.primaryPushButton.isChecked() and \
- shortcuts.index(key_sequence) == 0:
+ if self.primaryPushButton.isChecked() and shortcuts.index(key_sequence) == 0:
continue
- if self.alternatePushButton.isChecked() and \
- shortcuts.index(key_sequence) == 1:
+ if self.alternatePushButton.isChecked() and shortcuts.index(key_sequence) == 1:
continue
# Have the same parent, thus they cannot have the same shortcut.
if action.parent() is changing_action.parent():
@@ -436,16 +421,14 @@
if action.shortcutContext() in [QtCore.Qt.WindowShortcut,
QtCore.Qt.ApplicationShortcut]:
is_valid = False
- if changing_action.shortcutContext() in \
- [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
+ if changing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
is_valid = False
if not is_valid:
Receiver.send_message(u'openlp_warning_message', {
- u'title': translate('OpenLP.ShortcutListDialog',
- 'Duplicate Shortcut'),
+ u'title': translate('OpenLP.ShortcutListDialog', 'Duplicate Shortcut'),
u'message': translate('OpenLP.ShortcutListDialog',
- 'The shortcut "%s" is already assigned to another action, '
- 'please use a different shortcut.') % key_sequence.toString()
+ 'The shortcut "%s" is already assigned to another action, '
+ 'please use a different shortcut.') % key_sequence.toString()
})
return is_valid
=== modified file 'openlp/core/ui/splashscreen.py'
--- openlp/core/ui/splashscreen.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/splashscreen.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -34,8 +34,7 @@
def __init__(self):
QtGui.QSplashScreen.__init__(self)
self.setupUi()
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'close_splash'), self.close)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'close_splash'), self.close)
def setupUi(self):
self.setObjectName(u'splashScreen')
=== modified file 'openlp/core/ui/starttimedialog.py'
--- openlp/core/ui/starttimedialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/starttimedialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -101,15 +101,13 @@
self.secondFinishLabel.setAlignment(QtCore.Qt.AlignRight)
self.dialogLayout.addWidget(self.secondFinishLabel, 3, 3, 1, 1)
self.dialogLayout.addWidget(self.secondSpinBox, 3, 1, 1, 1)
- self.buttonBox = create_button_box(StartTimeDialog, u'buttonBox',
- [u'cancel', u'ok'])
+ self.buttonBox = create_button_box(StartTimeDialog, u'buttonBox', [u'cancel', u'ok'])
self.dialogLayout.addWidget(self.buttonBox, 5, 2, 1, 2)
self.retranslateUi(StartTimeDialog)
self.setMaximumHeight(self.sizeHint().height())
def retranslateUi(self, StartTimeDialog):
- self.setWindowTitle(translate('OpenLP.StartTimeForm',
- 'Item Start and Finish Time'))
+ self.setWindowTitle(translate('OpenLP.StartTimeForm', 'Item Start and Finish Time'))
self.hourSpinBox.setSuffix(UiStrings().Hours)
self.minuteSpinBox.setSuffix(UiStrings().Minutes)
self.secondSpinBox.setSuffix(UiStrings().Seconds)
=== modified file 'openlp/core/ui/starttimeform.py'
--- openlp/core/ui/starttimeform.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/starttimeform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -46,22 +46,17 @@
"""
Run the Dialog with correct heading.
"""
- hour, minutes, seconds = self._time_split(
- self.item[u'service_item'].start_time)
+ hour, minutes, seconds = self._time_split(self.item[u'service_item'].start_time)
self.hourSpinBox.setValue(hour)
self.minuteSpinBox.setValue(minutes)
self.secondSpinBox.setValue(seconds)
- hours, minutes, seconds = self._time_split(
- self.item[u'service_item'].media_length)
+ hours, minutes, seconds = self._time_split(self.item[u'service_item'].media_length)
self.hourFinishSpinBox.setValue(hours)
self.minuteFinishSpinBox.setValue(minutes)
self.secondFinishSpinBox.setValue(seconds)
- self.hourFinishLabel.setText(u'%s%s' % (unicode(hour),
- UiStrings().Hours))
- self.minuteFinishLabel.setText(u'%s%s' %
- (unicode(minutes), UiStrings().Minutes))
- self.secondFinishLabel.setText(u'%s%s' %
- (unicode(seconds), UiStrings().Seconds))
+ self.hourFinishLabel.setText(u'%s%s' % (unicode(hour), UiStrings().Hours))
+ self.minuteFinishLabel.setText(u'%s%s' % (unicode(minutes), UiStrings().Minutes))
+ self.secondFinishLabel.setText(u'%s%s' % (unicode(seconds), UiStrings().Seconds))
return QtGui.QDialog.exec_(self)
def accept(self):
@@ -72,18 +67,12 @@
self.minuteFinishSpinBox.value() * 60 + \
self.secondFinishSpinBox.value()
if end > self.item[u'service_item'].media_length:
- critical_error_message_box(
- title=translate('OpenLP.StartTimeForm',
- 'Time Validation Error'),
- message=translate('OpenLP.StartTimeForm',
- 'Finish time is set after the end of the media item'))
+ critical_error_message_box(title=translate('OpenLP.StartTimeForm', 'Time Validation Error'),
+ message=translate('OpenLP.StartTimeForm', 'Finish time is set after the end of the media item'))
return
elif start > end:
- critical_error_message_box(
- title=translate('OpenLP.StartTimeForm',
- 'Time Validation Error'),
- message=translate('OpenLP.StartTimeForm',
- 'Start time is after the finish time of the media item'))
+ critical_error_message_box(title=translate('OpenLP.StartTimeForm', 'Time Validation Error'),
+ message=translate('OpenLP.StartTimeForm', 'Start time is after the finish time of the media item'))
return
self.item[u'service_item'].start_time = start
self.item[u'service_item'].end_time = end
=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py 2012-12-27 17:17:08 +0000
+++ openlp/core/ui/themeform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -62,63 +62,38 @@
self.updateThemeAllowed = True
self.temp_background_filename = u''
self.themeLayoutForm = ThemeLayoutForm(self)
- QtCore.QObject.connect(self.backgroundComboBox,
- QtCore.SIGNAL(u'currentIndexChanged(int)'),
+ QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onBackgroundComboBoxCurrentIndexChanged)
- QtCore.QObject.connect(self.gradientComboBox,
- QtCore.SIGNAL(u'currentIndexChanged(int)'),
+ QtCore.QObject.connect(self.gradientComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.onGradientComboBoxCurrentIndexChanged)
- QtCore.QObject.connect(self.colorButton,
- QtCore.SIGNAL(u'clicked()'), self.onColorButtonClicked)
- QtCore.QObject.connect(self.imageColorButton,
- QtCore.SIGNAL(u'clicked()'), self.onImageColorButtonClicked)
- QtCore.QObject.connect(self.gradientStartButton,
- QtCore.SIGNAL(u'clicked()'), self.onGradientStartButtonClicked)
- QtCore.QObject.connect(self.gradientEndButton,
- QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked)
- QtCore.QObject.connect(self.imageBrowseButton,
- QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked)
- QtCore.QObject.connect(self.mainColorButton,
- QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked)
- QtCore.QObject.connect(self.outlineColorButton,
- QtCore.SIGNAL(u'clicked()'), self.onOutlineColorButtonClicked)
- QtCore.QObject.connect(self.shadowColorButton,
- QtCore.SIGNAL(u'clicked()'), self.onShadowColorButtonClicked)
- QtCore.QObject.connect(self.outlineCheckBox,
- QtCore.SIGNAL(u'stateChanged(int)'),
+ QtCore.QObject.connect(self.colorButton, QtCore.SIGNAL(u'clicked()'), self.onColorButtonClicked)
+ QtCore.QObject.connect(self.imageColorButton, QtCore.SIGNAL(u'clicked()'), self.onImageColorButtonClicked)
+ QtCore.QObject.connect(self.gradientStartButton, QtCore.SIGNAL(u'clicked()'),
+ self.onGradientStartButtonClicked)
+ QtCore.QObject.connect(self.gradientEndButton, QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked)
+ QtCore.QObject.connect(self.imageBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked)
+ QtCore.QObject.connect(self.mainColorButton, QtCore.SIGNAL(u'clicked()'), self.onMainColorButtonClicked)
+ QtCore.QObject.connect(self.outlineColorButton, QtCore.SIGNAL(u'clicked()'), self.onOutlineColorButtonClicked)
+ QtCore.QObject.connect(self.shadowColorButton, QtCore.SIGNAL(u'clicked()'), self.onShadowColorButtonClicked)
+ QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onOutlineCheckCheckBoxStateChanged)
- QtCore.QObject.connect(self.shadowCheckBox,
- QtCore.SIGNAL(u'stateChanged(int)'),
+ QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onShadowCheckCheckBoxStateChanged)
- QtCore.QObject.connect(self.footerColorButton,
- QtCore.SIGNAL(u'clicked()'), self.onFooterColorButtonClicked)
- QtCore.QObject.connect(self,
- QtCore.SIGNAL(u'customButtonClicked(int)'),
- self.onCustom1ButtonClicked)
- QtCore.QObject.connect(self.mainPositionCheckBox,
- QtCore.SIGNAL(u'stateChanged(int)'),
+ QtCore.QObject.connect(self.footerColorButton,QtCore.SIGNAL(u'clicked()'), self.onFooterColorButtonClicked)
+ QtCore.QObject.connect(self, QtCore.SIGNAL(u'customButtonClicked(int)'), self.onCustom1ButtonClicked)
+ QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onMainPositionCheckBoxStateChanged)
- QtCore.QObject.connect(self.footerPositionCheckBox,
- QtCore.SIGNAL(u'stateChanged(int)'),
+ QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'),
self.onFooterPositionCheckBoxStateChanged)
- QtCore.QObject.connect(self,
- QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'theme_line_count'), self.updateLinesText)
- QtCore.QObject.connect(self.mainSizeSpinBox,
- QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
- QtCore.QObject.connect(self.lineSpacingSpinBox,
- QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
- QtCore.QObject.connect(self.outlineSizeSpinBox,
- QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
- QtCore.QObject.connect(self.shadowSizeSpinBox,
- QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
- QtCore.QObject.connect(self.mainFontComboBox,
- QtCore.SIGNAL(u'activated(int)'), self.calculateLines)
- QtCore.QObject.connect(self.footerFontComboBox,
- QtCore.SIGNAL(u'activated(int)'), self.updateTheme)
- QtCore.QObject.connect(self.footerSizeSpinBox,
- QtCore.SIGNAL(u'valueChanged(int)'), self.updateTheme)
+ QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_line_count'), self.updateLinesText)
+ QtCore.QObject.connect(self.mainSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
+ QtCore.QObject.connect(self.lineSpacingSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
+ QtCore.QObject.connect(self.outlineSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
+ QtCore.QObject.connect(self.shadowSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines)
+ QtCore.QObject.connect(self.mainFontComboBox, QtCore.SIGNAL(u'activated(int)'), self.calculateLines)
+ QtCore.QObject.connect(self.footerFontComboBox, QtCore.SIGNAL(u'activated(int)'), self.updateTheme)
+ QtCore.QObject.connect(self.footerSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.updateTheme)
def setDefaults(self):
"""
@@ -136,61 +111,35 @@
"""
Map field names to screen names,
"""
- self.backgroundPage.registerField(
- u'background_type', self.backgroundComboBox)
+ self.backgroundPage.registerField(u'background_type', self.backgroundComboBox)
self.backgroundPage.registerField(u'color', self.colorButton)
- self.backgroundPage.registerField(
- u'grandient_start', self.gradientStartButton)
- self.backgroundPage.registerField(
- u'grandient_end', self.gradientEndButton)
- self.backgroundPage.registerField(
- u'background_image', self.imageFileEdit)
+ self.backgroundPage.registerField(u'grandient_start', self.gradientStartButton)
+ self.backgroundPage.registerField(u'grandient_end', self.gradientEndButton)
+ self.backgroundPage.registerField(u'background_image', self.imageFileEdit)
self.backgroundPage.registerField(u'gradient', self.gradientComboBox)
- self.mainAreaPage.registerField(
- u'mainColorButton', self.mainColorButton)
- self.mainAreaPage.registerField(
- u'mainSizeSpinBox', self.mainSizeSpinBox)
- self.mainAreaPage.registerField(
- u'lineSpacingSpinBox', self.lineSpacingSpinBox)
- self.mainAreaPage.registerField(
- u'outlineCheckBox', self.outlineCheckBox)
- self.mainAreaPage.registerField(
- u'outlineColorButton', self.outlineColorButton)
- self.mainAreaPage.registerField(
- u'outlineSizeSpinBox', self.outlineSizeSpinBox)
- self.mainAreaPage.registerField(
- u'shadowCheckBox', self.shadowCheckBox)
- self.mainAreaPage.registerField(
- u'mainBoldCheckBox', self.mainBoldCheckBox)
- self.mainAreaPage.registerField(
- u'mainItalicsCheckBox', self.mainItalicsCheckBox)
- self.mainAreaPage.registerField(
- u'shadowColorButton', self.shadowColorButton)
- self.mainAreaPage.registerField(
- u'shadowSizeSpinBox', self.shadowSizeSpinBox)
- self.mainAreaPage.registerField(
- u'footerSizeSpinBox', self.footerSizeSpinBox)
- self.areaPositionPage.registerField(
- u'mainPositionX', self.mainXSpinBox)
- self.areaPositionPage.registerField(
- u'mainPositionY', self.mainYSpinBox)
- self.areaPositionPage.registerField(
- u'mainPositionWidth', self.mainWidthSpinBox)
- self.areaPositionPage.registerField(
- u'mainPositionHeight', self.mainHeightSpinBox)
- self.areaPositionPage.registerField(
- u'footerPositionX', self.footerXSpinBox)
- self.areaPositionPage.registerField(
- u'footerPositionY', self.footerYSpinBox)
- self.areaPositionPage.registerField(
- u'footerPositionWidth', self.footerWidthSpinBox)
- self.areaPositionPage.registerField(
- u'footerPositionHeight', self.footerHeightSpinBox)
- self.backgroundPage.registerField(
- u'horizontal', self.horizontalComboBox)
+ self.mainAreaPage.registerField(u'mainColorButton', self.mainColorButton)
+ self.mainAreaPage.registerField(u'mainSizeSpinBox', self.mainSizeSpinBox)
+ self.mainAreaPage.registerField(u'lineSpacingSpinBox', self.lineSpacingSpinBox)
+ self.mainAreaPage.registerField(u'outlineCheckBox', self.outlineCheckBox)
+ self.mainAreaPage.registerField(u'outlineColorButton', self.outlineColorButton)
+ self.mainAreaPage.registerField(u'outlineSizeSpinBox', self.outlineSizeSpinBox)
+ self.mainAreaPage.registerField(u'shadowCheckBox', self.shadowCheckBox)
+ self.mainAreaPage.registerField(u'mainBoldCheckBox', self.mainBoldCheckBox)
+ self.mainAreaPage.registerField(u'mainItalicsCheckBox', self.mainItalicsCheckBox)
+ self.mainAreaPage.registerField(u'shadowColorButton', self.shadowColorButton)
+ self.mainAreaPage.registerField(u'shadowSizeSpinBox', self.shadowSizeSpinBox)
+ self.mainAreaPage.registerField(u'footerSizeSpinBox', self.footerSizeSpinBox)
+ self.areaPositionPage.registerField(u'mainPositionX', self.mainXSpinBox)
+ self.areaPositionPage.registerField(u'mainPositionY', self.mainYSpinBox)
+ self.areaPositionPage.registerField(u'mainPositionWidth', self.mainWidthSpinBox)
+ self.areaPositionPage.registerField(u'mainPositionHeight', self.mainHeightSpinBox)
+ self.areaPositionPage.registerField(u'footerPositionX', self.footerXSpinBox)
+ self.areaPositionPage.registerField(u'footerPositionY', self.footerYSpinBox)
+ self.areaPositionPage.registerField(u'footerPositionWidth', self.footerWidthSpinBox)
+ self.areaPositionPage.registerField(u'footerPositionHeight', self.footerHeightSpinBox)
+ self.backgroundPage.registerField(u'horizontal', self.horizontalComboBox)
self.backgroundPage.registerField(u'vertical', self.verticalComboBox)
- self.backgroundPage.registerField(
- u'slideTransition', self.transitionsCheckBox)
+ self.backgroundPage.registerField(u'slideTransition', self.transitionsCheckBox)
self.backgroundPage.registerField(u'name', self.themeNameEdit)
def calculateLines(self):
@@ -206,8 +155,8 @@
"""
Updates the lines on a page on the wizard
"""
- self.mainLineCountLabel.setText(translate('OpenLP.ThemeForm',
- '(approximately %d lines per slide)') % int(lines))
+ self.mainLineCountLabel.setText(
+ translate('OpenLP.ThemeForm', '(approximately %d lines per slide)') % int(lines))
def resizeEvent(self, event=None):
"""
@@ -231,10 +180,8 @@
def validateCurrentPage(self):
background_image = BackgroundType.to_string(BackgroundType.Image)
if self.page(self.currentId()) == self.backgroundPage and \
- self.theme.background_type == background_image and \
- not self.imageFileEdit.text():
- QtGui.QMessageBox.critical(self,
- translate('OpenLP.ThemeWizard', 'Background Image Empty'),
+ self.theme.background_type == background_image and not self.imageFileEdit.text():
+ QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeWizard', 'Background Image Empty'),
translate('OpenLP.ThemeWizard', 'You have not selected a '
'background image. Please select one before continuing.'))
return False
@@ -265,11 +212,9 @@
pixmap.fill(QtCore.Qt.white)
paint = QtGui.QPainter(pixmap)
paint.setPen(QtGui.QPen(QtCore.Qt.blue, 2))
- paint.drawRect(self.thememanager.mainwindow.renderer.
- get_main_rectangle(self.theme))
+ paint.drawRect(self.thememanager.mainwindow.renderer.get_main_rectangle(self.theme))
paint.setPen(QtGui.QPen(QtCore.Qt.red, 2))
- paint.drawRect(self.thememanager.mainwindow.renderer.
- get_footer_rectangle(self.theme))
+ paint.drawRect(self.thememanager.mainwindow.renderer.get_footer_rectangle(self.theme))
paint.end()
self.themeLayoutForm.exec_(pixmap)
@@ -325,8 +270,7 @@
self.themeNameEdit.setVisible(not edit)
self.edit_mode = edit
if edit:
- self.setWindowTitle(translate('OpenLP.ThemeWizard',
- 'Edit Theme - %s') % self.theme.theme_name)
+ self.setWindowTitle(translate('OpenLP.ThemeWizard', 'Edit Theme - %s') % self.theme.theme_name)
self.next()
else:
self.setWindowTitle(UiStrings().NewTheme)
@@ -355,36 +299,25 @@
"""
if self.theme.background_type == \
BackgroundType.to_string(BackgroundType.Solid):
- self.colorButton.setStyleSheet(u'background-color: %s' %
- self.theme.background_color)
+ self.colorButton.setStyleSheet(u'background-color: %s' % self.theme.background_color)
self.setField(u'background_type', 0)
- elif self.theme.background_type == \
- BackgroundType.to_string(BackgroundType.Gradient):
- self.gradientStartButton.setStyleSheet(u'background-color: %s' %
- self.theme.background_start_color)
- self.gradientEndButton.setStyleSheet(u'background-color: %s' %
- self.theme.background_end_color)
+ elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Gradient):
+ self.gradientStartButton.setStyleSheet(u'background-color: %s' % self.theme.background_start_color)
+ self.gradientEndButton.setStyleSheet(u'background-color: %s' % self.theme.background_end_color)
self.setField(u'background_type', 1)
- elif self.theme.background_type == \
- BackgroundType.to_string(BackgroundType.Image):
- self.imageColorButton.setStyleSheet(u'background-color: %s' %
- self.theme.background_border_color)
+ elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
+ self.imageColorButton.setStyleSheet(u'background-color: %s' % self.theme.background_border_color)
self.imageFileEdit.setText(self.theme.background_filename)
self.setField(u'background_type', 2)
- elif self.theme.background_type == \
- BackgroundType.to_string(BackgroundType.Transparent):
+ elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
self.setField(u'background_type', 3)
- if self.theme.background_direction == \
- BackgroundGradientType.to_string(BackgroundGradientType.Horizontal):
+ if self.theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.Horizontal):
self.setField(u'gradient', 0)
- elif self.theme.background_direction == \
- BackgroundGradientType.to_string(BackgroundGradientType.Vertical):
+ elif self.theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.Vertical):
self.setField(u'gradient', 1)
- elif self.theme.background_direction == \
- BackgroundGradientType.to_string(BackgroundGradientType.Circular):
+ elif self.theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.Circular):
self.setField(u'gradient', 2)
- elif self.theme.background_direction == \
- BackgroundGradientType.to_string(BackgroundGradientType.LeftTop):
+ elif self.theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.LeftTop):
self.setField(u'gradient', 3)
else:
self.setField(u'gradient', 4)
@@ -393,20 +326,15 @@
"""
Handle the display and state of the Main Area page.
"""
- self.mainFontComboBox.setCurrentFont(
- QtGui.QFont(self.theme.font_main_name))
- self.mainColorButton.setStyleSheet(u'background-color: %s' %
- self.theme.font_main_color)
+ self.mainFontComboBox.setCurrentFont(QtGui.QFont(self.theme.font_main_name))
+ self.mainColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_main_color)
self.setField(u'mainSizeSpinBox', self.theme.font_main_size)
- self.setField(u'lineSpacingSpinBox',
- self.theme.font_main_line_adjustment)
+ self.setField(u'lineSpacingSpinBox', self.theme.font_main_line_adjustment)
self.setField(u'outlineCheckBox', self.theme.font_main_outline)
- self.outlineColorButton.setStyleSheet(u'background-color: %s' %
- self.theme.font_main_outline_color)
+ self.outlineColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_main_outline_color)
self.setField(u'outlineSizeSpinBox', self.theme.font_main_outline_size)
self.setField(u'shadowCheckBox', self.theme.font_main_shadow)
- self.shadowColorButton.setStyleSheet(u'background-color: %s' %
- self.theme.font_main_shadow_color)
+ self.shadowColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_main_shadow_color)
self.setField(u'shadowSizeSpinBox', self.theme.font_main_shadow_size)
self.setField(u'mainBoldCheckBox', self.theme.font_main_bold)
self.setField(u'mainItalicsCheckBox', self.theme.font_main_italics)
@@ -415,10 +343,8 @@
"""
Handle the display and state of the Footer Area page.
"""
- self.footerFontComboBox.setCurrentFont(
- QtGui.QFont(self.theme.font_footer_name))
- self.footerColorButton.setStyleSheet(u'background-color: %s' %
- self.theme.font_footer_color)
+ self.footerFontComboBox.setCurrentFont(QtGui.QFont(self.theme.font_footer_name))
+ self.footerColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_footer_color)
self.setField(u'footerSizeSpinBox', self.theme.font_footer_size)
def setPositionPageValues(self):
@@ -432,8 +358,7 @@
self.setField(u'mainPositionHeight', self.theme.font_main_height)
self.setField(u'mainPositionWidth', self.theme.font_main_width)
# Footer
- self.footerPositionCheckBox.setChecked(
- not self.theme.font_footer_override)
+ self.footerPositionCheckBox.setChecked(not self.theme.font_footer_override)
self.setField(u'footerPositionX', self.theme.font_footer_x)
self.setField(u'footerPositionY', self.theme.font_footer_y)
self.setField(u'footerPositionHeight', self.theme.font_footer_height)
@@ -460,14 +385,12 @@
# do not allow updates when screen is building for the first time.
if self.updateThemeAllowed:
self.theme.background_type = BackgroundType.to_string(index)
- if self.theme.background_type != \
- BackgroundType.to_string(BackgroundType.Image) and \
- self.temp_background_filename == u'':
+ if self.theme.background_type != BackgroundType.to_string(BackgroundType.Image) and \
+ self.temp_background_filename == u'':
self.temp_background_filename = self.theme.background_filename
self.theme.background_filename = u''
- if self.theme.background_type == \
- BackgroundType.to_string(BackgroundType.Image) and \
- self.temp_background_filename != u'':
+ if self.theme.background_type == BackgroundType.to_string(BackgroundType.Image) and \
+ self.temp_background_filename != u'':
self.theme.background_filename = self.temp_background_filename
self.temp_background_filename = u''
self.setBackgroundPageValues()
@@ -477,40 +400,35 @@
Background gradient Combo box has changed.
"""
if self.updateThemeAllowed:
- self.theme.background_direction = \
- BackgroundGradientType.to_string(index)
+ self.theme.background_direction = BackgroundGradientType.to_string(index)
self.setBackgroundPageValues()
def onColorButtonClicked(self):
"""
Background / Gradient 1 Color button pushed.
"""
- self.theme.background_color = \
- self._colorButton(self.theme.background_color)
+ self.theme.background_color = self._colorButton(self.theme.background_color)
self.setBackgroundPageValues()
def onImageColorButtonClicked(self):
"""
Background / Gradient 1 Color button pushed.
"""
- self.theme.background_border_color = \
- self._colorButton(self.theme.background_border_color)
+ self.theme.background_border_color = self._colorButton(self.theme.background_border_color)
self.setBackgroundPageValues()
def onGradientStartButtonClicked(self):
"""
Gradient 2 Color button pushed.
"""
- self.theme.background_start_color = \
- self._colorButton(self.theme.background_start_color)
+ self.theme.background_start_color = self._colorButton(self.theme.background_start_color)
self.setBackgroundPageValues()
def onGradientEndButtonClicked(self):
"""
Gradient 2 Color button pushed.
"""
- self.theme.background_end_color = \
- self._colorButton(self.theme.background_end_color)
+ self.theme.background_end_color = self._colorButton(self.theme.background_end_color)
self.setBackgroundPageValues()
def onImageBrowseButtonClicked(self):
@@ -518,33 +436,27 @@
Background Image button pushed.
"""
images_filter = get_images_filter()
- images_filter = u'%s;;%s (*.*) (*)' % (
- images_filter, UiStrings().AllFiles)
+ images_filter = u'%s;;%s (*.*) (*)' % (images_filter, UiStrings().AllFiles)
filename = QtGui.QFileDialog.getOpenFileName(self,
- translate('OpenLP.ThemeWizard', 'Select Image'), u'',
- images_filter)
+ translate('OpenLP.ThemeWizard', 'Select Image'), u'', images_filter)
if filename:
self.theme.background_filename = unicode(filename)
self.setBackgroundPageValues()
def onMainColorButtonClicked(self):
- self.theme.font_main_color = \
- self._colorButton(self.theme.font_main_color)
+ self.theme.font_main_color = self._colorButton(self.theme.font_main_color)
self.setMainAreaPageValues()
def onOutlineColorButtonClicked(self):
- self.theme.font_main_outline_color = \
- self._colorButton(self.theme.font_main_outline_color)
+ self.theme.font_main_outline_color = self._colorButton(self.theme.font_main_outline_color)
self.setMainAreaPageValues()
def onShadowColorButtonClicked(self):
- self.theme.font_main_shadow_color = \
- self._colorButton(self.theme.font_main_shadow_color)
+ self.theme.font_main_shadow_color = self._colorButton(self.theme.font_main_shadow_color)
self.setMainAreaPageValues()
def onFooterColorButtonClicked(self):
- self.theme.font_footer_color = \
- self._colorButton(self.theme.font_footer_color)
+ self.theme.font_footer_color = self._colorButton(self.theme.font_footer_color)
self.setFooterAreaPageValues()
def updateTheme(self):
@@ -564,8 +476,7 @@
self.theme.font_main_bold = self.field(u'mainBoldCheckBox')
self.theme.font_main_italics = self.field(u'mainItalicsCheckBox')
# footer page
- self.theme.font_footer_name = \
- self.footerFontComboBox.currentFont().family()
+ self.theme.font_footer_name = self.footerFontComboBox.currentFont().family()
self.theme.font_footer_size = self.field(u'footerSizeSpinBox')
# position page
self.theme.font_main_x = self.field(u'mainPositionX')
@@ -577,8 +488,7 @@
self.theme.font_footer_height = self.field(u'footerPositionHeight')
self.theme.font_footer_width = self.field(u'footerPositionWidth')
# position page
- self.theme.display_horizontal_align = \
- self.horizontalComboBox.currentIndex()
+ self.theme.display_horizontal_align = self.horizontalComboBox.currentIndex()
self.theme.display_vertical_align = self.verticalComboBox.currentIndex()
self.theme.display_slide_transition = self.field(u'slideTransition')
@@ -591,25 +501,20 @@
if not self.theme.theme_name:
critical_error_message_box(
translate('OpenLP.ThemeWizard', 'Theme Name Missing'),
- translate('OpenLP.ThemeWizard',
- 'There is no name for this theme. Please enter one.'))
+ translate('OpenLP.ThemeWizard', 'There is no name for this theme. Please enter one.'))
return
if self.theme.theme_name == u'-1' or self.theme.theme_name == u'None':
critical_error_message_box(
translate('OpenLP.ThemeWizard', 'Theme Name Invalid'),
- translate('OpenLP.ThemeWizard',
- 'Invalid theme name. Please enter one.'))
+ translate('OpenLP.ThemeWizard', 'Invalid theme name. Please enter one.'))
return
saveFrom = None
saveTo = None
- if self.theme.background_type == \
- BackgroundType.to_string(BackgroundType.Image):
- filename = \
- os.path.split(unicode(self.theme.background_filename))[1]
+ if self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
+ filename = os.path.split(unicode(self.theme.background_filename))[1]
saveTo = os.path.join(self.path, self.theme.theme_name, filename)
saveFrom = self.theme.background_filename
- if not self.edit_mode and \
- not self.thememanager.checkIfThemeExists(self.theme.theme_name):
+ if not self.edit_mode and not self.thememanager.checkIfThemeExists(self.theme.theme_name):
return
self.thememanager.saveTheme(self.theme, saveFrom, saveTo)
return QtGui.QDialog.accept(self)
=== modified file 'openlp/core/ui/themelayoutdialog.py'
--- openlp/core/ui/themelayoutdialog.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/themelayoutdialog.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -58,16 +58,12 @@
self.footerColourLabel = QtGui.QLabel(self.previewArea)
self.footerColourLabel.setObjectName(u'footerColourLabel')
self.previewLayout.addWidget(self.footerColourLabel)
- self.buttonBox = create_button_box(themeLayoutDialog, u'buttonBox',
- [u'ok'])
+ self.buttonBox = create_button_box(themeLayoutDialog, u'buttonBox', [u'ok'])
self.previewLayout.addWidget(self.buttonBox)
self.retranslateUi(themeLayoutDialog)
def retranslateUi(self, themeLayoutDialog):
- themeLayoutDialog.setWindowTitle(
- translate('OpenLP.StartTimeForm', 'Theme Layout'))
- self.mainColourLabel.setText(translate('OpenLP.StartTimeForm',
- 'The blue box shows the main area.'))
- self.footerColourLabel.setText(translate('OpenLP.StartTimeForm',
- 'The red box shows the footer.'))
+ themeLayoutDialog.setWindowTitle(translate('OpenLP.StartTimeForm', 'Theme Layout'))
+ self.mainColourLabel.setText(translate('OpenLP.StartTimeForm', 'The blue box shows the main area.'))
+ self.footerColourLabel.setText(translate('OpenLP.StartTimeForm', 'The red box shows the footer.'))
=== modified file 'openlp/core/ui/themelayoutform.py'
--- openlp/core/ui/themelayoutform.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/themelayoutform.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2012-12-27 16:27:59 +0000
+++ openlp/core/ui/thememanager.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -36,17 +36,13 @@
from xml.etree.ElementTree import ElementTree, XML
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, \
- Receiver, SettingsManager, translate, check_item_selected, \
- check_directory_exists, create_thumb, validate_thumb, ImageSource, Settings
-from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \
- BackgroundGradientType
-from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
- create_widget_action
+from openlp.core.lib import OpenLPToolbar, get_text_file_string, build_icon, Receiver, SettingsManager, translate, \
+ check_item_selected, check_directory_exists, create_thumb, validate_thumb, ImageSource, Settings
+from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, BackgroundGradientType
+from openlp.core.lib.ui import UiStrings, critical_error_message_box, create_widget_action
from openlp.core.theme import Theme
from openlp.core.ui import FileRenameForm, ThemeForm
-from openlp.core.utils import AppLocation, delete_file, locale_compare, \
- get_filesystem_encoding
+from openlp.core.utils import AppLocation, delete_file, locale_compare, get_filesystem_encoding
log = logging.getLogger(__name__)
@@ -102,8 +98,7 @@
self.themeListWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.themeListWidget.setObjectName(u'themeListWidget')
self.layout.addWidget(self.themeListWidget)
- QtCore.QObject.connect(self.themeListWidget,
- QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
+ QtCore.QObject.connect(self.themeListWidget, QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
self.contextMenu)
# build the context menu
self.menu = QtGui.QMenu()
@@ -129,15 +124,12 @@
icon=u':/general/general_export.png', triggers=self.onExportTheme)
# Signals
QtCore.QObject.connect(self.themeListWidget,
- QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
- self.changeGlobalFromScreen)
- QtCore.QObject.connect(self.themeListWidget, QtCore.SIGNAL(
- u'currentItemChanged(QListWidgetItem *, QListWidgetItem *)'),
- self.checkListState)
+ QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.changeGlobalFromScreen)
+ QtCore.QObject.connect(self.themeListWidget,
+ QtCore.SIGNAL(u'currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), self.checkListState)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_global'), self.changeGlobalFromTab)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'config_updated'), self.configUpdated)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_updated'), self.configUpdated)
# Variables
self.themeList = []
self.path = AppLocation.get_section_data_path(self.settingsSection)
@@ -166,8 +158,7 @@
"""
Triggered when Config dialog is updated.
"""
- self.global_theme = Settings().value(
- self.settingsSection + u'/global theme', u'')
+ self.global_theme = Settings().value(self.settingsSection + u'/global theme', u'')
def checkListState(self, item):
"""
@@ -214,8 +205,7 @@
self.themeListWidget.item(count).setText(new_name)
# Set the new name
if theme_name == new_name:
- name = translate('OpenLP.ThemeManager',
- '%s (default)') % new_name
+ name = translate('OpenLP.ThemeManager', '%s (default)') % new_name
self.themeListWidget.item(count).setText(name)
self.deleteToolbarAction.setVisible(
item not in self.themeListWidget.selectedItems())
@@ -232,16 +222,13 @@
old_name = item.text()
# reset the old name
if old_name != item.data(QtCore.Qt.UserRole):
- self.themeListWidget.item(count).setText(
- item.data(QtCore.Qt.UserRole))
+ self.themeListWidget.item(count).setText(item.data(QtCore.Qt.UserRole))
# Set the new name
if count == selected_row:
self.global_theme = self.themeListWidget.item(count).text()
- name = translate('OpenLP.ThemeManager',
- '%s (default)') % self.global_theme
+ name = translate('OpenLP.ThemeManager', '%s (default)') % self.global_theme
self.themeListWidget.item(count).setText(name)
- Settings().setValue(
- self.settingsSection + u'/global theme', self.global_theme)
+ Settings().setValue(self.settingsSection + u'/global theme', self.global_theme)
Receiver.send_message(u'theme_update_global', self.global_theme)
self._pushThemes()
@@ -260,11 +247,9 @@
"""
Renames an existing theme to a new name
"""
- if self._validate_theme_action(translate('OpenLP.ThemeManager',
- 'You must select a theme to rename.'),
- translate('OpenLP.ThemeManager', 'Rename Confirmation'),
- translate('OpenLP.ThemeManager', 'Rename %s theme?'),
- False, False):
+ if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to rename.'),
+ translate('OpenLP.ThemeManager', 'Rename Confirmation'),
+ translate('OpenLP.ThemeManager', 'Rename %s theme?'), False, False):
item = self.themeListWidget.currentItem()
old_theme_name = item.data(QtCore.Qt.UserRole)
self.fileRenameForm.fileNameEdit.setText(old_theme_name)
@@ -289,8 +274,7 @@
"""
item = self.themeListWidget.currentItem()
old_theme_name = item.data(QtCore.Qt.UserRole)
- self.fileRenameForm.fileNameEdit.setText(
- translate('OpenLP.ThemeManager',
+ self.fileRenameForm.fileNameEdit.setText(translate('OpenLP.ThemeManager',
'Copy of %s', 'Copy of <theme name>') % old_theme_name)
if self.fileRenameForm.exec_(True):
new_theme_name = self.fileRenameForm.fileNameEdit.text()
@@ -319,8 +303,8 @@
Loads the settings for the theme that is to be edited and launches the
theme editing form so the user can make their changes.
"""
- if check_item_selected(self.themeListWidget, translate(
- 'OpenLP.ThemeManager', 'You must select a theme to edit.')):
+ if check_item_selected(self.themeListWidget,
+ translate('OpenLP.ThemeManager', 'You must select a theme to edit.')):
item = self.themeListWidget.currentItem()
theme = self.getThemeData(item.data(QtCore.Qt.UserRole))
if theme.background_type == u'image':
@@ -335,10 +319,9 @@
"""
Delete a theme
"""
- if self._validate_theme_action(translate('OpenLP.ThemeManager',
- 'You must select a theme to delete.'),
- translate('OpenLP.ThemeManager', 'Delete Confirmation'),
- translate('OpenLP.ThemeManager', 'Delete %s theme?')):
+ if self._validate_theme_action(translate('OpenLP.ThemeManager', 'You must select a theme to delete.'),
+ translate('OpenLP.ThemeManager', 'Delete Confirmation'),
+ translate('OpenLP.ThemeManager', 'Delete %s theme?')):
item = self.themeListWidget.currentItem()
theme = item.text()
row = self.themeListWidget.row(item)
@@ -372,8 +355,7 @@
"""
item = self.themeListWidget.currentItem()
if item is None:
- critical_error_message_box(message=translate('OpenLP.ThemeManager',
- 'You have not selected a theme.'))
+ critical_error_message_box(message=translate('OpenLP.ThemeManager', 'You have not selected a theme.'))
return
theme = item.data(QtCore.Qt.UserRole)
path = QtGui.QFileDialog.getExistingDirectory(self,
@@ -395,14 +377,12 @@
os.path.join(theme, name).encode(u'utf-8'))
QtGui.QMessageBox.information(self,
translate('OpenLP.ThemeManager', 'Theme Exported'),
- translate('OpenLP.ThemeManager',
- 'Your theme has been successfully exported.'))
+ translate('OpenLP.ThemeManager', 'Your theme has been successfully exported.'))
except (IOError, OSError):
log.exception(u'Export Theme Failed')
critical_error_message_box(
translate('OpenLP.ThemeManager', 'Theme Export Failed'),
- translate('OpenLP.ThemeManager',
- 'Your theme could not be exported due to an error.'))
+ translate('OpenLP.ThemeManager', 'Your theme could not be exported due to an error.'))
finally:
if zip:
zip.close()
@@ -417,8 +397,7 @@
files = QtGui.QFileDialog.getOpenFileNames(self,
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
SettingsManager.get_last_dir(self.settingsSection),
- translate('OpenLP.ThemeManager',
- 'OpenLP Themes (*.theme *.otz)'))
+ translate('OpenLP.ThemeManager', 'OpenLP Themes (*.theme *.otz)'))
log.info(u'New Themes %s', unicode(files))
if not files:
return
@@ -447,8 +426,7 @@
theme = ThemeXML()
theme.theme_name = UiStrings().Default
self._writeTheme(theme, None, None)
- Settings().setValue(
- self.settingsSection + u'/global theme', theme.theme_name)
+ Settings().setValue(self.settingsSection + u'/global theme', theme.theme_name)
self.configUpdated()
files = SettingsManager.get_files(self.settingsSection, u'.png')
# Sort the themes by its name considering language specific
@@ -461,8 +439,7 @@
if os.path.exists(theme):
text_name = os.path.splitext(name)[0]
if text_name == self.global_theme:
- name = translate(
- 'OpenLP.ThemeManager', '%s (default)') % text_name
+ name = translate('OpenLP.ThemeManager', '%s (default)') % text_name
else:
name = text_name
thumb = os.path.join(self.thumbPath, u'%s.png' % text_name)
@@ -510,10 +487,8 @@
ret = QtGui.QMessageBox.question(self,
translate('OpenLP.ThemeManager', 'Theme Already Exists'),
translate('OpenLP.ThemeManager',
- 'Theme %s already exists. Do you want to replace it?'
- ).replace('%s', theme_name),
- QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
- QtGui.QMessageBox.No),
+ 'Theme %s already exists. Do you want to replace it?').replace('%s', theme_name),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
return ret == QtGui.QMessageBox.Yes
@@ -539,8 +514,7 @@
xml_tree = ElementTree(element=XML(zip.read(xml_file[0]))).getroot()
v1_background = xml_tree.find(u'BackgroundType')
if v1_background is not None:
- theme_name, file_xml, out_file, abort_import = \
- self.unzipVersion122(
+ theme_name, file_xml, out_file, abort_import = self.unzipVersion122(
dir, zip, xml_file[0], xml_tree, v1_background, out_file)
else:
theme_name = xml_tree.find(u'name').text.strip()
@@ -555,8 +529,8 @@
try:
uname = unicode(name, u'utf-8')
except UnicodeDecodeError:
- log.exception(u'Theme file contains non utf-8 filename'
- u' "%s"' % name.decode(u'utf-8', u'replace'))
+ log.exception(u'Theme file contains non utf-8 filename "%s"' %
+ name.decode(u'utf-8', u'replace'))
raise Exception(u'validation')
uname = uname.replace(u'/', os.path.sep)
split_name = uname.split(os.path.sep)
@@ -579,8 +553,7 @@
except Exception as info:
if unicode(info) == u'validation':
critical_error_message_box(translate('OpenLP.ThemeManager',
- 'Validation Error'), translate('OpenLP.ThemeManager',
- 'File is not a valid theme.'))
+ 'Validation Error'), translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
else:
raise
finally:
@@ -599,10 +572,8 @@
elif zip is not None:
critical_error_message_box(
translate('OpenLP.ThemeManager', 'Validation Error'),
- translate('OpenLP.ThemeManager',
- 'File is not a valid theme.'))
- log.exception(u'Theme file does not contain XML data %s' %
- file_name)
+ translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
+ log.exception(u'Theme file does not contain XML data %s' % file_name)
def unzipVersion122(self, dir, zip, xml_file, xml_tree, background,
out_file):
@@ -634,8 +605,7 @@
out_file.write(zip.read(image_file[0]))
out_file.close()
else:
- log.exception(u'Theme file does not contain image file "%s"' %
- image_name.decode(u'utf-8', u'replace'))
+ log.exception(u'Theme file does not contain image file "%s"' % image_name.decode(u'utf-8', u'replace'))
raise Exception(u'validation')
return theme_name, file_xml, out_file, False
@@ -650,8 +620,7 @@
if os.path.exists(theme_dir):
critical_error_message_box(
translate('OpenLP.ThemeManager', 'Validation Error'),
- translate('OpenLP.ThemeManager',
- 'A theme with this name already exists.'))
+ translate('OpenLP.ThemeManager', 'A theme with this name already exists.'))
return False
return True
@@ -661,10 +630,8 @@
and to trigger the reload of the theme list
"""
self._writeTheme(theme, image_from, image_to)
- if theme.background_type == \
- BackgroundType.to_string(BackgroundType.Image):
- self.mainwindow.imageManager.updateImageBorder(
- theme.background_filename,
+ if theme.background_type == BackgroundType.to_string(BackgroundType.Image):
+ self.mainwindow.imageManager.updateImageBorder(theme.background_filename,
ImageSource.Theme, QtGui.QColor(theme.background_border_color))
self.mainwindow.imageManager.processUpdates()
@@ -693,9 +660,7 @@
if image_from and image_from != image_to:
try:
encoding = get_filesystem_encoding()
- shutil.copyfile(
- unicode(image_from).encode(encoding),
- unicode(image_to).encode(encoding))
+ shutil.copyfile(unicode(image_from).encode(encoding), unicode(image_to).encode(encoding))
except IOError:
log.exception(u'Failed to save theme image')
self.generateAndSaveImage(self.path, name, theme)
@@ -718,8 +683,7 @@
self.mainwindow.displayProgressBar(len(self.themeList))
for theme in self.themeList:
self.mainwindow.incrementProgressBar()
- self.generateAndSaveImage(
- self.path, theme, self.getThemeData(theme))
+ self.generateAndSaveImage(self.path, theme, self.getThemeData(theme))
self.mainwindow.finishedProgressBar()
self.loadThemes()
@@ -734,8 +698,7 @@
Flag to tell message lines per page need to be generated.
"""
log.debug(u'generateImage \n%s ', theme_data)
- return self.mainwindow.renderer.generate_preview(
- theme_data, forcePage)
+ return self.mainwindow.renderer.generate_preview(theme_data, forcePage)
def getPreviewImage(self, theme):
"""
@@ -773,28 +736,23 @@
theme = item.text()
# confirm deletion
if confirm:
- answer = QtGui.QMessageBox.question(self, confirm_title,
- confirm_text % theme, QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
+ answer = QtGui.QMessageBox.question(self, confirm_title, confirm_text % theme,
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
return False
# should be the same unless default
if theme != item.data(QtCore.Qt.UserRole):
critical_error_message_box(
- message=translate('OpenLP.ThemeManager',
- 'You are unable to delete the default theme.'))
+ message=translate('OpenLP.ThemeManager', 'You are unable to delete the default theme.'))
return False
# check for use in the system else where.
if testPlugin:
for plugin in self.mainwindow.pluginManager.plugins:
if plugin.usesTheme(theme):
- critical_error_message_box(
- translate('OpenLP.ThemeManager',
- 'Validation Error'),
- translate('OpenLP.ThemeManager',
- 'Theme %s is used in the %s plugin.') % \
- (theme, plugin.name))
+ critical_error_message_box(translate('OpenLP.ThemeManager', 'Validation Error'),
+ translate('OpenLP.ThemeManager', 'Theme %s is used in the %s plugin.') %
+ (theme, plugin.name))
return False
return True
return False
@@ -813,31 +771,20 @@
new_theme = ThemeXML()
new_theme.theme_name = self.badV1NameChars.sub(u'', theme.Name)
if theme.BackgroundType == 0:
- new_theme.background_type = \
- BackgroundType.to_string(BackgroundType.Solid)
- new_theme.background_color = \
- unicode(theme.BackgroundParameter1.name())
+ new_theme.background_type = BackgroundType.to_string(BackgroundType.Solid)
+ new_theme.background_color = unicode(theme.BackgroundParameter1.name())
elif theme.BackgroundType == 1:
- new_theme.background_type = \
- BackgroundType.to_string(BackgroundType.Gradient)
- new_theme.background_direction = \
- BackgroundGradientType. \
- to_string(BackgroundGradientType.Horizontal)
+ new_theme.background_type = BackgroundType.to_string(BackgroundType.Gradient)
+ new_theme.background_direction = BackgroundGradientType.to_string(BackgroundGradientType.Horizontal)
if theme.BackgroundParameter3.name() == 1:
- new_theme.background_direction = \
- BackgroundGradientType. \
- to_string(BackgroundGradientType.Horizontal)
- new_theme.background_start_color = \
- unicode(theme.BackgroundParameter1.name())
- new_theme.background_end_color = \
- unicode(theme.BackgroundParameter2.name())
+ new_theme.background_direction = BackgroundGradientType.to_string(BackgroundGradientType.Horizontal)
+ new_theme.background_start_color = unicode(theme.BackgroundParameter1.name())
+ new_theme.background_end_color = unicode(theme.BackgroundParameter2.name())
elif theme.BackgroundType == 2:
- new_theme.background_type = \
- BackgroundType.to_string(BackgroundType.Image)
+ new_theme.background_type = BackgroundType.to_string(BackgroundType.Image)
new_theme.background_filename = unicode(theme.BackgroundParameter1)
elif theme.BackgroundType == 3:
- new_theme.background_type = \
- BackgroundType.to_string(BackgroundType.Transparent)
+ new_theme.background_type = BackgroundType.to_string(BackgroundType.Transparent)
new_theme.font_main_name = theme.FontName
new_theme.font_main_color = unicode(theme.FontColor.name())
new_theme.font_main_size = theme.FontProportion * 3
@@ -849,8 +796,7 @@
new_theme.font_main_shadow_color = unicode(theme.ShadowColor.name())
if theme.Outline == 1:
new_theme.font_main_outline = True
- new_theme.font_main_outline_color = \
- unicode(theme.OutlineColor.name())
+ new_theme.font_main_outline_color = unicode(theme.OutlineColor.name())
vAlignCorrection = VerticalType.Top
if theme.VerticalAlign == 2:
vAlignCorrection = VerticalType.Middle
=== modified file 'openlp/core/ui/themestab.py'
--- openlp/core/ui/themestab.py 2012-12-27 16:27:59 +0000
+++ openlp/core/ui/themestab.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -51,10 +51,8 @@
self.GlobalGroupBoxLayout = QtGui.QVBoxLayout(self.GlobalGroupBox)
self.GlobalGroupBoxLayout.setObjectName(u'GlobalGroupBoxLayout')
self.DefaultComboBox = QtGui.QComboBox(self.GlobalGroupBox)
- self.DefaultComboBox.setSizeAdjustPolicy(
- QtGui.QComboBox.AdjustToMinimumContentsLength)
- self.DefaultComboBox.setSizePolicy(
- QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
+ self.DefaultComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength)
+ self.DefaultComboBox.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
self.DefaultComboBox.setObjectName(u'DefaultComboBox')
self.GlobalGroupBoxLayout.addWidget(self.DefaultComboBox)
self.DefaultListView = QtGui.QLabel(self.GlobalGroupBox)
@@ -65,10 +63,8 @@
self.LevelGroupBox = QtGui.QGroupBox(self.rightColumn)
self.LevelGroupBox.setObjectName(u'LevelGroupBox')
self.LevelLayout = QtGui.QFormLayout(self.LevelGroupBox)
- self.LevelLayout.setLabelAlignment(
- QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
- self.LevelLayout.setFormAlignment(
- QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
+ self.LevelLayout.setLabelAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
+ self.LevelLayout.setFormAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
self.LevelLayout.setObjectName(u'LevelLayout')
self.SongLevelRadioButton = QtGui.QRadioButton(self.LevelGroupBox)
self.SongLevelRadioButton.setObjectName(u'SongLevelRadioButton')
@@ -79,58 +75,44 @@
self.ServiceLevelRadioButton.setObjectName(u'ServiceLevelRadioButton')
self.ServiceLevelLabel = QtGui.QLabel(self.LevelGroupBox)
self.ServiceLevelLabel.setObjectName(u'ServiceLevelLabel')
- self.LevelLayout.addRow(self.ServiceLevelRadioButton,
- self.ServiceLevelLabel)
+ self.LevelLayout.addRow(self.ServiceLevelRadioButton, self.ServiceLevelLabel)
self.GlobalLevelRadioButton = QtGui.QRadioButton(self.LevelGroupBox)
self.GlobalLevelRadioButton.setObjectName(u'GlobalLevelRadioButton')
self.GlobalLevelLabel = QtGui.QLabel(self.LevelGroupBox)
self.GlobalLevelLabel.setObjectName(u'GlobalLevelLabel')
- self.LevelLayout.addRow(self.GlobalLevelRadioButton,
- self.GlobalLevelLabel)
+ self.LevelLayout.addRow(self.GlobalLevelRadioButton, self.GlobalLevelLabel)
label_top_margin = (self.SongLevelRadioButton.sizeHint().height() -
self.SongLevelLabel.sizeHint().height()) / 2
- for label in [self.SongLevelLabel, self.ServiceLevelLabel,
- self.GlobalLevelLabel]:
+ for label in [self.SongLevelLabel, self.ServiceLevelLabel, self.GlobalLevelLabel]:
rect = label.rect()
rect.setTop(rect.top() + label_top_margin)
label.setFrameRect(rect)
label.setWordWrap(True)
self.rightLayout.addWidget(self.LevelGroupBox)
self.rightLayout.addStretch()
- QtCore.QObject.connect(self.SongLevelRadioButton,
- QtCore.SIGNAL(u'clicked()'), self.onSongLevelButtonClicked)
- QtCore.QObject.connect(self.ServiceLevelRadioButton,
- QtCore.SIGNAL(u'clicked()'), self.onServiceLevelButtonClicked)
- QtCore.QObject.connect(self.GlobalLevelRadioButton,
- QtCore.SIGNAL(u'clicked()'), self.onGlobalLevelButtonClicked)
- QtCore.QObject.connect(self.DefaultComboBox,
- QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
+ QtCore.QObject.connect(self.SongLevelRadioButton, QtCore.SIGNAL(u'clicked()'), self.onSongLevelButtonClicked)
+ QtCore.QObject.connect(self.ServiceLevelRadioButton, QtCore.SIGNAL(u'clicked()'),
+ self.onServiceLevelButtonClicked)
+ QtCore.QObject.connect(self.GlobalLevelRadioButton, QtCore.SIGNAL(u'clicked()'),
+ self.onGlobalLevelButtonClicked)
+ QtCore.QObject.connect(self.DefaultComboBox, QtCore.SIGNAL(u'activated(int)'), self.onDefaultComboBoxChanged)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
def retranslateUi(self):
self.tabTitleVisible = UiStrings().Themes
- self.GlobalGroupBox.setTitle(
- translate('OpenLP.ThemesTab', 'Global Theme'))
- self.LevelGroupBox.setTitle(
- translate('OpenLP.ThemesTab', 'Theme Level'))
- self.SongLevelRadioButton.setText(
- translate('OpenLP.ThemesTab', 'S&ong Level'))
- self.SongLevelLabel.setText(
- translate('OpenLP.ThemesTab', 'Use the theme from each song '
+ self.GlobalGroupBox.setTitle(translate('OpenLP.ThemesTab', 'Global Theme'))
+ self.LevelGroupBox.setTitle(translate('OpenLP.ThemesTab', 'Theme Level'))
+ self.SongLevelRadioButton.setText(translate('OpenLP.ThemesTab', 'S&ong Level'))
+ self.SongLevelLabel.setText(translate('OpenLP.ThemesTab', 'Use the theme from each song '
'in the database. If a song doesn\'t have a theme associated with '
'it, then use the service\'s theme. If the service doesn\'t have '
'a theme, then use the global theme.'))
- self.ServiceLevelRadioButton.setText(
- translate('OpenLP.ThemesTab', '&Service Level'))
- self.ServiceLevelLabel.setText(
- translate('OpenLP.ThemesTab', 'Use the theme from the service, '
+ self.ServiceLevelRadioButton.setText(translate('OpenLP.ThemesTab', '&Service Level'))
+ self.ServiceLevelLabel.setText(translate('OpenLP.ThemesTab', 'Use the theme from the service, '
'overriding any of the individual songs\' themes. If the '
'service doesn\'t have a theme, then use the global theme.'))
- self.GlobalLevelRadioButton.setText(
- translate('OpenLP.ThemesTab', '&Global Level'))
- self.GlobalLevelLabel.setText(
- translate('OpenLP.ThemesTab', 'Use the global theme, overriding '
+ self.GlobalLevelRadioButton.setText(translate('OpenLP.ThemesTab', '&Global Level'))
+ self.GlobalLevelLabel.setText(translate('OpenLP.ThemesTab', 'Use the global theme, overriding '
'any themes associated with either the service or the songs.'))
def load(self):
@@ -183,8 +165,7 @@
[u'Bible Theme', u'Song Theme']
"""
# Reload as may have been triggered by the ThemeManager.
- self.global_theme = Settings().value(
- self.settingsSection + u'/global theme', u'')
+ self.global_theme = Settings().value(self.settingsSection + u'/global theme', u'')
self.DefaultComboBox.clear()
self.DefaultComboBox.addItems(theme_list)
find_and_set_in_combo_box(self.DefaultComboBox, self.global_theme)
@@ -197,10 +178,8 @@
"""
Utility method to update the global theme preview image.
"""
- image = self.mainwindow.themeManagerContents.getPreviewImage(
- self.global_theme)
+ image = self.mainwindow.themeManagerContents.getPreviewImage(self.global_theme)
preview = QtGui.QPixmap(unicode(image))
if not preview.isNull():
- preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
- QtCore.Qt.SmoothTransformation)
+ preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
self.DefaultListView.setPixmap(preview)
=== modified file 'openlp/core/ui/themewizard.py'
--- openlp/core/ui/themewizard.py 2012-12-01 07:57:54 +0000
+++ openlp/core/ui/themewizard.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -30,10 +30,8 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, build_icon
-from openlp.core.lib.theme import HorizontalType, BackgroundType, \
- BackgroundGradientType
-from openlp.core.lib.ui import UiStrings, add_welcome_page, \
- create_valign_selection_widgets
+from openlp.core.lib.theme import HorizontalType, BackgroundType, BackgroundGradientType
+from openlp.core.lib.ui import UiStrings, add_welcome_page, create_valign_selection_widgets
class Ui_ThemeWizard(object):
def setupUi(self, themeWizard):
@@ -43,8 +41,7 @@
themeWizard.setOptions(QtGui.QWizard.IndependentPages |
QtGui.QWizard.NoBackButtonOnStartPage |
QtGui.QWizard.HaveCustomButton1)
- self.spacer = QtGui.QSpacerItem(10, 0,
- QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
+ self.spacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
# Welcome Page
add_welcome_page(themeWizard, u':/wizards/wizard_createtheme.bmp')
# Background Page
@@ -59,10 +56,8 @@
self.backgroundComboBox = QtGui.QComboBox(self.backgroundPage)
self.backgroundComboBox.addItems([u'', u'', u'', u''])
self.backgroundComboBox.setObjectName(u'BackgroundComboBox')
- self.backgroundTypeLayout.addRow(self.backgroundLabel,
- self.backgroundComboBox)
- self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole,
- self.spacer)
+ self.backgroundTypeLayout.addRow(self.backgroundLabel, self.backgroundComboBox)
+ self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
self.backgroundLayout.addLayout(self.backgroundTypeLayout)
self.backgroundStack = QtGui.QStackedLayout()
self.backgroundStack.setObjectName(u'BackgroundStack')
@@ -87,21 +82,18 @@
self.gradientStartLabel.setObjectName(u'GradientStartLabel')
self.gradientStartButton = QtGui.QPushButton(self.gradientWidget)
self.gradientStartButton.setObjectName(u'GradientStartButton')
- self.gradientLayout.addRow(self.gradientStartLabel,
- self.gradientStartButton)
+ self.gradientLayout.addRow(self.gradientStartLabel, self.gradientStartButton)
self.gradientEndLabel = QtGui.QLabel(self.gradientWidget)
self.gradientEndLabel.setObjectName(u'GradientEndLabel')
self.gradientEndButton = QtGui.QPushButton(self.gradientWidget)
self.gradientEndButton.setObjectName(u'GradientEndButton')
- self.gradientLayout.addRow(self.gradientEndLabel,
- self.gradientEndButton)
+ self.gradientLayout.addRow(self.gradientEndLabel, self.gradientEndButton)
self.gradientTypeLabel = QtGui.QLabel(self.gradientWidget)
self.gradientTypeLabel.setObjectName(u'GradientTypeLabel')
self.gradientComboBox = QtGui.QComboBox(self.gradientWidget)
self.gradientComboBox.setObjectName(u'GradientComboBox')
self.gradientComboBox.addItems([u'', u'', u'', u'', u''])
- self.gradientLayout.addRow(self.gradientTypeLabel,
- self.gradientComboBox)
+ self.gradientLayout.addRow(self.gradientTypeLabel, self.gradientComboBox)
self.gradientLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
self.backgroundStack.addWidget(self.gradientWidget)
self.imageWidget = QtGui.QWidget(self.backgroundPage)
@@ -123,8 +115,7 @@
self.imageFileLayout.addWidget(self.imageFileEdit)
self.imageBrowseButton = QtGui.QToolButton(self.imageWidget)
self.imageBrowseButton.setObjectName(u'ImageBrowseButton')
- self.imageBrowseButton.setIcon(
- build_icon(u':/general/general_open.png'))
+ self.imageBrowseButton.setIcon(build_icon(u':/general/general_open.png'))
self.imageFileLayout.addWidget(self.imageBrowseButton)
self.imageLayout.addRow(self.imageLabel, self.imageFileLayout)
self.imageLayout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer)
@@ -162,8 +153,7 @@
self.mainItalicsCheckBox = QtGui.QCheckBox(self.mainAreaPage)
self.mainItalicsCheckBox.setObjectName(u'MainItalicsCheckBox')
self.mainPropertiesLayout.addWidget(self.mainItalicsCheckBox)
- self.mainAreaLayout.addRow(self.mainColorLabel,
- self.mainPropertiesLayout)
+ self.mainAreaLayout.addRow(self.mainColorLabel, self.mainPropertiesLayout)
self.mainSizeLabel = QtGui.QLabel(self.mainAreaPage)
self.mainSizeLabel.setObjectName(u'MainSizeLabel')
self.mainSizeLayout = QtGui.QHBoxLayout()
@@ -183,8 +173,7 @@
self.lineSpacingSpinBox.setMinimum(-50)
self.lineSpacingSpinBox.setMaximum(50)
self.lineSpacingSpinBox.setObjectName(u'LineSpacingSpinBox')
- self.mainAreaLayout.addRow(self.lineSpacingLabel,
- self.lineSpacingSpinBox)
+ self.mainAreaLayout.addRow(self.lineSpacingLabel, self.lineSpacingSpinBox)
self.outlineCheckBox = QtGui.QCheckBox(self.mainAreaPage)
self.outlineCheckBox.setObjectName(u'OutlineCheckBox')
self.outlineLayout = QtGui.QHBoxLayout()
@@ -229,24 +218,20 @@
self.footerFontLabel.setObjectName(u'FooterFontLabel')
self.footerFontComboBox = QtGui.QFontComboBox(self.footerAreaPage)
self.footerFontComboBox.setObjectName(u'footerFontComboBox')
- self.footerAreaLayout.addRow(self.footerFontLabel,
- self.footerFontComboBox)
+ self.footerAreaLayout.addRow(self.footerFontLabel, self.footerFontComboBox)
self.footerColorLabel = QtGui.QLabel(self.footerAreaPage)
self.footerColorLabel.setObjectName(u'FooterColorLabel')
self.footerColorButton = QtGui.QPushButton(self.footerAreaPage)
self.footerColorButton.setObjectName(u'footerColorButton')
- self.footerAreaLayout.addRow(self.footerColorLabel,
- self.footerColorButton)
+ self.footerAreaLayout.addRow(self.footerColorLabel, self.footerColorButton)
self.footerSizeLabel = QtGui.QLabel(self.footerAreaPage)
self.footerSizeLabel.setObjectName(u'FooterSizeLabel')
self.footerSizeSpinBox = QtGui.QSpinBox(self.footerAreaPage)
self.footerSizeSpinBox.setMaximum(999)
self.footerSizeSpinBox.setValue(10)
self.footerSizeSpinBox.setObjectName(u'FooterSizeSpinBox')
- self.footerAreaLayout.addRow(self.footerSizeLabel,
- self.footerSizeSpinBox)
- self.footerAreaLayout.setItem(3, QtGui.QFormLayout.LabelRole,
- self.spacer)
+ self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox)
+ self.footerAreaLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
themeWizard.addPage(self.footerAreaPage)
# Alignment Page
self.alignmentPage = QtGui.QWizardPage()
@@ -258,10 +243,8 @@
self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage)
self.horizontalComboBox.addItems([u'', u'', u'', u''])
self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
- self.alignmentLayout.addRow(self.horizontalLabel,
- self.horizontalComboBox)
- self.verticalLabel, self.verticalComboBox = \
- create_valign_selection_widgets(self.alignmentPage)
+ self.alignmentLayout.addRow(self.horizontalLabel, self.horizontalComboBox)
+ self.verticalLabel, self.verticalComboBox = create_valign_selection_widgets(self.alignmentPage)
self.verticalLabel.setObjectName(u'verticalLabel')
self.verticalComboBox.setObjectName(u'verticalComboBox')
self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
@@ -269,10 +252,8 @@
self.transitionsLabel.setObjectName(u'TransitionsLabel')
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
self.transitionsCheckBox.setObjectName(u'TransitionsCheckBox')
- self.alignmentLayout.addRow(self.transitionsLabel,
- self.transitionsCheckBox)
- self.alignmentLayout.setItem(3, QtGui.QFormLayout.LabelRole,
- self.spacer)
+ self.alignmentLayout.addRow(self.transitionsLabel, self.transitionsCheckBox)
+ self.alignmentLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
themeWizard.addPage(self.alignmentPage)
# Area Position Page
self.areaPositionPage = QtGui.QWizardPage()
@@ -303,23 +284,19 @@
self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
self.mainWidthSpinBox.setMaximum(9999)
self.mainWidthSpinBox.setObjectName(u'MainWidthSpinBox')
- self.mainPositionLayout.addRow(self.mainWidthLabel,
- self.mainWidthSpinBox)
+ self.mainPositionLayout.addRow(self.mainWidthLabel, self.mainWidthSpinBox)
self.mainHeightLabel = QtGui.QLabel(self.mainPositionGroupBox)
self.mainHeightLabel.setObjectName(u'MainHeightLabel')
self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
self.mainHeightSpinBox.setMaximum(9999)
self.mainHeightSpinBox.setObjectName(u'MainHeightSpinBox')
- self.mainPositionLayout.addRow(self.mainHeightLabel,
- self.mainHeightSpinBox)
+ self.mainPositionLayout.addRow(self.mainHeightLabel, self.mainHeightSpinBox)
self.areaPositionLayout.addWidget(self.mainPositionGroupBox)
self.footerPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage)
self.footerPositionGroupBox.setObjectName(u'FooterPositionGroupBox')
- self.footerPositionLayout = QtGui.QFormLayout(
- self.footerPositionGroupBox)
+ self.footerPositionLayout = QtGui.QFormLayout(self.footerPositionGroupBox)
self.footerPositionLayout.setObjectName(u'FooterPositionLayout')
- self.footerPositionCheckBox = QtGui.QCheckBox(
- self.footerPositionGroupBox)
+ self.footerPositionCheckBox = QtGui.QCheckBox(self.footerPositionGroupBox)
self.footerPositionCheckBox.setObjectName(u'FooterPositionCheckBox')
self.footerPositionLayout.addRow(self.footerPositionCheckBox)
self.footerXLabel = QtGui.QLabel(self.footerPositionGroupBox)
@@ -339,15 +316,13 @@
self.footerWidthSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
self.footerWidthSpinBox.setMaximum(9999)
self.footerWidthSpinBox.setObjectName(u'FooterWidthSpinBox')
- self.footerPositionLayout.addRow(self.footerWidthLabel,
- self.footerWidthSpinBox)
+ self.footerPositionLayout.addRow(self.footerWidthLabel, self.footerWidthSpinBox)
self.footerHeightLabel = QtGui.QLabel(self.footerPositionGroupBox)
self.footerHeightLabel.setObjectName(u'FooterHeightLabel')
self.footerHeightSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
self.footerHeightSpinBox.setMaximum(9999)
self.footerHeightSpinBox.setObjectName(u'FooterHeightSpinBox')
- self.footerPositionLayout.addRow(self.footerHeightLabel,
- self.footerHeightSpinBox)
+ self.footerPositionLayout.addRow(self.footerHeightLabel, self.footerHeightSpinBox)
self.areaPositionLayout.addWidget(self.footerPositionGroupBox)
themeWizard.addPage(self.areaPositionPage)
# Preview Page
@@ -360,8 +335,7 @@
self.themeNameLabel = QtGui.QLabel(self.previewPage)
self.themeNameLabel.setObjectName(u'ThemeNameLabel')
self.themeNameEdit = QtGui.QLineEdit(self.previewPage)
- self.themeNameEdit.setValidator(QtGui.QRegExpValidator(
- QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
+ self.themeNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
self.themeNameEdit.setObjectName(u'ThemeNameEdit')
self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit)
self.previewLayout.addLayout(self.themeNameLayout)
@@ -380,78 +354,55 @@
self.previewLayout.addWidget(self.previewArea)
themeWizard.addPage(self.previewPage)
self.retranslateUi(themeWizard)
- QtCore.QObject.connect(self.backgroundComboBox,
- QtCore.SIGNAL(u'currentIndexChanged(int)'), self.backgroundStack,
- QtCore.SLOT(u'setCurrentIndex(int)'))
- QtCore.QObject.connect(self.outlineCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.outlineColorButton,
- QtCore.SLOT(u'setEnabled(bool)'))
- QtCore.QObject.connect(self.outlineCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.outlineSizeSpinBox,
- QtCore.SLOT(u'setEnabled(bool)'))
- QtCore.QObject.connect(self.shadowCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.shadowColorButton,
- QtCore.SLOT(u'setEnabled(bool)'))
- QtCore.QObject.connect(self.shadowCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.shadowSizeSpinBox,
- QtCore.SLOT(u'setEnabled(bool)'))
- QtCore.QObject.connect(self.mainPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.mainXSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.mainPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.mainYSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.mainPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.mainWidthSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.mainPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.mainHeightSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.footerPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.footerXSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.footerPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.footerYSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.footerPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.footerWidthSpinBox,
- QtCore.SLOT(u'setDisabled(bool)'))
- QtCore.QObject.connect(self.footerPositionCheckBox,
- QtCore.SIGNAL(u'toggled(bool)'), self.footerHeightSpinBox,
+ QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'),
+ self.backgroundStack, QtCore.SLOT(u'setCurrentIndex(int)'))
+ QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.outlineColorButton,
+ QtCore.SLOT(u'setEnabled(bool)'))
+ QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.outlineSizeSpinBox,
+ QtCore.SLOT(u'setEnabled(bool)'))
+ QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.shadowColorButton,
+ QtCore.SLOT(u'setEnabled(bool)'))
+ QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.shadowSizeSpinBox,
+ QtCore.SLOT(u'setEnabled(bool)'))
+ QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainXSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainYSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainWidthSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainHeightSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.footerPositionCheckBox,QtCore.SIGNAL(u'toggled(bool)'), self.footerXSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerYSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerWidthSpinBox,
+ QtCore.SLOT(u'setDisabled(bool)'))
+ QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerHeightSpinBox,
QtCore.SLOT(u'setDisabled(bool)'))
def retranslateUi(self, themeWizard):
- themeWizard.setWindowTitle(
- translate('OpenLP.ThemeWizard', 'Theme Wizard'))
- self.titleLabel.setText(
- u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
+ themeWizard.setWindowTitle(translate('OpenLP.ThemeWizard', 'Theme Wizard'))
+ self.titleLabel.setText(u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
translate('OpenLP.ThemeWizard', 'Welcome to the Theme Wizard'))
self.informationLabel.setText(
translate('OpenLP.ThemeWizard', 'This wizard will help you to '
'create and edit your themes. Click the next button below to '
'start the process by setting up your background.'))
- self.backgroundPage.setTitle(
- translate('OpenLP.ThemeWizard', 'Set Up Background'))
- self.backgroundPage.setSubTitle(
- translate('OpenLP.ThemeWizard', 'Set up your theme\'s background '
+ self.backgroundPage.setTitle(translate('OpenLP.ThemeWizard', 'Set Up Background'))
+ self.backgroundPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Set up your theme\'s background '
'according to the parameters below.'))
- self.backgroundLabel.setText(
- translate('OpenLP.ThemeWizard', 'Background type:'))
+ self.backgroundLabel.setText(translate('OpenLP.ThemeWizard', 'Background type:'))
self.backgroundComboBox.setItemText(BackgroundType.Solid,
translate('OpenLP.ThemeWizard', 'Solid Color'))
self.backgroundComboBox.setItemText(BackgroundType.Gradient,
translate('OpenLP.ThemeWizard', 'Gradient'))
- self.backgroundComboBox.setItemText(
- BackgroundType.Image, UiStrings().Image)
- self.backgroundComboBox.setItemText(BackgroundType.Transparent,
- translate('OpenLP.ThemeWizard', 'Transparent'))
+ self.backgroundComboBox.setItemText(BackgroundType.Image, UiStrings().Image)
+ self.backgroundComboBox.setItemText(BackgroundType.Transparent, translate('OpenLP.ThemeWizard', 'Transparent'))
self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
- self.gradientStartLabel.setText(
- translate(u'OpenLP.ThemeWizard', 'Starting color:'))
- self.gradientEndLabel.setText(
- translate(u'OpenLP.ThemeWizard', 'Ending color:'))
- self.gradientTypeLabel.setText(
- translate('OpenLP.ThemeWizard', 'Gradient:'))
+ self.gradientStartLabel.setText(translate(u'OpenLP.ThemeWizard', 'Starting color:'))
+ self.gradientEndLabel.setText(translate(u'OpenLP.ThemeWizard', 'Ending color:'))
+ self.gradientTypeLabel.setText(translate('OpenLP.ThemeWizard', 'Gradient:'))
self.gradientComboBox.setItemText(BackgroundGradientType.Horizontal,
translate('OpenLP.ThemeWizard', 'Horizontal'))
self.gradientComboBox.setItemText(BackgroundGradientType.Vertical,
@@ -462,66 +413,46 @@
translate('OpenLP.ThemeWizard', 'Top Left - Bottom Right'))
self.gradientComboBox.setItemText(BackgroundGradientType.LeftBottom,
translate('OpenLP.ThemeWizard', 'Bottom Left - Top Right'))
- self.imageColorLabel.setText(
- translate(u'OpenLP.ThemeWizard', 'Background color:'))
+ self.imageColorLabel.setText(translate(u'OpenLP.ThemeWizard', 'Background color:'))
self.imageLabel.setText(u'%s:' % UiStrings().Image)
- self.mainAreaPage.setTitle(
- translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
- self.mainAreaPage.setSubTitle(
- translate('OpenLP.ThemeWizard', 'Define the font and display '
+ self.mainAreaPage.setTitle(translate('OpenLP.ThemeWizard', 'Main Area Font Details'))
+ self.mainAreaPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
'characteristics for the Display text'))
self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.mainSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
- self.lineSpacingLabel.setText(
- translate('OpenLP.ThemeWizard', 'Line Spacing:'))
+ self.lineSpacingLabel.setText(translate('OpenLP.ThemeWizard', 'Line Spacing:'))
self.lineSpacingSpinBox.setSuffix(UiStrings().FontSizePtUnit)
- self.outlineCheckBox.setText(
- translate('OpenLP.ThemeWizard', '&Outline:'))
+ self.outlineCheckBox.setText(translate('OpenLP.ThemeWizard', '&Outline:'))
self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.outlineSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.shadowSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
- self.mainItalicsCheckBox.setText(
- translate('OpenLP.ThemeWizard', 'Italic'))
- self.footerAreaPage.setTitle(
- translate('OpenLP.ThemeWizard', 'Footer Area Font Details'))
- self.footerAreaPage.setSubTitle(
- translate('OpenLP.ThemeWizard', 'Define the font and display '
+ self.mainItalicsCheckBox.setText(translate('OpenLP.ThemeWizard', 'Italic'))
+ self.footerAreaPage.setTitle(translate('OpenLP.ThemeWizard', 'Footer Area Font Details'))
+ self.footerAreaPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Define the font and display '
'characteristics for the Footer text'))
self.footerFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
self.footerColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.footerSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.footerSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
- self.alignmentPage.setTitle(
- translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
- self.alignmentPage.setSubTitle(
- translate('OpenLP.ThemeWizard', 'Allows additional display '
+ self.alignmentPage.setTitle(translate('OpenLP.ThemeWizard', 'Text Formatting Details'))
+ self.alignmentPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows additional display '
'formatting information to be defined'))
- self.horizontalLabel.setText(
- translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
- self.horizontalComboBox.setItemText(HorizontalType.Left,
- translate('OpenLP.ThemeWizard', 'Left'))
- self.horizontalComboBox.setItemText(HorizontalType.Right,
- translate('OpenLP.ThemeWizard', 'Right'))
- self.horizontalComboBox.setItemText(HorizontalType.Center,
- translate('OpenLP.ThemeWizard', 'Center'))
- self.horizontalComboBox.setItemText(HorizontalType.Justify,
- translate('OpenLP.ThemeWizard', 'Justify'))
- self.transitionsLabel.setText(
- translate('OpenLP.ThemeWizard', 'Transitions:'))
- self.areaPositionPage.setTitle(
- translate('OpenLP.ThemeWizard', 'Output Area Locations'))
- self.areaPositionPage.setSubTitle(
- translate('OpenLP.ThemeWizard', 'Allows you to change and move the'
+ self.horizontalLabel.setText(translate('OpenLP.ThemeWizard', 'Horizontal Align:'))
+ self.horizontalComboBox.setItemText(HorizontalType.Left, translate('OpenLP.ThemeWizard', 'Left'))
+ self.horizontalComboBox.setItemText(HorizontalType.Right, translate('OpenLP.ThemeWizard', 'Right'))
+ self.horizontalComboBox.setItemText(HorizontalType.Center, translate('OpenLP.ThemeWizard', 'Center'))
+ self.horizontalComboBox.setItemText(HorizontalType.Justify, translate('OpenLP.ThemeWizard', 'Justify'))
+ self.transitionsLabel.setText(translate('OpenLP.ThemeWizard', 'Transitions:'))
+ self.areaPositionPage.setTitle(translate('OpenLP.ThemeWizard', 'Output Area Locations'))
+ self.areaPositionPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows you to change and move the'
' main and footer areas.'))
- self.mainPositionGroupBox.setTitle(
- translate('OpenLP.ThemeWizard', '&Main Area'))
- self.mainPositionCheckBox.setText(
- translate('OpenLP.ThemeWizard', '&Use default location'))
+ self.mainPositionGroupBox.setTitle(translate('OpenLP.ThemeWizard', '&Main Area'))
+ self.mainPositionCheckBox.setText(translate('OpenLP.ThemeWizard', '&Use default location'))
self.mainXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:'))
self.mainXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
@@ -529,37 +460,24 @@
self.mainWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
self.mainWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:'))
self.mainHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
- self.mainHeightLabel.setText(
- translate('OpenLP.ThemeWizard', 'Height:'))
- self.footerPositionGroupBox.setTitle(
- translate('OpenLP.ThemeWizard', '&Footer Area'))
- self.footerXLabel.setText(
- translate('OpenLP.ThemeWizard', 'X position:'))
+ self.mainHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:'))
+ self.footerPositionGroupBox.setTitle(translate('OpenLP.ThemeWizard', '&Footer Area'))
+ self.footerXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:'))
self.footerXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
- self.footerYLabel.setText(
- translate('OpenLP.ThemeWizard', 'Y position:'))
+ self.footerYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:'))
self.footerYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
- self.footerWidthLabel.setText(
- translate('OpenLP.ThemeWizard', 'Width:'))
- self.footerWidthSpinBox.setSuffix(
- translate('OpenLP.ThemeWizard', 'px'))
- self.footerHeightLabel.setText(
- translate('OpenLP.ThemeWizard', 'Height:'))
- self.footerHeightSpinBox.setSuffix(
- translate('OpenLP.ThemeWizard', 'px'))
- self.footerPositionCheckBox.setText(
- translate('OpenLP.ThemeWizard', 'Use default location'))
+ self.footerWidthLabel.setText(translate('OpenLP.ThemeWizard', 'Width:'))
+ self.footerWidthSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
+ self.footerHeightLabel.setText(translate('OpenLP.ThemeWizard', 'Height:'))
+ self.footerHeightSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px'))
+ self.footerPositionCheckBox.setText(translate('OpenLP.ThemeWizard', 'Use default location'))
themeWizard.setOption(QtGui.QWizard.HaveCustomButton1, False)
themeWizard.setButtonText(QtGui.QWizard.CustomButton1,
translate('OpenLP.ThemeWizard', 'Layout Preview'))
- self.previewPage.setTitle(
- translate('OpenLP.ThemeWizard', 'Preview and Save'))
- self.previewPage.setSubTitle(
- translate('OpenLP.ThemeWizard', 'Preview the theme and save it.'))
- self.themeNameLabel.setText(
- translate('OpenLP.ThemeWizard', 'Theme name:'))
+ self.previewPage.setTitle(translate('OpenLP.ThemeWizard', 'Preview and Save'))
+ self.previewPage.setSubTitle(translate('OpenLP.ThemeWizard', 'Preview the theme and save it.'))
+ self.themeNameLabel.setText(translate('OpenLP.ThemeWizard', 'Theme name:'))
# Align all QFormLayouts towards each other.
labelWidth = max(self.backgroundLabel.minimumSizeHint().width(),
self.horizontalLabel.minimumSizeHint().width())
- self.spacer.changeSize(labelWidth, 0,
- QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ self.spacer.changeSize(labelWidth, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
=== modified file 'openlp/core/ui/wizard.py'
--- openlp/core/ui/wizard.py 2012-12-04 21:50:14 +0000
+++ openlp/core/ui/wizard.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -60,8 +60,7 @@
'Select the import format and the location to import from.')
NoSqlite = translate('OpenLP.Ui', 'The openlp.org 1.x importer has been '
'disabled due to a missing Python module. If you want to use this '
- 'importer, you will need to install the "python-sqlite" '
- 'module.')
+ 'importer, you will need to install the "python-sqlite" module.')
OpenTypeFile = translate('OpenLP.Ui', 'Open %s File')
OpenTypeFolder = translate('OpenLP.Ui', 'Open %s Folder')
PercentSymbolFormat = translate('OpenLP.Ui', '%p%')
@@ -92,12 +91,9 @@
self.registerFields()
self.customInit()
self.customSignals()
- QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'),
- self.onCurrentIdChanged)
- QtCore.QObject.connect(self.errorCopyToButton,
- QtCore.SIGNAL(u'clicked()'), self.onErrorCopyToButtonClicked)
- QtCore.QObject.connect(self.errorSaveToButton,
- QtCore.SIGNAL(u'clicked()'), self.onErrorSaveToButtonClicked)
+ QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged)
+ QtCore.QObject.connect(self.errorCopyToButton, QtCore.SIGNAL(u'clicked()'), self.onErrorCopyToButtonClicked)
+ QtCore.QObject.connect(self.errorSaveToButton, QtCore.SIGNAL(u'clicked()'), self.onErrorSaveToButtonClicked)
def setupUi(self, image):
"""
@@ -145,20 +141,17 @@
self.progressLayout.addWidget(self.errorReportTextEdit)
self.errorButtonLayout = QtGui.QHBoxLayout()
self.errorButtonLayout.setObjectName(u'errorButtonLayout')
- spacer = QtGui.QSpacerItem(40, 20,
- QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ spacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.errorButtonLayout.addItem(spacer)
self.errorCopyToButton = QtGui.QPushButton(self.progressPage)
self.errorCopyToButton.setObjectName(u'errorCopyToButton')
self.errorCopyToButton.setHidden(True)
- self.errorCopyToButton.setIcon(
- build_icon(u':/system/system_edit_copy.png'))
+ self.errorCopyToButton.setIcon(build_icon(u':/system/system_edit_copy.png'))
self.errorButtonLayout.addWidget(self.errorCopyToButton)
self.errorSaveToButton = QtGui.QPushButton(self.progressPage)
self.errorSaveToButton.setObjectName(u'errorSaveToButton')
self.errorSaveToButton.setHidden(True)
- self.errorSaveToButton.setIcon(
- build_icon(u':/general/general_save.png'))
+ self.errorSaveToButton.setIcon(build_icon(u':/general/general_save.png'))
self.errorButtonLayout.addWidget(self.errorSaveToButton)
self.progressLayout.addLayout(self.errorButtonLayout)
self.addPage(self.progressPage)
@@ -280,9 +273,8 @@
An editbox (QLineEdit).
"""
folder = unicode(QtGui.QFileDialog.getExistingDirectory(self, title,
- os.path.dirname(SettingsManager.get_last_dir(
- self.plugin.settingsSection, 1)), QtGui.QFileDialog.ShowDirsOnly))
+ os.path.dirname(SettingsManager.get_last_dir(self.plugin.settingsSection, 1)),
+ QtGui.QFileDialog.ShowDirsOnly))
if folder:
editbox.setText(folder)
- SettingsManager.set_last_dir(self.plugin.settingsSection,
- folder, 1)
+ SettingsManager.set_last_dir(self.plugin.settingsSection, folder, 1)
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2012-12-27 21:20:32 +0000
+++ openlp/core/utils/__init__.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -105,21 +105,15 @@
The directory type you want, for instance the data directory.
"""
if dir_type == AppLocation.AppDir:
- return _get_frozen_path(
- os.path.abspath(os.path.split(sys.argv[0])[0]),
- os.path.split(openlp.__file__)[0])
+ return _get_frozen_path(os.path.abspath(os.path.split(sys.argv[0])[0]), os.path.split(openlp.__file__)[0])
elif dir_type == AppLocation.PluginsDir:
app_path = os.path.abspath(os.path.split(sys.argv[0])[0])
return _get_frozen_path(os.path.join(app_path, u'plugins'),
os.path.join(os.path.split(openlp.__file__)[0], u'plugins'))
elif dir_type == AppLocation.VersionDir:
- return _get_frozen_path(
- os.path.abspath(os.path.split(sys.argv[0])[0]),
- os.path.split(openlp.__file__)[0])
+ return _get_frozen_path(os.path.abspath(os.path.split(sys.argv[0])[0]), os.path.split(openlp.__file__)[0])
elif dir_type == AppLocation.LanguageDir:
- app_path = _get_frozen_path(
- os.path.abspath(os.path.split(sys.argv[0])[0]),
- _get_os_dir_path(dir_type))
+ app_path = _get_frozen_path(os.path.abspath(os.path.split(sys.argv[0])[0]), _get_os_dir_path(dir_type))
return os.path.join(app_path, u'i18n')
elif dir_type == AppLocation.DataDir and AppLocation.BaseDir:
return os.path.join(AppLocation.BaseDir, 'data')
@@ -157,8 +151,7 @@
encoding = sys.getfilesystemencoding()
if sys.platform == u'win32':
if dir_type == AppLocation.DataDir:
- return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
- u'openlp', u'data')
+ return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), u'openlp', u'data')
elif dir_type == AppLocation.LanguageDir:
return os.path.split(openlp.__file__)[0]
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
@@ -181,17 +174,13 @@
return os.path.join(u'/usr', u'share', u'openlp')
if XDG_BASE_AVAILABLE:
if dir_type == AppLocation.ConfigDir:
- return os.path.join(unicode(BaseDirectory.xdg_config_home,
- encoding), u'openlp')
+ return os.path.join(unicode(BaseDirectory.xdg_config_home, encoding), u'openlp')
elif dir_type == AppLocation.DataDir:
- return os.path.join(
- unicode(BaseDirectory.xdg_data_home, encoding), u'openlp')
+ return os.path.join(unicode(BaseDirectory.xdg_data_home, encoding), u'openlp')
elif dir_type == AppLocation.CacheDir:
- return os.path.join(unicode(BaseDirectory.xdg_cache_home,
- encoding), u'openlp')
+ return os.path.join(unicode(BaseDirectory.xdg_cache_home, encoding), u'openlp')
if dir_type == AppLocation.DataDir:
- return os.path.join(unicode(os.getenv(u'HOME'), encoding),
- u'.openlp', u'data')
+ return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'.openlp', u'data')
return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'.openlp')
@@ -231,8 +220,7 @@
if revision_id in tags:
full_version = u'%s' % tags[revision_id][0]
else:
- full_version = '%s-bzr%s' % \
- (sorted(b.tags.get_tag_dict().keys())[-1], revno)
+ full_version = '%s-bzr%s' % (sorted(b.tags.get_tag_dict().keys())[-1], revno)
finally:
b.unlock()
except:
@@ -254,8 +242,7 @@
if code != 0:
raise Exception(u'Error running bzr log')
latest = output.split(u':')[0]
- full_version = latest == revision and tag or \
- u'%s-bzr%s' % (tag, latest)
+ full_version = latest == revision and tag or u'%s-bzr%s' % (tag, latest)
else:
# We're not running the development version, let's use the file.
filepath = AppLocation.get_directory(AppLocation.VersionDir)
@@ -277,8 +264,7 @@
u'build': bits[1] if len(bits) > 1 else None
}
if APPLICATION_VERSION[u'build']:
- log.info(u'Openlp version %s build %s',
- APPLICATION_VERSION[u'version'], APPLICATION_VERSION[u'build'])
+ log.info(u'Openlp version %s build %s', APPLICATION_VERSION[u'version'], APPLICATION_VERSION[u'build'])
else:
log.info(u'Openlp version %s' % APPLICATION_VERSION[u'version'])
return APPLICATION_VERSION
@@ -302,8 +288,7 @@
settings.endGroup()
if last_test != this_test:
if current_version[u'build']:
- req = urllib2.Request(
- u'http://www.openlp.org/files/dev_version.txt')
+ req = urllib2.Request(u'http://www.openlp.org/files/dev_version.txt')
else:
req = urllib2.Request(u'http://www.openlp.org/files/version.txt')
req.add_header(u'User-Agent', u'OpenLP/%s' % current_version[u'full'])
@@ -358,8 +343,7 @@
for fmt in QtGui.QImageReader.supportedImageFormats()]
visible_formats = u'(*.%s)' % u'; *.'.join(formats)
actual_formats = u'(*.%s)' % u' *.'.join(formats)
- IMAGES_FILTER = u'%s %s %s' % (translate('OpenLP', 'Image Files'),
- visible_formats, actual_formats)
+ IMAGES_FILTER = u'%s %s %s' % (translate('OpenLP', 'Image Files'), visible_formats, actual_formats)
return IMAGES_FILTER
@@ -463,11 +447,9 @@
"""
log.debug(u'get UNO Desktop Openoffice - resolve')
if UNO_CONNECTION_TYPE == u'pipe':
- return resolver.resolve(u'uno:pipe,name=openlp_pipe;' \
- + u'urp;StarOffice.ComponentContext')
+ return resolver.resolve(u'uno:pipe,name=openlp_pipe; urp;StarOffice.ComponentContext')
else:
- return resolver.resolve(u'uno:socket,host=localhost,port=2002;' \
- + u'urp;StarOffice.ComponentContext')
+ return resolver.resolve(u'uno:socket,host=localhost,port=2002; urp;StarOffice.ComponentContext')
def format_time(text, local_time):
=== modified file 'openlp/core/utils/actions.py'
--- openlp/core/utils/actions.py 2012-12-27 17:00:40 +0000
+++ openlp/core/utils/actions.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -287,8 +287,7 @@
# Remove empty categories.
if not self.categories[category].actions:
self.categories.remove(category)
- shortcuts = map(unicode,
- map(QtGui.QKeySequence.toString, action.shortcuts()))
+ shortcuts = map(unicode, map(QtGui.QKeySequence.toString, action.shortcuts()))
for shortcut in shortcuts:
# Remove action from the list of actions which are using this
# shortcut.
@@ -339,8 +338,7 @@
# Remove empty entries.
if not ActionList.shortcut_map[old_shortcut]:
del ActionList.shortcut_map[old_shortcut]
- new_shortcuts = map(unicode,
- map(QtGui.QKeySequence.toString, action.shortcuts()))
+ new_shortcuts = map(unicode, map(QtGui.QKeySequence.toString, action.shortcuts()))
# Add the new shortcuts to the map.
for new_shortcut in new_shortcuts:
existing_actions = ActionList.shortcut_map.get(new_shortcut, [])
@@ -358,8 +356,7 @@
``action``
The action which wants to use a particular shortcut.
"""
- local = action.shortcutContext() in \
- [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]
+ local = action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]
affected_actions = filter(lambda a: isinstance(a, QtGui.QAction),
self.getAllChildObjects(action.parent())) if local else []
for existing_action in existing_actions:
@@ -367,8 +364,7 @@
continue
if not local or existing_action in affected_actions:
return False
- if existing_action.shortcutContext() \
- in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
+ if existing_action.shortcutContext() in [QtCore.Qt.WindowShortcut, QtCore.Qt.ApplicationShortcut]:
return False
elif action in self.getAllChildObjects(existing_action.parent()):
return False
=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py 2012-12-27 21:56:53 +0000
+++ openlp/core/utils/languagemanager.py 2012-12-29 18:15:31 +0000
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
@@ -63,8 +63,7 @@
app_translator.load(language, lang_path)
# A translator for buttons and other default strings provided by Qt.
if sys.platform != u'win32' and sys.platform != u'darwin':
- lang_path = QtCore.QLibraryInfo.location(
- QtCore.QLibraryInfo.TranslationsPath)
+ lang_path = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
default_translator = QtCore.QTranslator()
default_translator.load(u'qt_%s' % language, lang_path)
return app_translator, default_translator
@@ -76,13 +75,10 @@
"""
log.debug(u'Translation files: %s', AppLocation.get_directory(
AppLocation.LanguageDir))
- trans_dir = QtCore.QDir(AppLocation.get_directory(
- AppLocation.LanguageDir))
- file_names = trans_dir.entryList(
- u'*.qm', QtCore.QDir.Files, QtCore.QDir.Name)
+ trans_dir = QtCore.QDir(AppLocation.get_directory(AppLocation.LanguageDir))
+ file_names = trans_dir.entryList(u'*.qm', QtCore.QDir.Files, QtCore.QDir.Name)
# Remove qm files from the list which start with "qt_".
- file_names = filter(
- lambda file_: not file_.startswith(u'qt_'), file_names)
+ file_names = filter(lambda file_: not file_.startswith(u'qt_'), file_names)
return map(trans_dir.filePath, file_names)
@staticmethod
@@ -95,8 +91,7 @@
"""
translator = QtCore.QTranslator()
translator.load(qm_file)
- return translator.translate('OpenLP.MainWindow', 'English',
- 'Please add the name of your language here')
+ return translator.translate('OpenLP.MainWindow', 'English', 'Please add the name of your language here')
@staticmethod
def get_language():
@@ -138,8 +133,7 @@
if message:
QtGui.QMessageBox.information(None,
translate('OpenLP.LanguageManager', 'Language'),
- translate('OpenLP.LanguageManager',
- 'Please restart OpenLP to use your new language setting.'))
+ translate('OpenLP.LanguageManager', 'Please restart OpenLP to use your new language setting.'))
@staticmethod
def init_qm_list():
@@ -152,8 +146,7 @@
reg_ex = QtCore.QRegExp("^.*i18n/(.*).qm")
if reg_ex.exactMatch(qmf):
name = u'%s' % reg_ex.cap(1)
- LanguageManager.__qm_list__[u'%#2i %s' % (counter + 1,
- LanguageManager.language_name(qmf))] = name
+ LanguageManager.__qm_list__[u'%#2i %s' % (counter + 1, LanguageManager.language_name(qmf))] = name
@staticmethod
def get_qm_list():
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2012-12-27 16:27:59 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2012-12-29 18:15:31 +0000
@@ -71,8 +71,8 @@
self.displayController.previewDisplay.screen = {u'size':self.displayController.previewDisplay.geometry()}
self.displayController.previewDisplay.setup()
self.plugin.mediaController.setup_display(self.displayController.previewDisplay, False)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'video_background_replaced'), self.videobackgroundReplaced)
+ QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'video_background_replaced'),
+ self.videobackgroundReplaced)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'mediaitem_media_rebuild'), self.rebuild_players)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'config_screen_changed'), self.displaySetup)
# Allow DnD from the desktop
Follow ups