← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~meths/openlp/trivialfixes into lp:openlp

 

Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.

    Requested reviews:
    OpenLP Core (openlp-core)


Fixes some dialogs parentage

Adds push button support to toolbars - fixing UI issue with screen black button

Adds exception handling to XML file loading
-- 
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/12765
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2009-09-29 12:51:38 +0000
+++ openlp/core/lib/__init__.py	2009-10-01 23:50:21 +0000
@@ -54,7 +54,17 @@
     ``xmlfile``
         The name of the file.
     """
-    return open(xmlfile).read()
+    file = None
+    xml = None
+    try:
+        file = open(xmlfile, u'r')
+        xml = file.read()
+    except IOError:
+        log.exception(u'Failed to open XML file')
+    finally:
+        if file:
+            file.close()
+    return xml
 
 def str_to_bool(stringvalue):
     """

=== modified file 'openlp/core/lib/baselistwithdnd.py'
--- openlp/core/lib/baselistwithdnd.py	2009-09-29 12:51:38 +0000
+++ openlp/core/lib/baselistwithdnd.py	2009-10-01 23:50:21 +0000
@@ -24,8 +24,6 @@
 
 from PyQt4 import QtCore, QtGui
 
-from openlp.core.lib.toolbar import *
-
 class BaseListWithDnD(QtGui.QListWidget):
     """
     Please put a short description of what this class does in here.

=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py	2009-09-29 12:51:38 +0000
+++ openlp/core/lib/toolbar.py	2009-10-01 23:50:21 +0000
@@ -125,3 +125,15 @@
         """
         for widget in widgets:
             self.actions[widget].setVisible(True)
+
+    def addPushButton(self, imageFile=None, text=u''):
+        """
+        Adds a push button to the toolbar.
+
+        Returns the push button
+        """
+        pushButton = QtGui.QPushButton(buildIcon(imageFile), text)
+        pushButton.setCheckable(True)
+        pushButton.setFlat(True)
+        self.addWidget(pushButton)
+        return pushButton
\ No newline at end of file

=== modified file 'openlp/core/ui/alertform.py'
--- openlp/core/ui/alertform.py	2009-09-29 02:54:32 +0000
+++ openlp/core/ui/alertform.py	2009-10-01 23:50:21 +0000
@@ -31,7 +31,7 @@
     log = logging.getLogger(u'AlertForm')
 
     def __init__(self, parent=None):
-        QtGui.QDialog.__init__(self, None)
+        QtGui.QDialog.__init__(self, parent)
         self.parent = parent
         self.setupUi(self)
         log.debug(u'Defined')

=== modified file 'openlp/core/ui/amendthemedialog.py'
--- openlp/core/ui/amendthemedialog.py	2009-09-29 02:54:32 +0000
+++ openlp/core/ui/amendthemedialog.py	2009-10-01 23:50:21 +0000
@@ -120,8 +120,6 @@
         self.ImageToolButton.setObjectName(u'ImageToolButton')
         self.horizontalLayout_2.addWidget(self.ImageToolButton)
         self.BackgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.ImageFilenameWidget)
-        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
-        #self.BackgroundLayout.addItem(spacerItem, 7, 1, 1, 1)
         self.ThemeTabWidget.addTab(self.BackgroundTab, u'')
         self.FontMainTab = QtGui.QWidget()
         self.FontMainTab.setObjectName(u'FontMainTab')

=== modified file 'openlp/core/ui/plugindialoglistform.py'
--- openlp/core/ui/plugindialoglistform.py	2009-09-21 17:56:36 +0000
+++ openlp/core/ui/plugindialoglistform.py	2009-10-01 23:50:21 +0000
@@ -9,14 +9,14 @@
 
 import logging
 from PyQt4 import QtCore, QtGui
-from openlp.core.lib import translate, PluginStatus
+from openlp.core.lib import translate, PluginStatus, buildIcon
 
 class PluginForm(QtGui.QDialog):
     global log
     log = logging.getLogger(u'PluginForm')
 
     def __init__(self, parent=None):
-        QtGui.QDialog.__init__(self, None)
+        QtGui.QDialog.__init__(self, parent)
         self.parent = parent
         self.setupUi(self)
         log.debug(u'Defined')
@@ -24,6 +24,8 @@
     def setupUi(self, PluginForm):
         PluginForm.setObjectName(u'PluginForm')
         PluginForm.resize(400, 393)
+        icon = buildIcon(u':/icon/openlp-logo-16x16.png')
+        PluginForm.setWindowIcon(icon)
         self.PluginViewList = QtGui.QTableWidget(PluginForm)
         self.PluginViewList.setGeometry(QtCore.QRect(20, 10, 371, 331))
         self.PluginViewList.setObjectName(u'PluginViewList')

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2009-09-25 23:06:54 +0000
+++ openlp/core/ui/slidecontroller.py	2009-10-01 23:50:21 +0000
@@ -131,10 +131,8 @@
                 self.onSlideSelectedLast)
         if self.isLive:
             self.Toolbar.addToolbarSeparator(u'Close Separator')
-            self.Toolbar.addToolbarButton(u'Close Screen',
-                u':/slides/slide_close.png',
-                translate(u'SlideController', u'Close Screen'),
-                self.onBlankScreen)
+            self.blackPushButton = self.Toolbar.addPushButton(
+                u':/slides/slide_close.png')
         if not self.isLive:
             self.Toolbar.addToolbarSeparator(u'Close Separator')
             self.Toolbar.addToolbarButton(u'Go Live',
@@ -190,6 +188,8 @@
         QtCore.QObject.connect(self.PreviewListWidget,
             QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected)
         if isLive:
+            QtCore.QObject.connect(self.blackPushButton,
+                QtCore.SIGNAL(u'toggled(bool)'), self.onBlankScreen)
             QtCore.QObject.connect(Receiver.get_receiver(),
                 QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
             Receiver().send_message(u'request_spin_delay')
@@ -337,7 +337,7 @@
         """
         row = self.PreviewListWidget.currentRow()
         if row > -1 and row < self.PreviewListWidget.rowCount():
-            label = self.PreviewListWidget.cellWidget(row, 0)
+            #label = self.PreviewListWidget.cellWidget(row, 0)
             frame = self.serviceitem.frames[row][u'image']
             before = time.time()
             if frame is None:

=== modified file 'openlp/plugins/presentations/lib/presentationtab.py'
--- openlp/plugins/presentations/lib/presentationtab.py	2009-09-30 19:26:51 +0000
+++ openlp/plugins/presentations/lib/presentationtab.py	2009-10-01 23:50:21 +0000
@@ -22,7 +22,6 @@
 # Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
 ###############################################################################
 
-import os
 from PyQt4 import QtGui
 
 from openlp.core.lib import SettingsTab, translate


Follow ups