forked from openlp/openlp
HEAD
This commit is contained in:
commit
dfbc0ffb35
@ -287,16 +287,16 @@ class GeneralTab(SettingsTab):
|
|||||||
Translate the general settings tab to the currently selected language
|
Translate the general settings tab to the currently selected language
|
||||||
"""
|
"""
|
||||||
self.MonitorGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Monitors'))
|
self.MonitorGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Monitors'))
|
||||||
self.MonitorLabel.setText(
|
self.MonitorLabel.setText(translate('OpenLP.GeneralTab',
|
||||||
translate('OpenLP.GeneralTab', 'Select monitor for output display:'))
|
'Select monitor for output display:'))
|
||||||
self.DisplayOnMonitorCheck.setText(
|
self.DisplayOnMonitorCheck.setText(
|
||||||
translate('OpenLP.GeneralTab', 'Display if a single screen'))
|
translate('OpenLP.GeneralTab', 'Display if a single screen'))
|
||||||
self.StartupGroupBox.setTitle(
|
self.StartupGroupBox.setTitle(
|
||||||
translate('OpenLP.GeneralTab', 'Application Startup'))
|
translate('OpenLP.GeneralTab', 'Application Startup'))
|
||||||
self.WarningCheckBox.setText(
|
self.WarningCheckBox.setText(
|
||||||
translate('OpenLP.GeneralTab', 'Show blank screen warning'))
|
translate('OpenLP.GeneralTab', 'Show blank screen warning'))
|
||||||
self.AutoOpenCheckBox.setText(
|
self.AutoOpenCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||||
translate('OpenLP.GeneralTab', 'Automatically open the last service'))
|
'Automatically open the last service'))
|
||||||
self.ShowSplashCheckBox.setText(
|
self.ShowSplashCheckBox.setText(
|
||||||
translate('OpenLP.GeneralTab', 'Show the splash screen'))
|
translate('OpenLP.GeneralTab', 'Show the splash screen'))
|
||||||
self.SettingsGroupBox.setTitle(
|
self.SettingsGroupBox.setTitle(
|
||||||
@ -379,10 +379,12 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.screens.current[u'size'].x())).toString())
|
QtCore.QVariant(self.screens.current[u'size'].x())).toString())
|
||||||
self.customYValueEdit.setText(settings.value(u'y position',
|
self.customYValueEdit.setText(settings.value(u'y position',
|
||||||
QtCore.QVariant(self.screens.current[u'size'].y())).toString())
|
QtCore.QVariant(self.screens.current[u'size'].y())).toString())
|
||||||
self.customHeightValueEdit.setText(settings.value(u'height',
|
self.customHeightValueEdit.setText(
|
||||||
QtCore.QVariant(self.screens.current[u'size'].height())).toString())
|
settings.value(u'height', QtCore.QVariant(
|
||||||
self.customWidthValueEdit.setText(settings.value(u'width',
|
self.screens.current[u'size'].height())).toString())
|
||||||
QtCore.QVariant(self.screens.current[u'size'].width())).toString())
|
self.customWidthValueEdit.setText(
|
||||||
|
settings.value(u'width', QtCore.QVariant(
|
||||||
|
self.screens.current[u'size'].width())).toString())
|
||||||
else:
|
else:
|
||||||
self.customXValueEdit.setText(
|
self.customXValueEdit.setText(
|
||||||
unicode(self.screens.current[u'size'].x()))
|
unicode(self.screens.current[u'size'].x()))
|
||||||
|
@ -108,8 +108,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.droppos = 0
|
self.droppos = 0
|
||||||
#is a new service and has not been saved
|
#is a new service and has not been saved
|
||||||
self.isNew = True
|
self.isNew = True
|
||||||
self.serviceNoteForm = ServiceNoteForm()
|
self.serviceNoteForm = ServiceNoteForm(self.parent)
|
||||||
self.serviceItemEditForm = ServiceItemEditForm()
|
self.serviceItemEditForm = ServiceItemEditForm(self.parent)
|
||||||
#start with the layout
|
#start with the layout
|
||||||
self.Layout = QtGui.QVBoxLayout(self)
|
self.Layout = QtGui.QVBoxLayout(self)
|
||||||
self.Layout.setSpacing(0)
|
self.Layout.setSpacing(0)
|
||||||
|
@ -253,15 +253,14 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
The theme to delete.
|
The theme to delete.
|
||||||
"""
|
"""
|
||||||
self.themelist.remove(theme)
|
self.themelist.remove(theme)
|
||||||
th = theme + u'.png'
|
thumb = theme + u'.png'
|
||||||
try:
|
try:
|
||||||
os.remove(os.path.join(self.path, th))
|
os.remove(os.path.join(self.path, thumb))
|
||||||
os.remove(os.path.join(self.thumbPath, th))
|
os.remove(os.path.join(self.thumbPath, thumb))
|
||||||
encoding = get_filesystem_encoding()
|
encoding = get_filesystem_encoding()
|
||||||
shutil.rmtree(os.path.join(self.path, theme).encode(encoding))
|
shutil.rmtree(os.path.join(self.path, theme).encode(encoding))
|
||||||
except OSError:
|
except OSError:
|
||||||
#if not present do not worry
|
log.exception(u'Error deleting theme %s', theme)
|
||||||
pass
|
|
||||||
# As we do not reload the themes push out the change
|
# As we do not reload the themes push out the change
|
||||||
# Reaload the list as the internal lists and events need
|
# Reaload the list as the internal lists and events need
|
||||||
# to be triggered
|
# to be triggered
|
||||||
@ -605,19 +604,21 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
if newThemeIndex != -1:
|
if newThemeIndex != -1:
|
||||||
self.serviceComboBox.setCurrentIndex(newThemeIndex)
|
self.serviceComboBox.setCurrentIndex(newThemeIndex)
|
||||||
if self.editingDefault:
|
if self.editingDefault:
|
||||||
|
if self.saveThemeName != name:
|
||||||
newThemeItem = self.ThemeListWidget.findItems(name,
|
newThemeItem = self.ThemeListWidget.findItems(name,
|
||||||
QtCore.Qt.MatchExactly)[0]
|
QtCore.Qt.MatchExactly)[0]
|
||||||
newThemeIndex = self.ThemeListWidget.indexFromItem(
|
newThemeIndex = self.ThemeListWidget.indexFromItem(
|
||||||
newThemeItem).row()
|
newThemeItem).row()
|
||||||
self.global_theme = unicode(
|
self.global_theme = unicode(
|
||||||
self.ThemeListWidget.item(newThemeIndex).text())
|
self.ThemeListWidget.item(newThemeIndex).text())
|
||||||
newName = unicode(translate('ThemeManager', '%s (default)')) % \
|
newName = unicode(translate('ThemeManager',
|
||||||
self.global_theme
|
'%s (default)')) % self.global_theme
|
||||||
self.ThemeListWidget.item(newThemeIndex).setText(newName)
|
self.ThemeListWidget.item(newThemeIndex).setText(newName)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settingsSection + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(self.global_theme))
|
QtCore.QVariant(self.global_theme))
|
||||||
Receiver.send_message(u'theme_update_global', self.global_theme)
|
Receiver.send_message(u'theme_update_global',
|
||||||
|
self.global_theme)
|
||||||
self.editingDefault = False
|
self.editingDefault = False
|
||||||
self.pushThemes()
|
self.pushThemes()
|
||||||
else:
|
else:
|
||||||
|
@ -441,7 +441,8 @@ class Ui_EditSongDialog(object):
|
|||||||
translate('SongsPlugin.EditSongForm', 'Song Book'))
|
translate('SongsPlugin.EditSongForm', 'Song Book'))
|
||||||
self.SongTabWidget.setTabText(
|
self.SongTabWidget.setTabText(
|
||||||
self.SongTabWidget.indexOf(self.AuthorsTab),
|
self.SongTabWidget.indexOf(self.AuthorsTab),
|
||||||
translate('SongsPlugin.EditSongForm', 'Authors, Topics && Song Book'))
|
translate('SongsPlugin.EditSongForm',
|
||||||
|
'Authors, Topics && Song Book'))
|
||||||
self.ThemeGroupBox.setTitle(
|
self.ThemeGroupBox.setTitle(
|
||||||
translate('SongsPlugin.EditSongForm', 'Theme'))
|
translate('SongsPlugin.EditSongForm', 'Theme'))
|
||||||
self.ThemeAddButton.setText(
|
self.ThemeAddButton.setText(
|
||||||
|
@ -291,6 +291,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
'exist, do you want to add them?'),
|
'exist, do you want to add them?'),
|
||||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
||||||
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
|
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
|
||||||
|
if text.find(u' ') == -1:
|
||||||
|
author = Author.populate(first_name=u'', last_name=u'',
|
||||||
|
display_name=text)
|
||||||
|
else:
|
||||||
author = Author.populate(first_name=text.rsplit(u' ', 1)[0],
|
author = Author.populate(first_name=text.rsplit(u' ', 1)[0],
|
||||||
last_name=text.rsplit(u' ', 1)[1], display_name=text)
|
last_name=text.rsplit(u' ', 1)[1], display_name=text)
|
||||||
self.songmanager.save_object(author, False)
|
self.songmanager.save_object(author, False)
|
||||||
@ -582,8 +586,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
unicode(translate('SongsPlugin.EditSongForm',
|
unicode(translate('SongsPlugin.EditSongForm',
|
||||||
'You have not used %s anywhere in the verse '
|
'You have not used %s anywhere in the verse '
|
||||||
'order. Are you sure you want to save the song '
|
'order. Are you sure you want to save the song '
|
||||||
'like this?')) % \
|
'like this?')) % verse_names[count].replace(u':', u' '),
|
||||||
verse_names[count].replace(u':', u' '),
|
|
||||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
|
||||||
if answer == QtGui.QMessageBox.No:
|
if answer == QtGui.QMessageBox.No:
|
||||||
return False
|
return False
|
||||||
@ -627,7 +630,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
'not exist, do you want to add it?'),
|
'not exist, do you want to add it?'),
|
||||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
||||||
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
|
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
|
||||||
book = Book.populate(name=text)
|
book = Book.populate(name=text, publisher=u'')
|
||||||
self.songmanager.save_object(book)
|
self.songmanager.save_object(book)
|
||||||
self.song.book = book
|
self.song.book = book
|
||||||
self.loadBooks()
|
self.loadBooks()
|
||||||
|
@ -350,6 +350,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
|
|||||||
book_id = self._getCurrentItemId(self.BooksListWidget)
|
book_id = self._getCurrentItemId(self.BooksListWidget)
|
||||||
if book_id != -1:
|
if book_id != -1:
|
||||||
book = self.songmanager.get_object(Book, book_id)
|
book = self.songmanager.get_object(Book, book_id)
|
||||||
|
if book.publisher is None:
|
||||||
|
book.publisher = u''
|
||||||
self.bookform.NameEdit.setText(book.name)
|
self.bookform.NameEdit.setText(book.name)
|
||||||
self.bookform.PublisherEdit.setText(book.publisher)
|
self.bookform.PublisherEdit.setText(book.publisher)
|
||||||
# Save the book's name and publisher for the case that they have to
|
# Save the book's name and publisher for the case that they have to
|
||||||
|
@ -169,7 +169,7 @@ class OpenLPSongImport(object):
|
|||||||
else:
|
else:
|
||||||
new_song.authors.append(Author.populate(
|
new_song.authors.append(Author.populate(
|
||||||
display_name=u'Author Unknown'))
|
display_name=u'Author Unknown'))
|
||||||
if song.song_book_id != 0:
|
if song.book:
|
||||||
existing_song_book = self.master_manager.get_object_filtered(
|
existing_song_book = self.master_manager.get_object_filtered(
|
||||||
Book, Book.name == song.book.name)
|
Book, Book.name == song.book.name)
|
||||||
if existing_song_book:
|
if existing_song_book:
|
||||||
|
@ -199,7 +199,8 @@ class OpenSongImport(object):
|
|||||||
if not verses.has_key(versetype):
|
if not verses.has_key(versetype):
|
||||||
verses[versetype] = {}
|
verses[versetype] = {}
|
||||||
if not verses[versetype].has_key(versenum):
|
if not verses[versetype].has_key(versenum):
|
||||||
verses[versetype][versenum] = [] # storage for lines in this verse
|
# storage for lines in this verse
|
||||||
|
verses[versetype][versenum] = []
|
||||||
if not verses_seen.has_key(versetag):
|
if not verses_seen.has_key(versetag):
|
||||||
verses_seen[versetag] = 1
|
verses_seen[versetag] = 1
|
||||||
our_verse_order.append(versetag)
|
our_verse_order.append(versetag)
|
||||||
@ -219,7 +220,8 @@ class OpenSongImport(object):
|
|||||||
versetag = u'%s%s' % (versetype, num)
|
versetag = u'%s%s' % (versetype, num)
|
||||||
lines = u'\n'.join(verses[versetype][num])
|
lines = u'\n'.join(verses[versetype][num])
|
||||||
self.song_import.verses.append([versetag, lines])
|
self.song_import.verses.append([versetag, lines])
|
||||||
versetags[versetag] = 1 # keep track of what we have for error checking later
|
# Keep track of what we have for error checking later
|
||||||
|
versetags[versetag] = 1
|
||||||
# now figure out the presentation order
|
# now figure out the presentation order
|
||||||
if u'presentation' in fields and root.presentation != u'':
|
if u'presentation' in fields and root.presentation != u'':
|
||||||
order = unicode(root.presentation)
|
order = unicode(root.presentation)
|
||||||
|
Loading…
Reference in New Issue
Block a user