forked from openlp/openlp
renderer merge
This commit is contained in:
commit
97d088f0ac
|
@ -48,7 +48,6 @@ QMainWindow::separator
|
||||||
|
|
||||||
QDockWidget::title
|
QDockWidget::title
|
||||||
{
|
{
|
||||||
/*background: palette(dark);*/
|
|
||||||
border: 1px solid palette(dark);
|
border: 1px solid palette(dark);
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
|
|
|
@ -312,7 +312,8 @@ def build_html(item, screen, alert):
|
||||||
build_alert(alert, width),
|
build_alert(alert, width),
|
||||||
build_footer(item),
|
build_footer(item),
|
||||||
build_lyrics(item),
|
build_lyrics(item),
|
||||||
u'true' if theme and theme.display_slideTransition else u'false',
|
u'true' if theme and theme.display_slideTransition \
|
||||||
|
else u'false',
|
||||||
image)
|
image)
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ class RenderManager(object):
|
||||||
self.display = MainDisplay(self, self.screens, False)
|
self.display = MainDisplay(self, self.screens, False)
|
||||||
self.display.setup()
|
self.display.setup()
|
||||||
self.renderer.bg_frame = None
|
self.renderer.bg_frame = None
|
||||||
|
self.themedata = None
|
||||||
|
|
||||||
def set_global_theme(self, global_theme, theme_level=ThemeLevel.Global):
|
def set_global_theme(self, global_theme, theme_level=ThemeLevel.Global):
|
||||||
"""
|
"""
|
||||||
|
@ -191,8 +192,6 @@ class RenderManager(object):
|
||||||
footer.append(u'Amazing Grace (John Newton)' )
|
footer.append(u'Amazing Grace (John Newton)' )
|
||||||
footer.append(u'Public Domain')
|
footer.append(u'Public Domain')
|
||||||
footer.append(u'CCLI 123456')
|
footer.append(u'CCLI 123456')
|
||||||
# Previews do not need the transition switched on!
|
|
||||||
themedata.display_slideTransition = False
|
|
||||||
# build a service item to generate preview
|
# build a service item to generate preview
|
||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
serviceItem.theme = themedata
|
serviceItem.theme = themedata
|
||||||
|
|
|
@ -177,6 +177,7 @@ class ServiceItem(object):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
log.error(u'Invalid value renderer :%s' % self.service_item_type)
|
||||||
|
self.title = clean_tags(self.title)
|
||||||
self.foot_text = None
|
self.foot_text = None
|
||||||
if self.raw_footer:
|
if self.raw_footer:
|
||||||
for foot in self.raw_footer:
|
for foot in self.raw_footer:
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
# more details. #
|
# more details. #
|
||||||
# #
|
# #
|
||||||
# You should have received a copy of the GNU General Pu__init__.pyblic License along #
|
# You should have received a copy of the GNU General Public License along #
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -390,7 +390,6 @@ class GeneralTab(SettingsTab):
|
||||||
unicode(self.screens.current[u'size'].width()))
|
unicode(self.screens.current[u'size'].width()))
|
||||||
self.overrideCheckBox.setChecked(settings.value(u'override position',
|
self.overrideCheckBox.setChecked(settings.value(u'override position',
|
||||||
QtCore.QVariant(False)).toBool())
|
QtCore.QVariant(False)).toBool())
|
||||||
if self.overrideCheckBox.isChecked():
|
|
||||||
self.customXValueEdit.setText(settings.value(u'x position',
|
self.customXValueEdit.setText(settings.value(u'x position',
|
||||||
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',
|
||||||
|
@ -401,15 +400,6 @@ class GeneralTab(SettingsTab):
|
||||||
self.customWidthValueEdit.setText(
|
self.customWidthValueEdit.setText(
|
||||||
settings.value(u'width', QtCore.QVariant(
|
settings.value(u'width', QtCore.QVariant(
|
||||||
self.screens.current[u'size'].width())).toString())
|
self.screens.current[u'size'].width())).toString())
|
||||||
else:
|
|
||||||
self.customXValueEdit.setText(
|
|
||||||
unicode(self.screens.current[u'size'].x()))
|
|
||||||
self.customYValueEdit.setText(
|
|
||||||
unicode(self.screens.current[u'size'].y()))
|
|
||||||
self.customHeightValueEdit.setText(
|
|
||||||
unicode(self.screens.current[u'size'].height()))
|
|
||||||
self.customWidthValueEdit.setText(
|
|
||||||
unicode(self.screens.current[u'size'].width()))
|
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
|
@ -438,8 +428,6 @@ class GeneralTab(SettingsTab):
|
||||||
QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
|
QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
|
||||||
settings.setValue(u'loop delay',
|
settings.setValue(u'loop delay',
|
||||||
QtCore.QVariant(self.timeoutSpinBox.value()))
|
QtCore.QVariant(self.timeoutSpinBox.value()))
|
||||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
|
||||||
self.timeoutSpinBox.value())
|
|
||||||
settings.setValue(u'ccli number',
|
settings.setValue(u'ccli number',
|
||||||
QtCore.QVariant(self.numberEdit.displayText()))
|
QtCore.QVariant(self.numberEdit.displayText()))
|
||||||
settings.setValue(u'songselect username',
|
settings.setValue(u'songselect username',
|
||||||
|
@ -459,17 +447,18 @@ class GeneralTab(SettingsTab):
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.screens.display = self.displayOnMonitorCheck.isChecked()
|
self.screens.display = self.displayOnMonitorCheck.isChecked()
|
||||||
# Monitor Number has changed.
|
# Monitor Number has changed.
|
||||||
|
postUpdate = False
|
||||||
if self.screens.monitor_number != self.monitorNumber:
|
if self.screens.monitor_number != self.monitorNumber:
|
||||||
self.screens.monitor_number = self.monitorNumber
|
self.screens.monitor_number = self.monitorNumber
|
||||||
self.screens.set_current_display(self.monitorNumber)
|
self.screens.set_current_display(self.monitorNumber)
|
||||||
Receiver.send_message(u'config_screen_changed')
|
postUpdate = True
|
||||||
Receiver.send_message(u'config_updated')
|
|
||||||
# On save update the screens as well
|
# On save update the screens as well
|
||||||
self.postSetUp()
|
self.postSetUp(postUpdate)
|
||||||
|
|
||||||
def postSetUp(self):
|
def postSetUp(self, postUpdate=False):
|
||||||
"""
|
"""
|
||||||
Apply settings after settings tab has loaded
|
Apply settings after settings tab has loaded and most of the
|
||||||
|
system so must be delayed
|
||||||
"""
|
"""
|
||||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
||||||
self.timeoutSpinBox.value())
|
self.timeoutSpinBox.value())
|
||||||
|
@ -482,10 +471,12 @@ class GeneralTab(SettingsTab):
|
||||||
int(self.customHeightValueEdit.text()))
|
int(self.customHeightValueEdit.text()))
|
||||||
if self.overrideCheckBox.isChecked():
|
if self.overrideCheckBox.isChecked():
|
||||||
self.screens.set_override_display()
|
self.screens.set_override_display()
|
||||||
Receiver.send_message(u'config_screen_changed')
|
|
||||||
else:
|
else:
|
||||||
self.screens.reset_current_display()
|
self.screens.reset_current_display()
|
||||||
|
# Order is important so be careful if you change
|
||||||
|
if self.overrideChanged or postUpdate:
|
||||||
Receiver.send_message(u'config_screen_changed')
|
Receiver.send_message(u'config_screen_changed')
|
||||||
|
Receiver.send_message(u'config_updated')
|
||||||
self.overrideChanged = False
|
self.overrideChanged = False
|
||||||
|
|
||||||
def onOverrideCheckBoxToggled(self, checked):
|
def onOverrideCheckBoxToggled(self, checked):
|
||||||
|
|
|
@ -80,6 +80,7 @@ class DisplayWidget(QtGui.QGraphicsView):
|
||||||
event.accept()
|
event.accept()
|
||||||
elif event.key() == QtCore.Qt.Key_Escape:
|
elif event.key() == QtCore.Qt.Key_Escape:
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
|
self.videoStop()
|
||||||
event.accept()
|
event.accept()
|
||||||
event.ignore()
|
event.ignore()
|
||||||
else:
|
else:
|
||||||
|
@ -103,8 +104,8 @@ class MainDisplay(DisplayWidget):
|
||||||
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
log.debug(u'Setup %s for %s ' % (
|
log.debug(u'Setup live = %s for %s ' % (self.isLive,
|
||||||
self.screens, self.screens.monitor_number))
|
self.screens.monitor_number))
|
||||||
self.screen = self.screens.current
|
self.screen = self.screens.current
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
self.setGeometry(self.screen[u'size'])
|
self.setGeometry(self.screen[u'size'])
|
||||||
|
@ -205,6 +206,9 @@ class MainDisplay(DisplayWidget):
|
||||||
self.screen[u'size'].height())
|
self.screen[u'size'].height())
|
||||||
self.resetVideo()
|
self.resetVideo()
|
||||||
self.displayImage(image)
|
self.displayImage(image)
|
||||||
|
# show screen
|
||||||
|
if self.isLive:
|
||||||
|
self.setVisible(True)
|
||||||
|
|
||||||
def displayImage(self, image):
|
def displayImage(self, image):
|
||||||
"""
|
"""
|
||||||
|
@ -238,6 +242,9 @@ class MainDisplay(DisplayWidget):
|
||||||
"""
|
"""
|
||||||
log.debug(u'videoPlay')
|
log.debug(u'videoPlay')
|
||||||
self.frame.evaluateJavaScript(u'show_video("play");')
|
self.frame.evaluateJavaScript(u'show_video("play");')
|
||||||
|
# show screen
|
||||||
|
if self.isLive:
|
||||||
|
self.setVisible(True)
|
||||||
|
|
||||||
def videoPause(self):
|
def videoPause(self):
|
||||||
"""
|
"""
|
||||||
|
@ -283,11 +290,13 @@ class MainDisplay(DisplayWidget):
|
||||||
"""
|
"""
|
||||||
Generates a preview of the image displayed.
|
Generates a preview of the image displayed.
|
||||||
"""
|
"""
|
||||||
log.debug(u'preview')
|
log.debug(u'preview for %s', self.isLive)
|
||||||
# Wait for the fade to finish before geting the preview.
|
# Wait for the fade to finish before geting the preview.
|
||||||
# Important otherwise preview will have incorrect text if at all !
|
# Important otherwise preview will have incorrect text if at all !
|
||||||
if self.serviceItem.themedata.display_slideTransition:
|
if self.serviceItem.themedata and \
|
||||||
while self.frame.evaluateJavaScript(u'show_text_complete()').toString() == u'false':
|
self.serviceItem.themedata.display_slideTransition:
|
||||||
|
while self.frame.evaluateJavaScript(u'show_text_complete()') \
|
||||||
|
.toString() == u'false':
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
# Wait for the webview to update before geting the preview.
|
# Wait for the webview to update before geting the preview.
|
||||||
# Important otherwise first preview will miss the background !
|
# Important otherwise first preview will miss the background !
|
||||||
|
@ -300,6 +309,9 @@ class MainDisplay(DisplayWidget):
|
||||||
painter.setRenderHint(QtGui.QPainter.Antialiasing)
|
painter.setRenderHint(QtGui.QPainter.Antialiasing)
|
||||||
self.frame.render(painter)
|
self.frame.render(painter)
|
||||||
painter.end()
|
painter.end()
|
||||||
|
# Make display show up if in single screen mode
|
||||||
|
if self.isLive:
|
||||||
|
self.setVisible(True)
|
||||||
# save preview for debugging
|
# save preview for debugging
|
||||||
if log.isEnabledFor(logging.DEBUG):
|
if log.isEnabledFor(logging.DEBUG):
|
||||||
preview.save(u'temp.png', u'png')
|
preview.save(u'temp.png', u'png')
|
||||||
|
|
|
@ -649,8 +649,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
version_text = unicode(translate('OpenLP.MainWindow',
|
version_text = unicode(translate('OpenLP.MainWindow',
|
||||||
'Version %s of OpenLP is now available for download (you are '
|
'Version %s of OpenLP is now available for download (you are '
|
||||||
'currently running version %s). \n\nYou can download the latest '
|
'currently running version %s). \n\nYou can download the latest '
|
||||||
'version from '
|
'version from http://openlp.org/.'))
|
||||||
'<a href="http://openlp.org/">http://openlp.org/</a>.'))
|
|
||||||
QtGui.QMessageBox.question(self,
|
QtGui.QMessageBox.question(self,
|
||||||
translate('OpenLP.MainWindow', 'OpenLP Version Updated'),
|
translate('OpenLP.MainWindow', 'OpenLP Version Updated'),
|
||||||
version_text % (version, self.applicationVersion[u'full']))
|
version_text % (version, self.applicationVersion[u'full']))
|
||||||
|
@ -743,6 +742,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
The screen has changed to so tell the displays to update_display
|
The screen has changed to so tell the displays to update_display
|
||||||
their locations
|
their locations
|
||||||
"""
|
"""
|
||||||
|
log.debug(u'screenChanged')
|
||||||
self.RenderManager.update_display()
|
self.RenderManager.update_display()
|
||||||
self.setFocus()
|
self.setFocus()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
@ -387,8 +386,6 @@ class SlideController(QtGui.QWidget):
|
||||||
QtCore.SIGNAL(u'config_updated'), self.refreshServiceItem)
|
QtCore.SIGNAL(u'config_updated'), self.refreshServiceItem)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'config_screen_changed'), self.screenSizeChanged)
|
QtCore.SIGNAL(u'config_screen_changed'), self.screenSizeChanged)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'%s_slide_cache' % self.typePrefix), self.slideCache)
|
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
QtCore.QObject.connect(self.volumeSlider,
|
QtCore.QObject.connect(self.volumeSlider,
|
||||||
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
|
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
|
||||||
|
@ -495,7 +492,7 @@ class SlideController(QtGui.QWidget):
|
||||||
if self.serviceItem.is_text() or self.serviceItem.is_image():
|
if self.serviceItem.is_text() or self.serviceItem.is_image():
|
||||||
item = self.serviceItem
|
item = self.serviceItem
|
||||||
item.render()
|
item.render()
|
||||||
self.addServiceManagerItem(item, self.selectedRow)
|
self._processItem(item, self.selectedRow)
|
||||||
|
|
||||||
def addServiceItem(self, item):
|
def addServiceItem(self, item):
|
||||||
"""
|
"""
|
||||||
|
@ -767,13 +764,6 @@ class SlideController(QtGui.QWidget):
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
|
|
||||||
def slideCache(self, slide):
|
|
||||||
"""
|
|
||||||
Generate a slide cache item rendered and ready for use
|
|
||||||
in the background.
|
|
||||||
"""
|
|
||||||
self.serviceItem.get_rendered_frame(int(slide))
|
|
||||||
|
|
||||||
def onSlideSelected(self):
|
def onSlideSelected(self):
|
||||||
"""
|
"""
|
||||||
Generate the preview when you click on a slide.
|
Generate the preview when you click on a slide.
|
||||||
|
@ -818,6 +808,7 @@ class SlideController(QtGui.QWidget):
|
||||||
else:
|
else:
|
||||||
label = self.PreviewListWidget.cellWidget(
|
label = self.PreviewListWidget.cellWidget(
|
||||||
self.PreviewListWidget.currentRow(), 1)
|
self.PreviewListWidget.currentRow(), 1)
|
||||||
|
if label:
|
||||||
self.SlidePreview.setPixmap(label.pixmap())
|
self.SlidePreview.setPixmap(label.pixmap())
|
||||||
|
|
||||||
def grabMainDisplay(self):
|
def grabMainDisplay(self):
|
||||||
|
|
|
@ -295,7 +295,7 @@ class ThemeManager(QtGui.QWidget):
|
||||||
path = unicode(path)
|
path = unicode(path)
|
||||||
if path:
|
if path:
|
||||||
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
||||||
themePath = os.path.join(path, theme + u'.theme')
|
themePath = os.path.join(path, theme + u'.thz')
|
||||||
zip = None
|
zip = None
|
||||||
try:
|
try:
|
||||||
zip = zipfile.ZipFile(themePath, u'w')
|
zip = zipfile.ZipFile(themePath, u'w')
|
||||||
|
|
|
@ -70,6 +70,8 @@ class VersionThread(QtCore.QThread):
|
||||||
remote_version[u'release'] = int(match.group(3))
|
remote_version[u'release'] = int(match.group(3))
|
||||||
if len(match.groups()) > 3 and match.group(4):
|
if len(match.groups()) > 3 and match.group(4):
|
||||||
remote_version[u'revision'] = int(match.group(4))
|
remote_version[u'revision'] = int(match.group(4))
|
||||||
|
else:
|
||||||
|
return
|
||||||
match = self.version_splitter.match(self.app_version[u'full'])
|
match = self.version_splitter.match(self.app_version[u'full'])
|
||||||
if match:
|
if match:
|
||||||
local_version[u'major'] = int(match.group(1))
|
local_version[u'major'] = int(match.group(1))
|
||||||
|
@ -77,6 +79,8 @@ class VersionThread(QtCore.QThread):
|
||||||
local_version[u'release'] = int(match.group(3))
|
local_version[u'release'] = int(match.group(3))
|
||||||
if len(match.groups()) > 3 and match.group(4):
|
if len(match.groups()) > 3 and match.group(4):
|
||||||
local_version[u'revision'] = int(match.group(4))
|
local_version[u'revision'] = int(match.group(4))
|
||||||
|
else:
|
||||||
|
return
|
||||||
if remote_version[u'major'] > local_version[u'major'] or \
|
if remote_version[u'major'] > local_version[u'major'] or \
|
||||||
remote_version[u'minor'] > local_version[u'minor'] or \
|
remote_version[u'minor'] > local_version[u'minor'] or \
|
||||||
remote_version[u'release'] > local_version[u'release']:
|
remote_version[u'release'] > local_version[u'release']:
|
||||||
|
@ -147,10 +151,10 @@ class AppLocation(object):
|
||||||
return plugin_path
|
return plugin_path
|
||||||
elif dir_type == AppLocation.VersionDir:
|
elif dir_type == AppLocation.VersionDir:
|
||||||
if hasattr(sys, u'frozen') and sys.frozen == 1:
|
if hasattr(sys, u'frozen') and sys.frozen == 1:
|
||||||
plugin_path = os.path.abspath(os.path.split(sys.argv[0])[0])
|
version_path = os.path.abspath(os.path.split(sys.argv[0])[0])
|
||||||
else:
|
else:
|
||||||
plugin_path = os.path.split(openlp.__file__)[0]
|
version_path = os.path.split(openlp.__file__)[0]
|
||||||
return plugin_path
|
return version_path
|
||||||
elif dir_type == AppLocation.CacheDir:
|
elif dir_type == AppLocation.CacheDir:
|
||||||
if sys.platform == u'win32':
|
if sys.platform == u'win32':
|
||||||
path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
path = os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
||||||
|
@ -206,11 +210,14 @@ def check_latest_version(current_version):
|
||||||
else:
|
else:
|
||||||
req = urllib2.Request(u'http://www.openlp.org/files/version.txt')
|
req = urllib2.Request(u'http://www.openlp.org/files/version.txt')
|
||||||
req.add_header(u'User-Agent', u'OpenLP/%s' % current_version[u'full'])
|
req.add_header(u'User-Agent', u'OpenLP/%s' % current_version[u'full'])
|
||||||
|
remote_version = None
|
||||||
try:
|
try:
|
||||||
version_string = unicode(urllib2.urlopen(req, None).read()).strip()
|
remote_version = unicode(urllib2.urlopen(req, None).read()).strip()
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
if hasattr(e, u'reason'):
|
if hasattr(e, u'reason'):
|
||||||
log.exception(u'Reason for failure: %s', e.reason)
|
log.exception(u'Reason for failure: %s', e.reason)
|
||||||
|
if remote_version:
|
||||||
|
version_string = remote_version
|
||||||
return version_string
|
return version_string
|
||||||
|
|
||||||
def add_actions(target, actions):
|
def add_actions(target, actions):
|
||||||
|
|
|
@ -34,7 +34,7 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class AlertsManager(QtCore.QObject):
|
class AlertsManager(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
AlertsTab is the Alerts settings tab in the settings dialog.
|
AlertsManager manages the settings of Alerts.
|
||||||
"""
|
"""
|
||||||
log.info(u'Alert Manager loaded')
|
log.info(u'Alert Manager loaded')
|
||||||
|
|
||||||
|
@ -99,7 +99,6 @@ class AlertsManager(QtCore.QObject):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
log.debug(u'timer event')
|
log.debug(u'timer event')
|
||||||
alertTab = self.parent.alertsTab
|
|
||||||
if event.timerId() == self.timer_id:
|
if event.timerId() == self.timer_id:
|
||||||
self.parent.liveController.display.alert(u'')
|
self.parent.liveController.display.alert(u'')
|
||||||
self.killTimer(self.timer_id)
|
self.killTimer(self.timer_id)
|
||||||
|
|
|
@ -401,9 +401,10 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
self.AdvancedBookComboBox.itemData(item).toInt()[0])
|
self.AdvancedBookComboBox.itemData(item).toInt()[0])
|
||||||
|
|
||||||
def onImportClick(self):
|
def onImportClick(self):
|
||||||
self.bibleimportform = ImportWizardForm(self,
|
if not hasattr(self, u'import_wizard'):
|
||||||
self.parent.manager, self.parent)
|
self.import_wizard = ImportWizardForm(self, self.parent.manager,
|
||||||
self.bibleimportform.exec_()
|
self.parent)
|
||||||
|
self.import_wizard.exec_()
|
||||||
self.reloadBibles()
|
self.reloadBibles()
|
||||||
|
|
||||||
def onAdvancedFromVerse(self):
|
def onAdvancedFromVerse(self):
|
||||||
|
@ -644,7 +645,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||||
'''
|
'''
|
||||||
version = self.parent.manager.get_meta_data(bible, u'Version')
|
version = self.parent.manager.get_meta_data(bible, u'Version')
|
||||||
copyright = self.parent.manager.get_meta_data(bible, u'Copyright')
|
copyright = self.parent.manager.get_meta_data(bible, u'Copyright')
|
||||||
permission = self.parent.manager.get_meta_data(bible, u'Permissions')
|
#permission = self.parent.manager.get_meta_data(bible, u'Permissions')
|
||||||
if dual_bible:
|
if dual_bible:
|
||||||
dual_version = self.parent.manager.get_meta_data(dual_bible,
|
dual_version = self.parent.manager.get_meta_data(dual_bible,
|
||||||
u'Version')
|
u'Version')
|
||||||
|
|
|
@ -143,7 +143,7 @@ class Ui_CustomEditDialog(object):
|
||||||
customEditDialog.setWindowTitle(
|
customEditDialog.setWindowTitle(
|
||||||
translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides'))
|
translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides'))
|
||||||
self.upButton.setToolTip(
|
self.upButton.setToolTip(
|
||||||
translate('CustomPlugin.EditCustomForm', 'Move slide up once '
|
translate('CustomPlugin.EditCustomForm', 'Move slide up one '
|
||||||
'position.'))
|
'position.'))
|
||||||
self.downButton.setToolTip(
|
self.downButton.setToolTip(
|
||||||
translate('CustomPlugin.EditCustomForm', 'Move slide down one '
|
translate('CustomPlugin.EditCustomForm', 'Move slide down one '
|
||||||
|
|
|
@ -25,59 +25,76 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from songimportwizard import Ui_SongImportWizard
|
from songimportwizard import Ui_SongImportWizard
|
||||||
from openlp.core.lib import Receiver, SettingsManager, translate
|
from openlp.core.lib import Receiver, SettingsManager, translate
|
||||||
#from openlp.core.utils import AppLocation
|
#from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.songs.lib import SongFormat
|
from openlp.plugins.songs.lib.importer import SongFormat
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||||
"""
|
"""
|
||||||
This is the Bible Import Wizard, which allows easy importing of Bibles
|
This is the Song Import Wizard, which allows easy importing of Songs
|
||||||
into OpenLP from other formats like OSIS, CSV and OpenSong.
|
into OpenLP from other formats like OpenLyrics, OpenSong and CCLI.
|
||||||
"""
|
"""
|
||||||
log.info(u'BibleImportForm loaded')
|
log.info(u'SongImportForm loaded')
|
||||||
|
|
||||||
def __init__(self, parent, manager, songsplugin):
|
def __init__(self, parent, plugin):
|
||||||
"""
|
"""
|
||||||
Instantiate the wizard, and run any extra setup we need to.
|
Instantiate the wizard, and run any extra setup we need to.
|
||||||
|
|
||||||
``parent``
|
``parent``
|
||||||
The QWidget-derived parent of the wizard.
|
The QWidget-derived parent of the wizard.
|
||||||
|
|
||||||
``config``
|
``plugin``
|
||||||
The configuration object for storing and retrieving settings.
|
The songs plugin.
|
||||||
|
|
||||||
``manager``
|
|
||||||
The Bible manager.
|
|
||||||
|
|
||||||
``bibleplugin``
|
|
||||||
The Bible plugin.
|
|
||||||
"""
|
"""
|
||||||
QtGui.QWizard.__init__(self, parent)
|
QtGui.QWizard.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.registerFields()
|
self.registerFields()
|
||||||
self.finishButton = self.button(QtGui.QWizard.FinishButton)
|
self.finishButton = self.button(QtGui.QWizard.FinishButton)
|
||||||
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
self.cancelButton = self.button(QtGui.QWizard.CancelButton)
|
||||||
self.manager = manager
|
self.plugin = plugin
|
||||||
self.songsplugin = songsplugin
|
QtCore.QObject.connect(self.openLP2BrowseButton,
|
||||||
#self.manager.set_process_dialog(self)
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
# QtCore.QObject.connect(self.OsisFileButton,
|
self.onOpenLP2BrowseButtonClicked)
|
||||||
# QtCore.SIGNAL(u'clicked()'),
|
QtCore.QObject.connect(self.openLP1BrowseButton,
|
||||||
# self.onOsisFileButtonClicked)
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
# QtCore.QObject.connect(self.BooksFileButton,
|
self.onOpenLP1BrowseButtonClicked)
|
||||||
# QtCore.SIGNAL(u'clicked()'),
|
QtCore.QObject.connect(self.openLyricsAddButton,
|
||||||
# self.onBooksFileButtonClicked)
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
# QtCore.QObject.connect(self.CsvVersesFileButton,
|
self.onOpenLyricsAddButtonClicked)
|
||||||
# QtCore.SIGNAL(u'clicked()'),
|
QtCore.QObject.connect(self.openLyricsRemoveButton,
|
||||||
# self.onCsvVersesFileButtonClicked)
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
# QtCore.QObject.connect(self.OpenSongBrowseButton,
|
self.onOpenLyricsRemoveButtonClicked)
|
||||||
# QtCore.SIGNAL(u'clicked()'),
|
QtCore.QObject.connect(self.openSongAddButton,
|
||||||
# self.onOpenSongBrowseButtonClicked)
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onOpenSongAddButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.openSongRemoveButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onOpenSongRemoveButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.wordsOfWorshipAddButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onWordsOfWorshipAddButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.wordsOfWorshipRemoveButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onWordsOfWorshipRemoveButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.songsOfFellowshipAddButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onSongsOfFellowshipAddButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.songsOfFellowshipRemoveButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onSongsOfFellowshipRemoveButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.genericAddButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onGenericAddButtonClicked)
|
||||||
|
QtCore.QObject.connect(self.genericRemoveButton,
|
||||||
|
QtCore.SIGNAL(u'clicked()'),
|
||||||
|
self.onGenericRemoveButtonClicked)
|
||||||
QtCore.QObject.connect(self.cancelButton,
|
QtCore.QObject.connect(self.cancelButton,
|
||||||
QtCore.SIGNAL(u'clicked(bool)'),
|
QtCore.SIGNAL(u'clicked(bool)'),
|
||||||
self.onCancelButtonClicked)
|
self.onCancelButtonClicked)
|
||||||
|
@ -101,154 +118,294 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard):
|
||||||
return True
|
return True
|
||||||
elif self.currentId() == 1:
|
elif self.currentId() == 1:
|
||||||
# Select page
|
# Select page
|
||||||
source_format = self.field(u'source_format').toInt()[0]
|
source_format = self.formatComboBox.currentIndex()
|
||||||
if source_format == SongFormat.OpenLyrics:
|
if source_format == SongFormat.OpenLP2:
|
||||||
if self.OpenLyricsFileListWidget.count() == 0:
|
if self.openLP2FilenameEdit.text().isEmpty():
|
||||||
|
QtGui.QMessageBox.critical(self,
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'No OpenLP 2.0 Song Database Selected'),
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'You need to select an OpenLP 2.0 song database '
|
||||||
|
'file to import from.'))
|
||||||
|
self.openLP2BrowseButton.setFocus()
|
||||||
|
return False
|
||||||
|
elif source_format == SongFormat.OpenLP1:
|
||||||
|
if self.openSongFilenameEdit.text().isEmpty():
|
||||||
|
QtGui.QMessageBox.critical(self,
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'No openlp.org 1.x Song Database Selected'),
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'You need to select an openlp.org 1.x song '
|
||||||
|
'database file to import from.'))
|
||||||
|
self.openLP1BrowseButton.setFocus()
|
||||||
|
return False
|
||||||
|
elif source_format == SongFormat.OpenLyrics:
|
||||||
|
if self.openLyricsFileListWidget.count() == 0:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'No OpenLyrics Files Selected'),
|
'No OpenLyrics Files Selected'),
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'You need to add at least one OpenLyrics '
|
'You need to add at least one OpenLyrics '
|
||||||
'song file to import from.'))
|
'song file to import from.'))
|
||||||
self.OpenLyricsAddButton.setFocus()
|
self.openLyricsAddButton.setFocus()
|
||||||
return False
|
return False
|
||||||
elif source_format == SongFormat.OpenSong:
|
elif source_format == SongFormat.OpenSong:
|
||||||
if self.OpenSongFileListWidget.count() == 0:
|
if self.openSongFileListWidget.count() == 0:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'No OpenSong Files Selected'),
|
'No OpenSong Files Selected'),
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'You need to add at least one OpenSong '
|
'You need to add at least one OpenSong '
|
||||||
'song file to import from.'))
|
'song file to import from.'))
|
||||||
self.OpenSongAddButton.setFocus()
|
self.openSongAddButton.setFocus()
|
||||||
|
return False
|
||||||
|
elif source_format == SongFormat.WordsOfWorship:
|
||||||
|
if self.wordsOfWorshipListWidget.count() == 0:
|
||||||
|
QtGui.QMessageBox.critical(self,
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'No Words of Worship Files Selected'),
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'You need to add at least one Words of Worship '
|
||||||
|
'file to import from.'))
|
||||||
|
self.wordsOfWorshipAddButton.setFocus()
|
||||||
return False
|
return False
|
||||||
elif source_format == SongFormat.CCLI:
|
elif source_format == SongFormat.CCLI:
|
||||||
if self.CCLIFileListWidget.count() == 0:
|
if self.ccliFileListWidget.count() == 0:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'No CCLI Files Selected'),
|
'No CCLI Files Selected'),
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'You need to add at least one CCLI file '
|
'You need to add at least one CCLI file '
|
||||||
'to import from.'))
|
'to import from.'))
|
||||||
self.CCLIAddButton.setFocus()
|
self.ccliAddButton.setFocus()
|
||||||
return False
|
return False
|
||||||
elif source_format == SongFormat.CSV:
|
elif source_format == SongFormat.SongsOfFellowship:
|
||||||
if self.CSVFilenameEdit.text().isEmpty():
|
if self.songsOfFellowshipFileListWidget.count() == 0:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'No CSV File Selected'),
|
'No Songs of Fellowship File Selected'),
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'You need to specify a CSV file to import from.'))
|
'You need to add at least one Songs of Fellowship '
|
||||||
self.CSVFilenameEdit.setFocus()
|
'file to import from.'))
|
||||||
|
self.songsOfFellowshipAddButton.setFocus()
|
||||||
|
return False
|
||||||
|
elif source_format == SongFormat.Generic:
|
||||||
|
if self.genericFileListWidget.count() == 0:
|
||||||
|
QtGui.QMessageBox.critical(self,
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'No Document/Presentation Selected'),
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'You need to add at least one document or '
|
||||||
|
'presentation file to import from.'))
|
||||||
|
self.genericAddButton.setFocus()
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
elif self.currentId() == 2:
|
elif self.currentId() == 2:
|
||||||
# Progress page
|
# Progress page
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def getFileName(self, title, editbox):
|
||||||
|
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
||||||
|
SettingsManager.get_last_dir(self.plugin.settingsSection, 1))
|
||||||
|
if filename:
|
||||||
|
editbox.setText(filename)
|
||||||
|
SettingsManager.set_last_dir(
|
||||||
|
self.plugin.settingsSection,
|
||||||
|
os.path.split(unicode(filename))[0], 1)
|
||||||
|
|
||||||
|
def getFiles(self, title, listbox):
|
||||||
|
filenames = QtGui.QFileDialog.getOpenFileNames(self, title,
|
||||||
|
SettingsManager.get_last_dir(self.plugin.settingsSection, 1))
|
||||||
|
if filenames:
|
||||||
|
listbox.addItems(filenames)
|
||||||
|
SettingsManager.set_last_dir(
|
||||||
|
self.plugin.settingsSection,
|
||||||
|
os.path.split(unicode(filenames[0]))[0], 1)
|
||||||
|
|
||||||
|
def getListOfFiles(self, listbox):
|
||||||
|
files = []
|
||||||
|
for row in range(0, listbox.count()):
|
||||||
|
files.append(unicode(listbox.item(row).text()))
|
||||||
|
return files
|
||||||
|
|
||||||
|
def removeSelectedItems(self, listbox):
|
||||||
|
for item in listbox.selectedItems():
|
||||||
|
item = listbox.takeItem(listbox.row(item))
|
||||||
|
del item
|
||||||
|
|
||||||
|
def onOpenLP2BrowseButtonClicked(self):
|
||||||
|
self.getFileName(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select OpenLP 2.0 Database File'),
|
||||||
|
self.openLP2FilenameEdit
|
||||||
|
)
|
||||||
|
|
||||||
|
def onOpenLP1BrowseButtonClicked(self):
|
||||||
|
self.getFileName(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select openlp.org 1.x Database File'),
|
||||||
|
self.openLP1FilenameEdit
|
||||||
|
)
|
||||||
|
|
||||||
|
def onOpenLyricsAddButtonClicked(self):
|
||||||
|
self.getFiles(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select OpenLyrics Files'),
|
||||||
|
self.openLyricsFileListWidget
|
||||||
|
)
|
||||||
|
|
||||||
|
def onOpenLyricsRemoveButtonClicked(self):
|
||||||
|
self.removeSelectedItems(self.openLyricsFileListWidget)
|
||||||
|
|
||||||
|
def onOpenSongAddButtonClicked(self):
|
||||||
|
self.getFiles(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select Open Song Files'),
|
||||||
|
self.openSongFileListWidget
|
||||||
|
)
|
||||||
|
|
||||||
|
def onOpenSongRemoveButtonClicked(self):
|
||||||
|
self.removeSelectedItems(self.openSongFileListWidget)
|
||||||
|
|
||||||
|
def onWordsOfWorshipAddButtonClicked(self):
|
||||||
|
self.getFiles(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select Words of Worship Files'),
|
||||||
|
self.wordsOfWorshipFileListWidget
|
||||||
|
)
|
||||||
|
|
||||||
|
def onWordsOfWorshipRemoveButtonClicked(self):
|
||||||
|
self.removeSelectedItems(self.wordsOfWorshipFileListWidget)
|
||||||
|
|
||||||
|
def onSongsOfFellowshipAddButtonClicked(self):
|
||||||
|
self.getFiles(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select Songs of Fellowship Files'),
|
||||||
|
self.songsOfFellowshipFileListWidget
|
||||||
|
)
|
||||||
|
|
||||||
|
def onSongsOfFellowshipRemoveButtonClicked(self):
|
||||||
|
self.removeSelectedItems(self.songsOfFellowshipFileListWidget)
|
||||||
|
|
||||||
|
def onGenericAddButtonClicked(self):
|
||||||
|
self.getFiles(
|
||||||
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
|
'Select Document/Presentation Files'),
|
||||||
|
self.genericFileListWidget
|
||||||
|
)
|
||||||
|
|
||||||
|
def onGenericRemoveButtonClicked(self):
|
||||||
|
self.removeSelectedItems(self.genericFileListWidget)
|
||||||
|
|
||||||
def onCancelButtonClicked(self, checked):
|
def onCancelButtonClicked(self, checked):
|
||||||
"""
|
"""
|
||||||
Stop the import on pressing the cancel button.
|
Stop the import on pressing the cancel button.
|
||||||
"""
|
"""
|
||||||
log.debug('Cancel button pressed!')
|
log.debug('Cancel button pressed!')
|
||||||
if self.currentId() == 3:
|
if self.currentId() == 3:
|
||||||
Receiver.send_message(u'openlp_stop_song_import')
|
Receiver.send_message(u'song_stop_import')
|
||||||
|
|
||||||
def onCurrentIdChanged(self, id):
|
def onCurrentIdChanged(self, id):
|
||||||
if id == 3:
|
if id == 2:
|
||||||
self.preImport()
|
self.preImport()
|
||||||
self.performImport()
|
self.performImport()
|
||||||
self.postImport()
|
self.postImport()
|
||||||
|
|
||||||
def registerFields(self):
|
def registerFields(self):
|
||||||
self.SourcePage.registerField(u'source_format', self.FormatComboBox)
|
pass
|
||||||
|
|
||||||
def setDefaults(self):
|
def setDefaults(self):
|
||||||
self.setField(u'source_format', QtCore.QVariant(0))
|
self.formatComboBox.setCurrentIndex(0)
|
||||||
self.OpenLyricsFileListWidget.clear()
|
self.openLP2FilenameEdit.setText(u'')
|
||||||
self.OpenSongFileListWidget.clear()
|
self.openLP1FilenameEdit.setText(u'')
|
||||||
self.CCLIFileListWidget.clear()
|
self.openLyricsFileListWidget.clear()
|
||||||
self.CSVFilenameEdit.setText(u'')
|
self.openSongFileListWidget.clear()
|
||||||
|
self.wordsOfWorshipFileListWidget.clear()
|
||||||
|
self.ccliFileListWidget.clear()
|
||||||
|
self.songsOfFellowshipFileListWidget.clear()
|
||||||
|
self.genericFileListWidget.clear()
|
||||||
|
#self.csvFilenameEdit.setText(u'')
|
||||||
|
|
||||||
def getFileName(self, title, editbox):
|
def incrementProgressBar(self, status_text, increment=1):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
|
||||||
SettingsManager.get_last_dir(self.songsplugin.settingsSection, 1))
|
|
||||||
if filename:
|
|
||||||
editbox.setText(filename)
|
|
||||||
SettingsManager.set_last_dir(self.songsplugin.settingsSection,
|
|
||||||
filename, 1)
|
|
||||||
|
|
||||||
def incrementProgressBar(self, status_text):
|
|
||||||
log.debug(u'IncrementBar %s', status_text)
|
log.debug(u'IncrementBar %s', status_text)
|
||||||
self.ImportProgressLabel.setText(status_text)
|
if status_text:
|
||||||
self.ImportProgressBar.setValue(self.ImportProgressBar.value() + 1)
|
self.importProgressLabel.setText(status_text)
|
||||||
Receiver.send_message(u'process_events')
|
if increment > 0:
|
||||||
|
self.importProgressBar.setValue(self.importProgressBar.value() +
|
||||||
|
increment)
|
||||||
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
||||||
def preImport(self):
|
def preImport(self):
|
||||||
self.finishButton.setVisible(False)
|
self.finishButton.setVisible(False)
|
||||||
self.ImportProgressBar.setMinimum(0)
|
self.importProgressBar.setMinimum(0)
|
||||||
self.ImportProgressBar.setMaximum(1188)
|
self.importProgressBar.setMaximum(1188)
|
||||||
self.ImportProgressBar.setValue(0)
|
self.importProgressBar.setValue(0)
|
||||||
self.ImportProgressLabel.setText(
|
self.importProgressLabel.setText(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Starting import...'))
|
translate('SongsPlugin.ImportWizardForm', 'Starting import...'))
|
||||||
Receiver.send_message(u'process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
||||||
def performImport(self):
|
def performImport(self):
|
||||||
pass
|
"""
|
||||||
# source_format = self.field(u'source_format').toInt()[0]
|
Perform the actual import. This method pulls in the correct importer
|
||||||
# importer = None
|
class, and then runs the ``do_import`` method of the importer to do
|
||||||
# if bible_type == BibleFormat.OSIS:
|
the actual importing.
|
||||||
# # Import an OSIS bible
|
"""
|
||||||
# importer = self.manager.import_bible(BibleFormat.OSIS,
|
source_format = self.formatComboBox.currentIndex()
|
||||||
# name=license_version,
|
importer = None
|
||||||
# filename=unicode(self.field(u'osis_location').toString())
|
if source_format == SongFormat.OpenLP2:
|
||||||
|
# Import an OpenLP 2.0 database
|
||||||
|
importer = self.plugin.importSongs(SongFormat.OpenLP2,
|
||||||
|
filename=unicode(self.openLP2FilenameEdit.text())
|
||||||
|
)
|
||||||
|
#elif source_format == SongFormat.OpenLP1:
|
||||||
|
# # Import an openlp.org database
|
||||||
|
# importer = self.plugin.importSongs(SongFormat.OpenLP1,
|
||||||
|
# filename=unicode(self.field(u'openlp1_filename').toString())
|
||||||
# )
|
# )
|
||||||
# elif bible_type == BibleFormat.CSV:
|
elif source_format == SongFormat.OpenLyrics:
|
||||||
# # Import a CSV bible
|
# Import OpenLyrics songs
|
||||||
# importer = self.manager.import_bible(BibleFormat.CSV,
|
importer = self.plugin.importSongs(SongFormat.OpenLyrics,
|
||||||
# name=license_version,
|
filenames=self.getListOfFiles(self.openLyricsFileListWidget)
|
||||||
# booksfile=unicode(self.field(u'csv_booksfile').toString()),
|
)
|
||||||
# versefile=unicode(self.field(u'csv_versefile').toString())
|
elif source_format == SongFormat.OpenSong:
|
||||||
# )
|
# Import OpenSong songs
|
||||||
# elif bible_type == BibleFormat.OpenSong:
|
importer = self.plugin.importSongs(SongFormat.OpenSong,
|
||||||
# # Import an OpenSong bible
|
filenames=self.getListOfFiles(self.openSongFileListWidget)
|
||||||
# importer = self.manager.import_bible(BibleFormat.OpenSong,
|
)
|
||||||
# name=license_version,
|
elif source_format == SongFormat.WordsOfWorship:
|
||||||
# filename=unicode(self.field(u'opensong_file').toString())
|
# Import Words Of Worship songs
|
||||||
# )
|
importer = self.plugin.importSongs(SongFormat.WordsOfWorship,
|
||||||
# elif bible_type == BibleFormat.WebDownload:
|
filenames=self.getListOfFiles(
|
||||||
# # Import a bible from the web
|
self.wordsOfWorshipFileListWidget)
|
||||||
# self.ImportProgressBar.setMaximum(1)
|
)
|
||||||
# download_location = self.field(u'web_location').toInt()[0]
|
elif source_format == SongFormat.CCLI:
|
||||||
# bible_version = self.BibleComboBox.currentText()
|
# Import Words Of Worship songs
|
||||||
# if not isinstance(bible_version, unicode):
|
importer = self.plugin.importSongs(SongFormat.CCLI,
|
||||||
# bible_version = unicode(bible_version, u'utf8')
|
filenames=self.getListOfFiles(self.ccliFileListWidget)
|
||||||
# if download_location == WebDownload.Crosswalk:
|
)
|
||||||
# bible = self.web_bible_list[WebDownload.Crosswalk][bible_version]
|
elif source_format == SongFormat.SongsOfFellowship:
|
||||||
# elif download_location == WebDownload.BibleGateway:
|
# Import a Songs of Fellowship RTF file
|
||||||
# bible = self.web_bible_list[WebDownload.BibleGateway][bible_version]
|
importer = self.plugin.importSongs(SongFormat.SongsOfFellowship,
|
||||||
# importer = self.manager.import_bible(
|
filenames=self.getListOfFiles(
|
||||||
# BibleFormat.WebDownload,
|
self.songsOfFellowshipFileListWidget)
|
||||||
# name=license_version,
|
)
|
||||||
# download_source=WebDownload.get_name(download_location),
|
elif source_format == SongFormat.Generic:
|
||||||
# download_name=bible,
|
# Import a generic document or presentatoin
|
||||||
# proxy_server=unicode(self.field(u'proxy_server').toString()),
|
importer = self.plugin.importSongs(SongFormat.Generic,
|
||||||
# proxy_username=unicode(self.field(u'proxy_username').toString()),
|
filenames=self.getListOfFiles(self.genericFileListWidget)
|
||||||
# proxy_password=unicode(self.field(u'proxy_password').toString())
|
)
|
||||||
# )
|
success = importer.do_import()
|
||||||
# success = importer.do_import()
|
if success:
|
||||||
# if success:
|
# reload songs
|
||||||
# self.manager.save_meta_data(license_version, license_version,
|
self.importProgressLabel.setText(
|
||||||
# license_copyright, license_permission)
|
translate('SongsPlugin.SongImportForm', 'Finished import.'))
|
||||||
# self.manager.reload_bibles()
|
else:
|
||||||
# self.ImportProgressLabel.setText(translate('SongsPlugin.SongImportForm', 'Finished import.'))
|
self.importProgressLabel.setText(
|
||||||
# else:
|
translate('SongsPlugin.SongImportForm',
|
||||||
# self.ImportProgressLabel.setText(
|
'Your song import failed.'))
|
||||||
# translate('SongsPlugin.SongImportForm', 'Your Bible import failed.'))
|
|
||||||
# importer.delete()
|
|
||||||
|
|
||||||
def postImport(self):
|
def postImport(self):
|
||||||
self.ImportProgressBar.setValue(self.ImportProgressBar.maximum())
|
self.importProgressBar.setValue(self.importProgressBar.maximum())
|
||||||
self.finishButton.setVisible(True)
|
self.finishButton.setVisible(True)
|
||||||
self.cancelButton.setVisible(False)
|
self.cancelButton.setVisible(False)
|
||||||
Receiver.send_message(u'process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
|
|
@ -29,247 +29,425 @@ from PyQt4 import QtCore, QtGui
|
||||||
from openlp.core.lib import build_icon, translate
|
from openlp.core.lib import build_icon, translate
|
||||||
|
|
||||||
class Ui_SongImportWizard(object):
|
class Ui_SongImportWizard(object):
|
||||||
def setupUi(self, SongImportWizard):
|
def setupUi(self, songImportWizard):
|
||||||
SongImportWizard.setObjectName(u'SongImportWizard')
|
openIcon = build_icon(u':/general/general_open.png')
|
||||||
SongImportWizard.resize(550, 386)
|
deleteIcon = build_icon(u':/general/general_delete.png')
|
||||||
SongImportWizard.setModal(True)
|
songImportWizard.setObjectName(u'songImportWizard')
|
||||||
SongImportWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
|
songImportWizard.resize(550, 386)
|
||||||
SongImportWizard.setOptions(
|
songImportWizard.setModal(True)
|
||||||
|
songImportWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
|
||||||
|
songImportWizard.setOptions(
|
||||||
QtGui.QWizard.IndependentPages |
|
QtGui.QWizard.IndependentPages |
|
||||||
QtGui.QWizard.NoBackButtonOnStartPage |
|
QtGui.QWizard.NoBackButtonOnStartPage |
|
||||||
QtGui.QWizard.NoBackButtonOnLastPage)
|
QtGui.QWizard.NoBackButtonOnLastPage)
|
||||||
self.WelcomePage = QtGui.QWizardPage()
|
self.welcomePage = QtGui.QWizardPage()
|
||||||
self.WelcomePage.setObjectName(u'WelcomePage')
|
self.welcomePage.setObjectName(u'welcomePage')
|
||||||
self.WelcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap,
|
self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap,
|
||||||
QtGui.QPixmap(u':/wizards/wizard_importsong.bmp'))
|
QtGui.QPixmap(u':/wizards/wizard_importsong.bmp'))
|
||||||
self.WelcomeLayout = QtGui.QHBoxLayout(self.WelcomePage)
|
self.welcomeLayout = QtGui.QHBoxLayout(self.welcomePage)
|
||||||
self.WelcomeLayout.setSpacing(8)
|
self.welcomeLayout.setSpacing(8)
|
||||||
self.WelcomeLayout.setMargin(0)
|
self.welcomeLayout.setMargin(0)
|
||||||
self.WelcomeLayout.setObjectName(u'WelcomeLayout')
|
self.welcomeLayout.setObjectName(u'welcomeLayout')
|
||||||
self.WelcomeTextLayout = QtGui.QVBoxLayout()
|
self.welcomeTextLayout = QtGui.QVBoxLayout()
|
||||||
self.WelcomeTextLayout.setSpacing(8)
|
self.welcomeTextLayout.setSpacing(8)
|
||||||
self.WelcomeTextLayout.setObjectName(u'WelcomeTextLayout')
|
self.welcomeTextLayout.setObjectName(u'welcomeTextLayout')
|
||||||
self.TitleLabel = QtGui.QLabel(self.WelcomePage)
|
self.titleLabel = QtGui.QLabel(self.welcomePage)
|
||||||
self.TitleLabel.setObjectName(u'TitleLabel')
|
self.titleLabel.setObjectName(u'TitleLabel')
|
||||||
self.WelcomeTextLayout.addWidget(self.TitleLabel)
|
self.welcomeTextLayout.addWidget(self.titleLabel)
|
||||||
self.WelcomeTopSpacer = QtGui.QSpacerItem(20, 40,
|
self.welcomeTopSpacer = QtGui.QSpacerItem(20, 40,
|
||||||
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
|
||||||
self.WelcomeTextLayout.addItem(self.WelcomeTopSpacer)
|
self.welcomeTextLayout.addItem(self.welcomeTopSpacer)
|
||||||
self.InformationLabel = QtGui.QLabel(self.WelcomePage)
|
self.informationLabel = QtGui.QLabel(self.welcomePage)
|
||||||
self.InformationLabel.setWordWrap(True)
|
self.informationLabel.setWordWrap(True)
|
||||||
self.InformationLabel.setMargin(10)
|
self.informationLabel.setMargin(10)
|
||||||
self.InformationLabel.setObjectName(u'InformationLabel')
|
self.informationLabel.setObjectName(u'InformationLabel')
|
||||||
self.WelcomeTextLayout.addWidget(self.InformationLabel)
|
self.welcomeTextLayout.addWidget(self.informationLabel)
|
||||||
self.WelcomeBottomSpacer = QtGui.QSpacerItem(20, 40,
|
self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40,
|
||||||
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
||||||
self.WelcomeTextLayout.addItem(self.WelcomeBottomSpacer)
|
self.welcomeTextLayout.addItem(self.welcomeBottomSpacer)
|
||||||
self.WelcomeLayout.addLayout(self.WelcomeTextLayout)
|
self.welcomeLayout.addLayout(self.welcomeTextLayout)
|
||||||
SongImportWizard.addPage(self.WelcomePage)
|
songImportWizard.addPage(self.welcomePage)
|
||||||
self.SourcePage = QtGui.QWizardPage()
|
self.sourcePage = QtGui.QWizardPage()
|
||||||
self.SourcePage.setObjectName(u'SourcePage')
|
self.sourcePage.setObjectName(u'SourcePage')
|
||||||
self.SourceLayout = QtGui.QVBoxLayout(self.SourcePage)
|
self.sourceLayout = QtGui.QVBoxLayout(self.sourcePage)
|
||||||
self.SourceLayout.setSpacing(8)
|
self.sourceLayout.setSpacing(8)
|
||||||
self.SourceLayout.setMargin(20)
|
self.sourceLayout.setMargin(20)
|
||||||
self.SourceLayout.setObjectName(u'SourceLayout')
|
self.sourceLayout.setObjectName(u'SourceLayout')
|
||||||
self.FormatLayout = QtGui.QHBoxLayout()
|
self.formatLayout = QtGui.QHBoxLayout()
|
||||||
self.FormatLayout.setSpacing(8)
|
self.formatLayout.setSpacing(8)
|
||||||
self.FormatLayout.setObjectName(u'FormatLayout')
|
self.formatLayout.setObjectName(u'FormatLayout')
|
||||||
self.FormatLabel = QtGui.QLabel(self.SourcePage)
|
self.formatLabel = QtGui.QLabel(self.sourcePage)
|
||||||
self.FormatLabel.setObjectName(u'FormatLabel')
|
self.formatLabel.setObjectName(u'FormatLabel')
|
||||||
self.FormatLayout.addWidget(self.FormatLabel)
|
self.formatLayout.addWidget(self.formatLabel)
|
||||||
self.FormatComboBox = QtGui.QComboBox(self.SourcePage)
|
self.formatComboBox = QtGui.QComboBox(self.sourcePage)
|
||||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
|
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
|
||||||
QtGui.QSizePolicy.Fixed)
|
QtGui.QSizePolicy.Fixed)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(
|
sizePolicy.setHeightForWidth(
|
||||||
self.FormatComboBox.sizePolicy().hasHeightForWidth())
|
self.formatComboBox.sizePolicy().hasHeightForWidth())
|
||||||
self.FormatComboBox.setSizePolicy(sizePolicy)
|
self.formatComboBox.setSizePolicy(sizePolicy)
|
||||||
self.FormatComboBox.setObjectName(u'FormatComboBox')
|
self.formatComboBox.setObjectName(u'formatComboBox')
|
||||||
self.FormatComboBox.addItem(u'')
|
self.formatComboBox.addItem(u'')
|
||||||
self.FormatComboBox.addItem(u'')
|
self.formatComboBox.addItem(u'')
|
||||||
self.FormatComboBox.addItem(u'')
|
self.formatComboBox.addItem(u'')
|
||||||
self.FormatComboBox.addItem(u'')
|
self.formatComboBox.addItem(u'')
|
||||||
self.FormatLayout.addWidget(self.FormatComboBox)
|
self.formatComboBox.addItem(u'')
|
||||||
self.FormatSpacer = QtGui.QSpacerItem(40, 20,
|
self.formatComboBox.addItem(u'')
|
||||||
|
self.formatComboBox.addItem(u'')
|
||||||
|
self.formatComboBox.addItem(u'')
|
||||||
|
# self.formatComboBox.addItem(u'')
|
||||||
|
self.formatLayout.addWidget(self.formatComboBox)
|
||||||
|
self.formatSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
self.FormatLayout.addItem(self.FormatSpacer)
|
self.formatLayout.addItem(self.formatSpacer)
|
||||||
self.SourceLayout.addLayout(self.FormatLayout)
|
self.sourceLayout.addLayout(self.formatLayout)
|
||||||
self.FormatStackedWidget = QtGui.QStackedWidget(self.SourcePage)
|
self.formatStackedWidget = QtGui.QStackedWidget(self.sourcePage)
|
||||||
self.FormatStackedWidget.setObjectName(u'FormatStackedWidget')
|
self.formatStackedWidget.setObjectName(u'FormatStackedWidget')
|
||||||
self.OpenLyricsPage = QtGui.QWidget()
|
# OpenLP 2.0
|
||||||
self.OpenLyricsPage.setObjectName(u'OpenLyricsPage')
|
self.openLP2Page = QtGui.QWidget()
|
||||||
self.OpenLyricsLayout = QtGui.QVBoxLayout(self.OpenLyricsPage)
|
self.openLP2Page.setObjectName(u'openLP2Page')
|
||||||
self.OpenLyricsLayout.setSpacing(8)
|
self.openLP2Layout = QtGui.QFormLayout(self.openLP2Page)
|
||||||
self.OpenLyricsLayout.setMargin(0)
|
self.openLP2Layout.setMargin(0)
|
||||||
self.OpenLyricsLayout.setObjectName(u'OpenLyricsLayout')
|
self.openLP2Layout.setSpacing(8)
|
||||||
self.OpenLyricsFileListWidget = QtGui.QListWidget(self.OpenLyricsPage)
|
self.openLP2Layout.setObjectName(u'openLP2Layout')
|
||||||
self.OpenLyricsFileListWidget.setObjectName(u'OpenLyricsFileListWidget')
|
self.openLP2FilenameLabel = QtGui.QLabel(self.openLP2Page)
|
||||||
self.OpenLyricsLayout.addWidget(self.OpenLyricsFileListWidget)
|
self.openLP2FilenameLabel.setObjectName(u'openLP2FilenameLabel')
|
||||||
self.OpenLyricsButtonLayout = QtGui.QHBoxLayout()
|
self.openLP2Layout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
||||||
self.OpenLyricsButtonLayout.setSpacing(8)
|
self.openLP2FilenameLabel)
|
||||||
self.OpenLyricsButtonLayout.setObjectName(u'OpenLyricsButtonLayout')
|
self.openLP2FileLayout = QtGui.QHBoxLayout()
|
||||||
self.OpenLyricsAddButton = QtGui.QPushButton(self.OpenLyricsPage)
|
self.openLP2FileLayout.setSpacing(8)
|
||||||
openIcon = build_icon(u':/general/general_open.png')
|
self.openLP2FileLayout.setObjectName(u'openLP2FileLayout')
|
||||||
self.OpenLyricsAddButton.setIcon(openIcon)
|
self.openLP2FilenameEdit = QtGui.QLineEdit(self.openLP2Page)
|
||||||
self.OpenLyricsAddButton.setObjectName(u'OpenLyricsAddButton')
|
self.openLP2FilenameEdit.setObjectName(u'openLP2FilenameEdit')
|
||||||
self.OpenLyricsButtonLayout.addWidget(self.OpenLyricsAddButton)
|
self.openLP2FileLayout.addWidget(self.openLP2FilenameEdit)
|
||||||
self.OpenLyricsButtonSpacer = QtGui.QSpacerItem(40, 20,
|
self.openLP2BrowseButton = QtGui.QToolButton(self.openLP2Page)
|
||||||
|
self.openLP2BrowseButton.setIcon(openIcon)
|
||||||
|
self.openLP2BrowseButton.setObjectName(u'openLP2BrowseButton')
|
||||||
|
self.openLP2FileLayout.addWidget(self.openLP2BrowseButton)
|
||||||
|
self.openLP2Layout.setLayout(0, QtGui.QFormLayout.FieldRole,
|
||||||
|
self.openLP2FileLayout)
|
||||||
|
self.formatStackedWidget.addWidget(self.openLP2Page)
|
||||||
|
# openlp.org 1.x
|
||||||
|
self.openLP1Page = QtGui.QWidget()
|
||||||
|
self.openLP1Page.setObjectName(u'openLP1Page')
|
||||||
|
self.openLP1Layout = QtGui.QFormLayout(self.openLP1Page)
|
||||||
|
self.openLP1Layout.setMargin(0)
|
||||||
|
self.openLP1Layout.setSpacing(8)
|
||||||
|
self.openLP1Layout.setObjectName(u'openLP1Layout')
|
||||||
|
self.openLP1FilenameLabel = QtGui.QLabel(self.openLP1Page)
|
||||||
|
self.openLP1FilenameLabel.setObjectName(u'openLP1FilenameLabel')
|
||||||
|
self.openLP1Layout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
||||||
|
self.openLP1FilenameLabel)
|
||||||
|
self.openLP1FileLayout = QtGui.QHBoxLayout()
|
||||||
|
self.openLP1FileLayout.setSpacing(8)
|
||||||
|
self.openLP1FileLayout.setObjectName(u'openLP1FileLayout')
|
||||||
|
self.openLP1FilenameEdit = QtGui.QLineEdit(self.openLP1Page)
|
||||||
|
self.openLP1FilenameEdit.setObjectName(u'openLP1FilenameEdit')
|
||||||
|
self.openLP1FileLayout.addWidget(self.openLP1FilenameEdit)
|
||||||
|
self.openLP1BrowseButton = QtGui.QToolButton(self.openLP1Page)
|
||||||
|
self.openLP1BrowseButton.setIcon(openIcon)
|
||||||
|
self.openLP1BrowseButton.setObjectName(u'openLP1BrowseButton')
|
||||||
|
self.openLP1FileLayout.addWidget(self.openLP1BrowseButton)
|
||||||
|
self.openLP1Layout.setLayout(0, QtGui.QFormLayout.FieldRole,
|
||||||
|
self.openLP1FileLayout)
|
||||||
|
self.formatStackedWidget.addWidget(self.openLP1Page)
|
||||||
|
# OpenLyrics
|
||||||
|
self.openLyricsPage = QtGui.QWidget()
|
||||||
|
self.openLyricsPage.setObjectName(u'OpenLyricsPage')
|
||||||
|
self.openLyricsLayout = QtGui.QVBoxLayout(self.openLyricsPage)
|
||||||
|
self.openLyricsLayout.setSpacing(8)
|
||||||
|
self.openLyricsLayout.setMargin(0)
|
||||||
|
self.openLyricsLayout.setObjectName(u'OpenLyricsLayout')
|
||||||
|
self.openLyricsFileListWidget = QtGui.QListWidget(self.openLyricsPage)
|
||||||
|
self.openLyricsFileListWidget.setSelectionMode(
|
||||||
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
|
self.openLyricsFileListWidget.setObjectName(u'OpenLyricsFileListWidget')
|
||||||
|
self.openLyricsLayout.addWidget(self.openLyricsFileListWidget)
|
||||||
|
self.openLyricsButtonLayout = QtGui.QHBoxLayout()
|
||||||
|
self.openLyricsButtonLayout.setSpacing(8)
|
||||||
|
self.openLyricsButtonLayout.setObjectName(u'OpenLyricsButtonLayout')
|
||||||
|
self.openLyricsAddButton = QtGui.QPushButton(self.openLyricsPage)
|
||||||
|
self.openLyricsAddButton.setIcon(openIcon)
|
||||||
|
self.openLyricsAddButton.setObjectName(u'OpenLyricsAddButton')
|
||||||
|
self.openLyricsButtonLayout.addWidget(self.openLyricsAddButton)
|
||||||
|
self.openLyricsButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
self.OpenLyricsButtonLayout.addItem(self.OpenLyricsButtonSpacer)
|
self.openLyricsButtonLayout.addItem(self.openLyricsButtonSpacer)
|
||||||
self.OpenLyricsRemoveButton = QtGui.QPushButton(self.OpenLyricsPage)
|
self.openLyricsRemoveButton = QtGui.QPushButton(self.openLyricsPage)
|
||||||
deleteIcon = build_icon(u':/general/general_delete.png')
|
self.openLyricsRemoveButton.setIcon(deleteIcon)
|
||||||
self.OpenLyricsRemoveButton.setIcon(deleteIcon)
|
self.openLyricsRemoveButton.setObjectName(u'OpenLyricsRemoveButton')
|
||||||
self.OpenLyricsRemoveButton.setObjectName(u'OpenLyricsRemoveButton')
|
self.openLyricsButtonLayout.addWidget(self.openLyricsRemoveButton)
|
||||||
self.OpenLyricsButtonLayout.addWidget(self.OpenLyricsRemoveButton)
|
self.openLyricsLayout.addLayout(self.openLyricsButtonLayout)
|
||||||
self.OpenLyricsLayout.addLayout(self.OpenLyricsButtonLayout)
|
self.formatStackedWidget.addWidget(self.openLyricsPage)
|
||||||
self.FormatStackedWidget.addWidget(self.OpenLyricsPage)
|
# Open Song
|
||||||
self.OpenSongPage = QtGui.QWidget()
|
self.openSongPage = QtGui.QWidget()
|
||||||
self.OpenSongPage.setObjectName(u'OpenSongPage')
|
self.openSongPage.setObjectName(u'OpenSongPage')
|
||||||
self.OpenSongLayout = QtGui.QVBoxLayout(self.OpenSongPage)
|
self.openSongLayout = QtGui.QVBoxLayout(self.openSongPage)
|
||||||
self.OpenSongLayout.setSpacing(8)
|
self.openSongLayout.setSpacing(8)
|
||||||
self.OpenSongLayout.setMargin(0)
|
self.openSongLayout.setMargin(0)
|
||||||
self.OpenSongLayout.setObjectName(u'OpenSongLayout')
|
self.openSongLayout.setObjectName(u'OpenSongLayout')
|
||||||
self.OpenSongFileListWidget = QtGui.QListWidget(self.OpenSongPage)
|
self.openSongFileListWidget = QtGui.QListWidget(self.openSongPage)
|
||||||
self.OpenSongFileListWidget.setObjectName(u'OpenSongFileListWidget')
|
self.openSongFileListWidget.setSelectionMode(
|
||||||
self.OpenSongLayout.addWidget(self.OpenSongFileListWidget)
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.OpenSongButtonLayout = QtGui.QHBoxLayout()
|
self.openSongFileListWidget.setObjectName(u'OpenSongFileListWidget')
|
||||||
self.OpenSongButtonLayout.setSpacing(8)
|
self.openSongLayout.addWidget(self.openSongFileListWidget)
|
||||||
self.OpenSongButtonLayout.setObjectName(u'OpenSongButtonLayout')
|
self.openSongButtonLayout = QtGui.QHBoxLayout()
|
||||||
self.OpenSongAddButton = QtGui.QPushButton(self.OpenSongPage)
|
self.openSongButtonLayout.setSpacing(8)
|
||||||
self.OpenSongAddButton.setIcon(openIcon)
|
self.openSongButtonLayout.setObjectName(u'OpenSongButtonLayout')
|
||||||
self.OpenSongAddButton.setObjectName(u'OpenSongAddButton')
|
self.openSongAddButton = QtGui.QPushButton(self.openSongPage)
|
||||||
self.OpenSongButtonLayout.addWidget(self.OpenSongAddButton)
|
self.openSongAddButton.setIcon(openIcon)
|
||||||
self.OpenSongButtonSpacer = QtGui.QSpacerItem(40, 20,
|
self.openSongAddButton.setObjectName(u'OpenSongAddButton')
|
||||||
|
self.openSongButtonLayout.addWidget(self.openSongAddButton)
|
||||||
|
self.openSongButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
self.OpenSongButtonLayout.addItem(self.OpenSongButtonSpacer)
|
self.openSongButtonLayout.addItem(self.openSongButtonSpacer)
|
||||||
self.OpenSongRemoveButton = QtGui.QPushButton(self.OpenSongPage)
|
self.openSongRemoveButton = QtGui.QPushButton(self.openSongPage)
|
||||||
self.OpenSongRemoveButton.setIcon(deleteIcon)
|
self.openSongRemoveButton.setIcon(deleteIcon)
|
||||||
self.OpenSongRemoveButton.setObjectName(u'OpenSongRemoveButton')
|
self.openSongRemoveButton.setObjectName(u'OpenSongRemoveButton')
|
||||||
self.OpenSongButtonLayout.addWidget(self.OpenSongRemoveButton)
|
self.openSongButtonLayout.addWidget(self.openSongRemoveButton)
|
||||||
self.OpenSongLayout.addLayout(self.OpenSongButtonLayout)
|
self.openSongLayout.addLayout(self.openSongButtonLayout)
|
||||||
self.FormatStackedWidget.addWidget(self.OpenSongPage)
|
self.formatStackedWidget.addWidget(self.openSongPage)
|
||||||
self.CCLIPage = QtGui.QWidget()
|
# Words of Worship
|
||||||
self.CCLIPage.setObjectName(u'CCLIPage')
|
self.wordsOfWorshipPage = QtGui.QWidget()
|
||||||
self.CCLILayout = QtGui.QVBoxLayout(self.CCLIPage)
|
self.wordsOfWorshipPage.setObjectName(u'wordsOfWorshipPage')
|
||||||
self.CCLILayout.setSpacing(8)
|
self.wordsOfWorshipLayout = QtGui.QVBoxLayout(self.wordsOfWorshipPage)
|
||||||
self.CCLILayout.setMargin(0)
|
self.wordsOfWorshipLayout.setSpacing(8)
|
||||||
self.CCLILayout.setObjectName(u'CCLILayout')
|
self.wordsOfWorshipLayout.setMargin(0)
|
||||||
self.CCLIFileListWidget = QtGui.QListWidget(self.CCLIPage)
|
self.wordsOfWorshipLayout.setObjectName(u'wordsOfWorshipLayout')
|
||||||
self.CCLIFileListWidget.setObjectName(u'CCLIFileListWidget')
|
self.wordsOfWorshipFileListWidget = QtGui.QListWidget(self.wordsOfWorshipPage)
|
||||||
self.CCLILayout.addWidget(self.CCLIFileListWidget)
|
self.wordsOfWorshipFileListWidget.setSelectionMode(
|
||||||
self.CCLIButtonLayout = QtGui.QHBoxLayout()
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.CCLIButtonLayout.setSpacing(8)
|
self.wordsOfWorshipFileListWidget.setObjectName(u'wordsOfWorshipFileListWidget')
|
||||||
self.CCLIButtonLayout.setObjectName(u'CCLIButtonLayout')
|
self.wordsOfWorshipLayout.addWidget(self.wordsOfWorshipFileListWidget)
|
||||||
self.CCLIAddButton = QtGui.QPushButton(self.CCLIPage)
|
self.wordsOfWorshipButtonLayout = QtGui.QHBoxLayout()
|
||||||
self.CCLIAddButton.setIcon(openIcon)
|
self.wordsOfWorshipButtonLayout.setSpacing(8)
|
||||||
self.CCLIAddButton.setObjectName(u'CCLIAddButton')
|
self.wordsOfWorshipButtonLayout.setObjectName(u'wordsOfWorshipButtonLayout')
|
||||||
self.CCLIButtonLayout.addWidget(self.CCLIAddButton)
|
self.wordsOfWorshipAddButton = QtGui.QPushButton(self.wordsOfWorshipPage)
|
||||||
self.CCLIButtonSpacer = QtGui.QSpacerItem(40, 20,
|
self.wordsOfWorshipAddButton.setIcon(openIcon)
|
||||||
|
self.wordsOfWorshipAddButton.setObjectName(u'wordsOfWorshipAddButton')
|
||||||
|
self.wordsOfWorshipButtonLayout.addWidget(self.wordsOfWorshipAddButton)
|
||||||
|
self.wordsOfWorshipButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
self.CCLIButtonLayout.addItem(self.CCLIButtonSpacer)
|
self.wordsOfWorshipButtonLayout.addItem(self.wordsOfWorshipButtonSpacer)
|
||||||
self.CCLIRemoveButton = QtGui.QPushButton(self.CCLIPage)
|
self.wordsOfWorshipRemoveButton = QtGui.QPushButton(self.wordsOfWorshipPage)
|
||||||
self.CCLIRemoveButton.setIcon(deleteIcon)
|
self.wordsOfWorshipRemoveButton.setIcon(deleteIcon)
|
||||||
self.CCLIRemoveButton.setObjectName(u'CCLIRemoveButton')
|
self.wordsOfWorshipRemoveButton.setObjectName(u'wordsOfWorshipRemoveButton')
|
||||||
self.CCLIButtonLayout.addWidget(self.CCLIRemoveButton)
|
self.wordsOfWorshipButtonLayout.addWidget(self.wordsOfWorshipRemoveButton)
|
||||||
self.CCLILayout.addLayout(self.CCLIButtonLayout)
|
self.wordsOfWorshipLayout.addLayout(self.wordsOfWorshipButtonLayout)
|
||||||
self.FormatStackedWidget.addWidget(self.CCLIPage)
|
self.formatStackedWidget.addWidget(self.wordsOfWorshipPage)
|
||||||
self.CSVPage = QtGui.QWidget()
|
# CCLI File import
|
||||||
self.CSVPage.setObjectName(u'CSVPage')
|
self.ccliPage = QtGui.QWidget()
|
||||||
self.CSVLayout = QtGui.QFormLayout(self.CSVPage)
|
self.ccliPage.setObjectName(u'ccliPage')
|
||||||
self.CSVLayout.setMargin(0)
|
self.ccliLayout = QtGui.QVBoxLayout(self.ccliPage)
|
||||||
self.CSVLayout.setSpacing(8)
|
self.ccliLayout.setSpacing(8)
|
||||||
self.CSVLayout.setObjectName(u'CSVLayout')
|
self.ccliLayout.setMargin(0)
|
||||||
self.CSVFilenameLabel = QtGui.QLabel(self.CSVPage)
|
self.ccliLayout.setObjectName(u'ccliLayout')
|
||||||
self.CSVFilenameLabel.setObjectName(u'CSVFilenameLabel')
|
self.ccliFileListWidget = QtGui.QListWidget(self.ccliPage)
|
||||||
self.CSVLayout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
self.ccliFileListWidget.setSelectionMode(
|
||||||
self.CSVFilenameLabel)
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.CSVFileLayout = QtGui.QHBoxLayout()
|
self.ccliFileListWidget.setObjectName(u'ccliFileListWidget')
|
||||||
self.CSVFileLayout.setSpacing(8)
|
self.ccliLayout.addWidget(self.ccliFileListWidget)
|
||||||
self.CSVFileLayout.setObjectName(u'CSVFileLayout')
|
self.ccliButtonLayout = QtGui.QHBoxLayout()
|
||||||
self.CSVFilenameEdit = QtGui.QLineEdit(self.CSVPage)
|
self.ccliButtonLayout.setSpacing(8)
|
||||||
self.CSVFilenameEdit.setObjectName(u'CSVFilenameEdit')
|
self.ccliButtonLayout.setObjectName(u'ccliButtonLayout')
|
||||||
self.CSVFileLayout.addWidget(self.CSVFilenameEdit)
|
self.ccliAddButton = QtGui.QPushButton(self.ccliPage)
|
||||||
self.CSVBrowseButton = QtGui.QToolButton(self.CSVPage)
|
self.ccliAddButton.setIcon(openIcon)
|
||||||
self.CSVBrowseButton.setIcon(openIcon)
|
self.ccliAddButton.setObjectName(u'ccliAddButton')
|
||||||
self.CSVBrowseButton.setObjectName(u'CSVBrowseButton')
|
self.ccliButtonLayout.addWidget(self.ccliAddButton)
|
||||||
self.CSVFileLayout.addWidget(self.CSVBrowseButton)
|
self.ccliButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
self.CSVLayout.setLayout(0, QtGui.QFormLayout.FieldRole,
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
self.CSVFileLayout)
|
self.ccliButtonLayout.addItem(self.ccliButtonSpacer)
|
||||||
self.FormatStackedWidget.addWidget(self.CSVPage)
|
self.ccliRemoveButton = QtGui.QPushButton(self.ccliPage)
|
||||||
self.SourceLayout.addWidget(self.FormatStackedWidget)
|
self.ccliRemoveButton.setIcon(deleteIcon)
|
||||||
SongImportWizard.addPage(self.SourcePage)
|
self.ccliRemoveButton.setObjectName(u'ccliRemoveButton')
|
||||||
self.ImportPage = QtGui.QWizardPage()
|
self.ccliButtonLayout.addWidget(self.ccliRemoveButton)
|
||||||
self.ImportPage.setObjectName(u'ImportPage')
|
self.ccliLayout.addLayout(self.ccliButtonLayout)
|
||||||
self.ImportLayout = QtGui.QVBoxLayout(self.ImportPage)
|
self.formatStackedWidget.addWidget(self.ccliPage)
|
||||||
self.ImportLayout.setSpacing(8)
|
# Songs of Fellowship
|
||||||
self.ImportLayout.setMargin(50)
|
self.songsOfFellowshipPage = QtGui.QWidget()
|
||||||
self.ImportLayout.setObjectName(u'ImportLayout')
|
self.songsOfFellowshipPage.setObjectName(u'songsOfFellowshipPage')
|
||||||
self.ImportProgressLabel = QtGui.QLabel(self.ImportPage)
|
self.songsOfFellowshipLayout = QtGui.QVBoxLayout(self.songsOfFellowshipPage)
|
||||||
self.ImportProgressLabel.setObjectName(u'ImportProgressLabel')
|
self.songsOfFellowshipLayout.setMargin(0)
|
||||||
self.ImportLayout.addWidget(self.ImportProgressLabel)
|
self.songsOfFellowshipLayout.setSpacing(8)
|
||||||
self.ImportProgressBar = QtGui.QProgressBar(self.ImportPage)
|
self.songsOfFellowshipLayout.setObjectName(u'songsOfFellowshipLayout')
|
||||||
self.ImportProgressBar.setProperty(u'value', 0)
|
self.songsOfFellowshipFileListWidget = QtGui.QListWidget(self.songsOfFellowshipPage)
|
||||||
self.ImportProgressBar.setInvertedAppearance(False)
|
self.songsOfFellowshipFileListWidget.setSelectionMode(
|
||||||
self.ImportProgressBar.setObjectName(u'ImportProgressBar')
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.ImportLayout.addWidget(self.ImportProgressBar)
|
self.songsOfFellowshipFileListWidget.setObjectName(u'songsOfFellowshipFileListWidget')
|
||||||
SongImportWizard.addPage(self.ImportPage)
|
self.songsOfFellowshipLayout.addWidget(self.songsOfFellowshipFileListWidget)
|
||||||
self.retranslateUi(SongImportWizard)
|
self.songsOfFellowshipButtonLayout = QtGui.QHBoxLayout()
|
||||||
self.FormatStackedWidget.setCurrentIndex(0)
|
self.songsOfFellowshipButtonLayout.setSpacing(8)
|
||||||
QtCore.QObject.connect(self.FormatComboBox,
|
self.songsOfFellowshipButtonLayout.setObjectName(u'songsOfFellowshipButtonLayout')
|
||||||
|
self.songsOfFellowshipAddButton = QtGui.QPushButton(self.songsOfFellowshipPage)
|
||||||
|
self.songsOfFellowshipAddButton.setIcon(openIcon)
|
||||||
|
self.songsOfFellowshipAddButton.setObjectName(u'songsOfFellowshipAddButton')
|
||||||
|
self.songsOfFellowshipButtonLayout.addWidget(self.songsOfFellowshipAddButton)
|
||||||
|
self.songsOfFellowshipButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
|
self.songsOfFellowshipButtonLayout.addItem(self.songsOfFellowshipButtonSpacer)
|
||||||
|
self.songsOfFellowshipRemoveButton = QtGui.QPushButton(self.songsOfFellowshipPage)
|
||||||
|
self.songsOfFellowshipRemoveButton.setIcon(deleteIcon)
|
||||||
|
self.songsOfFellowshipRemoveButton.setObjectName(u'songsOfFellowshipRemoveButton')
|
||||||
|
self.songsOfFellowshipButtonLayout.addWidget(self.songsOfFellowshipRemoveButton)
|
||||||
|
self.songsOfFellowshipLayout.addLayout(self.songsOfFellowshipButtonLayout)
|
||||||
|
self.formatStackedWidget.addWidget(self.songsOfFellowshipPage)
|
||||||
|
# Generic Document/Presentation import
|
||||||
|
self.genericPage = QtGui.QWidget()
|
||||||
|
self.genericPage.setObjectName(u'genericPage')
|
||||||
|
self.genericLayout = QtGui.QVBoxLayout(self.genericPage)
|
||||||
|
self.genericLayout.setMargin(0)
|
||||||
|
self.genericLayout.setSpacing(8)
|
||||||
|
self.genericLayout.setObjectName(u'genericLayout')
|
||||||
|
self.genericFileListWidget = QtGui.QListWidget(self.genericPage)
|
||||||
|
self.genericFileListWidget.setSelectionMode(
|
||||||
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
|
self.genericFileListWidget.setObjectName(u'genericFileListWidget')
|
||||||
|
self.genericLayout.addWidget(self.genericFileListWidget)
|
||||||
|
self.genericButtonLayout = QtGui.QHBoxLayout()
|
||||||
|
self.genericButtonLayout.setSpacing(8)
|
||||||
|
self.genericButtonLayout.setObjectName(u'genericButtonLayout')
|
||||||
|
self.genericAddButton = QtGui.QPushButton(self.genericPage)
|
||||||
|
self.genericAddButton.setIcon(openIcon)
|
||||||
|
self.genericAddButton.setObjectName(u'genericAddButton')
|
||||||
|
self.genericButtonLayout.addWidget(self.genericAddButton)
|
||||||
|
self.genericButtonSpacer = QtGui.QSpacerItem(40, 20,
|
||||||
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
|
self.genericButtonLayout.addItem(self.genericButtonSpacer)
|
||||||
|
self.genericRemoveButton = QtGui.QPushButton(self.genericPage)
|
||||||
|
self.genericRemoveButton.setIcon(deleteIcon)
|
||||||
|
self.genericRemoveButton.setObjectName(u'genericRemoveButton')
|
||||||
|
self.genericButtonLayout.addWidget(self.genericRemoveButton)
|
||||||
|
self.genericLayout.addLayout(self.genericButtonLayout)
|
||||||
|
self.formatStackedWidget.addWidget(self.genericPage)
|
||||||
|
# Commented out for future use.
|
||||||
|
# self.csvPage = QtGui.QWidget()
|
||||||
|
# self.csvPage.setObjectName(u'CSVPage')
|
||||||
|
# self.csvLayout = QtGui.QFormLayout(self.csvPage)
|
||||||
|
# self.csvLayout.setMargin(0)
|
||||||
|
# self.csvLayout.setSpacing(8)
|
||||||
|
# self.csvLayout.setObjectName(u'CSVLayout')
|
||||||
|
# self.csvFilenameLabel = QtGui.QLabel(self.csvPage)
|
||||||
|
# self.csvFilenameLabel.setObjectName(u'CSVFilenameLabel')
|
||||||
|
# self.csvLayout.setWidget(0, QtGui.QFormLayout.LabelRole,
|
||||||
|
# self.csvFilenameLabel)
|
||||||
|
# self.csvFileLayout = QtGui.QHBoxLayout()
|
||||||
|
# self.csvFileLayout.setSpacing(8)
|
||||||
|
# self.csvFileLayout.setObjectName(u'CSVFileLayout')
|
||||||
|
# self.csvFilenameEdit = QtGui.QLineEdit(self.csvPage)
|
||||||
|
# self.csvFilenameEdit.setObjectName(u'CSVFilenameEdit')
|
||||||
|
# self.csvFileLayout.addWidget(self.csvFilenameEdit)
|
||||||
|
# self.csvBrowseButton = QtGui.QToolButton(self.csvPage)
|
||||||
|
# self.csvBrowseButton.setIcon(openIcon)
|
||||||
|
# self.csvBrowseButton.setObjectName(u'CSVBrowseButton')
|
||||||
|
# self.csvFileLayout.addWidget(self.csvBrowseButton)
|
||||||
|
# self.csvLayout.setLayout(0, QtGui.QFormLayout.FieldRole,
|
||||||
|
# self.csvFileLayout)
|
||||||
|
# self.formatStackedWidget.addWidget(self.csvPage)
|
||||||
|
self.sourceLayout.addWidget(self.formatStackedWidget)
|
||||||
|
songImportWizard.addPage(self.sourcePage)
|
||||||
|
self.importPage = QtGui.QWizardPage()
|
||||||
|
self.importPage.setObjectName(u'importPage')
|
||||||
|
self.importLayout = QtGui.QVBoxLayout(self.importPage)
|
||||||
|
self.importLayout.setSpacing(8)
|
||||||
|
self.importLayout.setMargin(50)
|
||||||
|
self.importLayout.setObjectName(u'importLayout')
|
||||||
|
self.importProgressLabel = QtGui.QLabel(self.importPage)
|
||||||
|
self.importProgressLabel.setObjectName(u'importProgressLabel')
|
||||||
|
self.importLayout.addWidget(self.importProgressLabel)
|
||||||
|
self.importProgressBar = QtGui.QProgressBar(self.importPage)
|
||||||
|
self.importProgressBar.setProperty(u'value', 0)
|
||||||
|
self.importProgressBar.setInvertedAppearance(False)
|
||||||
|
self.importProgressBar.setObjectName(u'importProgressBar')
|
||||||
|
self.importLayout.addWidget(self.importProgressBar)
|
||||||
|
songImportWizard.addPage(self.importPage)
|
||||||
|
self.retranslateUi(songImportWizard)
|
||||||
|
self.formatStackedWidget.setCurrentIndex(0)
|
||||||
|
QtCore.QObject.connect(self.formatComboBox,
|
||||||
QtCore.SIGNAL(u'currentIndexChanged(int)'),
|
QtCore.SIGNAL(u'currentIndexChanged(int)'),
|
||||||
self.FormatStackedWidget.setCurrentIndex)
|
self.formatStackedWidget.setCurrentIndex)
|
||||||
QtCore.QMetaObject.connectSlotsByName(SongImportWizard)
|
QtCore.QMetaObject.connectSlotsByName(songImportWizard)
|
||||||
|
|
||||||
def retranslateUi(self, SongImportWizard):
|
def retranslateUi(self, songImportWizard):
|
||||||
SongImportWizard.setWindowTitle(
|
songImportWizard.setWindowTitle(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard'))
|
translate('SongsPlugin.ImportWizardForm', 'Song Import Wizard'))
|
||||||
self.TitleLabel.setText(
|
self.titleLabel.setText(
|
||||||
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
u'<span style="font-size:14pt; font-weight:600;">%s</span>' % \
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'Welcome to the Song Import Wizard'))
|
'Welcome to the Song Import Wizard'))
|
||||||
self.InformationLabel.setText(
|
self.informationLabel.setText(
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'This wizard will help you to import songs from a variety of '
|
'This wizard will help you to import songs from a variety of '
|
||||||
'formats. Click the next button below to start the process by '
|
'formats. Click the next button below to start the process by '
|
||||||
'selecting a format to import from.'))
|
'selecting a format to import from.'))
|
||||||
self.SourcePage.setTitle(
|
self.sourcePage.setTitle(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Select Import Source'))
|
translate('SongsPlugin.ImportWizardForm', 'Select Import Source'))
|
||||||
self.SourcePage.setSubTitle(
|
self.sourcePage.setSubTitle(
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'Select the import format, and where to import from.'))
|
'Select the import format, and where to import from.'))
|
||||||
self.FormatLabel.setText(
|
self.formatLabel.setText(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Format:'))
|
translate('SongsPlugin.ImportWizardForm', 'Format:'))
|
||||||
self.FormatComboBox.setItemText(0,
|
self.formatComboBox.setItemText(0,
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0'))
|
||||||
|
self.formatComboBox.setItemText(1,
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x'))
|
||||||
|
self.formatComboBox.setItemText(2,
|
||||||
translate('SongsPlugin.ImportWizardForm', 'OpenLyrics'))
|
translate('SongsPlugin.ImportWizardForm', 'OpenLyrics'))
|
||||||
self.FormatComboBox.setItemText(1,
|
self.formatComboBox.setItemText(3,
|
||||||
translate('SongsPlugin.ImportWizardForm', 'OpenSong'))
|
translate('SongsPlugin.ImportWizardForm', 'OpenSong'))
|
||||||
self.FormatComboBox.setItemText(2,
|
self.formatComboBox.setItemText(4,
|
||||||
translate('SongsPlugin.ImportWizardForm', 'CCLI'))
|
translate('SongsPlugin.ImportWizardForm', 'Words of Worship'))
|
||||||
self.FormatComboBox.setItemText(3,
|
self.formatComboBox.setItemText(5,
|
||||||
translate('SongsPlugin.ImportWizardForm', 'CSV'))
|
translate('SongsPlugin.ImportWizardForm', 'CCLI/SongSelect'))
|
||||||
self.OpenLyricsAddButton.setText(
|
self.formatComboBox.setItemText(6,
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
translate('SongsPlugin.ImportWizardForm', 'Songs of Fellowship'))
|
||||||
self.OpenLyricsRemoveButton.setText(
|
self.formatComboBox.setItemText(7,
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
self.OpenSongAddButton.setText(
|
'Generic Document/Presentation'))
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
# self.formatComboBox.setItemText(8,
|
||||||
self.OpenSongRemoveButton.setText(
|
# translate('SongsPlugin.ImportWizardForm', 'CSV'))
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
self.openLP2FilenameLabel.setText(
|
||||||
self.CCLIAddButton.setText(
|
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
|
||||||
self.CCLIRemoveButton.setText(
|
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
|
||||||
self.CSVFilenameLabel.setText(
|
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Filename:'))
|
translate('SongsPlugin.ImportWizardForm', 'Filename:'))
|
||||||
self.CSVBrowseButton.setText(
|
self.openLP2BrowseButton.setText(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Browse...'))
|
translate('SongsPlugin.ImportWizardForm', 'Browse...'))
|
||||||
self.ImportPage.setTitle(
|
self.openLP1FilenameLabel.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Filename:'))
|
||||||
|
self.openLP1BrowseButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Browse...'))
|
||||||
|
self.openLyricsAddButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
||||||
|
self.openLyricsRemoveButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
||||||
|
self.openSongAddButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
||||||
|
self.openSongRemoveButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
||||||
|
self.wordsOfWorshipAddButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
||||||
|
self.wordsOfWorshipRemoveButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
||||||
|
self.ccliAddButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
||||||
|
self.ccliRemoveButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
||||||
|
self.songsOfFellowshipAddButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
||||||
|
self.songsOfFellowshipRemoveButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
||||||
|
self.genericAddButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Add Files...'))
|
||||||
|
self.genericRemoveButton.setText(
|
||||||
|
translate('SongsPlugin.ImportWizardForm', 'Remove File(s)'))
|
||||||
|
# self.csvFilenameLabel.setText(
|
||||||
|
# translate('SongsPlugin.ImportWizardForm', 'Filename:'))
|
||||||
|
# self.csvBrowseButton.setText(
|
||||||
|
# translate('SongsPlugin.ImportWizardForm', 'Browse...'))
|
||||||
|
self.importPage.setTitle(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Importing'))
|
translate('SongsPlugin.ImportWizardForm', 'Importing'))
|
||||||
self.ImportPage.setSubTitle(
|
self.importPage.setSubTitle(
|
||||||
translate('SongsPlugin.ImportWizardForm',
|
translate('SongsPlugin.ImportWizardForm',
|
||||||
'Please wait while your songs are imported.'))
|
'Please wait while your songs are imported.'))
|
||||||
self.ImportProgressLabel.setText(
|
self.importProgressLabel.setText(
|
||||||
translate('SongsPlugin.ImportWizardForm', 'Ready.'))
|
translate('SongsPlugin.ImportWizardForm', 'Ready.'))
|
||||||
self.ImportProgressBar.setFormat(
|
self.importProgressBar.setFormat(
|
||||||
translate('SongsPlugin.ImportWizardForm', '%p%'))
|
translate('SongsPlugin.ImportWizardForm', '%p%'))
|
||||||
|
|
|
@ -88,9 +88,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
|
||||||
item = self.songmanager.get_object(item_class, item_id)
|
item = self.songmanager.get_object(item_class, item_id)
|
||||||
if item and len(item.songs) == 0:
|
if item and len(item.songs) == 0:
|
||||||
if QtGui.QMessageBox.warning(self, dlg_title, del_text,
|
if QtGui.QMessageBox.warning(self, dlg_title, del_text,
|
||||||
QtGui.QMessageBox.StandardButtons(
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No |
|
||||||
QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)
|
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes:
|
||||||
) == QtGui.QMessageBox.Yes:
|
|
||||||
self.songmanager.delete_object(item_class, item.id)
|
self.songmanager.delete_object(item_class, item.id)
|
||||||
reset_func()
|
reset_func()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -26,52 +26,6 @@
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
|
|
||||||
#from openlp.plugins.songs.lib import OpenLyricsSong, OpenSongSong, CCLISong, \
|
|
||||||
# CSVSong
|
|
||||||
|
|
||||||
class SongFormat(object):
|
|
||||||
"""
|
|
||||||
This is a special enumeration class that holds the various types of songs,
|
|
||||||
plus a few helper functions to facilitate generic handling of song types
|
|
||||||
for importing.
|
|
||||||
"""
|
|
||||||
Unknown = -1
|
|
||||||
OpenLyrics = 0
|
|
||||||
OpenSong = 1
|
|
||||||
CCLI = 2
|
|
||||||
CSV = 3
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_class(format):
|
|
||||||
"""
|
|
||||||
Return the appropriate imeplementation class.
|
|
||||||
|
|
||||||
``format``
|
|
||||||
The song format.
|
|
||||||
"""
|
|
||||||
# if format == SongFormat.OpenLyrics:
|
|
||||||
# return OpenLyricsSong
|
|
||||||
# elif format == SongFormat.OpenSong:
|
|
||||||
# return OpenSongSong
|
|
||||||
# elif format == SongFormat.CCLI:
|
|
||||||
# return CCLISong
|
|
||||||
# elif format == SongFormat.CSV:
|
|
||||||
# return CSVSong
|
|
||||||
# else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def list():
|
|
||||||
"""
|
|
||||||
Return a list of the supported song formats.
|
|
||||||
"""
|
|
||||||
return [
|
|
||||||
SongFormat.OpenLyrics,
|
|
||||||
SongFormat.OpenSong,
|
|
||||||
SongFormat.CCLI,
|
|
||||||
SongFormat.CSV
|
|
||||||
]
|
|
||||||
|
|
||||||
class VerseType(object):
|
class VerseType(object):
|
||||||
"""
|
"""
|
||||||
VerseType provides an enumeration for the tags that may be associated
|
VerseType provides an enumeration for the tags that may be associated
|
||||||
|
@ -138,14 +92,7 @@ class VerseType(object):
|
||||||
unicode(VerseType.to_string(VerseType.Other)).lower():
|
unicode(VerseType.to_string(VerseType.Other)).lower():
|
||||||
return VerseType.Other
|
return VerseType.Other
|
||||||
|
|
||||||
|
|
||||||
from xml import LyricsXML, SongXMLBuilder, SongXMLParser
|
from xml import LyricsXML, SongXMLBuilder, SongXMLParser
|
||||||
from songstab import SongsTab
|
from songstab import SongsTab
|
||||||
from mediaitem import SongMediaItem
|
from mediaitem import SongMediaItem
|
||||||
from songimport import SongImport
|
|
||||||
from opensongimport import OpenSongImport
|
|
||||||
from olpimport import OpenLPSongImport
|
|
||||||
try:
|
|
||||||
from sofimport import SofImport
|
|
||||||
from oooimport import OooImport
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2010 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
|
||||||
|
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
|
||||||
|
# Carsten Tinggaard, Frode Woldsund #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from opensongimport import OpenSongImport
|
||||||
|
from olpimport import OpenLPSongImport
|
||||||
|
try:
|
||||||
|
from sofimport import SofImport
|
||||||
|
from oooimport import OooImport
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
class SongFormat(object):
|
||||||
|
"""
|
||||||
|
This is a special enumeration class that holds the various types of songs,
|
||||||
|
plus a few helper functions to facilitate generic handling of song types
|
||||||
|
for importing.
|
||||||
|
"""
|
||||||
|
Unknown = -1
|
||||||
|
OpenLP2 = 0
|
||||||
|
OpenLP1 = 1
|
||||||
|
OpenLyrics = 2
|
||||||
|
OpenSong = 3
|
||||||
|
WordsOfWorship = 4
|
||||||
|
CCLI = 5
|
||||||
|
SongsOfFellowship = 6
|
||||||
|
Generic = 7
|
||||||
|
CSV = 8
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_class(format):
|
||||||
|
"""
|
||||||
|
Return the appropriate imeplementation class.
|
||||||
|
|
||||||
|
``format``
|
||||||
|
The song format.
|
||||||
|
"""
|
||||||
|
if format == SongFormat.OpenLP2:
|
||||||
|
return OpenLPSongImport
|
||||||
|
elif format == SongFormat.OpenSong:
|
||||||
|
return OpenSongImport
|
||||||
|
elif format == SongFormat.SongsOfFellowship:
|
||||||
|
return SofImport
|
||||||
|
elif format == SongFormat.Generic:
|
||||||
|
return OooImport
|
||||||
|
# else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def list():
|
||||||
|
"""
|
||||||
|
Return a list of the supported song formats.
|
||||||
|
"""
|
||||||
|
return [
|
||||||
|
SongFormat.OpenLP2,
|
||||||
|
SongFormat.OpenLP1,
|
||||||
|
SongFormat.OpenLyrics,
|
||||||
|
SongFormat.OpenSong,
|
||||||
|
SongFormat.WordsOfWorship,
|
||||||
|
SongFormat.CCLI,
|
||||||
|
SongFormat.SongsOfFellowship,
|
||||||
|
SongFormat.Generic
|
||||||
|
]
|
||||||
|
|
||||||
|
__all__ = [u'SongFormat']
|
|
@ -236,9 +236,10 @@ class SongMediaItem(MediaManagerItem):
|
||||||
self.onSearchTextButtonClick()
|
self.onSearchTextButtonClick()
|
||||||
|
|
||||||
def onImportClick(self):
|
def onImportClick(self):
|
||||||
songimportform = ImportWizardForm(self, self.parent.manager,
|
if not hasattr(self, u'import_wizard'):
|
||||||
self.parent)
|
self.import_wizard = ImportWizardForm(self, self.parent)
|
||||||
songimportform.exec_()
|
self.import_wizard.exec_()
|
||||||
|
Receiver.send_message(u'songs_load_list')
|
||||||
|
|
||||||
def onNewClick(self):
|
def onNewClick(self):
|
||||||
self.edit_song_form.newSong()
|
self.edit_song_form.newSong()
|
||||||
|
|
|
@ -36,6 +36,7 @@ from sqlalchemy.orm.exc import UnmappedClassError
|
||||||
|
|
||||||
from openlp.core.lib.db import BaseModel
|
from openlp.core.lib.db import BaseModel
|
||||||
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic #, MediaFile
|
from openlp.plugins.songs.lib.db import Author, Book, Song, Topic #, MediaFile
|
||||||
|
from songimport import SongImport
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -69,12 +70,12 @@ class OldTopic(BaseModel):
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class OpenLPSongImport(object):
|
class OpenLPSongImport(SongImport):
|
||||||
"""
|
"""
|
||||||
The :class:`OpenLPSongImport` class provides OpenLP with the ability to
|
The :class:`OpenLPSongImport` class provides OpenLP with the ability to
|
||||||
import song databases from other installations of OpenLP.
|
import song databases from other installations of OpenLP.
|
||||||
"""
|
"""
|
||||||
def __init__(self, master_manager, source_db):
|
def __init__(self, master_manager, **kwargs):
|
||||||
"""
|
"""
|
||||||
Initialise the import.
|
Initialise the import.
|
||||||
|
|
||||||
|
@ -84,11 +85,13 @@ class OpenLPSongImport(object):
|
||||||
``source_db``
|
``source_db``
|
||||||
The database providing the data to import.
|
The database providing the data to import.
|
||||||
"""
|
"""
|
||||||
|
SongImport.__init__(self, master_manager)
|
||||||
self.master_manager = master_manager
|
self.master_manager = master_manager
|
||||||
self.import_source = source_db
|
self.import_source = u'sqlite:///%s' % kwargs[u'filename']
|
||||||
|
log.debug(self.import_source)
|
||||||
self.source_session = None
|
self.source_session = None
|
||||||
|
|
||||||
def import_source_v2_db(self):
|
def do_import(self):
|
||||||
"""
|
"""
|
||||||
Run the import for an OpenLP version 2 song database.
|
Run the import for an OpenLP version 2 song database.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from openlp.core.lib import translate
|
from openlp.core.lib import translate
|
||||||
from openlp.plugins.songs.lib import SongXMLBuilder, VerseType
|
from openlp.plugins.songs.lib import VerseType
|
||||||
from openlp.plugins.songs.lib.db import Song, Author, Topic, Book
|
from openlp.plugins.songs.lib.db import Song, Author, Topic, Book
|
||||||
|
from openlp.plugins.songs.lib.xml import SongXMLBuilder
|
||||||
|
|
||||||
class SongImport(object):
|
class SongImport(object):
|
||||||
"""
|
"""
|
||||||
|
@ -39,14 +40,14 @@ class SongImport(object):
|
||||||
as necessary
|
as necessary
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, song_manager):
|
def __init__(self, manager):
|
||||||
"""
|
"""
|
||||||
Initialise and create defaults for properties
|
Initialise and create defaults for properties
|
||||||
|
|
||||||
song_manager is an instance of a SongManager, through which all
|
song_manager is an instance of a SongManager, through which all
|
||||||
database access is performed
|
database access is performed
|
||||||
"""
|
"""
|
||||||
self.manager = song_manager
|
self.manager = manager
|
||||||
self.title = u''
|
self.title = u''
|
||||||
self.song_number = u''
|
self.song_number = u''
|
||||||
self.alternate_title = u''
|
self.alternate_title = u''
|
||||||
|
@ -67,6 +68,9 @@ class SongImport(object):
|
||||||
self.copyright_symbol = unicode(translate(
|
self.copyright_symbol = unicode(translate(
|
||||||
'SongsPlugin.SongImport', '\xa9'))
|
'SongsPlugin.SongImport', '\xa9'))
|
||||||
|
|
||||||
|
def register(self, import_wizard):
|
||||||
|
self.import_wizard = import_wizard
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_songs_text(manager, text):
|
def process_songs_text(manager, text):
|
||||||
songs = []
|
songs = []
|
||||||
|
|
|
@ -28,18 +28,11 @@ import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, build_icon, Receiver, translate
|
from openlp.core.lib import Plugin, build_icon, translate
|
||||||
from openlp.core.lib.db import Manager
|
from openlp.core.lib.db import Manager
|
||||||
from openlp.plugins.songs.lib import OpenLPSongImport, SongMediaItem, SongsTab
|
from openlp.plugins.songs.lib import SongMediaItem, SongsTab
|
||||||
from openlp.plugins.songs.lib.db import init_schema, Song
|
from openlp.plugins.songs.lib.db import init_schema, Song
|
||||||
|
from openlp.plugins.songs.lib.importer import SongFormat
|
||||||
try:
|
|
||||||
from openlp.plugins.songs.lib import SofImport, OooImport
|
|
||||||
OOo_available = True
|
|
||||||
except ImportError:
|
|
||||||
OOo_available = False
|
|
||||||
|
|
||||||
from openlp.plugins.songs.lib import OpenSongImport
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -99,76 +92,6 @@ class SongsPlugin(Plugin):
|
||||||
# Signals and slots
|
# Signals and slots
|
||||||
QtCore.QObject.connect(self.SongImportItem,
|
QtCore.QObject.connect(self.SongImportItem,
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
|
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
|
||||||
if OOo_available:
|
|
||||||
# Songs of Fellowship import menu item - will be removed and the
|
|
||||||
# functionality will be contained within the import wizard
|
|
||||||
self.ImportSofItem = QtGui.QAction(import_menu)
|
|
||||||
self.ImportSofItem.setObjectName(u'ImportSofItem')
|
|
||||||
self.ImportSofItem.setText(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Songs of Fellowship (temp menu item)'))
|
|
||||||
self.ImportSofItem.setToolTip(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Import songs from the VOLS1_2.RTF, sof3words' \
|
|
||||||
+ '.rtf and sof4words.rtf supplied with the music books'))
|
|
||||||
self.ImportSofItem.setStatusTip(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Import songs from the VOLS1_2.RTF, sof3words' \
|
|
||||||
+ '.rtf and sof4words.rtf supplied with the music books'))
|
|
||||||
import_menu.addAction(self.ImportSofItem)
|
|
||||||
# OpenOffice.org import menu item - will be removed and the
|
|
||||||
# functionality will be contained within the import wizard
|
|
||||||
self.ImportOooItem = QtGui.QAction(import_menu)
|
|
||||||
self.ImportOooItem.setObjectName(u'ImportOooItem')
|
|
||||||
self.ImportOooItem.setText(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Generic Document/Presentation Import '
|
|
||||||
'(temp menu item)'))
|
|
||||||
self.ImportOooItem.setToolTip(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Import songs from '
|
|
||||||
'Word/Writer/Powerpoint/Impress'))
|
|
||||||
self.ImportOooItem.setStatusTip(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Import songs from '
|
|
||||||
'Word/Writer/Powerpoint/Impress'))
|
|
||||||
import_menu.addAction(self.ImportOooItem)
|
|
||||||
# Signals and slots
|
|
||||||
QtCore.QObject.connect(self.ImportSofItem,
|
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onImportSofItemClick)
|
|
||||||
QtCore.QObject.connect(self.ImportOooItem,
|
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onImportOooItemClick)
|
|
||||||
# OpenSong import menu item - will be removed and the
|
|
||||||
# functionality will be contained within the import wizard
|
|
||||||
self.ImportOpenSongItem = QtGui.QAction(import_menu)
|
|
||||||
self.ImportOpenSongItem.setObjectName(u'ImportOpenSongItem')
|
|
||||||
self.ImportOpenSongItem.setText(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'OpenSong (temp menu item)'))
|
|
||||||
self.ImportOpenSongItem.setToolTip(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Import songs from OpenSong files' +
|
|
||||||
'(either raw text or ZIPfiles)'))
|
|
||||||
self.ImportOpenSongItem.setStatusTip(
|
|
||||||
translate('SongsPlugin',
|
|
||||||
'Import songs from OpenSong files' +
|
|
||||||
'(either raw text or ZIPfiles)'))
|
|
||||||
import_menu.addAction(self.ImportOpenSongItem)
|
|
||||||
QtCore.QObject.connect(self.ImportOpenSongItem,
|
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick)
|
|
||||||
# OpenLP v2 import menu item - ditto above regarding refactoring into
|
|
||||||
# an import wizard
|
|
||||||
self.ImportOpenLPSongItem = QtGui.QAction(import_menu)
|
|
||||||
self.ImportOpenLPSongItem.setObjectName(u'ImportOpenLPSongItem')
|
|
||||||
self.ImportOpenLPSongItem.setText(translate('SongsPlugin',
|
|
||||||
'OpenLP v2 Songs (temporary)'))
|
|
||||||
self.ImportOpenLPSongItem.setToolTip(translate('SongsPlugin',
|
|
||||||
'Import an OpenLP v2 song database'))
|
|
||||||
self.ImportOpenLPSongItem.setStatusTip(translate('SongsPlugin',
|
|
||||||
'Import an OpenLP v2 song database'))
|
|
||||||
import_menu.addAction(self.ImportOpenLPSongItem)
|
|
||||||
QtCore.QObject.connect(self.ImportOpenLPSongItem,
|
|
||||||
QtCore.SIGNAL(u'triggered()'), self.onImportOpenLPSongItemClick)
|
|
||||||
|
|
||||||
def addExportMenuItem(self, export_menu):
|
def addExportMenuItem(self, export_menu):
|
||||||
"""
|
"""
|
||||||
|
@ -186,68 +109,6 @@ class SongsPlugin(Plugin):
|
||||||
if self.mediaItem:
|
if self.mediaItem:
|
||||||
self.mediaItem.onImportClick()
|
self.mediaItem.onImportClick()
|
||||||
|
|
||||||
def onImportSofItemClick(self):
|
|
||||||
filenames = QtGui.QFileDialog.getOpenFileNames(
|
|
||||||
None, translate('SongsPlugin',
|
|
||||||
'Open Songs of Fellowship file'),
|
|
||||||
u'', u'Songs of Fellowship file (*.rtf *.RTF)')
|
|
||||||
try:
|
|
||||||
for filename in filenames:
|
|
||||||
sofimport = SofImport(self.manager)
|
|
||||||
sofimport.import_sof(unicode(filename))
|
|
||||||
except:
|
|
||||||
log.exception('Could not import SoF file')
|
|
||||||
QtGui.QMessageBox.critical(None,
|
|
||||||
translate('SongsPlugin', 'Import Error'),
|
|
||||||
translate('SongsPlugin', 'Error importing Songs of '
|
|
||||||
'Fellowship file.\nOpenOffice.org must be installed'
|
|
||||||
' and you must be using an unedited copy of the RTF'
|
|
||||||
' included with the Songs of Fellowship Music Editions'))
|
|
||||||
Receiver.send_message(u'songs_load_list')
|
|
||||||
|
|
||||||
def onImportOpenSongItemClick(self):
|
|
||||||
filenames = QtGui.QFileDialog.getOpenFileNames(
|
|
||||||
None, translate('SongsPlugin',
|
|
||||||
'Open OpenSong file'),
|
|
||||||
u'', u'All files (*.*)')
|
|
||||||
try:
|
|
||||||
for filename in filenames:
|
|
||||||
importer = OpenSongImport(self.manager)
|
|
||||||
importer.do_import(unicode(filename))
|
|
||||||
except:
|
|
||||||
log.exception('Could not import OpenSong file')
|
|
||||||
QtGui.QMessageBox.critical(None,
|
|
||||||
translate('SongsPlugin', 'Import Error'),
|
|
||||||
translate('SongsPlugin', 'Error importing OpenSong file'))
|
|
||||||
Receiver.send_message(u'songs_load_list')
|
|
||||||
|
|
||||||
def onImportOpenLPSongItemClick(self):
|
|
||||||
filenames = QtGui.QFileDialog.getOpenFileNames(None,
|
|
||||||
translate('SongsPlugin', 'Select OpenLP database(s) to import...'),
|
|
||||||
u'', u'OpenLP databases (*.sqlite);;All Files (*)')
|
|
||||||
try:
|
|
||||||
for filename in filenames:
|
|
||||||
db_url = u'sqlite:///%s' % filename
|
|
||||||
importer = OpenLPSongImport(self.manager, db_url)
|
|
||||||
importer.import_source_v2_db()
|
|
||||||
QtGui.QMessageBox.information(None, translate('SongsPlugin',
|
|
||||||
'Database(s) imported'), translate('SongsPlugin', 'Your '
|
|
||||||
'OpenLP v2 song databases have been successfully imported'))
|
|
||||||
except:
|
|
||||||
log.exception(u'Failed to import OpenLP v2 database(s)')
|
|
||||||
QtGui.QMessageBox.critical(None, translate('SongsPlugin',
|
|
||||||
'Import Error'), translate('SongsPlugin',
|
|
||||||
'Error importing OpenLP v2 database(s)'))
|
|
||||||
Receiver.send_message(u'songs_load_list')
|
|
||||||
|
|
||||||
def onImportOooItemClick(self):
|
|
||||||
filenames = QtGui.QFileDialog.getOpenFileNames(
|
|
||||||
None, translate('SongsPlugin', 'Open documents or presentations'),
|
|
||||||
'', u'All Files(*.*)')
|
|
||||||
oooimport = OooImport(self.manager)
|
|
||||||
oooimport.import_docs(filenames)
|
|
||||||
Receiver.send_message(u'songs_load_list')
|
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
about_text = translate('SongsPlugin', '<strong>Songs Plugin</strong>'
|
about_text = translate('SongsPlugin', '<strong>Songs Plugin</strong>'
|
||||||
'<br />The songs plugin provides the ability to display and '
|
'<br />The songs plugin provides the ability to display and '
|
||||||
|
@ -280,3 +141,9 @@ class SongsPlugin(Plugin):
|
||||||
for song in songsUsingTheme:
|
for song in songsUsingTheme:
|
||||||
song.theme_name = newTheme
|
song.theme_name = newTheme
|
||||||
self.custommanager.save_object(song)
|
self.custommanager.save_object(song)
|
||||||
|
|
||||||
|
def importSongs(self, format, **kwargs):
|
||||||
|
class_ = SongFormat.get_class(format)
|
||||||
|
importer = class_(self.manager, **kwargs)
|
||||||
|
importer.register(self.mediaItem.import_wizard)
|
||||||
|
return importer
|
||||||
|
|
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
Loading…
Reference in New Issue