diff --git a/openlp.pyw b/openlp.pyw
index 8d20080c9..100c3336f 100755
--- a/openlp.pyw
+++ b/openlp.pyw
@@ -76,7 +76,7 @@ class OpenLP(QtGui.QApplication):
"""
Load and store current Application Version
"""
- if u'--dev-version' in sys.argv:
+ if u'--dev-version' in sys.argv or u'-d' in sys.argv:
# If we're running the dev version, let's use bzr to get the version
try:
# If bzrlib is availble, use it
@@ -216,6 +216,7 @@ class OpenLP(QtGui.QApplication):
Sets the Busy Cursor for the Application
"""
self.setOverrideCursor(QtCore.Qt.BusyCursor)
+ self.processEvents()
def setNormalCursor(self):
"""
diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py
index 69035dc4d..ba7bab496 100644
--- a/openlp/core/ui/exceptiondialog.py
+++ b/openlp/core/ui/exceptiondialog.py
@@ -46,6 +46,15 @@ class Ui_ExceptionDialog(object):
self.messageLabel.setObjectName(u'messageLabel')
self.messageLayout.addWidget(self.messageLabel)
self.exceptionLayout.addLayout(self.messageLayout)
+ self.descriptionExplanation = QtGui.QLabel(exceptionDialog)
+ self.descriptionExplanation.setObjectName(u'descriptionExplanation')
+ self.exceptionLayout.addWidget(self.descriptionExplanation)
+ self.descriptionTextEdit = QtGui.QPlainTextEdit(exceptionDialog)
+ self.descriptionTextEdit.setObjectName(u'descriptionTextEdit')
+ self.exceptionLayout.addWidget(self.descriptionTextEdit)
+ self.descriptionWordCount = QtGui.QLabel(exceptionDialog)
+ self.descriptionWordCount.setObjectName(u'descriptionWordCount')
+ self.exceptionLayout.addWidget(self.descriptionWordCount)
self.exceptionTextEdit = QtGui.QPlainTextEdit(exceptionDialog)
self.exceptionTextEdit.setReadOnly(True)
self.exceptionTextEdit.setObjectName(u'exceptionTextEdit')
@@ -65,19 +74,31 @@ class Ui_ExceptionDialog(object):
self.saveReportButton.setObjectName(u'saveReportButton')
self.exceptionButtonBox.addButton(self.saveReportButton,
QtGui.QDialogButtonBox.ActionRole)
+ self.attachFileButton = QtGui.QPushButton(exceptionDialog)
+ self.attachFileButton.setIcon(build_icon(u':/general/general_open.png'))
+ self.attachFileButton.setObjectName(u'attachFileButton')
+ self.exceptionButtonBox.addButton(self.attachFileButton,
+ QtGui.QDialogButtonBox.ActionRole)
self.retranslateUi(exceptionDialog)
+ QtCore.QObject.connect(self.descriptionTextEdit,
+ QtCore.SIGNAL(u'textChanged()'), self.onDescriptionUpdated)
QtCore.QObject.connect(self.exceptionButtonBox,
QtCore.SIGNAL(u'rejected()'), exceptionDialog.reject)
QtCore.QObject.connect(self.sendReportButton,
QtCore.SIGNAL(u'pressed()'), self.onSendReportButtonPressed)
QtCore.QObject.connect(self.saveReportButton,
QtCore.SIGNAL(u'pressed()'), self.onSaveReportButtonPressed)
+ QtCore.QObject.connect(self.attachFileButton,
+ QtCore.SIGNAL(u'pressed()'), self.onAttachFileButtonPressed)
QtCore.QMetaObject.connectSlotsByName(exceptionDialog)
def retranslateUi(self, exceptionDialog):
exceptionDialog.setWindowTitle(
translate('OpenLP.ExceptionDialog', 'Error Occurred'))
+ self.descriptionExplanation.setText(translate('OpenLP.ExceptionDialog',
+ 'Please enter a description of what you were doing to cause this '
+ 'error \n(Minimum 20 characters)'))
self.messageLabel.setText(translate('OpenLP.ExceptionDialog', 'Oops! '
'OpenLP hit a problem, and couldn\'t recover. The text in the box '
'below contains information that might be helpful to the OpenLP '
@@ -88,3 +109,5 @@ class Ui_ExceptionDialog(object):
'Send E-Mail'))
self.saveReportButton.setText(translate('OpenLP.ExceptionDialog',
'Save to File'))
+ self.attachFileButton.setText(translate('OpenLP.ExceptionDialog',
+ 'Attach File'))
diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py
index 347bcf8f1..7f9e23c61 100644
--- a/openlp/core/ui/exceptionform.py
+++ b/openlp/core/ui/exceptionform.py
@@ -70,8 +70,15 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
self.setupUi(self)
self.settingsSection = u'crashreport'
+ def exec_(self):
+ self.descriptionTextEdit.setPlainText(u'')
+ self.onDescriptionUpdated()
+ self.fileAttachment = None
+ return QtGui.QDialog.exec_(self)
+
def _createReport(self):
openlp_version = self.parent().applicationVersion[u'full']
+ description = unicode(self.descriptionTextEdit.toPlainText())
traceback = unicode(self.exceptionTextEdit.toPlainText())
system = unicode(translate('OpenLP.ExceptionForm',
'Platform: %s\n')) % platform.platform()
@@ -90,7 +97,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
system = system + u'Desktop: KDE SC\n'
elif os.environ.get(u'GNOME_DESKTOP_SESSION_ID'):
system = system + u'Desktop: GNOME\n'
- return (openlp_version, traceback, system, libraries)
+ return (openlp_version, description, traceback, system, libraries)
def onSaveReportButtonPressed(self):
"""
@@ -99,6 +106,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
report = unicode(translate('OpenLP.ExceptionForm',
'**OpenLP Bug Report**\n'
'Version: %s\n\n'
+ '--- Details of the Exception. ---\n\n%s\n\n '
'--- Exception Traceback ---\n%s\n'
'--- System information ---\n%s\n'
'--- Library Versions ---\n%s\n'))
@@ -132,18 +140,48 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
body = unicode(translate('OpenLP.ExceptionForm',
'*OpenLP Bug Report*\n'
'Version: %s\n\n'
- '--- Please enter the report below this line. ---\n\n\n'
+ '--- Details of the Exception. ---\n\n%s\n\n '
'--- Exception Traceback ---\n%s\n'
'--- System information ---\n%s\n'
'--- Library Versions ---\n%s\n',
'Please add the information that bug reports are favoured written '
'in English.'))
content = self._createReport()
- for line in content[1].split(u'\n'):
+ for line in content[2].split(u'\n'):
if re.search(r'[/\\]openlp[/\\]', line):
source = re.sub(r'.*[/\\]openlp[/\\](.*)".*', r'\1', line)
if u':' in line:
exception = line.split(u'\n')[-1].split(u':')[0]
subject = u'Bug report: %s in %s' % (exception, source)
- mailto(address=u'bugs@openlp.org', subject=subject,
- body=body % content)
+ if self.fileAttachment:
+ mailto(address=u'bugs@openlp.org', subject=subject,
+ body=body % content, attach=self.fileAttachment)
+ else:
+ mailto(address=u'bugs@openlp.org', subject=subject,
+ body=body % content)
+
+ def onDescriptionUpdated(self):
+ count = int(20 - len(self.descriptionTextEdit.toPlainText()))
+ if count < 0:
+ count = 0
+ self.__buttonState(True)
+ else:
+ self.__buttonState(False)
+ self.descriptionWordCount.setText(
+ unicode(translate('OpenLP.ExceptionDialog',
+ 'Description characters to enter : %s')) % count )
+
+ def onAttachFileButtonPressed(self):
+ files = QtGui.QFileDialog.getOpenFileName(
+ self,translate('ImagePlugin.ExceptionDialog',
+ 'Select Attachment'),
+ SettingsManager.get_last_dir(u'exceptions'),
+ u'%s (*.*) (*)' %
+ unicode(translate('ImagePlugin.MediaItem', 'All Files')))
+ log.info(u'New files(s) %s', unicode(files))
+ if files:
+ self.fileAttachment = unicode(files)
+
+ def __buttonState(self, state):
+ self.saveReportButton.setEnabled(state)
+ self.sendReportButton.setEnabled(state)
diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py
index 4d36f4aec..bddd150b8 100644
--- a/openlp/core/ui/servicemanager.py
+++ b/openlp/core/ui/servicemanager.py
@@ -507,7 +507,6 @@ class ServiceManager(QtGui.QWidget):
p_file = filePath
if 'p_file' in locals():
Receiver.send_message(u'cursor_busy')
- Receiver.send_message(u'openlp_process_events')
fileTo = open(p_file, u'r')
items = cPickle.load(fileTo)
fileTo.close()
diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py
index 8db214140..7cba6facb 100644
--- a/openlp/plugins/bibles/lib/http.py
+++ b/openlp/plugins/bibles/lib/http.py
@@ -443,7 +443,6 @@ class HTTPBible(BibleDB):
book = db_book.name
if BibleDB.get_verse_count(self, book, reference[1]) == 0:
Receiver.send_message(u'cursor_busy')
- Receiver.send_message(u'openlp_process_events')
search_results = self.get_chapter(book, reference[1])
if search_results and search_results.has_verselist():
## We have found a book of the bible lets check to see
diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py
index b73899057..a3b09310c 100644
--- a/openlp/plugins/custom/forms/editcustomdialog.py
+++ b/openlp/plugins/custom/forms/editcustomdialog.py
@@ -60,16 +60,20 @@ class Ui_CustomEditDialog(object):
self.addButton.setObjectName(u'addButton')
self.buttonLayout.addWidget(self.addButton)
self.editButton = QtGui.QPushButton(customEditDialog)
+ self.editButton.setEnabled(False)
self.editButton.setObjectName(u'editButton')
self.buttonLayout.addWidget(self.editButton)
self.editAllButton = QtGui.QPushButton(customEditDialog)
self.editAllButton.setObjectName(u'editAllButton')
self.buttonLayout.addWidget(self.editAllButton)
self.deleteButton = delete_push_button(customEditDialog)
+ self.deleteButton.setEnabled(False)
self.buttonLayout.addWidget(self.deleteButton)
self.buttonLayout.addStretch()
self.upButton, self.downButton = up_down_push_button_set(
customEditDialog)
+ self.upButton.setEnabled(False)
+ self.downButton.setEnabled(False)
self.buttonLayout.addWidget(self.upButton)
self.buttonLayout.addWidget(self.downButton)
self.centralLayout.addLayout(self.buttonLayout)
@@ -91,6 +95,9 @@ class Ui_CustomEditDialog(object):
self.bottomFormLayout.addRow(self.creditLabel, self.creditEdit)
self.dialogLayout.addLayout(self.bottomFormLayout)
self.buttonBox = save_cancel_button_box(customEditDialog)
+ self.previewButton = QtGui.QPushButton()
+ self.buttonBox.addButton(
+ self.previewButton, QtGui.QDialogButtonBox.ActionRole)
self.dialogLayout.addWidget(self.buttonBox)
self.retranslateUi(customEditDialog)
QtCore.QMetaObject.connectSlotsByName(customEditDialog)
@@ -119,3 +126,5 @@ class Ui_CustomEditDialog(object):
translate('CustomPlugin.EditCustomForm', 'The&me:'))
self.creditLabel.setText(
translate('CustomPlugin.EditCustomForm', '&Credits:'))
+ self.previewButton.setText(
+ translate('CustomPlugin.EditCustomForm', 'Save && Preview'))
diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py
index 5a32d6cc1..b667cd529 100644
--- a/openlp/plugins/custom/forms/editcustomform.py
+++ b/openlp/plugins/custom/forms/editcustomform.py
@@ -48,46 +48,22 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
"""
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
+ # Create other objects and forms.
+ self.manager = manager
+ self.editSlideForm = EditCustomSlideForm(self)
# Connecting signals and slots
- self.previewButton = QtGui.QPushButton()
- self.previewButton.setText(
- translate('CustomPlugin.EditCustomForm', 'Save && Preview'))
- self.buttonBox.addButton(
- self.previewButton, QtGui.QDialogButtonBox.ActionRole)
- QtCore.QObject.connect(self.buttonBox,
- QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview)
+ QtCore.QObject.connect(self.previewButton,
+ QtCore.SIGNAL(u'pressed()'), self.onPreviewButtonPressed)
QtCore.QObject.connect(self.addButton,
QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed)
QtCore.QObject.connect(self.editButton,
QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed)
QtCore.QObject.connect(self.editAllButton,
QtCore.SIGNAL(u'pressed()'), self.onEditAllButtonPressed)
- QtCore.QObject.connect(self.slideListView,
- QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
- self.onSlideListViewPressed)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'theme_update_list'), self.loadThemes)
- # Create other objects and forms.
- self.manager = manager
- self.editSlideForm = EditCustomSlideForm(self)
- self.initialise()
-
- def onPreview(self, button):
- log.debug(u'onPreview')
- if button.text() == unicode(translate('CustomPlugin.EditCustomForm',
- 'Save && Preview')) and self.saveCustom():
- Receiver.send_message(u'custom_preview')
-
- def initialise(self):
- self.addButton.setEnabled(True)
- self.deleteButton.setEnabled(False)
- self.editButton.setEnabled(False)
- self.editAllButton.setEnabled(True)
- self.titleEdit.setText(u'')
- self.creditEdit.setText(u'')
- self.slideListView.clear()
- # Make sure we have a new item.
- self.customSlide = CustomSlide()
+ QtCore.QObject.connect(self.slideListView,
+ QtCore.SIGNAL(u'currentRowChanged(int)'), self.onCurrentRowChanged)
def loadThemes(self, themelist):
self.themeComboBox.clear()
@@ -106,9 +82,13 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
States whether the custom is edited while being previewed in the
preview panel.
"""
- self.customSlide = CustomSlide()
- self.initialise()
- if id != 0:
+ self.slideListView.clear()
+ if id == 0:
+ self.customSlide = CustomSlide()
+ self.titleEdit.setText(u'')
+ self.creditEdit.setText(u'')
+ self.themeComboBox.setCurrentIndex(0)
+ else:
self.customSlide = self.manager.get_object(CustomSlide, id)
self.titleEdit.setText(self.customSlide.title)
self.creditEdit.setText(self.customSlide.credits)
@@ -122,9 +102,6 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
if id == -1:
id = 0
self.themeComboBox.setCurrentIndex(id)
- else:
- self.themeComboBox.setCurrentIndex(0)
- self.editAllButton.setEnabled(False)
# If not preview hide the preview button.
self.previewButton.setVisible(False)
if preview:
@@ -144,9 +121,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
"""
Saves the custom.
"""
- valid, message = self._validate()
- if not valid:
- critical_error_message_box(message=message)
+ if not self._validate():
return False
sxml = CustomXMLBuilder()
sxml.new_document()
@@ -177,16 +152,11 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.slideListView.insertItem(selectedRow + 1, qw)
self.slideListView.setCurrentRow(selectedRow + 1)
- def onSlideListViewPressed(self, item):
- self.deleteButton.setEnabled(True)
- self.editButton.setEnabled(True)
-
def onAddButtonPressed(self):
self.editSlideForm.setText(u'')
if self.editSlideForm.exec_():
for slide in self.editSlideForm.getText():
self.slideListView.addItem(slide)
- self.editAllButton.setEnabled(True)
def onEditButtonPressed(self):
self.editSlideForm.setText(self.slideListView.currentItem().text())
@@ -197,16 +167,23 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
"""
Edits all slides.
"""
- if self.slideListView.count() > 0:
- slide_list = u''
- for row in range(0, self.slideListView.count()):
- item = self.slideListView.item(row)
- slide_list += item.text()
- if row != self.slideListView.count() - 1:
- slide_list += u'\n[---]\n'
- self.editSlideForm.setText(slide_list)
- if self.editSlideForm.exec_():
- self.updateSlideList(self.editSlideForm.getText(), True)
+ slide_list = u''
+ for row in range(0, self.slideListView.count()):
+ item = self.slideListView.item(row)
+ slide_list += item.text()
+ if row != self.slideListView.count() - 1:
+ slide_list += u'\n[---]\n'
+ self.editSlideForm.setText(slide_list)
+ if self.editSlideForm.exec_():
+ self.updateSlideList(self.editSlideForm.getText(), True)
+
+ def onPreviewButtonPressed(self):
+ """
+ Save the custom item and preview it.
+ """
+ log.debug(u'onPreview')
+ if self.saveCustom():
+ Receiver.send_message(u'custom_preview')
def updateSlideList(self, slides, edit_all=False):
"""
@@ -238,13 +215,40 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
self.slideListView.repaint()
def onDeleteButtonClicked(self):
+ """
+ Removes the current row from the list.
+ """
self.slideListView.takeItem(self.slideListView.currentRow())
- self.editButton.setEnabled(True)
- self.editAllButton.setEnabled(True)
- if self.slideListView.count() == 0:
+ if self.slideListView.currentRow() == 0:
+ self.upButton.setEnabled(False)
+ if self.slideListView.currentRow() == self.slideListView.count():
+ self.downButton.setEnabled(False)
+
+ def onCurrentRowChanged(self, row):
+ """
+ Called when the *slideListView*'s current row has been changed. This
+ enables or disables buttons which require an slide to act on.
+
+ ``row``
+ The row (int). If there is no current row, the value is -1.
+ """
+ if row == -1:
self.deleteButton.setEnabled(False)
self.editButton.setEnabled(False)
- self.editAllButton.setEnabled(False)
+ self.upButton.setEnabled(False)
+ self.downButton.setEnabled(False)
+ else:
+ self.deleteButton.setEnabled(True)
+ self.editButton.setEnabled(True)
+ # Decide if the up/down buttons should be enabled or not.
+ if self.slideListView.count() - 1 == row:
+ self.downButton.setEnabled(False)
+ else:
+ self.downButton.setEnabled(True)
+ if row == 0:
+ self.upButton.setEnabled(False)
+ else:
+ self.upButton.setEnabled(True)
def _validate(self):
"""
@@ -253,10 +257,14 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
# We must have a title.
if len(self.titleEdit.displayText()) == 0:
self.titleEdit.setFocus()
- return False, translate('CustomPlugin.EditCustomForm',
- 'You need to type in a title.')
+ critical_error_message_box(
+ message=translate('CustomPlugin.EditCustomForm',
+ 'You need to type in a title.'))
+ return False
# We must have at least one slide.
if self.slideListView.count() == 0:
- return False, translate('CustomPlugin.EditCustomForm',
- 'You need to add at least one slide')
- return True, u''
+ critical_error_message_box(
+ message=translate('CustomPlugin.EditCustomForm',
+ 'You need to add at least one slide'))
+ return False
+ return True
diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py
index 28b03ec7d..1eb63fbf4 100644
--- a/openlp/plugins/songs/forms/songmaintenanceform.py
+++ b/openlp/plugins/songs/forms/songmaintenanceform.py
@@ -372,7 +372,6 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
Utility method to merge two objects to leave one in the database.
"""
Receiver.send_message(u'cursor_busy')
- Receiver.send_message(u'openlp_process_events')
merge(dbObject)
reset()
Receiver.send_message(u'songs_load_list')
diff --git a/resources/forms/exceptiondialog.ui b/resources/forms/exceptiondialog.ui
index f6f15cdc7..9fd138092 100644
--- a/resources/forms/exceptiondialog.ui
+++ b/resources/forms/exceptiondialog.ui
@@ -13,82 +13,128 @@
Dialog
-
-
- 8
+
+
+
+ 8
+ 194
+ 564
+ 171
+
-
- 8
+
+ true
- -
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 64
- 64
-
-
-
-
- 64
- 64
-
-
-
-
-
-
- :/graphics/exception.png
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Oops! OpenLP hit a problem, and couldn't recover. The text in the box below contains information that might be helpful to the OpenLP developers, so please e-mail it to bugs@openlp.org, along with a detailed description of what you were doing when the problem occurred.
-
-
- true
-
-
-
-
-
- -
-
-
- true
-
-
- false
-
-
-
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Close
-
-
-
-
+
+ false
+
+
+
+
+
+ 8
+ 373
+ 83
+ 26
+
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Close
+
+
+
+
+
+ 8
+ 103
+ 561
+ 71
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ 10
+ 170
+ 301
+ 17
+
+
+
+ TextLabel
+
+
+
+
+
+ 10
+ 80
+ 59
+ 17
+
+
+
+ TextLabel
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+ -
+
+
+
+ 64
+ 64
+
+
+
+
+ 64
+ 64
+
+
+
+
+
+
+ :/graphics/exception.png
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Oops! OpenLP hit a problem, and couldn't recover. The text in the box below contains information that might be helpful to the OpenLP developers, so please e-mail it to bugs@openlp.org, along with a detailed description of what you were doing when the problem occurred.
+
+
+ true
+
+
+
+
+
diff --git a/setup.py b/setup.py
index a435c5496..205688f1e 100755
--- a/setup.py
+++ b/setup.py
@@ -69,8 +69,7 @@ OpenLP (previously openlp.org) is free church presentation software, or lyrics p
url='http://openlp.org/',
license='GNU General Public License',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
- scripts=['openlp.pyw', 'scripts/openlp-1to2-converter.py',
- 'scripts/bible-1to2-converter.py','scripts/openlp-remoteclient.py'],
+ scripts=['openlp.pyw', 'scripts/openlp-remoteclient.py'],
include_package_data=True,
zip_safe=False,
install_requires=[