mirror of
https://github.com/aclist/dztui.git
synced 2026-08-28 18:57:12 +02:00
chore: drop digit parsing from connect panel entry
This commit is contained in:
parent
f8be7e33d1
commit
5b5e91c2fa
@ -26,15 +26,12 @@ def validate_port(text: str) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def validate_ip_or_id(text: str) -> bool:
|
def validate_ip_truthy(text: str) -> bool:
|
||||||
try:
|
try:
|
||||||
validate_ip(text)
|
validate_ip(text)
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
if text.isdigit():
|
return False
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
class ValidatedEntry(Gtk.Entry):
|
class ValidatedEntry(Gtk.Entry):
|
||||||
@ -124,7 +121,7 @@ class IpEntry(ValidatedEntry):
|
|||||||
def __init__(self, controller: "Controller") -> None:
|
def __init__(self, controller: "Controller") -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller,
|
controller,
|
||||||
func=validate_ip_or_id,
|
func=validate_ip_truthy,
|
||||||
placeholder_text=connect_panel.placeholder,
|
placeholder_text=connect_panel.placeholder,
|
||||||
tooltip_text=connect_panel.entry_tooltip,
|
tooltip_text=connect_panel.entry_tooltip,
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user