mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added warning state for mongo url input
This commit is contained in:
parent
c104c26c74
commit
fee3a2484e
2 changed files with 18 additions and 2 deletions
|
|
@ -94,7 +94,11 @@ class MongoUrlInput(QtWidgets.QLineEdit):
|
|||
def set_valid(self):
|
||||
"""Set valid state on mongo url input."""
|
||||
self.setProperty("state", "valid")
|
||||
# self.ensurePolished()
|
||||
self.style().polish(self)
|
||||
|
||||
def set_warning(self):
|
||||
"""Set invalid state on mongo url input."""
|
||||
self.setProperty("state", "warning")
|
||||
self.style().polish(self)
|
||||
|
||||
def set_invalid(self):
|
||||
|
|
@ -369,8 +373,14 @@ class InstallDialog(QtWidgets.QDialog):
|
|||
self.reject()
|
||||
|
||||
def _on_mongo_url_change(self, new_value):
|
||||
# Strip the value
|
||||
new_value = new_value.strip()
|
||||
# Store new mongo url to variable
|
||||
self.mongo_url = new_value
|
||||
if self.mongo_url_regex.match(new_value):
|
||||
# Change style of input
|
||||
if not new_value:
|
||||
self._mongo_input.set_warning()
|
||||
elif self.mongo_url_regex.match(new_value):
|
||||
self._mongo_input.set_valid()
|
||||
else:
|
||||
self._mongo_input.set_invalid()
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ QLineEdit[state="invalid"] {
|
|||
border: 1px solid rgb(64, 32, 32);
|
||||
}
|
||||
|
||||
QLineEdit[state="warning"] {
|
||||
background-color: rgb(32, 32, 19);
|
||||
color: rgb(255, 190, 15);
|
||||
border: 1px solid rgb(64, 64, 32);
|
||||
}
|
||||
|
||||
QScrollBar:vertical {
|
||||
border: 1px solid rgb(61, 115, 97);
|
||||
background: #000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue