Merge lp:~raoul-snyman/openlp/bugfixes into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Merged at revision: not available
Proposed branch: lp:~raoul-snyman/openlp/bugfixes
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~raoul-snyman/openlp/bugfixes
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+11668@code.launchpad.net

This proposal supersedes a proposal from 2009-09-12.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Nice One
Approved

review: Approve
Revision history for this message
Tim Bentley (trb143) wrote :

Looks good to me

review: Approve
lp:~raoul-snyman/openlp/bugfixes updated
537. By Raoul Snyman

Merge from lp:~raoul-snyman/openlp/bugfixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp.pyw'
2--- openlp.pyw 2009-09-12 17:24:16 +0000
3+++ openlp.pyw 2009-09-12 21:31:35 +0000
4@@ -29,9 +29,10 @@
5
6 from PyQt4 import QtCore, QtGui
7
8-from openlp.core.lib import Receiver
9+from openlp.core.lib import Receiver, str_to_bool
10 from openlp.core.resources import *
11 from openlp.core.ui import MainWindow, SplashScreen
12+from openlp.core.utils import ConfigHelper
13
14 log = logging.getLogger()
15
16@@ -55,10 +56,13 @@
17 #provide a listener for widgets to reqest a screen update.
18 QtCore.QObject.connect(Receiver.get_receiver(),
19 QtCore.SIGNAL(u'process_events'), self.processEvents)
20- self.setApplicationName(u'openlp.org')
21+ self.setApplicationName(u'OpenLP')
22 self.setApplicationVersion(u'1.9.0')
23- self.splash = SplashScreen(self.applicationVersion())
24- self.splash.show()
25+ show_splash = str_to_bool(ConfigHelper.get_registry().get_value(
26+ u'general', u'show splash', True))
27+ if show_splash:
28+ self.splash = SplashScreen(self.applicationVersion())
29+ self.splash.show()
30 # make sure Qt really display the splash screen
31 self.processEvents()
32 screens = []
33@@ -72,9 +76,10 @@
34 # start the main app window
35 self.mainWindow = MainWindow(screens)
36 self.mainWindow.show()
37- # now kill the splashscreen
38- self.splash.finish(self.mainWindow)
39- sys.exit(self.exec_())
40+ if show_splash:
41+ # now kill the splashscreen
42+ self.splash.finish(self.mainWindow)
43+ return self.exec_()
44
45
46 def main():
47@@ -102,7 +107,7 @@
48 log.setLevel(logging.INFO)
49 # Now create and actually run the application.
50 app = OpenLP(sys.argv)
51- app.run()
52+ sys.exit(app.run())
53
54 if __name__ == u'__main__':
55 """
56
57=== modified file 'openlp/core/ui/generaltab.py'
58--- openlp/core/ui/generaltab.py 2009-09-12 17:31:03 +0000
59+++ openlp/core/ui/generaltab.py 2009-09-12 21:31:35 +0000
60@@ -24,7 +24,7 @@
61
62 from PyQt4 import QtCore, QtGui
63
64-from openlp.core.lib import SettingsTab, translate, str_to_bool
65+from openlp.core.lib import SettingsTab, translate, str_to_bool
66
67 class GeneralTab(SettingsTab):
68 """
69@@ -59,24 +59,22 @@
70 self.MonitorComboBox.setObjectName(u'MonitorComboBox')
71 self.MonitorLayout.addWidget(self.MonitorComboBox)
72 self.GeneralLeftLayout.addWidget(self.MonitorGroupBox)
73- self.BlankScreenGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
74- self.BlankScreenGroupBox.setObjectName(u'BlankScreenGroupBox')
75- self.BlankScreenLayout = QtGui.QVBoxLayout(self.BlankScreenGroupBox)
76- self.BlankScreenLayout.setSpacing(8)
77- self.BlankScreenLayout.setMargin(8)
78- self.BlankScreenLayout.setObjectName(u'BlankScreenLayout')
79- self.WarningCheckBox = QtGui.QCheckBox(self.BlankScreenGroupBox)
80+ self.StartupGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
81+ self.StartupGroupBox.setObjectName(u'StartupGroupBox')
82+ self.StartupLayout = QtGui.QVBoxLayout(self.StartupGroupBox)
83+ self.StartupLayout.setSpacing(8)
84+ self.StartupLayout.setMargin(8)
85+ self.StartupLayout.setObjectName(u'StartupLayout')
86+ self.WarningCheckBox = QtGui.QCheckBox(self.StartupGroupBox)
87 self.WarningCheckBox.setObjectName(u'WarningCheckBox')
88- self.BlankScreenLayout.addWidget(self.WarningCheckBox)
89- self.GeneralLeftLayout.addWidget(self.BlankScreenGroupBox)
90- self.AutoOpenGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
91- self.AutoOpenGroupBox.setObjectName(u'AutoOpenGroupBox')
92- self.AutoOpenLayout = QtGui.QVBoxLayout(self.AutoOpenGroupBox)
93- self.AutoOpenLayout.setObjectName(u'AutoOpenLayout')
94- self.AutoOpenCheckBox = QtGui.QCheckBox(self.AutoOpenGroupBox)
95+ self.StartupLayout.addWidget(self.WarningCheckBox)
96+ self.AutoOpenCheckBox = QtGui.QCheckBox(self.StartupGroupBox)
97 self.AutoOpenCheckBox.setObjectName(u'AutoOpenCheckBox')
98- self.AutoOpenLayout.addWidget(self.AutoOpenCheckBox)
99- self.GeneralLeftLayout.addWidget(self.AutoOpenGroupBox)
100+ self.StartupLayout.addWidget(self.AutoOpenCheckBox)
101+ self.ShowSplashCheckBox = QtGui.QCheckBox(self.StartupGroupBox)
102+ self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox')
103+ self.StartupLayout.addWidget(self.ShowSplashCheckBox)
104+ self.GeneralLeftLayout.addWidget(self.StartupGroupBox)
105 self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
106 QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
107 self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
108@@ -123,6 +121,8 @@
109 QtCore.SIGNAL(u'stateChanged(int)'), self.onWarningCheckBoxChanged)
110 QtCore.QObject.connect(self.AutoOpenCheckBox,
111 QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged)
112+ QtCore.QObject.connect(self.ShowSplashCheckBox,
113+ QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged)
114 QtCore.QObject.connect(self.NumberEdit,
115 QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
116 QtCore.QObject.connect(self.UsernameEdit,
117@@ -133,10 +133,10 @@
118 def retranslateUi(self):
119 self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors'))
120 self.MonitorLabel.setText(translate(u'GeneralTab', u'Select monitor for output display:'))
121- self.BlankScreenGroupBox.setTitle(translate(u'GeneralTab', u'Blank Screen'))
122- self.WarningCheckBox.setText(translate(u'GeneralTab', u'Show warning on startup'))
123- self.AutoOpenGroupBox.setTitle(translate(u'GeneralTab', u'Auto Open Last Service'))
124- self.AutoOpenCheckBox.setText(translate(u'GeneralTab', u'Automatically open the last service at startup'))
125+ self.StartupGroupBox.setTitle(translate(u'GeneralTab', u'Application Startup'))
126+ self.WarningCheckBox.setText(translate(u'GeneralTab', u'Show blank screen warning'))
127+ self.AutoOpenCheckBox.setText(translate(u'GeneralTab', u'Automatically open the last service'))
128+ self.ShowSplashCheckBox.setText(translate(u'GeneralTab', u'Show the splash screen'))
129 self.CCLIGroupBox.setTitle(translate(u'GeneralTab', u'CCLI Details'))
130 self.NumberLabel.setText(translate(u'GeneralTab', u'CCLI Number:'))
131 self.UsernameLabel.setText(translate(u'GeneralTab', u'SongSelect Username:'))
132@@ -146,16 +146,13 @@
133 self.MonitorNumber = self.MonitorComboBox.currentIndex()
134
135 def onAutoOpenCheckBoxChanged(self, value):
136- self.AutoOpen = False
137- if value == 2:
138- # we have a set value convert to True/False
139- self.AutoOpen = True
140+ self.AutoOpen = (value == QtCore.Qt.Checked)
141+
142+ def onShowSplashCheckBoxChanged(self, value):
143+ self.ShowSplash = (value == QtCore.Qt.Checked)
144
145 def onWarningCheckBoxChanged(self, value):
146- self.Warning = False
147- if value == 2:
148- # we have a set value convert to True/False
149- self.Warning = True
150+ self.Warning = (value == QtCore.Qt.Checked)
151
152 def onNumberEditLostFocus(self):
153 self.CCLNumber = self.NumberEdit.displayText()
154@@ -178,6 +175,7 @@
155 self.MonitorNumber = int(self.config.get_config(u'Monitor', u'0'))
156 self.Warning = str_to_bool(self.config.get_config(u'Warning', u'False'))
157 self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False'))
158+ self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True'))
159 self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX'))
160 self.Username = unicode(self.config.get_config(u'User Name', u''))
161 self.Password = unicode(self.config.get_config(u'Password', u''))
162@@ -185,6 +183,7 @@
163 self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
164 self.WarningCheckBox.setChecked(self.Warning)
165 self.AutoOpenCheckBox.setChecked(self.AutoOpen)
166+ self.ShowSplashCheckBox.setChecked(self.ShowSplash)
167 self.NumberEdit.setText(self.CCLNumber)
168 self.UsernameEdit.setText(self.Username)
169 self.PasswordEdit.setText(self.Password)
170@@ -193,6 +192,7 @@
171 self.config.set_config(u'Monitor', self.MonitorNumber)
172 self.config.set_config(u'Warning', self.Warning)
173 self.config.set_config(u'Auto Open', self.AutoOpen)
174+ self.config.set_config(u'show splash', self.ShowSplash)
175 self.config.set_config(u'CCL Number', self.CCLNumber)
176 self.config.set_config(u'User Name', self.Username)
177 self.config.set_config(u'Password', self.Password)