mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 19:57:51 -06:00
Use a separate function to validate IP address
CURA-6483
This commit is contained in:
parent
defcba6927
commit
c8872cb4a1
4 changed files with 79 additions and 1 deletions
21
cura/Utils/QtUtil.py
Normal file
21
cura/Utils/QtUtil.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from PyQt5.QtCore import QObject, pyqtSlot
|
||||
|
||||
from . import networking
|
||||
|
||||
|
||||
#
|
||||
# Exposes the util functions to QML using a QObject.
|
||||
#
|
||||
class QtUtil(QObject):
|
||||
|
||||
def __init__(self, parent: Optional["QObject"] = None) -> None:
|
||||
super().__init__(parent = parent)
|
||||
|
||||
@pyqtSlot(str, result = bool)
|
||||
def isValidIP(self, address: str) -> bool:
|
||||
return networking.isValidIP(address)
|
Loading…
Add table
Add a link
Reference in a new issue