This commit is contained in:
Jon Tibble 2010-06-08 16:38:09 +01:00
parent cbd9fbd47e
commit 559e4c4d63
39 changed files with 254 additions and 211 deletions

View File

@ -671,8 +671,8 @@ class Ui_AmendThemeDialog(object):
self.ThemePreviewLayout.addItem(spacerItem8)
self.AmendThemeLayout.addWidget(self.PreviewGroupBox)
self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog)
self.ThemeButtonBox.setStandardButtons(
QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok)
self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Ok)
self.ThemeButtonBox.setObjectName(u'ThemeButtonBox')
self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
@ -813,12 +813,9 @@ class Ui_AmendThemeDialog(object):
translate(u'AmendThemeForm', u'Width:'))
self.FontMainHeightLabel.setText(
translate(u'AmendThemeForm', u'Height:'))
self.FontMainXSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.FontMainYSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.FontMainWidthSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.FontMainXSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.FontMainYSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.FontMainWidthSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.FontMainHeightSpinBox.setSuffix(
translate(u'AmendThemeForm', u'px'))
self.ThemeTabWidget.setTabText(
@ -830,7 +827,8 @@ class Ui_AmendThemeDialog(object):
self.FontFooterColorLabel.setText(
translate(u'AmendThemeForm', u'Font Color:'))
self.FontFooterSizeLabel.setText(translate(u'AmendThemeForm', u'Size:'))
self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeForm', u'pt'))
self.FontFooterSizeSpinBox.setSuffix(
translate(u'AmendThemeForm', u'pt'))
self.FontFooterWeightComboBox.setItemText(0,
translate(u'AmendThemeForm', u'Normal'))
self.FontFooterWeightComboBox.setItemText(1,
@ -863,16 +861,16 @@ class Ui_AmendThemeDialog(object):
translate(u'AmendThemeForm', u'px'))
self.ThemeTabWidget.setTabText(
self.ThemeTabWidget.indexOf(self.FontFooterTab),
translate('AmendThemeForm', 'Font Footer'))
self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline'))
translate(u'AmendThemeForm', u'Font Footer'))
self.OutlineGroupBox.setTitle(translate(u'AmendThemeForm', u'Outline'))
self.OutlineSpinBoxLabel.setText(
translate('AmendThemeForm', 'Outline Size:'))
self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px'))
translate(u'AmendThemeForm', u'Outline Size:'))
self.OutlineSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
self.OutlineColorLabel.setText(
translate(u'AmendThemeForm', u'Outline Color:'))
self.OutlineEnabledLabel.setText(
translate('AmendThemeForm', 'Show Outline:'))
self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow'))
translate(u'AmendThemeForm', u'Show Outline:'))
self.ShadowGroupBox.setTitle(translate(u'AmendThemeForm', u'Shadow'))
self.ShadowSpinBoxLabel.setText(
translate(u'AmendThemeForm', u'Shadow Size:'))
self.ShadowSpinBox.setSuffix(translate(u'AmendThemeForm', u'px'))
@ -906,3 +904,4 @@ class Ui_AmendThemeDialog(object):
self.ThemeTabWidget.indexOf(self.OtherOptionsTab),
translate(u'AmendThemeForm', u'Other Options'))
self.PreviewGroupBox.setTitle(translate(u'AmendThemeForm', u'Preview'))

View File

@ -215,6 +215,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.ImageLineEdit.setText(filename)
self.theme.background_filename = filename
self.previewTheme()
#
#Main Font Tab
#
@ -306,6 +307,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
if self.theme.font_main_height != self.FontMainHeightSpinBox.value():
self.theme.font_main_height = self.FontMainHeightSpinBox.value()
self.previewTheme()
#
#Footer Font Tab
#
@ -384,6 +386,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.font_footer_height = \
self.FontFooterHeightSpinBox.value()
self.previewTheme()
#
#Background Tab
#
@ -446,6 +449,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.Color2PushButton.setStyleSheet(
u'background-color: %s' % unicode(self.theme.background_endColor))
self.previewTheme()
#
#Other Tab
#
@ -506,6 +510,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.display_verticalAlign = currentIndex
self.stateChanging(self.theme)
self.previewTheme()
#
#Local Methods
#
@ -629,7 +634,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
if theme.background_type == u'solid':
self.Color1PushButton.setStyleSheet(
u'background-color: %s' % unicode(theme.background_color))
self.Color1Label.setText(translate(u'AmendThemeForm', u'Background Color:'))
self.Color1Label.setText(
translate(u'AmendThemeForm', u'Background Color:'))
self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True)
self.Color2Label.setVisible(False)
@ -644,8 +650,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
% unicode(theme.background_startColor))
self.Color2PushButton.setStyleSheet(u'background-color: %s' \
% unicode(theme.background_endColor))
self.Color1Label.setText(translate(u'AmendThemeForm', u'First Color:'))
self.Color2Label.setText(translate(u'AmendThemeForm', u'Second Color:'))
self.Color1Label.setText(
translate(u'AmendThemeForm', u'First Color:'))
self.Color2Label.setText(
translate(u'AmendThemeForm', u'Second Color:'))
self.Color1Label.setVisible(True)
self.Color1PushButton.setVisible(True)
self.Color2Label.setVisible(True)
@ -713,7 +721,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
log.debug(u'Page Length area height %s, metrics %s, lines %s' %
(self.FontMainHeightSpinBox.value(), metrics.height(),
page_length))
page_length_text = unicode(translate(u'AmendThemeForm', u'Slide Height is %s rows'))
page_length_text = unicode(
translate(u'AmendThemeForm', u'Slide Height is %s rows'))
self.FontMainLinesPageLabel.setText(page_length_text % page_length)
frame = self.thememanager.generateImage(self.theme)
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
@ -728,8 +737,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.font_main_italics)# italic
mainFont.setPixelSize(self.theme.font_main_proportion)
metrics = QtGui.QFontMetrics(mainFont)
#Validate that the screen width is big enough to display the text
# Validate that the screen width is big enough to display the text
if self.theme.font_main_width < metrics.maxWidth() * 2 + 64:
self.theme.font_main_width = metrics.maxWidth() * 2 + 64
self.FontMainWidthSpinBox.setValue(self.theme.font_main_width)
return metrics

View File

@ -155,12 +155,12 @@ class DisplayTab(SettingsTab):
self.OverrideCheckBox.setObjectName(u'OverrideCheckBox')
QtCore.QMetaObject.connectSlotsByName(self)
QtCore.QObject.connect(self.OverrideCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'),
self.onOverrideCheckBoxChanged)
QtCore.SIGNAL(u'stateChanged(int)'), self.onOverrideCheckBoxChanged)
def retranslateUi(self):
self.setWindowTitle(translate(u'DisplayTab', u'Amend Display Settings'))
self.CurrentGroupBox.setTitle(translate(u'DisplayTab', u'Default Settings'))
self.CurrentGroupBox.setTitle(
translate(u'DisplayTab', u'Default Settings'))
self.XLabel.setText(translate(u'DisplayTab', u'X'))
self.Xpos.setText(u'0')
self.YLabel.setText(translate(u'DisplayTab', u'Y'))
@ -169,12 +169,14 @@ class DisplayTab(SettingsTab):
self.Height.setText(u'0')
self.WidthLabel.setText(translate(u'DisplayTab', u'Width'))
self.Width.setText(u'0')
self.CurrentGroupBox_2.setTitle(translate(u'DisplayTab', u'Amend Settings'))
self.CurrentGroupBox_2.setTitle(
translate(u'DisplayTab', u'Amend Settings'))
self.XAmendLabel.setText(translate(u'DisplayTab', u'X'))
self.YAmendLabel.setText(translate(u'DisplayTab', u'Y'))
self.HeightAmendLabel.setText(translate(u'DisplayTab', u'Height'))
self.WidthAmendLabel.setText(translate(u'DisplayTab', u'Width'))
self.OverrideCheckBox.setText(translate(u'DisplayTab', u'Override Output Display'))
self.OverrideCheckBox.setText(
translate(u'DisplayTab', u'Override Output Display'))
def load(self):
settings = QtCore.QSettings()
@ -209,16 +211,11 @@ class DisplayTab(SettingsTab):
def save(self):
settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection)
settings.setValue('x position',
QtCore.QVariant(self.XposEdit.text()))
settings.setValue('y position',
QtCore.QVariant(self.YposEdit.text()))
settings.setValue('height',
QtCore.QVariant(self.HeightEdit.text()))
settings.setValue('width',
QtCore.QVariant(self.WidthEdit.text()))
settings.setValue('amend display',
QtCore.QVariant(self.amend_display))
settings.setValue('x position', QtCore.QVariant(self.XposEdit.text()))
settings.setValue('y position', QtCore.QVariant(self.YposEdit.text()))
settings.setValue('height', QtCore.QVariant(self.HeightEdit.text()))
settings.setValue('width', QtCore.QVariant(self.WidthEdit.text()))
settings.setValue('amend display', QtCore.QVariant(self.amend_display))
self.postSetUp()
def postSetUp(self):

View File

@ -35,7 +35,7 @@ from openlp.core.ui import AmendThemeForm
from openlp.core.theme import Theme
from openlp.core.lib import OpenLPToolbar, contextMenuAction, \
ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \
contextMenuSeparator, SettingsManager, translate
contextMenuSeparator, SettingsManager, translate
from openlp.core.utils import AppLocation
log = logging.getLogger(__name__)
@ -99,7 +99,7 @@ class ThemeManager(QtGui.QWidget):
contextMenuAction(self.ThemeListWidget,
u':/general/general_export.png',
translate(u'ThemeManager', u'Export theme'),
self.onExportTheme))
self.onExportTheme))
self.ThemeListWidget.addAction(
contextMenuSeparator(self.ThemeListWidget))
#Signals
@ -199,7 +199,7 @@ class ThemeManager(QtGui.QWidget):
return
if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme:
QtGui.QMessageBox.critical(
self, translate('ThemeManager','Error'),
self, translate(u'ThemeManager',u'Error'),
translate(u'ThemeManager',
u'Theme %s is use by Service Manager' % theme),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))

View File

@ -34,7 +34,7 @@ log = logging.getLogger()
class LanguageManager(object):
"""
Helper for Language selection
Helper for Language selection
"""
__qmList__ = None
AutoLanguage = False
@ -55,8 +55,8 @@ class LanguageManager(object):
trans_dir = QtCore.QDir(os.path.join(trans_dir, u'resources', u'i18n'))
fileNames = trans_dir.entryList(QtCore.QStringList("*.qm"),
QtCore.QDir.Files, QtCore.QDir.Name)
for i in fileNames:
fileNames.replaceInStrings(i, trans_dir.filePath(i))
for name in fileNames:
fileNames.replaceInStrings(name, trans_dir.filePath(name))
return fileNames
@staticmethod
@ -101,11 +101,12 @@ class LanguageManager(object):
regEx = QtCore.QRegExp("^.*openlp_(.*).qm")
if regEx.exactMatch(qmf):
langName = regEx.cap(1)
LanguageManager.__qmList__[u'%#2i %s' % (i+1,
LanguageManager.language_name(qmf))] = langName
LanguageManager.__qmList__[u'%#2i %s' % (i+1,
LanguageManager.language_name(qmf))] = langName
@staticmethod
def get_qm_list():
if LanguageManager.__qmList__ == None:
LanguageManager.init_qm_list()
return LanguageManager.__qmList__

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager
from openlp.plugins.alerts.forms import AlertForm

View File

@ -43,38 +43,29 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
self.item_id = None
QtGui.QDialog.__init__(self, None)
self.setupUi(self)
QtCore.QObject.connect(self.DisplayButton,
QtCore.SIGNAL(u'clicked()'),
self.onDisplayClicked)
QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL(u'clicked()'),
self.onDisplayClicked)
QtCore.QObject.connect(self.DisplayCloseButton,
QtCore.SIGNAL(u'clicked()'),
self.onDisplayCloseClicked)
QtCore.SIGNAL(u'clicked()'), self.onDisplayCloseClicked)
QtCore.QObject.connect(self.AlertTextEdit,
QtCore.SIGNAL(u'textChanged(const QString&)'),
self.onTextChanged)
QtCore.QObject.connect(self.NewButton,
QtCore.SIGNAL(u'clicked()'),
self.onNewClick)
QtCore.QObject.connect(self.DeleteButton,
QtCore.SIGNAL(u'clicked()'),
self.onDeleteClick)
QtCore.QObject.connect(self.SaveButton,
QtCore.SIGNAL(u'clicked()'),
self.onSaveClick)
QtCore.SIGNAL(u'textChanged(const QString&)'), self.onTextChanged)
QtCore.QObject.connect(self.NewButton, QtCore.SIGNAL(u'clicked()'),
self.onNewClick)
QtCore.QObject.connect(self.DeleteButton, QtCore.SIGNAL(u'clicked()'),
self.onDeleteClick)
QtCore.QObject.connect(self.SaveButton, QtCore.SIGNAL(u'clicked()'),
self.onSaveClick)
QtCore.QObject.connect(self.AlertListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onDoubleClick)
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onDoubleClick)
QtCore.QObject.connect(self.AlertListWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'),
self.onSingleClick)
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSingleClick)
def loadList(self):
self.AlertListWidget.clear()
alerts = self.manager.get_all_alerts()
for alert in alerts:
item_name = QtGui.QListWidgetItem(alert.text)
item_name.setData(
QtCore.Qt.UserRole, QtCore.QVariant(alert.id))
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(alert.id))
self.AlertListWidget.addItem(item_name)
self.SaveButton.setEnabled(False)
self.DeleteButton.setEnabled(False)
@ -157,3 +148,4 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog):
self.parent.alertsmanager.displayAlert(text)
return True
return False

View File

@ -31,7 +31,7 @@ import os.path
from PyQt4 import QtCore, QtGui
from bibleimportwizard import Ui_BibleImportWizard
from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.utils import AppLocation, variant_to_unicode
from openlp.plugins.bibles.lib.manager import BibleFormat

View File

@ -27,7 +27,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsTab, translate
from openlp.core.lib import Receiver, SettingsTab, translate
log = logging.getLogger(__name__)

View File

@ -29,7 +29,7 @@ import time
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \
ItemCapabilities, translate
ItemCapabilities, translate
from openlp.plugins.bibles.forms import ImportWizardForm
log = logging.getLogger(__name__)
@ -521,10 +521,10 @@ class BibleMediaItem(MediaManagerItem):
if self.parent.settings_tab.display_style == 1:
verse_text = self.formatVerse(old_chapter, chapter, verse,
u'(u', u')')
elif self.parent.settings_tab.display_style == 2:
elif self.parent.settings_tab.display_style == 2:
verse_text = self.formatVerse(old_chapter, chapter, verse,
u'{', u'}')
elif self.parent.settings_tab.display_style == 3:
elif self.parent.settings_tab.display_style == 3:
verse_text = self.formatVerse(old_chapter, chapter, verse,
u'[', u']')
else:
@ -558,10 +558,9 @@ class BibleMediaItem(MediaManagerItem):
service_item.title = u'%s %s' % (book, verse_text)
elif service_item.title.find(
translate(u'BiblesPlugin.MediaItem', u'etc')) == -1:
service_item.title = u'%s, %s' \
% (service_item.title,
service_item.title = u'%s, %s' % (service_item.title,
translate(u'BiblesPlugin.MediaItem', u'etc'))
if len(self.parent.settings_tab.bible_theme) == 0:
if len(self.parent.settings_tab.bible_theme) == 0:
service_item.theme = None
else:
service_item.theme = self.parent.settings_tab.bible_theme
@ -658,3 +657,4 @@ class BibleMediaItem(MediaManagerItem):
def searchByReference(self, bible, search):
log.debug(u'searchByReference %s, %s', bible, search)
self.search_results = self.parent.manager.get_verses(bible, search)

View File

@ -28,7 +28,7 @@ import logging
from lxml import objectify
from PyQt4 import QtCore
from openlp.core.lib import Receiver, translate
from openlp.core.lib import Receiver, translate
from db import BibleDB
log = logging.getLogger(__name__)
@ -95,7 +95,7 @@ class OpenSongBible(BibleDB):
Receiver.send_message(u'openlp_process_events')
self.wizard.incrementProgressBar(
QtCore.QString('%s %s %s' % (
translate(u'BiblesPlugin.Opensong', u'Importing'),\
translate(u'BiblesPlugin.Opensong', u'Importing'), \
db_book.name, chapter.attrib[u'n'])))
self.commit()
except IOError:

View File

@ -26,7 +26,7 @@
import logging
from forms import EditCustomForm
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab
log = logging.getLogger(__name__)

View File

@ -24,6 +24,7 @@
###############################################################################
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
class Ui_customEditDialog(object):
@ -106,8 +107,8 @@ class Ui_customEditDialog(object):
self.SplitButton = QtGui.QPushButton(self.ButtonWidge)
self.SplitButton.setObjectName(u'SplitButton')
self.verticalLayout_2.addWidget(self.SplitButton)
spacerItem1 = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
QtGui.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem1)
self.EditLayout_3.addWidget(self.ButtonWidge)
self.gridLayout.addWidget(self.EditWidget, 2, 0, 1, 1)
@ -130,7 +131,8 @@ class Ui_customEditDialog(object):
self.horizontalLayout_2.addWidget(self.CreditEdit)
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(customEditDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Save)
self.buttonBox.setObjectName(u'buttonBox')
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1)
@ -153,20 +155,17 @@ class Ui_customEditDialog(object):
customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox)
def retranslateUi(self, customEditDialog):
customEditDialog.setWindowTitle(translate(u'CustomPlugin.EditCustomForm',
u'Edit Custom Slides'))
self.UpButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm'
u'CustomPlugin.EditCustomForm',
u'Move slide Up 1'))
customEditDialog.setWindowTitle(
translate(u'CustomPlugin.EditCustomForm', u'Edit Custom Slides'))
self.UpButton.setToolTip(translate(u'CustomPlugin.EditCustomForm'
u'CustomPlugin.EditCustomForm', u'Move slide Up 1'))
self.DownButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1'))
self.TitleLabel.setText(
translate(u'CustomPlugin.EditCustomForm', u'Title:'))
self.AddButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Add New'))
self.AddButton.setToolTip(
translate(u'CustomPlugin.EditCustomForm',
self.AddButton.setToolTip(translate(u'CustomPlugin.EditCustomForm',
u'Add new slide at bottom'))
self.EditButton.setText(
translate(u'CustomPlugin.EditCustomForm', u'Edit'))
@ -196,3 +195,4 @@ class Ui_customEditDialog(object):
translate(u'CustomPlugin.EditCustomForm', u'Theme:'))
self.CreditLabel.setText(
translate(u'CustomPlugin.EditCustomForm', u'Credits:'))

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui
from editcustomdialog import Ui_customEditDialog
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate
from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate
from openlp.plugins.custom.lib.models import CustomSlide
log = logging.getLogger(__name__)
@ -163,8 +163,10 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
count += 1
self.customSlide.title = unicode(self.TitleEdit.displayText(), u'utf-8')
self.customSlide.text = unicode(sxml.extract_xml(), u'utf-8')
self.customSlide.credits = unicode(self.CreditEdit.displayText(), u'utf-8')
self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(), u'utf-8')
self.customSlide.credits = unicode(self.CreditEdit.displayText(),
u'utf-8')
self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(),
u'utf-8')
self.custommanager.save_slide(self.customSlide)
return True
@ -230,7 +232,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
def onSaveButtonPressed(self):
if self.editAll:
self.VerseListView.clear()
for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n[---]\n'):
for row in unicode(self.VerseTextEdit.toPlainText()).split(
u'\n[---]\n'):
self.VerseListView.addItem(row)
else:
self.VerseListView.currentItem().setText(

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate
from openlp.core.lib import SettingsTab, translate
class CustomTab(SettingsTab):
"""

View File

@ -28,7 +28,7 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \
Receiver, ItemCapabilities, translate
Receiver, ItemCapabilities, translate
log = logging.getLogger(__name__)
@ -70,7 +70,6 @@ class CustomMediaItem(MediaManagerItem):
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
self.hasFileIcon = False
def initialise(self):
self.loadCustomListView(self.parent.custommanager.get_all_slides())

View File

@ -25,7 +25,7 @@
import logging
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.images.lib import ImageMediaItem, ImageTab
log = logging.getLogger(__name__)

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, translate
from openlp.core.lib import SettingsTab, Receiver, translate
class ImageTab(SettingsTab):
"""

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
contextMenuAction, ItemCapabilities, SettingsManager, translate
contextMenuAction, ItemCapabilities, SettingsManager, translate
from openlp.core.utils import AppLocation
log = logging.getLogger(__name__)
@ -169,7 +169,8 @@ class ImageMediaItem(MediaManagerItem):
if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self,
translate(u'ImagePlugin.MediaItem', u'No item selected'),
translate(u'ImagePlugin.MediaItem', u'You must select one item'))
translate(u'ImagePlugin.MediaItem',
u'You must select one item'))
items = self.ListView.selectedIndexes()
for item in items:
bitem = self.ListView.item(item.row())

View File

@ -29,7 +29,7 @@ import os
from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, contextMenuAction, Receiver, translate
ItemCapabilities, SettingsManager, contextMenuAction, Receiver, translate
log = logging.getLogger(__name__)
@ -77,8 +77,7 @@ class MediaMediaItem(MediaManagerItem):
MediaManagerItem.addListViewToToolBar(self)
self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
self.ListView.addAction(
contextMenuAction(
self.ListView, u':/slides/slide_blank.png',
contextMenuAction(self.ListView, u':/slides/slide_blank.png',
translate(u'MediaPlugin.MediaItem', u'Replace Live Background'),
self.onReplaceClick))
@ -107,8 +106,7 @@ class MediaMediaItem(MediaManagerItem):
self.background = True
if not self.ListView.selectedIndexes():
QtGui.QMessageBox.information(self,
translate(u'MediaPlugin.MediaItem',
u'No item selected'),
translate(u'MediaPlugin.MediaItem', u'No item selected'),
translate(u'MediaPlugin.MediaItem',
u'You must select one item'))
items = self.ListView.selectedIndexes()
@ -135,8 +133,8 @@ class MediaMediaItem(MediaManagerItem):
self.ListView.setSelectionMode(
QtGui.QAbstractItemView.ExtendedSelection)
self.ListView.setIconSize(QtCore.QSize(88, 50))
self.loadList(SettingsManager.load_list(
self.settingsSection, self.settingsSection))
self.loadList(SettingsManager.load_list(self.settingsSection,
self.settingsSection))
def onDeleteClick(self):
item = self.ListView.currentItem()
@ -154,3 +152,4 @@ class MediaMediaItem(MediaManagerItem):
item_name.setIcon(build_icon(img))
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file))
self.ListView.addItem(item_name)

View File

@ -25,9 +25,10 @@
import logging
from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, build_icon, PluginStatus, translate
from openlp.plugins.media.lib import MediaMediaItem
from PyQt4.phonon import Phonon
log = logging.getLogger(__name__)
@ -46,13 +47,17 @@ class MediaPlugin(Plugin):
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype)
type = mimetype.split(u'audio/x-')
self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype)
self.audio_list, mimetype = self._add_to_list(self.audio_list,
type, mimetype)
type = mimetype.split(u'audio/')
self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype)
self.audio_list, mimetype = self._add_to_list(self.audio_list,
type, mimetype)
type = mimetype.split(u'video/x-')
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
self.video_list, mimetype = self._add_to_list(self.video_list,
type, mimetype)
type = mimetype.split(u'video/')
self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype)
self.video_list, mimetype = self._add_to_list(self.video_list,
type, mimetype)
def _add_to_list(self, list, value, type):
if len(value) == 2:
@ -80,3 +85,4 @@ class MediaPlugin(Plugin):
u'<b>Media Plugin</b><br>This plugin '
u'allows the playing of audio and video media')
return about_text

View File

@ -106,20 +106,23 @@ class ImpressController(PresentationController):
loop = 0
log.debug(u'get UNO Desktop Openoffice - getComponentContext')
context = uno.getComponentContext()
log.debug(u'get UNO Desktop Openoffice - createInstaneWithContext - UnoUrlResolver')
log.debug(u'get UNO Desktop Openoffice - createInstaneWithContext - '
u'UnoUrlResolver')
resolver = context.ServiceManager.createInstanceWithContext(
u'com.sun.star.bridge.UnoUrlResolver', context)
while ctx is None and loop < 3:
try:
log.debug(u'get UNO Desktop Openoffice - resolve')
ctx = resolver.resolve(u'uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext')
ctx = resolver.resolve(u'uno:socket,host=localhost,port=2002;'
u'urp;StarOffice.ComponentContext')
except:
log.exception(u'Unable to find running instance ')
self.start_process()
loop += 1
try:
self.manager = ctx.ServiceManager
log.debug(u'get UNO Desktop Openoffice - createInstanceWithContext - Desktop')
log.debug(u'get UNO Desktop Openoffice - createInstanceWithContext'
u' - Desktop')
desktop = self.manager.createInstanceWithContext(
"com.sun.star.frame.Desktop", ctx )
return desktop
@ -201,7 +204,8 @@ class ImpressDocument(PresentationDocument):
if desktop is None:
self.controller.start_process()
desktop = self.controller.get_com_desktop()
url = u'file:///' + self.filepath.replace(u'\\', u'/').replace(u':', u'|').replace(u' ', u'%20')
url = u'file:///' + self.filepath.replace(u'\\', u'/').replace(
u':', u'|').replace(u' ', u'%20')
else:
desktop = self.controller.get_uno_desktop()
url = uno.systemPathToFileUrl(self.filepath)
@ -219,7 +223,8 @@ class ImpressDocument(PresentationDocument):
log.exception(u'Failed to load presentation')
return
self.presentation = self.document.getPresentation()
self.presentation.Display = self.controller.plugin.render_manager.screens.current_display + 1
self.presentation.Display = \
self.controller.plugin.render_manager.screens.current_display + 1
self.control = None
self.create_thumbnails()
@ -332,12 +337,14 @@ class ImpressDocument(PresentationDocument):
log.debug(u'start presentation OpenOffice')
if self.control is None or not self.control.isRunning():
self.presentation.start()
# start() returns before the getCurrentComponent is ready. Try for 5 seconds
# start() returns before the getCurrentComponent is ready.
# Try for 5 seconds
i = 1
while self.desktop.getCurrentComponent() is None and i < 50:
time.sleep(0.1)
i = i + 1
self.control = self.desktop.getCurrentComponent().Presentation.getController()
self.control = \
self.desktop.getCurrentComponent().Presentation.getController()
else:
self.control.activate()
self.goto_slide(1)
@ -383,7 +390,7 @@ class ImpressDocument(PresentationDocument):
Returns the text on the slide
``slide_no``
The slide the text is required for, starting at 1
The slide the text is required for, starting at 1
"""
doc = self.document
pages = doc.getDrawPages()
@ -412,3 +419,4 @@ class ImpressDocument(PresentationDocument):
if shape.supportsService("com.sun.star.drawing.Text"):
text += shape.getString() + '\n'
return text

View File

@ -122,7 +122,8 @@ class PowerpointDocument(PresentationDocument):
if not self.controller.process.Visible:
self.controller.start_process()
#try:
self.controller.process.Presentations.Open(self.filepath, False, False, True)
self.controller.process.Presentations.Open(self.filepath, False, False,
True)
#except:
# return
self.presentation = self.controller.process.Presentations(
@ -140,8 +141,8 @@ class PowerpointDocument(PresentationDocument):
"""
if self.check_thumbnails():
return
self.presentation.Export(os.path.join(self.thumbnailpath, '')
, 'png', 640, 480)
self.presentation.Export(os.path.join(self.thumbnailpath, ''), 'png',
640, 480)
def close_presentation(self):
"""
@ -225,7 +226,8 @@ class PowerpointDocument(PresentationDocument):
dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88)
except:
try:
dpi = win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
dpi = \
win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88)
except:
dpi = 96
self.presentation.SlideShowSettings.Run()
@ -286,7 +288,7 @@ class PowerpointDocument(PresentationDocument):
Returns the text on the slide
``slide_no``
The slide the text is required for, starting at 1
The slide the text is required for, starting at 1
"""
text = ''
shapes = self.presentation.Slides(slide_no).Shapes

View File

@ -125,7 +125,8 @@ class PptviewDocument(PresentationDocument):
filepath = str(self.filepath.replace(u'/', u'\\'))
try:
self.pptid = self.controller.process.OpenPPT(filepath, None, rect,
str(os.path.join(self.thumbnailpath, self.controller.thumbnailprefix)))
str(os.path.join(self.thumbnailpath,
self.controller.thumbnailprefix)))
self.stop_presentation()
except:
log.exception(u'Failed to load presentation')
@ -233,3 +234,4 @@ class PptviewDocument(PresentationDocument):
return path
else:
return None

View File

@ -381,7 +381,7 @@ class PresentationDocument(object):
Returns the text on the slide
``slide_no``
The slide the text is required for, starting at 1
The slide the text is required for, starting at 1
"""
return ''

View File

@ -37,36 +37,42 @@ class VerseType(object):
@staticmethod
def to_string(verse_type):
if verse_type == VerseType.Verse:
return translate('VerseType', 'Verse')
return translate(u'VerseType', u'Verse')
elif verse_type == VerseType.Chorus:
return translate('VerseType', 'Chorus')
return translate(u'VerseType', u'Chorus')
elif verse_type == VerseType.Bridge:
return translate('VerseType', 'Bridge')
return translate(u'VerseType', u'Bridge')
elif verse_type == VerseType.PreChorus:
return translate('VerseType', 'Pre-Chorus')
return translate(u'VerseType', u'Pre-Chorus')
elif verse_type == VerseType.Intro:
return translate('VerseType', 'Intro')
return translate(u'VerseType', u'Intro')
elif verse_type == VerseType.Ending:
return translate('VerseType', 'Ending')
return translate(u'VerseType', u'Ending')
elif verse_type == VerseType.Other:
return translate('VerseType', 'Other')
return translate(u'VerseType', u'Other')
@staticmethod
def from_string(verse_type):
verse_type = verse_type.lower()
if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower():
return VerseType.Verse
elif verse_type == unicode(VerseType.to_string(VerseType.Chorus)).lower():
elif verse_type == \
unicode(VerseType.to_string(VerseType.Chorus)).lower():
return VerseType.Chorus
elif verse_type == unicode(VerseType.to_string(VerseType.Bridge)).lower():
elif verse_type == \
unicode(VerseType.to_string(VerseType.Bridge)).lower():
return VerseType.Bridge
elif verse_type == unicode(VerseType.to_string(VerseType.PreChorus)).lower():
elif verse_type == \
unicode(VerseType.to_string(VerseType.PreChorus)).lower():
return VerseType.PreChorus
elif verse_type == unicode(VerseType.to_string(VerseType.Intro)).lower():
elif verse_type == \
unicode(VerseType.to_string(VerseType.Intro)).lower():
return VerseType.Intro
elif verse_type == unicode(VerseType.to_string(VerseType.Ending)).lower():
elif verse_type == \
unicode(VerseType.to_string(VerseType.Ending)).lower():
return VerseType.Ending
elif verse_type == unicode(VerseType.to_string(VerseType.Other)).lower():
elif verse_type == \
unicode(VerseType.to_string(VerseType.Other)).lower():
return VerseType.Other
from authorsform import AuthorsForm

View File

@ -116,7 +116,8 @@ class Ui_EditSongDialog(object):
self.AuthorsTabLayout.setObjectName(u'AuthorsTabLayout')
self.AuthorsMaintenanceWidget = QtGui.QWidget(self.AuthorsTab)
self.AuthorsMaintenanceWidget.setObjectName(u'AuthorsMaintenanceWidget')
self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(self.AuthorsMaintenanceWidget)
self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(
self.AuthorsMaintenanceWidget)
self.AuthorsMaintenanceLayout.setSpacing(8)
self.AuthorsMaintenanceLayout.setMargin(0)
self.AuthorsMaintenanceLayout.setObjectName(u'AuthorsMaintenanceLayout')
@ -146,7 +147,8 @@ class Ui_EditSongDialog(object):
self.AuthorsSelectionComboItem.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength)
self.AuthorsSelectionComboItem.setMinimumContentsLength(8)
self.AuthorsSelectionComboItem.setObjectName(u'AuthorsSelectionComboItem')
self.AuthorsSelectionComboItem.setObjectName(
u'AuthorsSelectionComboItem')
self.AuthorAddLayout.addWidget(self.AuthorsSelectionComboItem)
self.AuthorAddButton = QtGui.QPushButton(self.AuthorAddWidget)
self.AuthorAddButton.setMaximumSize(QtCore.QSize(110, 16777215))
@ -261,7 +263,8 @@ class Ui_EditSongDialog(object):
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.SongbookCombo.sizePolicy().hasHeightForWidth())
sizePolicy.setHeightForWidth(
self.SongbookCombo.sizePolicy().hasHeightForWidth())
self.SongbookCombo.setEditable(True)
self.SongbookCombo.setSizePolicy(sizePolicy)
self.SongbookCombo.setObjectName(u'SongbookCombo')
@ -277,7 +280,8 @@ class Ui_EditSongDialog(object):
self.ThemeTabLayout.setObjectName(u'ThemeTabLayout')
self.ThemeCopyCommentsWidget = QtGui.QWidget(self.ThemeTab)
self.ThemeCopyCommentsWidget.setObjectName(u'ThemeCopyCommentsWidget')
self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(self.ThemeCopyCommentsWidget)
self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(
self.ThemeCopyCommentsWidget)
self.ThemeCopyCommentsLayout.setSpacing(8)
self.ThemeCopyCommentsLayout.setMargin(0)
self.ThemeCopyCommentsLayout.setObjectName(u'ThemeCopyCommentsLayout')
@ -286,7 +290,8 @@ class Ui_EditSongDialog(object):
QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.TextWidget.sizePolicy().hasHeightForWidth())
sizePolicy.setHeightForWidth(
self.TextWidget.sizePolicy().hasHeightForWidth())
self.TextWidget.setSizePolicy(sizePolicy)
self.TextWidget.setObjectName(u'TextWidget')
self.DetailsLayout = QtGui.QVBoxLayout(self.TextWidget)
@ -401,24 +406,34 @@ class Ui_EditSongDialog(object):
EditSongDialog.setTabOrder(self.AlternativeEdit, self.VerseListWidget)
EditSongDialog.setTabOrder(self.VerseListWidget, self.VerseAddButton)
EditSongDialog.setTabOrder(self.VerseAddButton, self.VerseEditButton)
EditSongDialog.setTabOrder(self.VerseEditButton, self.VerseEditAllButton)
EditSongDialog.setTabOrder(self.VerseEditAllButton, self.VerseDeleteButton)
EditSongDialog.setTabOrder(self.VerseEditButton,
self.VerseEditAllButton)
EditSongDialog.setTabOrder(self.VerseEditAllButton,
self.VerseDeleteButton)
EditSongDialog.setTabOrder(self.VerseDeleteButton, self.VerseOrderEdit)
EditSongDialog.setTabOrder(self.VerseOrderEdit, self.AuthorsSelectionComboItem)
EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem, self.AuthorAddButton)
EditSongDialog.setTabOrder(self.VerseOrderEdit,
self.AuthorsSelectionComboItem)
EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem,
self.AuthorAddButton)
EditSongDialog.setTabOrder(self.AuthorAddButton, self.AuthorsListView)
EditSongDialog.setTabOrder(self.AuthorsListView, self.AuthorRemoveButton)
EditSongDialog.setTabOrder(self.AuthorRemoveButton, self.MaintenanceButton)
EditSongDialog.setTabOrder(self.AuthorsListView,
self.AuthorRemoveButton)
EditSongDialog.setTabOrder(self.AuthorRemoveButton,
self.MaintenanceButton)
EditSongDialog.setTabOrder(self.MaintenanceButton, self.SongTopicCombo)
EditSongDialog.setTabOrder(self.SongTopicCombo, self.TopicAddButton)
EditSongDialog.setTabOrder(self.TopicAddButton, self.TopicsListView)
EditSongDialog.setTabOrder(self.TopicsListView, self.TopicRemoveButton)
EditSongDialog.setTabOrder(self.TopicRemoveButton, self.SongbookCombo)
EditSongDialog.setTabOrder(self.SongbookCombo, self.ThemeSelectionComboItem)
EditSongDialog.setTabOrder(self.ThemeSelectionComboItem, self.ThemeAddButton)
EditSongDialog.setTabOrder(self.SongbookCombo,
self.ThemeSelectionComboItem)
EditSongDialog.setTabOrder(self.ThemeSelectionComboItem,
self.ThemeAddButton)
EditSongDialog.setTabOrder(self.ThemeAddButton, self.CopyrightEditItem)
EditSongDialog.setTabOrder(self.CopyrightEditItem, self.CopyrightInsertButton)
EditSongDialog.setTabOrder(self.CopyrightInsertButton, self.CCLNumberEdit)
EditSongDialog.setTabOrder(self.CopyrightEditItem,
self.CopyrightInsertButton)
EditSongDialog.setTabOrder(self.CopyrightInsertButton,
self.CCLNumberEdit)
EditSongDialog.setTabOrder(self.CCLNumberEdit, self.CommentsEdit)
EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox)
@ -450,8 +465,7 @@ class Ui_EditSongDialog(object):
translate(u'SongsPlugin.EditSongForm', u'&Add to Song'))
self.AuthorRemoveButton.setText(
translate(u'SongsPlugin.EditSongForm', u'&Remove'))
self.MaintenanceButton.setText(
translate(u'SongsPlugin.EditSongForm',
self.MaintenanceButton.setText(translate(u'SongsPlugin.EditSongForm',
u'&Manage Authors, Topics, Books'))
self.TopicGroupBox.setTitle(
translate(u'SongsPlugin.EditSongForm', u'Topic'))

View File

@ -437,12 +437,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if parts.endswith(u'\n'):
parts = parts.rstrip(u'\n')
item = QtGui.QTableWidgetItem(parts)
item.setData(
QtCore.Qt.UserRole, QtCore.QVariant(variant))
item.setData(QtCore.Qt.UserRole,
QtCore.QVariant(variant))
self.VerseListWidget.setRowCount(
self.VerseListWidget.rowCount() + 1)
self.VerseListWidget.setItem(
int(self.VerseListWidget.rowCount() - 1), 0, item)
int(self.VerseListWidget.rowCount() - 1),
0, item)
self.VerseListWidget.setColumnWidth(0, self.width)
self.VerseListWidget.resizeRowsToContents()
self.VerseListWidget.repaint()
@ -483,10 +484,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
else:
self.SongTabWidget.setCurrentIndex(0)
self.VerseOrderEdit.setFocus()
return False, \
translate(u'SongsPlugin.EditSongForm',
u'Invalid verse entry, values must be I,B,T,P,E,O,V,C '
u'followed by a number')
return False, translate(u'SongsPlugin.EditSongForm',
u'Invalid verse entry, values must be I,B,T,P,E,O,V,C '
u'followed by a number')
return True, u''
def onTitleEditItemLostFocus(self):
@ -597,4 +597,3 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.search_title = self.song.search_title.replace(u'}', u'')
self.song.search_title = self.song.search_title.replace(u'?', u'')

View File

@ -73,22 +73,16 @@ class Ui_EditVerseDialog(object):
self.EditVerseLayout.addLayout(self.VerseTypeLayout)
self.EditButtonBox = QtGui.QDialogButtonBox(EditVerseDialog)
self.EditButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.EditButtonBox.setStandardButtons(
QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Save)
self.EditButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Save)
self.EditButtonBox.setObjectName(u'EditButtonBox')
self.EditVerseLayout.addWidget(self.EditButtonBox)
self.retranslateUi(EditVerseDialog)
QtCore.QObject.connect(
self.EditButtonBox,
QtCore.SIGNAL(u'accepted()'),
EditVerseDialog.accept
)
QtCore.QObject.connect(
self.EditButtonBox,
QtCore.SIGNAL(u'rejected()'),
EditVerseDialog.reject
)
QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'accepted()'),
EditVerseDialog.accept)
QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'rejected()'),
EditVerseDialog.reject)
QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
def retranslateUi(self, EditVerseDialog):
@ -96,14 +90,20 @@ class Ui_EditVerseDialog(object):
translate(u'SongsPlugin.EditVerseForm', u'Edit Verse'))
self.VerseTypeLabel.setText(
translate(u'SongsPlugin.EditVerseForm', u'Verse Type:'))
self.VerseTypeComboBox.setItemText(0, VerseType.to_string(VerseType.Verse))
self.VerseTypeComboBox.setItemText(1, VerseType.to_string(VerseType.Chorus))
self.VerseTypeComboBox.setItemText(2, VerseType.to_string(VerseType.Bridge))
self.VerseTypeComboBox.setItemText(3, VerseType.to_string(VerseType.PreChorus))
self.VerseTypeComboBox.setItemText(4, VerseType.to_string(VerseType.Intro))
self.VerseTypeComboBox.setItemText(5, VerseType.to_string(VerseType.Ending))
self.VerseTypeComboBox.setItemText(6, VerseType.to_string(VerseType.Other))
self.VerseTypeComboBox.setItemText(0,
VerseType.to_string(VerseType.Verse))
self.VerseTypeComboBox.setItemText(1,
VerseType.to_string(VerseType.Chorus))
self.VerseTypeComboBox.setItemText(2,
VerseType.to_string(VerseType.Bridge))
self.VerseTypeComboBox.setItemText(3,
VerseType.to_string(VerseType.PreChorus))
self.VerseTypeComboBox.setItemText(4,
VerseType.to_string(VerseType.Intro))
self.VerseTypeComboBox.setItemText(5,
VerseType.to_string(VerseType.Ending))
self.VerseTypeComboBox.setItemText(6,
VerseType.to_string(VerseType.Other))
self.InsertButton.setText(
translate(u'SongsPlugin.EditVerseForm', u'Insert'))

View File

@ -112,7 +112,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
tag=u'%s:1' % VerseType.to_string(VerseType.Verse)):
if single:
verse_type, verse_number = tag.split(u':')
self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type))
self.VerseTypeComboBox.setCurrentIndex(
VerseType.from_string(verse_type))
self.VerseNumberBox.setValue(int(verse_number))
self.InsertButton.setVisible(False)
else:
@ -133,6 +134,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
def getVerseAll(self):
text = self.VerseTextEdit.toPlainText()
if not text.startsWith(u'---['):
text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), text)
text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse),
text)
return text

View File

@ -25,7 +25,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate
from openlp.core.lib import build_icon, translate
class Ui_SongMaintenanceDialog(object):
def setupUi(self, SongMaintenanceDialog):
@ -192,9 +192,11 @@ class Ui_SongMaintenanceDialog(object):
self.TypeStackedWidget.addWidget(self.BooksPage)
self.ContentLayout.addWidget(self.TypeStackedWidget)
self.DialogLayout.addWidget(self.ContentWidget)
self.MaintenanceButtonBox = QtGui.QDialogButtonBox(SongMaintenanceDialog)
self.MaintenanceButtonBox = QtGui.QDialogButtonBox(
SongMaintenanceDialog)
self.MaintenanceButtonBox.setOrientation(QtCore.Qt.Horizontal)
self.MaintenanceButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
self.MaintenanceButtonBox.setStandardButtons(
QtGui.QDialogButtonBox.Close)
self.MaintenanceButtonBox.setObjectName(u'MaintenanceButtonBox')
self.DialogLayout.addWidget(self.MaintenanceButtonBox)

View File

@ -238,7 +238,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
translate(u'SongsPlugin.SongMaintenanceForm',
u'This author can\'t be deleted, they are currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm', u'No author selected!'))
translate(u'SongsPlugin.SongMaintenanceForm',
u'No author selected!'))
def onTopicDeleteButtonClick(self):
"""
@ -253,7 +254,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
translate(u'SongsPlugin.SongMaintenanceForm',
u'This topic can\'t be deleted, it is currently '
u'assigned to at least one song.'),
translate(u'SongsPlugin.SongMaintenanceForm', u'No topic selected!'))
translate(u'SongsPlugin.SongMaintenanceForm',
u'No topic selected!'))
def onBookDeleteButtonClick(self):
"""

View File

@ -96,8 +96,8 @@ class SongManager(object):
settings = QtCore.QSettings()
settings.beginGroup(u'songs')
self.db_url = u''
db_type = unicode(
settings.value(u'songs/db type', QtCore.QVariant(u'sqlite')).toString())
db_type = unicode(settings.value(u'songs/db type',
QtCore.QVariant(u'sqlite')).toString())
if db_type == u'sqlite':
self.db_url = u'sqlite:///%s/songs.sqlite' % \
AppLocation.get_section_data_path(u'songs')

View File

@ -64,7 +64,6 @@ class SongMediaItem(MediaManagerItem):
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
self.hasFileIcon = False
def addEndHeaderBar(self):
self.addToolbarSeparator()

View File

@ -97,7 +97,7 @@ class OooImport(object):
loop += 1
manager = ctx.ServiceManager
self.desktop = manager.createInstanceWithContext(
"com.sun.star.frame.Desktop", ctx )
"com.sun.star.frame.Desktop", ctx)
def start_ooo_process(self):
try:
@ -130,10 +130,9 @@ class OooImport(object):
try:
self.document = self.desktop.loadComponentFromURL(url, u'_blank',
0, properties)
if not self.document.supportsService(
"com.sun.star.presentation.PresentationDocument") \
and not self.document.supportsService(
"com.sun.star.text.TextDocument"):
if not self.document.supportsService(
"com.sun.star.presentation.PresentationDocument") and not \
self.document.supportsService("com.sun.star.text.TextDocument"):
self.close_ooo_file()
except:
pass

View File

@ -65,8 +65,8 @@ class SongsTab(SettingsTab):
translate(u'SongsPlugin.SongsTab', u'Songs Mode'))
self.SearchAsTypeCheckBox.setText(
translate(u'SongsPlugin.SongsTab', u'Enable search as you type'))
self.SongBarActiveCheckBox.setText(
translate(u'SongsPlugin.SongsTab', u'Display Verses on Live Tool bar'))
self.SongBarActiveCheckBox.setText(translate(u'SongsPlugin.SongsTab',
u'Display Verses on Live Tool bar'))
def onSearchAsTypeCheckBoxChanged(self, check_state):
self.song_search = False

View File

@ -27,7 +27,8 @@ import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, translate
from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \
translate
from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \
SofImport, OooImport

View File

@ -54,3 +54,4 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog):
deleteDate = self.DeleteCalendar.selectedDate().toPyDate()
self.songusagemanager.delete_to_date(deleteDate)
self.close()

View File

@ -70,20 +70,19 @@ class Ui_SongUsageDetailDialog(object):
self.verticalLayout_2.addWidget(self.FileGroupBox)
self.verticalLayout.addWidget(self.DateRangeGroupBox)
self.buttonBox = QtGui.QDialogButtonBox(SongUsageDetailDialog)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(u'buttonBox')
self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(SongUsageDetailDialog)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'accepted()'),
SongUsageDetailDialog.accept)
QtCore.QObject.connect(self.buttonBox,
QtCore.SIGNAL(u'rejected()'),
SongUsageDetailDialog.close)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'),
SongUsageDetailDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
SongUsageDetailDialog.close)
QtCore.QObject.connect(self.SaveFilePushButton,
QtCore.SIGNAL(u'pressed()'),
SongUsageDetailDialog.defineOutputLocation)
QtCore.SIGNAL(u'pressed()'),
SongUsageDetailDialog.defineOutputLocation)
QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog)
def retranslateUi(self, SongUsageDetailDialog):