This commit is contained in:
Andreas Preikschat 2011-06-22 21:23:21 +02:00
commit 25fcdc2600
36 changed files with 32103 additions and 22821 deletions

View File

@ -486,11 +486,11 @@ def build_lyrics_css(item, webkitvers):
# Before 533.3 the webkit-text-fill colour wasn't displayed, only the
# stroke (outline) color. So put stroke layer underneath the main text.
#
# Before 534.4 the webkit-text-stroke was sometimes out of alignment
# Up to 534.3 the webkit-text-stroke was sometimes out of alignment
# with the fill, or normal text. letter-spacing=1 is workaround
# https://bugs.webkit.org/show_bug.cgi?id=44403
#
# Before 534.4 the text-shadow didn't get displayed when
# Up to 534.3 the text-shadow didn't get displayed when
# webkit-text-stroke was used. So use an offset text layer underneath.
# https://bugs.webkit.org/show_bug.cgi?id=19728
if webkitvers >= 533.3:
@ -498,7 +498,7 @@ def build_lyrics_css(item, webkitvers):
else:
outline = build_lyrics_outline_css(theme)
if theme.font_main_shadow:
if theme.font_main_outline and webkitvers < 534.3:
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),
@ -564,7 +564,7 @@ def build_lyrics_format_css(theme, width, height):
theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
left_margin, width, height)
if theme.font_main_outline:
if webkit_version() < 534.3:
if webkit_version() <= 534.3:
lyrics += u' letter-spacing: 1px;'
if theme.font_main_italics:
lyrics += u' font-style:italic; '
@ -588,7 +588,7 @@ def build_lyrics_html(item, webkitvers):
# display:table/display:table-cell are required for each lyric block.
lyrics = u''
theme = item.themedata
if webkitvers < 534.4 and theme and theme.font_main_outline:
if webkitvers <= 534.3 and theme and theme.font_main_outline:
lyrics += u'<div class="lyricstable">' \
u'<div id="lyricsshadow" style="opacity:1" ' \
u'class="lyricscell lyricsshadow"></div></div>'

View File

@ -352,6 +352,7 @@ class ServiceItem(object):
replace an original version.
"""
self._uuid = other._uuid
self.notes = other.notes
def __eq__(self, other):
"""

View File

@ -118,8 +118,8 @@ class Ui_AboutDialog(object):
u'Armin "orangeshirt" K\xf6hler', u'Joshua "milleja46" Miller',
u'Stevan "StevanP" Pettit', u'Mattias "mahfiaz" P\xf5ldaru',
u'Christian "crichter" Richter', u'Philip "Phill" Ridout',
u'Simon "samscudder" Scudder, Jeffrey "whydoubt" Smith',
u'Maikel Stuivenberg Frode "frodus" Woldsund']
u'Simon "samscudder" Scudder', u'Jeffrey "whydoubt" Smith',
u'Maikel Stuivenberg', u'Frode "frodus" Woldsund']
testers = [u'Philip "Phill" Ridout', u'Wesley "wrst" Stout',
u'John "jseagull1" Cegalis (lead)']
packagers = ['Thomas "tabthorpe" Abthorpe (FreeBSD)',

View File

@ -49,7 +49,10 @@ class MainDisplay(QtGui.QGraphicsView):
This is the display screen.
"""
def __init__(self, parent, image_manager, live):
QtGui.QGraphicsView.__init__(self, parent)
if live:
QtGui.QGraphicsView.__init__(self)
else:
QtGui.QGraphicsView.__init__(self, parent)
self.isLive = live
self.image_manager = image_manager
self.screens = ScreenList.get_instance()
@ -62,7 +65,8 @@ class MainDisplay(QtGui.QGraphicsView):
self.firstTime = True
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool |
QtCore.Qt.WindowStaysOnTopHint)
QtCore.Qt.WindowStaysOnTopHint |
QtCore.Qt.X11BypassWindowManagerHint)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
if self.isLive:
QtCore.QObject.connect(Receiver.get_receiver(),

View File

@ -27,6 +27,7 @@
import logging
import os
import sys
from tempfile import gettempdir
from PyQt4 import QtCore, QtGui
@ -291,10 +292,18 @@ class Ui_MainWindow(object):
# i18n add Language Actions
add_actions(self.settingsLanguageMenu, (self.autoLanguageItem, None))
add_actions(self.settingsLanguageMenu, self.languageGroup.actions())
add_actions(self.settingsMenu, (self.settingsPluginListItem,
self.settingsLanguageMenu.menuAction(), None,
self.displayTagItem, self.settingsShortcutsItem,
self.settingsConfigureItem))
# Order things differently in OS X so that Preferences menu item in the
# app menu is correct (this gets picked up automatically by Qt).
if sys.platform == u'darwin':
add_actions(self.settingsMenu, (self.settingsPluginListItem,
self.settingsLanguageMenu.menuAction(), None,
self.settingsConfigureItem, self.settingsShortcutsItem,
self.displayTagItem))
else:
add_actions(self.settingsMenu, (self.settingsPluginListItem,
self.settingsLanguageMenu.menuAction(), None,
self.displayTagItem, self.settingsShortcutsItem,
self.settingsConfigureItem))
add_actions(self.toolsMenu, (self.toolsAddToolItem, None))
add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None))
add_actions(self.toolsMenu, [self.updateThemeImages])
@ -599,7 +608,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
log.info(u'Load Themes')
self.themeManagerContents.loadThemes(True)
# Hide/show the theme combobox on the service manager
Receiver.send_message(u'theme_update_global')
self.serviceManagerContents.themeChange()
# Reset the cursor
Receiver.send_message(u'cursor_normal')

View File

@ -42,6 +42,10 @@ class ServiceNoteForm(QtGui.QDialog):
self.setupUi()
self.retranslateUi()
def exec_(self):
self.textEdit.setFocus()
return QtGui.QDialog.exec_(self)
def setupUi(self):
self.setObjectName(u'serviceNoteEdit')
self.dialogLayout = QtGui.QVBoxLayout(self)

View File

@ -625,9 +625,7 @@ class SlideController(QtGui.QWidget):
label.setMargin(4)
label.setScaledContents(True)
if self.serviceItem.is_command():
image = resize_image(frame[u'image'],
self.parent().renderer.width,
self.parent().renderer.height)
image = QtGui.QImage(frame[u'image'])
else:
# If current slide set background to image
if framenumber == slideno:

View File

@ -190,6 +190,14 @@ class OpenLPWizard(QtGui.QWizard):
self.preWizard()
self.performWizard()
self.postWizard()
else:
self.customPageChanged(pageId)
def customPageChanged(self, pageId):
"""
Called when changing to a page other than the progress page
"""
pass
def onErrorCopyToButtonClicked(self):
"""

View File

@ -46,7 +46,7 @@ class CustomPlugin(Plugin):
log.info(u'Custom Plugin loaded')
def __init__(self, plugin_helpers):
Plugin.__init__(self, u'Custom Slide', plugin_helpers,
Plugin.__init__(self, u'Custom', plugin_helpers,
CustomMediaItem, CustomTab)
self.weight = -5
self.manager = Manager(u'custom', init_schema)

View File

@ -95,6 +95,8 @@ class Controller(object):
if self.is_live:
self.doc.start_presentation()
if self.doc.slidenumber > 1:
if self.doc.slidenumber > self.doc.get_slide_count():
self.doc.slidenumber = self.doc.get_slide_count()
self.doc.goto_slide(self.doc.slidenumber)
def slide(self, slide):
@ -150,6 +152,11 @@ class Controller(object):
if self.doc.slidenumber < self.doc.get_slide_count():
self.doc.slidenumber = self.doc.slidenumber + 1
return
# The "End of slideshow" screen is after the last slide
# Note, we can't just stop on the last slide, since it may
# contain animations that need to be stepped through.
if self.doc.slidenumber > self.doc.get_slide_count():
return
self.activate()
self.doc.next_step()
self.doc.poll_slidenumber(self.is_live)

View File

@ -185,7 +185,14 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
if self.hasSingleVerse:
value = unicode(self.getVerse()[0])
else:
value = self.getVerse()[0].split(u'\n')[1]
log.debug(unicode(self.getVerse()[0]).split(u'\n'))
value = unicode(self.getVerse()[0]).split(u'\n')[1]
if len(value) == 0:
lines = unicode(self.getVerse()[0]).split(u'\n')
index = 2
while index < len(lines) and len(value) == 0:
value = lines[index]
index += 1
if len(value) == 0:
critical_error_message_box(
message=translate('SongsPlugin.EditSongForm',

View File

@ -343,6 +343,13 @@ class SongImportForm(OpenLPWizard):
self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Fixed)
def customPageChanged(self, pageId):
"""
Called when changing to a page other than the progress page
"""
if self.page(pageId) == self.sourcePage:
self.onCurrentIndexChanged(self.formatStack.currentIndex())
def validateCurrentPage(self):
"""
Validate the current page before moving on to the next page.

View File

@ -73,15 +73,21 @@ class EasiSlidesImport(SongImport):
def _parse_song(self, song):
self._success = True
self._add_unicode_attribute(u'title', song.Title1, True)
self._add_unicode_attribute(u'alternate_title', song.Title2)
self._add_unicode_attribute(u'song_number', song.SongNumber)
if hasattr(song, u'Title2'):
self._add_unicode_attribute(u'alternate_title', song.Title2)
if hasattr(song, u'SongNumber'):
self._add_unicode_attribute(u'song_number', song.SongNumber)
if self.song_number == u'0':
self.song_number = u''
self._add_authors(song)
self._add_copyright(song.Copyright)
self._add_copyright(song.LicenceAdmin1)
self._add_copyright(song.LicenceAdmin2)
self._add_unicode_attribute(u'song_book_name', song.BookReference)
if hasattr(song, u'Copyright'):
self._add_copyright(song.Copyright)
if hasattr(song, u'LicenceAdmin1'):
self._add_copyright(song.LicenceAdmin1)
if hasattr(song, u'LicenceAdmin2'):
self._add_copyright(song.LicenceAdmin2)
if hasattr(song, u'BookReference'):
self._add_unicode_attribute(u'song_book_name', song.BookReference)
self._parse_and_add_lyrics(song)
if self._success:
if not self.finish():

View File

@ -467,23 +467,20 @@ class SongMediaItem(MediaManagerItem):
search_results = self.plugin.manager.get_all_objects(Song,
Song.search_title == item.data_string[u'title'],
Song.search_title.asc())
author_list = item.data_string[u'authors'].split(u', ')
editId = 0
add_song = True
if search_results:
for song in search_results:
author_list = item.data_string[u'authors']
same_authors = True
# If the author counts are different, we do not have to do any
# further checking.
if len(song.authors) == len(author_list):
for author in song.authors:
if author.display_name not in author_list:
same_authors = False
else:
same_authors = False
# All authors are the same, so we can stop here and the song
# does not have to be saved.
if same_authors:
for author in song.authors:
if author.display_name in author_list:
author_list = author_list.replace(author.display_name,
u'', 1)
else:
same_authors = False
break
if same_authors and author_list.strip(u', ') == u'':
add_song = False
editId = song.id
break

View File

@ -70,10 +70,12 @@ class OpenLyricsExport(object):
song.title)
xml = openLyrics.song_to_xml(song)
tree = etree.ElementTree(etree.fromstring(xml))
filename = u'%s (%s).xml' % (song.title,
filename = u'%s (%s)' % (song.title,
u', '.join([author.display_name for author in song.authors]))
filename = re.sub(
r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_')
# Ensure the filename isn't too long for some filesystems
filename = u'%s.xml' % filename[0:250 - len(self.save_path)]
# Pass a file object, because lxml does not cope with some special
# characters in the path (see lp:757673 and lp:744337).
tree.write(open(os.path.join(self.save_path, filename), u'w'),

View File

@ -165,8 +165,9 @@ class SongShowPlusImport(SongImport):
elif blockKey == VERSE_ORDER:
verseTag = self.toOpenLPVerseTag(data, True)
if verseTag:
self.sspVerseOrderList.append(unicode(verseTag,
u'cp1252'))
if not isinstance(verseTag, unicode):
verseTag = unicode(verseTag, u'cp1252')
self.sspVerseOrderList.append(verseTag)
elif blockKey == SONG_BOOK:
self.song_book_name = unicode(data, u'cp1252')
elif blockKey == SONG_NUMBER:

View File

@ -527,8 +527,7 @@ class OpenLyrics(object):
book = Book.populate(name=bookname, publisher=u'')
self.manager.save_object(book)
song.song_book_id = book.id
if hasattr(songbook, u'entry'):
song.song_number = self._get(songbook, u'entry')
song.song_number = self._get(songbook, u'entry')
# We only support one song book, so take the first one.
break

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff