← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~patrick-zakweb/openlp/bug-936281-newformat into lp:openlp

 

mohij has proposed merging lp:~patrick-zakweb/openlp/bug-936281-newformat into lp:openlp.

Requested reviews:
  Jonathan Corwin (j-corwin)
  Andreas Preikschat (googol)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~patrick-zakweb/openlp/bug-936281-newformat/+merge/143032

Continuation of bug-9362181 branch.
My bzr denied pushing to the other branch with a "different serializers" incompatibility error. Thus I created a new branch. I hope it is ok to loose the history of the old branch.

-Corrected indentation.
-Tested on Kubuntu and Windows again and fix a "won't start" bug.
-----------------------------
-Fixed default on Windows without existing configuration.
-Tested on Kubuntu.
-----------------------------
-Rename stylesheetFix->alternateRows.
-Little different restart message.
-Tested on Kubuntu.
-----------------------------
-Merge master including Setting() refactor.
-Tested on Kubuntu.
-----------------------------
-Rename "workarounds" -> "Display workarounds"
-Use True/False in blockSignals()
-Tested on Kubuntu.
-----------------------------
-Fix an indentation mistake.
-Merge master.
-Tested on Kubuntu.
-- 
https://code.launchpad.net/~patrick-zakweb/openlp/bug-936281-newformat/+merge/143032
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/__init__.py'
--- openlp/core/__init__.py	2012-12-29 20:56:56 +0000
+++ openlp/core/__init__.py	2013-01-12 20:57:24 +0000
@@ -123,11 +123,15 @@
             if FirstTimeForm(screens).exec_() == QtGui.QDialog.Accepted:
                 Settings().setValue(u'general/has run wizard', True)
         # Correct stylesheet bugs
-        if os.name == u'nt':
+        application_stylesheet = u''
+        if Settings().value(u'advanced/alternate rows', sys.platform.startswith(u'win')):
             base_color = self.palette().color(QtGui.QPalette.Active, QtGui.QPalette.Base)
-            application_stylesheet = \
+            alternate_rows_repair_stylesheet = \
                 u'QTableWidget, QListWidget, QTreeWidget {alternate-background-color: ' + base_color.name() + ';}\n'
+            application_stylesheet += alternate_rows_repair_stylesheet
+        if os.name == u'nt':
             application_stylesheet += nt_repair_stylesheet
+        if application_stylesheet:
             self.setStyleSheet(application_stylesheet)
         show_splash = Settings().value(u'general/show splash', True)
         if show_splash:

=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py	2013-01-02 22:32:41 +0000
+++ openlp/core/ui/advancedtab.py	2013-01-12 20:57:24 +0000
@@ -240,14 +240,18 @@
         self.nextItemRadioButton.setObjectName(u'nextItemRadioButton')
         self.slideLayout.addWidget(self.nextItemRadioButton)
         self.rightLayout.addWidget(self.slideGroupBox)
-        self.x11GroupBox = QtGui.QGroupBox(self.leftColumn)
-        self.x11GroupBox.setObjectName(u'x11GroupBox')
-        self.x11Layout = QtGui.QVBoxLayout(self.x11GroupBox)
-        self.x11Layout.setObjectName(u'x11Layout')
-        self.x11BypassCheckBox = QtGui.QCheckBox(self.x11GroupBox)
+        # Display Workarounds
+        self.displayWorkaroundGroupBox = QtGui.QGroupBox(self.leftColumn)
+        self.displayWorkaroundGroupBox.setObjectName(u'displayWorkaroundGroupBox')
+        self.displayWorkaroundLayout = QtGui.QVBoxLayout(self.displayWorkaroundGroupBox)
+        self.displayWorkaroundLayout.setObjectName(u'displayWorkaroundLayout')
+        self.x11BypassCheckBox = QtGui.QCheckBox(self.displayWorkaroundGroupBox)
         self.x11BypassCheckBox.setObjectName(u'x11BypassCheckBox')
-        self.x11Layout.addWidget(self.x11BypassCheckBox)
-        self.rightLayout.addWidget(self.x11GroupBox)
+        self.displayWorkaroundLayout.addWidget(self.x11BypassCheckBox)
+        self.alternateRowsCheckBox = QtGui.QCheckBox(self.displayWorkaroundGroupBox)
+        self.alternateRowsCheckBox.setObjectName(u'alternateRowsCheckBox')
+        self.displayWorkaroundLayout.addWidget(self.alternateRowsCheckBox)
+        self.rightLayout.addWidget(self.displayWorkaroundGroupBox)
         self.rightLayout.addStretch()
         self.shouldUpdateServiceNameExample = False
         QtCore.QObject.connect(self.serviceNameCheckBox, QtCore.SIGNAL(u'toggled(bool)'),
@@ -264,6 +268,8 @@
         QtCore.QObject.connect(self.defaultBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultBrowseButtonClicked)
         QtCore.QObject.connect(self.defaultRevertButton, QtCore.SIGNAL(u'clicked()'), self.onDefaultRevertButtonClicked)
         QtCore.QObject.connect(self.x11BypassCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.onX11BypassCheckBoxToggled)
+        QtCore.QObject.connect(self.alternateRowsCheckBox,
+            QtCore.SIGNAL(u'toggled(bool)'), self.onAlternateRowsCheckBoxToggled)
         QtCore.QObject.connect(self.dataDirectoryBrowseButton, QtCore.SIGNAL(u'clicked()'),
             self.onDataDirectoryBrowseButtonClicked)
         QtCore.QObject.connect(self.dataDirectoryDefaultButton, QtCore.SIGNAL(u'clicked()'),
@@ -271,7 +277,7 @@
         QtCore.QObject.connect(self.dataDirectoryCancelButton, QtCore.SIGNAL(u'clicked()'),
             self.onDataDirectoryCancelButtonClicked)
         QtCore.QObject.connect(self.dataDirectoryCopyCheckBox, QtCore.SIGNAL(u'toggled(bool)'),
-                self.onDataDirectoryCopyCheckBoxToggled)
+            self.onDataDirectoryCopyCheckBoxToggled)
         QtCore.QObject.connect(self.endSlideRadioButton, QtCore.SIGNAL(u'clicked()'), self.onEndSlideButtonClicked)
         QtCore.QObject.connect(self.wrapSlideRadioButton, QtCore.SIGNAL(u'clicked()'), self.onWrapSlideButtonClicked)
         QtCore.QObject.connect(self.nextItemRadioButton, QtCore.SIGNAL(u'clicked()'), self.onnextItemButtonClicked)
@@ -334,8 +340,10 @@
         self.newDataDirectoryHasFilesLabel.setText(
             translate('OpenLP.AdvancedTab', '<strong>WARNING:</strong> New data directory location contains '
                 'OpenLP data files.  These files WILL be replaced during a copy.'))
-        self.x11GroupBox.setTitle(translate('OpenLP.AdvancedTab', 'X11'))
+        self.displayWorkaroundGroupBox.setTitle(translate('OpenLP.AdvancedTab', 'Display Workarounds'))
         self.x11BypassCheckBox.setText(translate('OpenLP.AdvancedTab','Bypass X11 Window Manager'))
+        self.alternateRowsCheckBox.setText(translate('OpenLP.AdvancedTab',
+            'Disable alternating row colors in lists'))
         # Slide Limits
         self.slideGroupBox.setTitle(translate('OpenLP.GeneralTab', 'Service Item Slide Limits'))
         self.slideLabel.setText(translate('OpenLP.GeneralTab', 'Behavior of next/previous on the last/first slide:'))
@@ -379,6 +387,11 @@
             if os.environ.get(u'DESKTOP_SESSION') == u'xfce':
                 x11_bypass_default = False
         self.x11BypassCheckBox.setChecked(settings.value(u'x11 bypass wm', x11_bypass_default))
+        # Fix for bug #936281.
+        # Prevent the dialog displayed by the alternateRowsCheckBox to display.
+        self.alternateRowsCheckBox.blockSignals(True)
+        self.alternateRowsCheckBox.setChecked(settings.value(u'alternate rows', sys.platform.startswith(u'win')))
+        self.alternateRowsCheckBox.blockSignals(False)
         self.defaultColor = settings.value(u'default color', u'#ffffff')
         self.defaultFileEdit.setText(settings.value(u'default image', u':/graphics/openlp-splash-screen.png'))
         self.slide_limits = settings.value(u'slide limits', SlideLimits.End)
@@ -452,6 +465,7 @@
         settings.setValue(u'enable exit confirmation', self.enableAutoCloseCheckBox.isChecked())
         settings.setValue(u'hide mouse', self.hideMouseCheckBox.isChecked())
         settings.setValue(u'x11 bypass wm', self.x11BypassCheckBox.isChecked())
+        settings.setValue(u'alternate rows', self.alternateRowsCheckBox.isChecked())
         settings.setValue(u'default color', self.defaultColor)
         settings.setValue(u'default image', self.defaultFileEdit.text())
         settings.setValue(u'slide limits', self.slide_limits)
@@ -635,6 +649,17 @@
             The state of the check box (boolean).
         """
         self.displayChanged = True
+        
+    def onAlternateRowsCheckBoxToggled(self, checked):
+        """
+        Notify user about required restart.
+
+        ``checked``
+            The state of the check box (boolean).
+        """
+        QtGui.QMessageBox.information(self,
+            translate('OpenLP.AdvancedTab', 'Restart Required'),
+            translate('OpenLP.AdvancedTab', 'This change will only take effect once OpenLP has been restarted.'))
 
     def onEndSlideButtonClicked(self):
         self.slide_limits = SlideLimits.End


Follow ups