openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00667
[Merge] lp:~trb143/openlp/fixes into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
--
https://code.launchpad.net/~trb143/openlp/fixes/+merge/13921
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp-1to2-converter.py'
--- openlp-1to2-converter.py 2009-10-24 19:43:16 +0000
+++ openlp-1to2-converter.py 2009-10-25 18:15:21 +0000
@@ -25,13 +25,7 @@
import sys
import os
-try:
- import sqlite
-except:
- try:
- import pysqlite2
- except:
- print 'No Sqlite2 package available'
+import sqlite
import sqlite3
import re
from optparse import OptionParser
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py 2009-10-01 23:43:16 +0000
+++ openlp/core/lib/__init__.py 2009-10-25 18:15:21 +0000
@@ -110,12 +110,21 @@
Utility method to help build context menus for plugins
"""
action = QtGui.QAction(text, base)
+ if icon is not None:
+ action.setIcon(buildIcon(icon))
+ QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot)
+ return action
+
+def contextMenu(base, icon, text):
+ """
+ Utility method to help build context menus for plugins
+ """
+ action = QtGui.QMenu(text, base)
action.setIcon(buildIcon(icon))
- QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered()'), slot)
return action
def contextMenuSeparator(base):
- action = QtGui.QAction("", base)
+ action = QtGui.QAction(u'', base)
action.setSeparator(True)
return action
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-10-24 16:40:36 +0000
+++ openlp/core/ui/servicemanager.py 2009-10-25 18:15:21 +0000
@@ -30,7 +30,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
- ServiceType, contextMenuAction, contextMenuSeparator, Receiver
+ ServiceType, contextMenuAction, contextMenuSeparator, Receiver, contextMenu
class ServiceManagerList(QtGui.QTreeWidget):
@@ -168,6 +168,12 @@
self.ServiceManagerList.addAction(contextMenuAction(
self.ServiceManagerList, ':/services/service_delete',
self.trUtf8(u'&Remove from Service'), self.onDeleteFromService))
+ self.ServiceManagerList.addAction(contextMenuSeparator(
+ self.ServiceManagerList))
+ self.ThemeMenu = contextMenu(
+ self.ServiceManagerList, '',
+ self.trUtf8(u'&Change Item Theme'))
+ self.ServiceManagerList.addAction(self.ThemeMenu.menuAction())
self.Layout.addWidget(self.ServiceManagerList)
# Add the bottom toolbar
self.OrderToolbar = OpenLPToolbar(self)
@@ -599,12 +605,17 @@
``theme_list``
A list of current themes to be displayed
-
"""
self.ThemeComboBox.clear()
+ self.ThemeMenu.clear()
self.ThemeComboBox.addItem(u'')
for theme in theme_list:
self.ThemeComboBox.addItem(theme)
+ action = contextMenuAction(
+ self.ServiceManagerList,
+ None,
+ theme , self.onThemeChangeAction)
+ self.ThemeMenu.addAction(action)
id = self.ThemeComboBox.findText(self.service_theme,
QtCore.Qt.MatchExactly)
# Not Found
@@ -614,3 +625,9 @@
self.ThemeComboBox.setCurrentIndex(id)
self.parent.RenderManager.set_service_theme(self.service_theme)
self.regenerateServiceItems()
+
+ def onThemeChangeAction(self):
+ theme = unicode(self.sender().text())
+ item, count = self.findServiceItem()
+ self.serviceItems[item][u'data'].theme = theme
+ self.regenerateServiceItems()
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-10-24 16:40:36 +0000
+++ openlp/core/ui/thememanager.py 2009-10-25 18:15:21 +0000
@@ -198,7 +198,7 @@
return
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
path = QtGui.QFileDialog.getExistingDirectory(self,
- self.trUtf8(u'Save Theme - (%s)') % theme,
+ unicode(self.trUtf8(u'Save Theme - (%s)')) % theme,
self.config.get_last_dir(1) )
path = unicode(path)
if path != u'':
=== modified file 'openlp/plugins/audit/auditplugin.py'
--- openlp/plugins/audit/auditplugin.py 2009-10-24 16:40:36 +0000
+++ openlp/plugins/audit/auditplugin.py 2009-10-25 18:15:21 +0000
@@ -160,6 +160,7 @@
self.auditdeleteform.exec_()
def onAuditReport(self):
+ self.auditdetailform.initialise()
self.auditdetailform.exec_()
def about(self):
=== modified file 'openlp/plugins/audit/forms/auditdetailform.py'
--- openlp/plugins/audit/forms/auditdetailform.py 2009-10-19 14:56:44 +0000
+++ openlp/plugins/audit/forms/auditdetailform.py 2009-10-25 18:15:21 +0000
@@ -37,41 +37,86 @@
QtGui.QDialog.__init__(self, None)
self.parent = parent
self.setupUi(self)
- self.initialise()
def initialise(self):
- self.firstService = \
- int(self.parent.config.get_config(u'first service', QtCore.Qt.Checked))
- self.secondService = \
- int(self.parent.config.get_config(u'second service', QtCore.Qt.Checked))
+ self.FirstCheckBox.setCheckState(
+ int(self.parent.config.get_config(u'first service', QtCore.Qt.Checked)))
+ self.SecondCheckBox.setCheckState(
+ int(self.parent.config.get_config(u'second service', QtCore.Qt.Checked)))
+ self.ThirdCheckBox.setCheckState(
+ int(self.parent.config.get_config(u'third service', QtCore.Qt.Checked)))
+ year = QtCore.QDate().currentDate().year()
+ if QtCore.QDate().currentDate().month() < 9:
+ year -= 1
+ toDate = QtCore.QDate(year, 8, 31)
+ fromDate = QtCore.QDate(year - 1, 9, 1)
+ self.FromDateEdit.setDate(fromDate)
+ self.ToDateEdit.setDate(toDate)
+ self.FileLineEdit.setText(self.parent.config.get_last_dir(1))
self.resetWindow()
def changeFirstService(self, value):
- self.firstService = value
self.parent.config.set_config(u'first service', value)
self.resetWindow()
def changeSecondService(self, value):
- self.secondService = value
self.parent.config.set_config(u'second service', value)
self.resetWindow()
def changeThirdService(self, value):
- pass
+ self.parent.config.set_config(u'third service', value)
+ self.resetWindow()
def defineOutputLocation(self):
- pass
+ path = QtGui.QFileDialog.getExistingDirectory(self,
+ self.trUtf8(u'Output File Location'),
+ self.parent.config.get_last_dir(1) )
+ path = unicode(path)
+ if path != u'':
+ self.parent.config.set_last_dir(path, 1)
+ self.FileLineEdit.setText(path)
def resetWindow(self):
- if self.firstService == QtCore.Qt.Unchecked:
+ if self.FirstCheckBox.checkState() == QtCore.Qt.Unchecked:
self.FirstFromTimeEdit.setEnabled(False)
self.FirstToTimeEdit.setEnabled(False)
else:
self.FirstFromTimeEdit.setEnabled(True)
self.FirstToTimeEdit.setEnabled(True)
- if self.secondService == QtCore.Qt.Unchecked:
+ if self.SecondCheckBox.checkState() == QtCore.Qt.Unchecked:
self.SecondFromTimeEdit.setEnabled(False)
self.SecondToTimeEdit.setEnabled(False)
else:
self.SecondFromTimeEdit.setEnabled(True)
self.SecondToTimeEdit.setEnabled(True)
+ if self.ThirdCheckBox.checkState() == QtCore.Qt.Unchecked:
+ self.ThirdFromTimeEdit.setEnabled(False)
+ self.ThirdToTimeEdit.setEnabled(False)
+ else:
+ self.ThirdFromTimeEdit.setEnabled(True)
+ self.ThirdToTimeEdit.setEnabled(True)
+
+ def accept(self):
+ print self.DetailedReport.isChecked()
+ print self.SummaryReport.isChecked()
+ print self.FromDateEdit.date()
+ print self.ToDateEdit.date()
+ if self.DetailedReport.isChecked():
+ self.detailedReport()
+ else:
+ self.summaryReport()
+ self.close()
+
+ def detailedReport(self):
+ print "detailed"
+ filename = u'audit_det_%s_%s.txt' % \
+ (self.FromDateEdit.date().toString(u'ddMMyyyy'),
+ self.ToDateEdit.date().toString(u'ddMMyyyy'))
+ print filename
+
+ def summaryReport(self):
+ print "summary"
+ filename = u'audit_sum_%s_%s.txt' % \
+ (self.FromDateEdit.date().toString(u'ddMMyyyy'),
+ self.ToDateEdit.date().toString(u'ddMMyyyy'))
+ print filename
=== modified file 'openlp/plugins/songs/forms/editsongdialog.py'
--- openlp/plugins/songs/forms/editsongdialog.py 2009-10-24 16:40:36 +0000
+++ openlp/plugins/songs/forms/editsongdialog.py 2009-10-25 18:15:21 +0000
@@ -447,4 +447,3 @@
self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.ThemeTab),
self.trUtf8(u'Theme, Copyright Info && Comments'))
-
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-10-24 16:40:36 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-10-25 18:15:21 +0000
@@ -93,6 +93,11 @@
QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus)
QtCore.QObject.connect(self.VerseOrderEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
+ previewButton = QtGui.QPushButton()
+ previewButton.setText(self.trUtf8(u'Save & Preview'))
+ self.ButtonBox.addButton(previewButton, QtGui.QDialogButtonBox.ActionRole)
+ QtCore.QObject.connect(self.ButtonBox,
+ QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview)
# Create other objects and forms
self.songmanager = songmanager
self.verse_form = EditVerseForm()
@@ -391,14 +396,26 @@
self.loadBooks()
self.loadTopics()
+ def onPreview(self, button):
+ log.debug(u'onPreview')
+ if button.text() == self.trUtf8(u'Save & Preview') and self.saveSong():
+ Receiver().send_message(u'preview_song')
+
def accept(self):
log.debug(u'accept')
+ if self.saveSong():
+ if self.title_change:
+ Receiver().send_message(u'load_song_list')
+ Receiver().send_message(u'preview_song')
+ self.close()
+
+ def saveSong(self):
valid, message = self._validate_song()
if not valid:
QtGui.QMessageBox.critical(
self, self.trUtf8(u'Error'), message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
- return
+ return False
self.song.title = unicode(self.TitleEditItem.displayText())
self.song.copyright = unicode(self.CopyrightEditItem.displayText())
self.song.search_title = unicode(self.TitleEditItem.displayText()) + \
@@ -408,10 +425,7 @@
self.processLyrics()
self.processTitle()
self.songmanager.save_song(self.song)
- if self.title_change:
- Receiver().send_message(u'load_song_list')
- Receiver().send_message(u'preview_song')
- self.close()
+ return True
def processLyrics(self):
log.debug(u'processLyrics')
Follow ups