mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Fixes a bug when entering non-digit values for item's goal in metadata
This commit is contained in:
parent
15ccaa513b
commit
bc70501373
|
@ -24,9 +24,12 @@ def wordCount(text):
|
|||
|
||||
def toInt(text):
|
||||
if text:
|
||||
return int(text)
|
||||
else:
|
||||
return 0
|
||||
try:
|
||||
return int(text)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def toFloat(text):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
# --!-- coding: utf8 --!--
|
||||
from PyQt5.QtWidgets import QWidget
|
||||
from PyQt5.QtGui import QIntValidator
|
||||
|
||||
from manuskript.enums import Outline
|
||||
from manuskript.ui.views.propertiesView_ui import Ui_propertiesView
|
||||
|
@ -19,6 +20,7 @@ class propertiesView(QWidget, Ui_propertiesView):
|
|||
self.chkCompile.setModel(mdlOutline)
|
||||
self.txtTitle.setModel(mdlOutline)
|
||||
self.txtGoal.setModel(mdlOutline)
|
||||
self.txtGoal.setValidator(QIntValidator(0, 9999999))
|
||||
|
||||
def getIndexes(self, sourceView):
|
||||
"""Returns a list of indexes from list of QItemSelectionRange"""
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'manuskript/ui/views/propertiesView_ui.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.4.2
|
||||
# Created by: PyQt5 UI code generator 5.9
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
|
|
Loading…
Reference in a new issue