From ccc640bb27b5f28aa2b329f856ffcf409794792b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 7 Dec 2010 20:47:09 +0000 Subject: [PATCH] Stop invalid characters being entered --- openlp/core/ui/generaltab.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 0801c91c6..f932f7ab1 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -243,6 +243,7 @@ class GeneralTab(SettingsTab): self.customXLayout.addWidget(self.customXLabel) self.customXValueEdit = QtGui.QLineEdit(self.displayGroupBox) self.customXValueEdit.setObjectName(u'customXValueEdit') + self.customXValueEdit.setInputMask(u'99999') self.customXLayout.addWidget(self.customXValueEdit) self.customLayout.addLayout(self.customXLayout) self.customYLayout = QtGui.QVBoxLayout() @@ -255,6 +256,7 @@ class GeneralTab(SettingsTab): self.customYLayout.addWidget(self.customYLabel) self.customYValueEdit = QtGui.QLineEdit(self.displayGroupBox) self.customYValueEdit.setObjectName(u'customYValueEdit') + self.customYValueEdit.setInputMask(u'99999') self.customYLayout.addWidget(self.customYValueEdit) self.customLayout.addLayout(self.customYLayout) self.customWidthLayout = QtGui.QVBoxLayout() @@ -268,6 +270,7 @@ class GeneralTab(SettingsTab): self.customWidthLayout.addWidget(self.customWidthLabel) self.customWidthValueEdit = QtGui.QLineEdit(self.displayGroupBox) self.customWidthValueEdit.setObjectName(u'customWidthValueEdit') + self.customWidthValueEdit.setInputMask(u'99999') self.customWidthLayout.addWidget(self.customWidthValueEdit) self.customLayout.addLayout(self.customWidthLayout) self.customHeightLayout = QtGui.QVBoxLayout() @@ -280,6 +283,7 @@ class GeneralTab(SettingsTab): self.customHeightLayout.addWidget(self.customHeightLabel) self.customHeightValueEdit = QtGui.QLineEdit(self.displayGroupBox) self.customHeightValueEdit.setObjectName(u'customHeightValueEdit') + self.customHeightValueEdit.setInputMask(u'99999') self.customHeightLayout.addWidget(self.customHeightValueEdit) self.customLayout.addLayout(self.customHeightLayout) self.displayLayout.addLayout(self.customLayout) @@ -491,7 +495,7 @@ class GeneralTab(SettingsTab): def _toInt(self, value): """ - Convert text string to a numeric string + Make sure a Int returns a value. """ try: return int(value)