forked from openlp/openlp
Fix string to int problem
This commit is contained in:
parent
676beeed48
commit
a55cdd3a50
@ -23,6 +23,7 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
import re
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
@ -465,10 +466,10 @@ class GeneralTab(SettingsTab):
|
|||||||
# Reset screens after initial definition
|
# Reset screens after initial definition
|
||||||
if self.overrideChanged:
|
if self.overrideChanged:
|
||||||
self.screens.override[u'size'] = QtCore.QRect(
|
self.screens.override[u'size'] = QtCore.QRect(
|
||||||
int(self.customXValueEdit.text()),
|
self._toInt(self.customXValueEdit.text()),
|
||||||
int(self.customYValueEdit.text()),
|
self._toInt(self.customYValueEdit.text()),
|
||||||
int(self.customWidthValueEdit.text()),
|
self._toInt(self.customWidthValueEdit.text()),
|
||||||
int(self.customHeightValueEdit.text()))
|
self._toInt(self.customHeightValueEdit.text()))
|
||||||
if self.overrideCheckBox.isChecked():
|
if self.overrideCheckBox.isChecked():
|
||||||
self.screens.set_override_display()
|
self.screens.set_override_display()
|
||||||
else:
|
else:
|
||||||
@ -487,3 +488,12 @@ class GeneralTab(SettingsTab):
|
|||||||
self.customHeightValueEdit.setEnabled(checked)
|
self.customHeightValueEdit.setEnabled(checked)
|
||||||
self.customWidthValueEdit.setEnabled(checked)
|
self.customWidthValueEdit.setEnabled(checked)
|
||||||
self.overrideChanged = True
|
self.overrideChanged = True
|
||||||
|
|
||||||
|
def _toInt(self, value):
|
||||||
|
"""
|
||||||
|
Convert text string to a numeric string
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return int(value)
|
||||||
|
except:
|
||||||
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user