forked from openlp/openlp
Fix merge conflict
This commit is contained in:
commit
60b0120e56
@ -24,7 +24,6 @@
|
||||
###############################################################################
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
||||
ts_file = u"""<?xml version="1.0" encoding="utf-8"?>
|
||||
|
@ -28,7 +28,7 @@ import os
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib.toolbar import *
|
||||
from openlp.core.lib import translate, contextMenuAction, contextMenuSeparator
|
||||
from openlp.core.lib import contextMenuAction, contextMenuSeparator
|
||||
from serviceitem import ServiceItem
|
||||
|
||||
class MediaManagerItem(QtGui.QWidget):
|
||||
@ -36,7 +36,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
MediaManagerItem is a helper widget for plugins.
|
||||
|
||||
None of the following *need* to be used, feel free to override
|
||||
them cmopletely in your plugin's implementation. Alternatively,
|
||||
them completely in your plugin's implementation. Alternatively,
|
||||
call them from your plugin before or after you've done extra
|
||||
things that you need to.
|
||||
|
||||
@ -118,7 +118,6 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.requiredIcons()
|
||||
self.setupUi()
|
||||
self.retranslateUi()
|
||||
#self.initialise()
|
||||
|
||||
def requiredIcons(self):
|
||||
"""
|
||||
|
@ -201,7 +201,7 @@ class Renderer(object):
|
||||
#if we have more text add up to 10 spaces on the front.
|
||||
if len(line) > 0 and self._theme.font_main_indentation > 0:
|
||||
line = u'%s%s' % \
|
||||
(u' '[:self._theme.font_main_indentation], line)
|
||||
(u' '[:int(self._theme.font_main_indentation)], line)
|
||||
#Text fits in a line now
|
||||
for count, line in enumerate(split_lines):
|
||||
page.append(line)
|
||||
|
@ -65,6 +65,7 @@ class RenderManager(object):
|
||||
self.service_theme = u''
|
||||
self.global_style = u''
|
||||
self.override_background = None
|
||||
self.themedata = None
|
||||
self.save_bg_frame = None
|
||||
self.override_background_changed = False
|
||||
|
||||
@ -130,7 +131,7 @@ class RenderManager(object):
|
||||
self.theme = self.service_theme
|
||||
else:
|
||||
self.theme = self.global_theme
|
||||
if self.theme != self.renderer.theme_name:
|
||||
if self.theme != self.renderer.theme_name or self.themedata is None:
|
||||
log.debug(u'theme is now %s', self.theme)
|
||||
self.themedata = self.theme_manager.getThemeData(self.theme)
|
||||
self.calculate_default(
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class AboutForm(QtGui.QDialog):
|
||||
"""
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
import logging
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class AlertForm(QtGui.QDialog):
|
||||
global log
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate
|
||||
from openlp.core.lib import SettingsTab
|
||||
|
||||
class AlertsTab(SettingsTab):
|
||||
"""
|
||||
|
@ -23,7 +23,7 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class Ui_AmendThemeDialog(object):
|
||||
def setupUi(self, AmendThemeDialog):
|
||||
|
@ -28,7 +28,7 @@ import os.path
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import ThemeXML, file_to_xml, translate
|
||||
from openlp.core.lib import ThemeXML, file_to_xml
|
||||
from amendthemedialog import Ui_AmendThemeDialog
|
||||
|
||||
log = logging.getLogger(u'AmendThemeForm')
|
||||
@ -678,6 +678,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
log.debug(u'Page Length area height %s , metrics %s , lines %s' %
|
||||
(int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length ))
|
||||
self.FontMainLinesPageLabel.setText(
|
||||
self.trUtf8(u'Slide Height is %s rows') % page_length)
|
||||
self.trUtf8((u'Slide Height is %s rows') % page_length))
|
||||
frame = self.thememanager.generateImage(theme)
|
||||
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate, str_to_bool
|
||||
from openlp.core.lib import SettingsTab, str_to_bool
|
||||
|
||||
class GeneralTab(SettingsTab):
|
||||
"""
|
||||
|
@ -30,9 +30,8 @@ from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.ui import AboutForm, SettingsForm, AlertForm, \
|
||||
ServiceManager, ThemeManager, MainDisplay, SlideController, \
|
||||
PluginForm, MediaDockManager
|
||||
from openlp.core.lib import translate, RenderManager, PluginConfig, \
|
||||
OpenLPDockWidget, SettingsManager, PluginManager, Receiver, \
|
||||
buildIcon, str_to_bool
|
||||
from openlp.core.lib import RenderManager, PluginConfig, buildIcon, \
|
||||
OpenLPDockWidget, SettingsManager, PluginManager, Receiver, str_to_bool
|
||||
from openlp.core.utils import check_latest_version
|
||||
|
||||
media_manager_style = """
|
||||
|
@ -23,7 +23,6 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate
|
||||
|
||||
class Ui_PluginViewDialog(object):
|
||||
def setupUi(self, PluginViewDialog):
|
||||
|
@ -30,7 +30,7 @@ import zipfile
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
|
||||
translate, ServiceType, contextMenuAction, contextMenuSeparator, Receiver
|
||||
ServiceType, contextMenuAction, contextMenuSeparator, Receiver
|
||||
|
||||
class ServiceManagerList(QtGui.QTreeWidget):
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate
|
||||
|
||||
class Ui_SettingsDialog(object):
|
||||
def setupUi(self, SettingsDialog):
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
import time
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType
|
||||
from openlp.core.lib import OpenLPToolbar, Receiver, ServiceType
|
||||
|
||||
label_stylesheet = u"""
|
||||
QTableWidget::item:selected
|
||||
@ -87,10 +87,13 @@ class SlideController(QtGui.QWidget):
|
||||
self.isLive = isLive
|
||||
self.parent = parent
|
||||
self.image_list = [
|
||||
self.trUtf8(u'Start Loop'),
|
||||
self.trUtf8(u'Stop Loop'),
|
||||
#self.trUtf8(u'Loop Separator'),
|
||||
self.trUtf8(u'Image SpinBox')
|
||||
u'Start Loop',
|
||||
u'Stop Loop',
|
||||
u'Loop Separator',
|
||||
u'Image SpinBox'
|
||||
]
|
||||
self.song_list = [
|
||||
u'Edit Song',
|
||||
]
|
||||
self.timer_id = 0
|
||||
self.commandItem = None
|
||||
@ -140,17 +143,17 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.setSizePolicy(sizeToolbarPolicy)
|
||||
if self.isLive:
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'First Slide'), u':/slides/slide_first.png',
|
||||
u'First Slide', u':/slides/slide_first.png',
|
||||
self.trUtf8(u'Move to first'), self.onSlideSelectedFirst)
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'Previous Slide'), u':/slides/slide_previous.png',
|
||||
u'Previous Slide', u':/slides/slide_previous.png',
|
||||
self.trUtf8(u'Move to previous'), self.onSlideSelectedPrevious)
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'Next Slide'), u':/slides/slide_next.png',
|
||||
u'Next Slide', u':/slides/slide_next.png',
|
||||
self.trUtf8(u'Move to next'), self.onSlideSelectedNext)
|
||||
if self.isLive:
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'Last Slide'), u':/slides/slide_last.png',
|
||||
u'Last Slide', u':/slides/slide_last.png',
|
||||
self.trUtf8(u'Move to last'), self.onSlideSelectedLast)
|
||||
if self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
@ -159,19 +162,23 @@ class SlideController(QtGui.QWidget):
|
||||
if not self.isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'Go Live'), u':/system/system_live.png',
|
||||
u'Go Live', u':/system/system_live.png',
|
||||
self.trUtf8(u'Move to live'), self.onGoLive)
|
||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||
self.Toolbar.addToolbarButton(
|
||||
u'Edit Song', u':songs/song_edit.png',
|
||||
self.trUtf8(u'Edit and re-preview Song'), self.onEditSong)
|
||||
if isLive:
|
||||
self.Toolbar.addToolbarSeparator(u'Loop Separator')
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'Start Loop'), u':/media/media_time.png',
|
||||
u'Start Loop', u':/media/media_time.png',
|
||||
self.trUtf8(u'Start continuous loop'), self.onStartLoop)
|
||||
self.Toolbar.addToolbarButton(
|
||||
self.trUtf8(u'Stop Loop'), u':/media/media_stop.png',
|
||||
u'Stop Loop', u':/media/media_stop.png',
|
||||
self.trUtf8(u'Stop continuous loop'), self.onStopLoop)
|
||||
self.DelaySpinBox = QtGui.QSpinBox()
|
||||
self.Toolbar.addToolbarWidget(
|
||||
self.trUtf8(u'Image SpinBox'), self.DelaySpinBox)
|
||||
u'Image SpinBox', self.DelaySpinBox)
|
||||
self.DelaySpinBox.setSuffix(self.trUtf8(u's'))
|
||||
|
||||
self.ControllerLayout.addWidget(self.Toolbar)
|
||||
@ -216,6 +223,8 @@ class SlideController(QtGui.QWidget):
|
||||
Receiver().send_message(u'request_spin_delay')
|
||||
if isLive:
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
else:
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_list)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'slidecontroller_first'), self.onSlideSelectedFirst)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
@ -257,7 +266,10 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Allows the Preview toolbar to be customised
|
||||
"""
|
||||
pass
|
||||
if item.name == u'Songs':
|
||||
self.Toolbar.makeWidgetsVisible(self.song_list)
|
||||
else:
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_list)
|
||||
|
||||
def addServiceItem(self, item):
|
||||
"""
|
||||
@ -474,6 +486,9 @@ class SlideController(QtGui.QWidget):
|
||||
if event.timerId() == self.timer_id:
|
||||
self.onSlideSelectedNext()
|
||||
|
||||
def onEditSong(self):
|
||||
Receiver().send_message(u'edit_song')
|
||||
|
||||
def onGoLive(self):
|
||||
"""
|
||||
If preview copy slide item to live
|
||||
|
@ -23,7 +23,7 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class SplashScreen(object):
|
||||
def __init__(self, version):
|
||||
|
@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.ui import AmendThemeForm
|
||||
from openlp.core.theme import Theme
|
||||
from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, translate, \
|
||||
from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, \
|
||||
str_to_bool, file_to_xml, buildIcon, Receiver, contextMenuAction, \
|
||||
contextMenuSeparator
|
||||
from openlp.core.utils import ConfigHelper
|
||||
@ -371,7 +371,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
|
||||
newtheme.add_font(unicode(theme.FontName),
|
||||
unicode(theme.FontColor.name()),
|
||||
unicode(theme.FontProportion * 2), u'False')
|
||||
unicode(theme.FontProportion * 3), u'False')
|
||||
newtheme.add_font(unicode(theme.FontName),
|
||||
unicode(theme.FontColor.name()),
|
||||
unicode(12), u'False', u'footer')
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate, Receiver
|
||||
from openlp.core.lib import SettingsTab, Receiver
|
||||
|
||||
class ThemesTab(SettingsTab):
|
||||
"""
|
||||
|
@ -27,7 +27,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, Receiver, translate, str_to_bool, buildIcon
|
||||
from openlp.core.lib import Plugin, Receiver, str_to_bool, buildIcon
|
||||
from openlp.plugins.audit.lib import AuditManager
|
||||
from openlp.plugins.audit.forms import AuditDetailForm, AuditDeleteForm
|
||||
from openlp.plugins.audit.lib.models import AuditItem
|
||||
|
@ -27,8 +27,6 @@ from datetime import date
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from auditdeletedialog import Ui_AuditDeleteDialog
|
||||
from openlp.core.lib import translate
|
||||
#from openlp.plugins.audit.lib import AuditManager
|
||||
|
||||
class AuditDeleteForm(QtGui.QDialog, Ui_AuditDeleteDialog):
|
||||
"""
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, translate, buildIcon
|
||||
from openlp.core.lib import Plugin, buildIcon
|
||||
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
|
||||
|
||||
class BiblePlugin(Plugin):
|
||||
|
@ -29,8 +29,7 @@ import os.path
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from bibleimportdialog import Ui_BibleImportDialog
|
||||
from openlp.core.lib import Receiver, translate
|
||||
|
||||
from openlp.core.lib import Receiver
|
||||
|
||||
class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog):
|
||||
global log
|
||||
|
@ -158,6 +158,11 @@ class BibleDBImpl(BibleCommon):
|
||||
def get_bible_text(self, bookname, chapter, sverse, everse):
|
||||
log.debug(u'get_bible_text %s, %s, %s, %s', bookname, chapter, sverse,
|
||||
everse)
|
||||
#Look up book name or abbreviation
|
||||
book = self.get_bible_book(bookname)
|
||||
if book is not None:
|
||||
bookname = book.name
|
||||
log.debug(u'bookname corrected to %s' % bookname)
|
||||
verses = self.session.query(Verse).join(Book).filter(
|
||||
Book.name == bookname).filter(Verse.chapter == chapter).filter(
|
||||
Verse.verse>=sverse).filter(Verse.verse<=everse).order_by(
|
||||
|
@ -30,7 +30,7 @@ import codecs
|
||||
|
||||
from PyQt4 import QtCore
|
||||
|
||||
from openlp.core.lib import translate, Receiver
|
||||
from openlp.core.lib import Receiver
|
||||
|
||||
class BibleOSISImpl():
|
||||
"""
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate, str_to_bool, Receiver
|
||||
from openlp.core.lib import str_to_bool, Receiver
|
||||
from openlp.core.lib import SettingsTab
|
||||
|
||||
class BiblesTab(SettingsTab):
|
||||
|
@ -25,8 +25,6 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
from openlp.core.lib import translate
|
||||
|
||||
from bibleOSISimpl import BibleOSISImpl
|
||||
from bibleCSVimpl import BibleCSVImpl
|
||||
from bibleDBimpl import BibleDBImpl
|
||||
|
@ -27,8 +27,8 @@ import time
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate, MediaManagerItem, Receiver, \
|
||||
BaseListWithDnD, str_to_bool
|
||||
from openlp.core.lib import MediaManagerItem, Receiver, str_to_bool, \
|
||||
BaseListWithDnD
|
||||
from openlp.plugins.bibles.forms import BibleImportForm
|
||||
from openlp.plugins.bibles.lib.manager import BibleMode
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class Ui_customEditDialog(object):
|
||||
def setupUi(self, customEditDialog):
|
||||
|
@ -25,7 +25,7 @@
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from editcustomdialog import Ui_customEditDialog
|
||||
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate
|
||||
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver
|
||||
from openlp.plugins.custom.lib.models import CustomSlide
|
||||
|
||||
class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
|
@ -24,15 +24,15 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate, Receiver
|
||||
from openlp.core.lib import SettingsTab, Receiver
|
||||
|
||||
class ImageTab(SettingsTab):
|
||||
"""
|
||||
ImageTab is the Image settings tab in the settings dialog.
|
||||
"""
|
||||
def __init__(self):
|
||||
#SettingsTab.__init__(self, self.trUtf8(u'Images'), u'Image')
|
||||
SettingsTab.__init__(self, u'Images', u'Image')
|
||||
#SettingsTab.__init__(self, self.trUtf8(u'Images'), u'Images')
|
||||
SettingsTab.__init__(self, u'Images', u'Images')
|
||||
|
||||
def setupUi(self):
|
||||
self.setObjectName(u'ImageTab')
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
import os
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, buildIcon, translate
|
||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, buildIcon
|
||||
|
||||
# We have to explicitly create separate classes for each plugin
|
||||
# in order for DnD to the Service manager to work correctly.
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, str_to_bool, translate
|
||||
from openlp.core.lib import SettingsTab, str_to_bool
|
||||
|
||||
class MediaTab(SettingsTab):
|
||||
"""
|
||||
|
@ -27,7 +27,7 @@ import os
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import MediaManagerItem, translate, BaseListWithDnD
|
||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD
|
||||
from openlp.plugins.presentations.lib import MessageListener
|
||||
|
||||
# We have to explicitly create separate classes for each plugin
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate
|
||||
from openlp.core.lib import SettingsTab
|
||||
|
||||
class PresentationTab(SettingsTab):
|
||||
"""
|
||||
|
@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, translate
|
||||
from openlp.core.lib import SettingsTab
|
||||
|
||||
class RemoteTab(SettingsTab):
|
||||
"""
|
||||
|
@ -23,7 +23,6 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate
|
||||
|
||||
class Ui_AuthorsDialog(object):
|
||||
def setupUi(self, AuthorsDialog):
|
||||
|
@ -23,7 +23,7 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtGui, QtCore
|
||||
from openlp.core.lib import translate
|
||||
|
||||
from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog
|
||||
|
||||
class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class Ui_EditSongDialog(object):
|
||||
def setupUi(self, EditSongDialog):
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate
|
||||
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver
|
||||
from openlp.plugins.songs.forms import EditVerseForm
|
||||
from openlp.plugins.songs.lib.models import Song
|
||||
from editsongdialog import Ui_EditSongDialog
|
||||
@ -410,6 +410,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.songmanager.save_song(self.song)
|
||||
if self.title_change:
|
||||
Receiver().send_message(u'load_song_list')
|
||||
Receiver().send_message(u'preview_song')
|
||||
self.close()
|
||||
|
||||
def processLyrics(self):
|
||||
|
@ -23,7 +23,6 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate
|
||||
|
||||
class Ui_EditVerseDialog(object):
|
||||
def setupUi(self, EditVerseDialog):
|
||||
|
@ -22,7 +22,8 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.plugins.songs.forms.openlpexportdialog import Ui_OpenLPExportDialog
|
||||
|
||||
class OpenLPExportForm(QtGui.QDialog, Ui_OpenLPExportDialog):
|
||||
|
@ -22,7 +22,7 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4 import QtGui
|
||||
from openlp.plugins.songs.forms.openlpimportdialog import Ui_OpenLPImportDialog
|
||||
|
||||
class OpenLPImportForm(QtGui.QDialog, Ui_OpenLPImportDialog):
|
||||
@ -30,4 +30,3 @@ class OpenLPImportForm(QtGui.QDialog, Ui_OpenLPImportDialog):
|
||||
def __init__(self, parent=None):
|
||||
QtGui.QDialog.__init__(self, parent)
|
||||
self.setupUi(self)
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4 import QtGui
|
||||
from openlp.plugins.songs.forms.opensongexportdialog import Ui_OpenSongExportDialog
|
||||
|
||||
class OpenSongExportForm(QtGui.QDialog, Ui_OpenSongExportDialog):
|
||||
|
@ -22,7 +22,7 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4 import QtGui
|
||||
from openlp.plugins.songs.forms.opensongimportdialog import Ui_OpenSongImportDialog
|
||||
|
||||
class OpenSongImportForm(QtGui.QDialog, Ui_OpenSongImportDialog):
|
||||
|
@ -23,7 +23,6 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate
|
||||
|
||||
class Ui_SongBookDialog(object):
|
||||
def setupUi(self, SongBookDialog):
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog
|
||||
|
||||
class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import translate, buildIcon
|
||||
from openlp.core.lib import buildIcon
|
||||
|
||||
class Ui_SongMaintenanceDialog(object):
|
||||
def setupUi(self, SongMaintenanceDialog):
|
||||
|
@ -18,7 +18,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from PyQt4 import QtGui, QtCore
|
||||
from openlp.core.lib import translate
|
||||
|
||||
from openlp.plugins.songs.lib.classes import Author, Book, Topic
|
||||
from songmaintenancedialog import Ui_SongMaintenanceDialog
|
||||
from authorsform import AuthorsForm
|
||||
|
@ -23,7 +23,6 @@
|
||||
###############################################################################
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from openlp.core.lib import translate
|
||||
|
||||
class Ui_TopicsDialog(object):
|
||||
def setupUi(self, TopicsDialog):
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog
|
||||
|
||||
class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import MediaManagerItem, translate, SongXMLParser, \
|
||||
from openlp.core.lib import MediaManagerItem, SongXMLParser, \
|
||||
BaseListWithDnD, Receiver, str_to_bool
|
||||
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm
|
||||
|
||||
@ -55,6 +55,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
self.edit_song_form = EditSongForm(self.parent.songmanager, self)
|
||||
self.song_maintenance_form = SongMaintenanceForm(
|
||||
self.parent.songmanager, self)
|
||||
self.fromPreview = None
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
@ -121,6 +122,10 @@ class SongMediaItem(MediaManagerItem):
|
||||
QtCore.SIGNAL(u'load_song_list'), self.onSearchTextButtonClick)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'config_updated'), self.configUpdated)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'edit_song'), self.onEventEditSong)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'proview_song'), self.onPreviewClick)
|
||||
|
||||
def configUpdated(self):
|
||||
self.searchAsYouType = str_to_bool(
|
||||
@ -168,19 +173,23 @@ class SongMediaItem(MediaManagerItem):
|
||||
if author_list != u'':
|
||||
author_list = author_list + u', '
|
||||
author_list = author_list + author.display_name
|
||||
song_detail = unicode(u'%s (%s)' % \
|
||||
(unicode(song.title), unicode(author_list)))
|
||||
song_detail = unicode(self.trUtf8(u'%s (%s)' % \
|
||||
(unicode(song.title), unicode(author_list))))
|
||||
song_name = QtGui.QListWidgetItem(song_detail)
|
||||
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
|
||||
self.ListView.addItem(song_name)
|
||||
if song.id == self.fromPreview:
|
||||
self.fromPreview = 0
|
||||
self.ListView.setCurrentItem(song_name)
|
||||
self.onPreviewClick()
|
||||
|
||||
def displayResultsAuthor(self, searchresults):
|
||||
log.debug(u'display results Author')
|
||||
self.ListView.clear()
|
||||
for author in searchresults:
|
||||
for song in author.songs:
|
||||
song_detail = unicode(u'%s (%s)' % \
|
||||
(unicode(author.display_name), unicode(song.title)))
|
||||
song_detail = unicode(self.trUtf8(u'%s (%s)' % \
|
||||
(unicode(author.display_name), unicode(song.title))))
|
||||
song_name = QtGui.QListWidgetItem(song_detail)
|
||||
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
|
||||
self.ListView.addItem(song_name)
|
||||
@ -218,13 +227,19 @@ class SongMediaItem(MediaManagerItem):
|
||||
def onSongMaintenanceClick(self):
|
||||
self.song_maintenance_form.exec_()
|
||||
|
||||
def onEditClick(self):
|
||||
def onEditClick(self, preview=False):
|
||||
item = self.ListView.currentItem()
|
||||
if item is not None:
|
||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.fromPreview = 0
|
||||
if preview:
|
||||
self.fromPreview = item_id
|
||||
self.edit_song_form.loadSong(item_id)
|
||||
self.edit_song_form.exec_()
|
||||
|
||||
def onEventEditSong (self):
|
||||
self.onEditClick(True)
|
||||
|
||||
def onDeleteClick(self):
|
||||
item = self.ListView.currentItem()
|
||||
if item is not None:
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import SettingsTab, str_to_bool, translate
|
||||
from openlp.core.lib import SettingsTab, str_to_bool
|
||||
|
||||
class SongsTab(SettingsTab):
|
||||
"""
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Plugin, translate, buildIcon
|
||||
from openlp.core.lib import Plugin, buildIcon
|
||||
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab
|
||||
from openlp.plugins.songs.forms import OpenLPImportForm, OpenSongExportForm, \
|
||||
OpenSongImportForm, OpenLPExportForm
|
||||
|
@ -28,8 +28,7 @@ import logging
|
||||
import time
|
||||
import subprocess
|
||||
import codecs
|
||||
import sys
|
||||
from datetime import date
|
||||
|
||||
if os.name == u'nt':
|
||||
import win32api
|
||||
import win32con
|
||||
|
Loading…
Reference in New Issue
Block a user