From 385bfebca321750e2238fc033fa6cead6d1e435a Mon Sep 17 00:00:00 2001 From: Peery Date: Thu, 7 Apr 2022 17:48:01 +0200 Subject: [PATCH] Fixed Bug; Added Completer to tag search bar Fixed a bug when closing DB connection dialog during startup causing an error later. A normal exit suffices. --- ArtNet/artnet_manager.py | 3 +++ ArtNet/gui/window.py | 9 +++++++++ DB | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ArtNet/artnet_manager.py b/ArtNet/artnet_manager.py index 88db6b7..1460426 100644 --- a/ArtNet/artnet_manager.py +++ b/ArtNet/artnet_manager.py @@ -61,6 +61,9 @@ class ArtNetManager: dialog.ui.port_line_edit.setText(str(prev_db_data["port"])) db_data: dict = dialog.exec_() + if db_data is None: + logging.info("Dialog was closed without result! Exiting ...") + exit(0) if len(db_data.keys()) == 0: return self.change_db_connection(host=db_data["host"], port=db_data["port"], diff --git a/ArtNet/gui/window.py b/ArtNet/gui/window.py index a48fa58..bcba64b 100644 --- a/ArtNet/gui/window.py +++ b/ArtNet/gui/window.py @@ -90,6 +90,15 @@ class Window(QtWidgets.QMainWindow): self.ui.description_edit.setReadOnly(False) + tags = self.__main.db_connection.search_fuzzy_tag("", all_if_empty=True) + + result = [] + for tag_name, tag_desc, tag_category in tags: + result.append(tag_name) + complete = QtWidgets.QCompleter(result) + complete.setCaseSensitivity(Qt.CaseInsensitive) + self.ui.tag_search_bar.setCompleter(complete) + self.on_tag_search_change() self.center() diff --git a/DB b/DB index 6b3592e..7a0b0df 160000 --- a/DB +++ b/DB @@ -1 +1 @@ -Subproject commit 6b3592e0b7114c3043816d0f28a1c092098a8354 +Subproject commit 7a0b0dfc88e46f1ec31842a34c18d408f23f041d