openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00542
[Merge] lp:~trb143/openlp/bitsandbobs into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bitsandbobs into lp:openlp.
Requested reviews:
Raoul Snyman (raoul-snyman)
--
https://code.launchpad.net/~trb143/openlp/bitsandbobs/+merge/13199
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp.pyw'
--- openlp.pyw 2009-09-29 12:51:38 +0000
+++ openlp.pyw 2009-10-12 04:50:24 +0000
@@ -49,6 +49,7 @@
"""
Run the OpenLP application.
"""
+ applicationVersion = u'1.9.0'
#set the default string encoding
try:
sys.setappdefaultencoding(u'utf-8')
@@ -58,7 +59,7 @@
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'process_events'), self.processEvents)
self.setApplicationName(u'OpenLP')
- self.setApplicationVersion(u'1.9.0')
+ self.setApplicationVersion(applicationVersion)
show_splash = str_to_bool(ConfigHelper.get_registry().get_value(
u'general', u'show splash', True))
if show_splash:
=== modified file 'openlp/core/lib/dockwidget.py'
--- openlp/core/lib/dockwidget.py 2009-09-29 12:51:38 +0000
+++ openlp/core/lib/dockwidget.py 2009-10-12 04:50:24 +0000
@@ -46,8 +46,3 @@
self.parent.settingsmanager.setUIItemVisibility(
self.objectName(), False)
event.accept()
-
- def resizeEvent(self, event):
- if self.objectName() == u'MediaManagerDock':
- if event.size().width() != event.oldSize().width():
- self.parent.settingsmanager.setDockbarLeft(event.size().width())
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2009-10-03 13:08:18 +0000
+++ openlp/core/lib/mediamanageritem.py 2009-10-12 04:50:24 +0000
@@ -281,22 +281,22 @@
self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
if self.hasEditIcon:
self.ListView.addAction(contextMenuAction(self.ListView,
- ':' +self.IconPath+u'_new.png',
+ u':' +self.IconPath+u'_new.png',
translate(self.TranslationContext,
u'&Edit ' + self.PluginTextShort),
self.onEditClick))
self.ListView.addAction(contextMenuSeparator(self.ListView))
self.ListView.addAction(contextMenuAction(
- self.ListView, ':/system/system_preview.png',
+ self.ListView, u':/system/system_preview.png',
translate(self.TranslationContext,
u'&Preview ' + self.PluginTextShort),
self.onPreviewClick))
self.ListView.addAction(contextMenuAction(
- self.ListView, ':/system/system_live.png',
+ self.ListView, u':/system/system_live.png',
translate(self.TranslationContext, u'&Show Live'),
self.onLiveClick))
self.ListView.addAction(contextMenuAction(
- self.ListView, ':/system/system_add.png',
+ self.ListView, u':/system/system_add.png',
translate(self.TranslationContext, u'&Add to Service'),
self.onAddClick))
QtCore.QObject.connect(self.ListView,
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-10-10 04:56:06 +0000
+++ openlp/core/lib/pluginmanager.py 2009-10-12 04:50:24 +0000
@@ -90,7 +90,7 @@
try:
__import__(modulename, globals(), locals(), [])
except ImportError, e:
- log.error(u'Failed to import module %s on path %s for reason %s',
+ log.exception(u'Failed to import module %s on path %s for reason %s',
modulename, path, e.args[0])
plugin_classes = Plugin.__subclasses__()
self.plugins = []
=== modified file 'openlp/core/lib/settingsmanager.py'
--- openlp/core/lib/settingsmanager.py 2009-09-29 17:05:34 +0000
+++ openlp/core/lib/settingsmanager.py 2009-10-12 04:50:24 +0000
@@ -46,11 +46,6 @@
self.mainwindow_left = mainwindow_docbars
self.mainwindow_right = mainwindow_docbars
- #self.mainwindow_left = int( ConfigHelper.get_config(
- # u'user interface', u'mediamanager left', self.mainwindow_left))
- #self.mainwindow_right = int( ConfigHelper.get_config(
- # u'user interface', u'mediamanager right', self.mainwindow_right))
-
self.slidecontroller = (self.width - (
self.mainwindow_left + self.mainwindow_right) - 100 ) / 2
self.slidecontroller_image = self.slidecontroller - 50
@@ -79,8 +74,3 @@
def togglePreviewPanel(self, isVisible):
ConfigHelper.set_config(u'user interface', u'display previewpanel',
isVisible)
-
- def setDockbarLeft(self, value):
- #ConfigHelper.set_config(u'user interface', u'mediamanager left', value)
- pass
-
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-10-10 12:10:05 +0000
+++ openlp/core/ui/mainwindow.py 2009-10-12 04:50:24 +0000
@@ -33,6 +33,7 @@
from openlp.core.lib import translate, RenderManager, PluginConfig, \
OpenLPDockWidget, SettingsManager, PluginManager, Receiver, \
buildIcon
+from openlp.core.utils import LatestVersion
class Ui_MainWindow(object):
@@ -524,6 +525,19 @@
self.ThemeManagerContents.loadThemes()
log.info(u'Load data from Settings')
self.settingsForm.postSetUp()
+ self.versionCheck()
+
+ def versionCheck(self):
+ applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595')
+ version = LatestVersion(self.generalConfig).checkVersion(applicationVersion)
+ if applicationVersion != version:
+ QtGui.QMessageBox.question(None,
+ translate(u'mainWindow', u'OpenLP version Updated'),
+ translate(u'mainWindow', u'OpenLP version %s has been updated to version %s'
+ % (applicationVersion, version)),
+ QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
+ QtGui.QMessageBox.Ok)
+ self.generalConfig.set_config(u'Application version', version)
def getMonitorNumber(self):
=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py 2009-10-08 19:58:49 +0000
+++ openlp/core/ui/pluginform.py 2009-10-12 04:50:24 +0000
@@ -83,7 +83,11 @@
log.debug('PluginStatus: %s', str(self.activePlugin.status))
self.VersionNumberLabel.setText(self.activePlugin.version)
self.AboutTextBrowser.setHtml(self.activePlugin.about())
- self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
+ if self.activePlugin.can_be_disabled():
+ self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
+ self.StatusComboBox.setEnabled(True)
+ else:
+ self.StatusComboBox.setEnabled(False)
def onPluginListWidgetSelectionChanged(self):
if self.PluginListWidget.currentItem() is None:
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-10-01 16:56:42 +0000
+++ openlp/core/ui/servicemanager.py 2009-10-12 04:50:24 +0000
@@ -66,6 +66,20 @@
else:
event.ignore()
+ def mouseMoveEvent(self, event):
+ """
+ Drag and drop event does not care what data is selected
+ as the recipient will use events to request the data move
+ just tell it what plugin to call
+ """
+ if event.buttons() != QtCore.Qt.LeftButton:
+ return
+ drag = QtGui.QDrag(self)
+ mimeData = QtCore.QMimeData()
+ drag.setMimeData(mimeData)
+ mimeData.setText(u'ServiceManager')
+ dropAction = drag.start(QtCore.Qt.CopyAction)
+
class Iter(QtGui.QTreeWidgetItemIterator):
def __init__(self, *args):
QtGui.QTreeWidgetItemIterator.__init__(self, *args)
@@ -490,23 +504,16 @@
Service Item to be added
"""
- self.serviceItems.append({u'data': item,
- u'order': len(self.serviceItems)+1, u'expanded':True})
- treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
- treewidgetitem.setText(0,item.title)
- treewidgetitem.setIcon(0,item.iconic_representation)
- treewidgetitem.setData(0, QtCore.Qt.UserRole,
- QtCore.QVariant(len(self.serviceItems)))
- treewidgetitem.setExpanded(True)
+ sitem, count = self.findServiceItem()
item.render()
- count = 0
- for frame in item.frames:
- treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem)
- text = frame[u'title']
- treewidgetitem1.setText(0,text[:40])
- treewidgetitem1.setData(0, QtCore.Qt.UserRole,
- QtCore.QVariant(count))
- count = count + 1
+ if sitem == -1:
+ self.serviceItems.append({u'data': item,
+ u'order': len(self.serviceItems) + 1, u'expanded':True})
+ self.repaintServiceList(len(self.serviceItems) + 1, 0)
+ else:
+ self.serviceItems.insert(sitem + 1, {u'data': item,
+ u'order': len(self.serviceItems)+1, u'expanded':True})
+ self.repaintServiceList(sitem + 1, 0)
self.parent.serviceChanged(False, self.serviceName)
def makePreview(self):
@@ -565,7 +572,28 @@
link = event.mimeData()
if link.hasText():
plugin = event.mimeData().text()
- Receiver().send_message(u'%s_add_service_item' % plugin)
+ if plugin == u'ServiceManager':
+ startpos, startCount = self.findServiceItem()
+ item = self.ServiceManagerList.itemAt(event.pos())
+ if item == None:
+ endpos = len(self.serviceItems)
+ else:
+ parentitem = item.parent()
+ if parentitem is None:
+ endpos = item.data(0, QtCore.Qt.UserRole).toInt()[0]
+ else:
+ endpos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
+ endpos -= 1
+ if endpos < startpos:
+ newpos = endpos
+ else:
+ newpos = endpos + 1
+ serviceItem = self.serviceItems[startpos]
+ self.serviceItems.remove(serviceItem)
+ self.serviceItems.insert(newpos, serviceItem)
+ self.repaintServiceList(endpos, startCount)
+ else:
+ Receiver().send_message(u'%s_add_service_item' % plugin)
def updateThemeList(self, theme_list):
"""
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2009-10-10 04:56:06 +0000
+++ openlp/core/ui/settingsform.py 2009-10-12 04:50:24 +0000
@@ -53,28 +53,13 @@
def insertTab(self, tab, location):
log.debug(u'Inserting %s tab' % tab.title())
self.SettingsTabWidget.insertTab(location + 13, tab, tab.title())
- #for tab_index in range(0, self.SettingsTabWidget.count()):
- #print self.SettingsTabWidget.widget(tab_index).title()
- #if self.SettingsTabWidget.widget(tab_index).title() == name:
- #print "Insert match"
- #print self.SettingsTabWidget.widget(tab_index).isVisible()
- #self.SettingsTabWidget.setTabEnabled(tab_index, True)
- #self.SettingsTabWidget.removeTab(tab_index)
- #print self.SettingsTabWidget.widget(tab_index).isVisible()
-
def removeTab(self, name):
log.debug(u'remove %s tab' % name)
- #print ">>>>>>>>>>> remove settings"
for tab_index in range(0, self.SettingsTabWidget.count()):
if self.SettingsTabWidget.widget(tab_index) is not None:
- #print "rt", self.SettingsTabWidget.widget(tab_index).title(), name
if self.SettingsTabWidget.widget(tab_index).title() == name:
- #print "remove match"
- #print self.SettingsTabWidget.widget(tab_index).isVisible()
- #self.SettingsTabWidget.setTabEnabled(tab_index, False)
self.SettingsTabWidget.removeTab(tab_index)
- #print self.SettingsTabWidget.widget(tab_index).isVisible()
def accept(self):
for tab_index in range(0, self.SettingsTabWidget.count()):
=== modified file 'openlp/core/ui/thememanager.py'
--- openlp/core/ui/thememanager.py 2009-09-25 00:43:42 +0000
+++ openlp/core/ui/thememanager.py 2009-10-12 04:50:24 +0000
@@ -33,7 +33,8 @@
from openlp.core.ui import AmendThemeForm
from openlp.core.theme import Theme
from openlp.core.lib import PluginConfig, OpenLPToolbar, ThemeXML, translate, \
- str_to_bool, file_to_xml, buildIcon, Receiver
+ str_to_bool, file_to_xml, buildIcon, Receiver, contextMenuAction, \
+ contextMenuSeparator
from openlp.core.utils import ConfigHelper
class ThemeManager(QtGui.QWidget):
@@ -77,6 +78,25 @@
self.ThemeListWidget.setAlternatingRowColors(True)
self.ThemeListWidget.setIconSize(QtCore.QSize(88,50))
self.Layout.addWidget(self.ThemeListWidget)
+ self.ThemeListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
+ self.ThemeListWidget.addAction(contextMenuAction(self.ThemeListWidget,
+ u':/themes/theme_edit.png',
+ translate(u'ThemeManager', u'Edit a theme'),
+ self.onEditTheme))
+ self.ThemeListWidget.addAction(contextMenuSeparator(self.ThemeListWidget))
+ self.ThemeListWidget.addAction(contextMenuAction(self.ThemeListWidget,
+ u':/themes/theme_delete.png',
+ translate(u'ThemeManager', u'Delete theme'),
+ self.onDeleteTheme))
+ self.ThemeListWidget.addAction(contextMenuAction(self.ThemeListWidget,
+ u':/themes/theme_export.png',
+ translate(u'ThemeManager', u'Make Global'),
+ self.changeGlobalFromScreen))
+ self.ThemeListWidget.addAction(contextMenuAction(self.ThemeListWidget,
+ u':/themes/theme_export.png',
+ translate(u'ThemeManager', u'Export theme'),
+ self.onExportTheme))
+ self.ThemeListWidget.addAction(contextMenuSeparator(self.ThemeListWidget))
#Signals
QtCore.QObject.connect(self.ThemeListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
@@ -109,8 +129,9 @@
u'default'))
self.ThemeListWidget.item(count).setText(name)
- def changeGlobalFromScreen(self, index):
+ def changeGlobalFromScreen(self, index = -1):
log.debug(u'changeGlobalFromScreen %s', index)
+ selected_row = self.ThemeListWidget.currentRow()
for count in range (0, self.ThemeListWidget.count()):
item = self.ThemeListWidget.item(count)
oldName = item.text()
@@ -119,7 +140,7 @@
self.ThemeListWidget.item(count).setText(
unicode(item.data(QtCore.Qt.UserRole).toString()))
#Set the new name
- if count == index.row():
+ if count == selected_row:
self.global_theme = unicode(
self.ThemeListWidget.item(count).text())
name = u'%s (%s)' % (self.global_theme,
@@ -186,14 +207,15 @@
u'You have not selected a theme!'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
return
- theme = unicode(item.text())
+ theme = unicode(item.data(QtCore.Qt.UserRole).toString())
path = QtGui.QFileDialog.getExistingDirectory(self,
- u'Save Theme',self.config.get_last_dir(1) )
+ u'Save Theme - (%s)' % theme,
+ self.config.get_last_dir(1) )
path = unicode(path)
if path != u'':
self.config.set_last_dir(path, 1)
themePath = os.path.join(path, theme + u'.theme')
- zip = zipfile.ZipFile(themePath, 'w')
+ zip = zipfile.ZipFile(themePath, u'w')
source = os.path.join(self.path, theme)
for root, dirs, files in os.walk(source):
for name in files:
@@ -203,7 +225,8 @@
def onImportTheme(self):
files = QtGui.QFileDialog.getOpenFileNames(None,
- translate(u'ThemeManager', u'Select Theme Import File'),
+ translate(u'ThemeManager',
+ u'Select Theme Import File'),
self.path, u'Theme (*.*)')
log.info(u'New Themes %s', unicode(files))
if len(files) > 0:
=== modified file 'openlp/core/utils/__init__.py'
--- openlp/core/utils/__init__.py 2009-09-08 19:58:05 +0000
+++ openlp/core/utils/__init__.py 2009-10-12 04:50:24 +0000
@@ -24,5 +24,6 @@
from registry import Registry
from confighelper import ConfigHelper
+from latestversion import LatestVersion
__all__ = ['Registry', 'ConfigHelper']
=== added file 'openlp/core/utils/latestversion.py'
--- openlp/core/utils/latestversion.py 1970-01-01 00:00:00 +0000
+++ openlp/core/utils/latestversion.py 2009-10-12 04:50:24 +0000
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2009 Raoul Snyman #
+# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
+# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
+# --------------------------------------------------------------------------- #
+# 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 #
+###############################################################################
+
+import logging
+import urllib2
+from datetime import datetime
+
+
+class LatestVersion(object):
+ """
+ """
+ global log
+ log = logging.getLogger(u'LatestVersion')
+ log.info(u'Latest Version detector loaded')
+
+ def __init__(self, config):
+ self.config = config
+
+ def checkVersion(self, current_version):
+ version_string = current_version
+ lastTest = self.config.get_config(u'Application version Test', datetime.now().date())
+ thisTest = unicode(datetime.now().date())
+ self.config.set_config(u'Application version Test', thisTest)
+ if lastTest != thisTest:
+ print "Now check"
+ version_string = u''
+ req = urllib2.Request(u'http://www.openlp.org/files/version.txt')
+ req.add_header(u'User-Agent', u'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)')
+ try:
+ handle = urllib2.urlopen(req, None, 1)
+ html = handle.read()
+ version_string = unicode(html).rstrip()
+ except IOError, e:
+ if hasattr(e, u'reason'):
+ log.exception(u'Reason for failure: %s', e.reason)
+ return version_string
=== modified file 'openlp/plugins/audit/auditplugin.py'
--- openlp/plugins/audit/auditplugin.py 2009-10-03 18:39:44 +0000
+++ openlp/plugins/audit/auditplugin.py 2009-10-12 04:50:24 +0000
@@ -64,14 +64,7 @@
self.AuditMenu.setObjectName(u'AuditMenu')
self.AuditMenu.setTitle(
translate(u'AuditPlugin', u'&Audit'))
- #Audit Delete All
- self.AuditDeleteAll = QtGui.QAction(tools_menu)
- self.AuditDeleteAll.setText(
- translate(u'AuditPlugin', u'Au&dit Delete all'))
- self.AuditDeleteAll.setStatusTip(
- translate(u'AuditPlugin', u'Deleted all Audit records'))
- self.AuditDeleteAll.setObjectName(u'AuditDeleteAll')
- #Audit Delete
+ #Audit Delete
self.AuditDelete = QtGui.QAction(tools_menu)
self.AuditDelete.setText(
translate(u'AuditPlugin', u'Audit &Delete'))
@@ -81,9 +74,9 @@
#Audit Report
self.AuditReport = QtGui.QAction(tools_menu)
self.AuditReport.setText(
- translate(u'AuditPlugin', u'Au&dit &Report'))
+ translate(u'AuditPlugin', u'Au&dit &Extract'))
self.AuditReport.setStatusTip(
- translate(u'AuditPlugin', u'Generate Reports on Audit Data'))
+ translate(u'AuditPlugin', u'Generate Extracts on Audit Data'))
self.AuditReport.setObjectName(u'AuditReport')
#Audit activation
AuditIcon = buildIcon(u':/tools/tools_alert.png')
@@ -100,9 +93,7 @@
self.toolsMenu.addAction(self.AuditMenu.menuAction())
self.AuditMenu.addAction(self.AuditStatus)
self.AuditMenu.addSeparator()
- self.AuditMenu.addAction(self.AuditDeleteAll)
self.AuditMenu.addAction(self.AuditDelete)
- self.AuditMenu.addSeparator()
self.AuditMenu.addAction(self.AuditReport)
# Signals and slots
QtCore.QObject.connect(self.AuditStatus,
@@ -111,8 +102,6 @@
QtCore.QObject.connect(self.AuditStatus,
QtCore.SIGNAL(u'triggered(bool)'),
self.toggleAuditState)
- QtCore.QObject.connect(self.AuditDeleteAll,
- QtCore.SIGNAL(u'triggered()'), self.onAuditDeleteAll)
QtCore.QObject.connect(self.AuditDelete,
QtCore.SIGNAL(u'triggered()'), self.onAuditDelete)
QtCore.QObject.connect(self.AuditReport,
@@ -132,7 +121,7 @@
if self.auditmanager is None:
self.auditmanager = AuditManager(self.config)
self.auditdeleteform = AuditDeleteForm(self.auditmanager)
- self.auditdetailform = AuditDetailForm(self.auditmanager)
+ self.auditdetailform = AuditDetailForm(self)
self.AuditMenu.menuAction().setVisible(True)
def finalise(self):
@@ -170,17 +159,6 @@
self.config.get_config(u'audit active', False))
self.AuditStatus.setEnabled(True)
- def onAuditDeleteAll(self):
- ret = QtGui.QMessageBox.question(None,
- translate(u'mainWindow', u'Delete All Audit Events?'),
- translate(u'mainWindow', u'Are you sure you want to delete all Audit Data?'),
- QtGui.QMessageBox.StandardButtons(
- QtGui.QMessageBox.Ok |
- QtGui.QMessageBox.Cancel),
- QtGui.QMessageBox.Cancel)
- if ret == QtGui.QMessageBox.Ok:
- self.auditmanager.delete_all()
-
def onAuditDelete(self):
self.auditdeleteform.exec_()
=== modified file 'openlp/plugins/audit/forms/auditdeletedialog.py'
--- openlp/plugins/audit/forms/auditdeletedialog.py 2009-09-25 20:12:35 +0000
+++ openlp/plugins/audit/forms/auditdeletedialog.py 2009-10-12 04:50:24 +0000
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'auditdeletedialog.ui'
#
-# Created: Fri Sep 25 21:03:48 2009
+# Created: Sun Oct 11 11:34:45 2009
# by: PyQt4 UI code generator 4.5.4
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,7 @@
class Ui_AuditDeleteDialog(object):
def setupUi(self, AuditDeleteDialog):
AuditDeleteDialog.setObjectName("AuditDeleteDialog")
- AuditDeleteDialog.resize(291, 202)
+ AuditDeleteDialog.resize(291, 243)
self.layoutWidget = QtGui.QWidget(AuditDeleteDialog)
self.layoutWidget.setGeometry(QtCore.QRect(20, 10, 247, 181))
self.layoutWidget.setObjectName("layoutWidget")
@@ -24,10 +24,10 @@
self.DeleteCalendar.setVerticalHeaderFormat(QtGui.QCalendarWidget.NoVerticalHeader)
self.DeleteCalendar.setObjectName("DeleteCalendar")
self.verticalLayout.addWidget(self.DeleteCalendar)
- self.buttonBox = QtGui.QDialogButtonBox(self.layoutWidget)
+ self.buttonBox = QtGui.QDialogButtonBox(AuditDeleteDialog)
+ self.buttonBox.setGeometry(QtCore.QRect(30, 210, 245, 25))
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
- self.verticalLayout.addWidget(self.buttonBox)
self.retranslateUi(AuditDeleteDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AuditDeleteDialog.accept)
=== modified file 'openlp/plugins/audit/forms/auditdetaildialog.py'
--- openlp/plugins/audit/forms/auditdetaildialog.py 2009-09-25 20:12:35 +0000
+++ openlp/plugins/audit/forms/auditdetaildialog.py 2009-10-12 04:50:24 +0000
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'auditdetaildialog.ui'
#
-# Created: Fri Sep 25 21:04:08 2009
+# Created: Sun Oct 11 11:40:02 2009
# by: PyQt4 UI code generator 4.5.4
#
# WARNING! All changes made in this file will be lost!
@@ -136,6 +136,10 @@
self.retranslateUi(AuditDetailDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AuditDetailDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), AuditDetailDialog.close)
+ QtCore.QObject.connect(self.FirstCheckBox, QtCore.SIGNAL("stateChanged(int)"), AuditDetailDialog.changeFirstService)
+ QtCore.QObject.connect(self.SecondCheckBox, QtCore.SIGNAL("stateChanged(int)"), AuditDetailDialog.changeSecondService)
+ QtCore.QObject.connect(self.ThirdCheckBox, QtCore.SIGNAL("stateChanged(int)"), AuditDetailDialog.changeThirdService)
+ QtCore.QObject.connect(self.SaveFilePushButton, QtCore.SIGNAL("pressed()"), AuditDetailDialog.defineOutputLocation)
QtCore.QMetaObject.connectSlotsByName(AuditDetailDialog)
def retranslateUi(self, AuditDetailDialog):
@@ -144,11 +148,11 @@
self.ReportTypeGroup.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Report Type", None, QtGui.QApplication.UnicodeUTF8))
self.SummaryReport.setText(QtGui.QApplication.translate("AuditDetailDialog", "Summary", None, QtGui.QApplication.UnicodeUTF8))
self.DetailedReport.setText(QtGui.QApplication.translate("AuditDetailDialog", "Detailed", None, QtGui.QApplication.UnicodeUTF8))
- self.DateRangeGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Date Range", None, QtGui.QApplication.UnicodeUTF8))
+ self.DateRangeGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Select Date Range", None, QtGui.QApplication.UnicodeUTF8))
self.FromDateEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "dd/MM/yyyy", None, QtGui.QApplication.UnicodeUTF8))
self.To.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8))
self.ToDateEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "dd/MM/yyyy", None, QtGui.QApplication.UnicodeUTF8))
- self.TimePeriodGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Time Periods", None, QtGui.QApplication.UnicodeUTF8))
+ self.TimePeriodGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Select Time Periods", None, QtGui.QApplication.UnicodeUTF8))
self.FirstCheckBox.setText(QtGui.QApplication.translate("AuditDetailDialog", "First Service", None, QtGui.QApplication.UnicodeUTF8))
self.FirstFromTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8))
self.FirstTo.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8))
=== modified file 'openlp/plugins/audit/forms/auditdetailform.py'
--- openlp/plugins/audit/forms/auditdetailform.py 2009-09-25 20:12:35 +0000
+++ openlp/plugins/audit/forms/auditdetailform.py 2009-10-12 04:50:24 +0000
@@ -32,209 +32,48 @@
"""
Class documentation goes here.
"""
- def __init__(self, auditmanager, parent = None):
+ def __init__(self, parent = None):
"""
Constructor
"""
- QtGui.QDialog.__init__(self, parent)
- #self.parent = parent
+ QtGui.QDialog.__init__(self, None)
+ self.parent = parent
self.setupUi(self)
-# # Connecting signals and slots
-# QtCore.QObject.connect(self.buttonBox,
-# QtCore.SIGNAL(u'rejected()'), self.rejected)
-# QtCore.QObject.connect(self.buttonBox,
-# QtCore.SIGNAL(u'accepted()'), self.accept)
-# 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.SaveButton,
-# QtCore.SIGNAL(u'pressed()'), self.onSaveButtonPressed)
-# QtCore.QObject.connect(self.DeleteButton,
-# QtCore.SIGNAL(u'pressed()'), self.onDeleteButtonPressed)
-# QtCore.QObject.connect(self.ClearButton,
-# QtCore.SIGNAL(u'pressed()'), self.onClearButtonPressed)
-# QtCore.QObject.connect(self.UpButton,
-# QtCore.SIGNAL(u'pressed()'), self.onUpButtonPressed)
-# QtCore.QObject.connect(self.DownButton,
-# QtCore.SIGNAL(u'pressed()'), self.onDownButtonPressed)
-#
-# QtCore.QObject.connect(self.VerseListView,
-# QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem*)'),
-# self.onVerseListViewSelected)
-# QtCore.QObject.connect(self.VerseListView,
-# QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'),
-# self.onVerseListViewPressed)
-# QtCore.QObject.connect(Receiver.get_receiver(),
-# QtCore.SIGNAL(u'update_themes'), self.loadThemes)
-# # Create other objects and forms
-# self.custommanager = custommanager
self.initialise()
def initialise(self):
- pass
-# self.editAll = False
-# self.DeleteButton.setEnabled(False)
-# self.EditButton.setEnabled(False)
-# self.EditAllButton.setEnabled(True)
-# self.SaveButton.setEnabled(False)
-# self.ClearButton.setEnabled(False)
-# self.TitleEdit.setText(u'')
-# self.CreditEdit.setText(u'')
-# self.VerseTextEdit.clear()
-# self.VerseListView.clear()
-# #make sure we have a new item
-# self.customSlide = CustomSlide()
-# self.ThemeComboBox.addItem(u'')
-#
-# def loadThemes(self, themelist):
-# self.ThemeComboBox.clear()
-# self.ThemeComboBox.addItem(u'')
-# for themename in themelist:
-# self.ThemeComboBox.addItem(themename)
-#
-# def loadCustom(self, id):
-# self.customSlide = CustomSlide()
-# self.initialise()
-# if id != 0:
-# self.customSlide = self.custommanager.get_custom(id)
-# self.TitleEdit.setText(self.customSlide.title)
-# self.CreditEdit.setText(self.customSlide.credits)
-#
-# songXML = SongXMLParser(self.customSlide.text)
-# verseList = songXML.get_verses()
-# for verse in verseList:
-# self.VerseListView.addItem(verse[1])
-# theme = unicode(self.customSlide.theme_name)
-# id = self.ThemeComboBox.findText(theme, QtCore.Qt.MatchExactly)
-# if id == -1:
-# id = 0 # Not Found
-# self.ThemeComboBox.setCurrentIndex(id)
-# else:
-# self.ThemeComboBox.setCurrentIndex(0)
-#
-# def accept(self):
-# valid, message = self._validate()
-# if not valid:
-# QtGui.QMessageBox.critical(self,
-# translate(u'customEditDialog', u'Error'), message,
-# QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
-# return
-# sxml = SongXMLBuilder()
-# sxml.new_document()
-# sxml.add_lyrics_to_song()
-# count = 1
-# for i in range (0, self.VerseListView.count()):
-# sxml.add_verse_to_lyrics(
-# u'custom', unicode(count),
-# unicode(self.VerseListView.item(i).text()))
-# count += 1
-# self.customSlide.title = unicode(self.TitleEdit.displayText())
-# self.customSlide.text = unicode(sxml.extract_xml())
-# self.customSlide.credits = unicode(self.CreditEdit.displayText())
-# self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText())
-# self.custommanager.save_slide(self.customSlide)
-# self.close()
-#
-# def rejected(self):
-# self.close()
-#
-# def onUpButtonPressed(self):
-# selectedRow = self.VerseListView.currentRow()
-# if selectedRow != 0:
-# qw = self.VerseListView.takeItem(selectedRow)
-# self.VerseListView.insertItem(selectedRow - 1, qw)
-# self.VerseListView.setCurrentRow(selectedRow - 1)
-#
-# def onDownButtonPressed(self):
-# selectedRow = self.VerseListView.currentRow()
-# # zero base arrays
-# if selectedRow != self.VerseListView.count() - 1:
-# qw = self.VerseListView.takeItem(selectedRow)
-# self.VerseListView.insertItem(selectedRow + 1, qw)
-# self.VerseListView.setCurrentRow(selectedRow + 1)
-#
-# def onClearButtonPressed(self):
-# self.VerseTextEdit.clear()
-# self.editAll = False
-# self.AddButton.setEnabled(True)
-# self.EditAllButton.setEnabled(True)
-# self.SaveButton.setEnabled(False)
-#
-# def onVerseListViewPressed(self, item):
-# self.DeleteButton.setEnabled(True)
-# self.EditButton.setEnabled(True)
-#
-# def onVerseListViewSelected(self, item):
-# self.editText(item.text())
-#
-# def onAddButtonPressed(self):
-# self.VerseListView.addItem(self.VerseTextEdit.toPlainText())
-# self.DeleteButton.setEnabled(False)
-# self.VerseTextEdit.clear()
-#
-# def onEditButtonPressed(self):
-# self.editText(self.VerseListView.currentItem().text())
-#
-# def onEditAllButtonPressed(self):
-# self.editAll = True
-# self.AddButton.setEnabled(False)
-# if self.VerseListView.count() > 0:
-# verse_list = u''
-# for row in range(0, self.VerseListView.count()):
-# item = self.VerseListView.item(row)
-# verse_list += item.text()
-# verse_list += u'\n---\n'
-# self.editText(verse_list)
-#
-# def editText(self, text):
-# self.beforeText = text
-# self.VerseTextEdit.setPlainText(text)
-# self.DeleteButton.setEnabled(False)
-# self.EditButton.setEnabled(False)
-# self.EditAllButton.setEnabled(False)
-# self.SaveButton.setEnabled(True)
-# self.ClearButton.setEnabled(True)
-#
-# def onSaveButtonPressed(self):
-# if self.editAll:
-# self.VerseListView.clear()
-# for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n---\n'):
-# self.VerseListView.addItem(row)
-# else:
-# self.VerseListView.currentItem().setText(
-# self.VerseTextEdit.toPlainText())
-# #number of lines has change
-# if len(self.beforeText.split(u'\n')) != \
-# len(self.VerseTextEdit.toPlainText().split(u'\n')):
-# tempList = {}
-# for row in range(0, self.VerseListView.count()):
-# tempList[row] = self.VerseListView.item(row).text()
-# self.VerseListView.clear()
-# for row in range (0, len(tempList)):
-# self.VerseListView.addItem(tempList[row])
-# self.VerseListView.repaint()
-# self.AddButton.setEnabled(True)
-# self.SaveButton.setEnabled(False)
-# self.EditButton.setEnabled(False)
-# self.EditAllButton.setEnabled(True)
-# self.VerseTextEdit.clear()
-#
-# def onDeleteButtonPressed(self):
-# self.VerseListView.takeItem(self.VerseListView.currentRow())
-# self.EditButton.setEnabled(False)
-# self.EditAllButton.setEnabled(True)
-#
-# def _validate(self):
-# if len(self.TitleEdit.displayText()) == 0:
-# self.TitleEdit.setFocus()
-# return False, translate(
-# u'customEditDialog', u'You need to enter a title \n')
-# # must have 1 slide
-# if self.VerseListView.count() == 0:
-# self.VerseTextEdit.setFocus()
-# return False, translate(
-# u'customEditDialog', u'You need to enter a slide \n')
-# return True, u''
+ 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.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
+
+ def defineOutputLocation(self):
+ pass
+
+ def resetWindow(self):
+ if self.firstService == 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:
+ self.SecondFromTimeEdit.setEnabled(False)
+ self.SecondToTimeEdit.setEnabled(False)
+ else:
+ self.SecondFromTimeEdit.setEnabled(True)
+ self.SecondToTimeEdit.setEnabled(True)
=== modified file 'resources/forms/auditdeletedialog.ui'
--- resources/forms/auditdeletedialog.ui 2009-09-25 20:12:35 +0000
+++ resources/forms/auditdeletedialog.ui 2009-10-12 04:50:24 +0000
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>291</width>
- <height>202</height>
+ <height>243</height>
</rect>
</property>
<property name="windowTitle">
@@ -36,15 +36,21 @@
</property>
</widget>
</item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
</layout>
</widget>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="geometry">
+ <rect>
+ <x>30</x>
+ <y>210</y>
+ <width>245</width>
+ <height>25</height>
+ </rect>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
</widget>
<resources/>
<connections>
=== modified file 'resources/forms/auditdetaildialog.ui'
--- resources/forms/auditdetaildialog.ui 2009-09-26 06:46:26 +0000
+++ resources/forms/auditdetaildialog.ui 2009-10-12 04:50:24 +0000
@@ -108,7 +108,7 @@
<item>
<widget class="QGroupBox" name="DateRangeGroupBox">
<property name="title">
- <string>Date Range</string>
+ <string>Select Date Range</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
@@ -148,7 +148,7 @@
<item>
<widget class="QGroupBox" name="TimePeriodGroupBox">
<property name="title">
- <string>Time Periods</string>
+ <string>Select Time Periods</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@@ -336,8 +336,76 @@
</hint>
</hints>
</connection>
+ <connection>
+ <sender>FirstCheckBox</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AuditDetailDialog</receiver>
+ <slot>changeFirstService(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>26</x>
+ <y>285</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>136</x>
+ <y>483</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>SecondCheckBox</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AuditDetailDialog</receiver>
+ <slot>changeSecondService(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>41</x>
+ <y>323</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>103</x>
+ <y>494</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>ThirdCheckBox</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>AuditDetailDialog</receiver>
+ <slot>changeThirdService(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>38</x>
+ <y>351</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>155</x>
+ <y>463</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>SaveFilePushButton</sender>
+ <signal>pressed()</signal>
+ <receiver>AuditDetailDialog</receiver>
+ <slot>defineOutputLocation()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>538</x>
+ <y>419</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>385</x>
+ <y>480</y>
+ </hint>
+ </hints>
+ </connection>
</connections>
<slots>
<slot>accept()</slot>
+ <slot>changeFirstService(int)</slot>
+ <slot>changeSecondService(int)</slot>
+ <slot>changeThirdService(int)</slot>
+ <slot>defineOutputLocation()</slot>
</slots>
</ui>