From 9d41465b7e23ae9a8038369134e6af267a933054 Mon Sep 17 00:00:00 2001 From: "Julien M." Date: Mon, 29 Apr 2024 13:14:18 +0200 Subject: [PATCH] ui(forms): add message bars to forms --- qtribu/gui/form_article.py | 1 + qtribu/gui/form_article.ui | 30 +++++++++++++----------------- qtribu/gui/form_rdp_news.py | 1 + qtribu/gui/form_rdp_news.ui | 37 ++++++++++++++++++++++++++++++++++++- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/qtribu/gui/form_article.py b/qtribu/gui/form_article.py index 37ca580b..562fa023 100644 --- a/qtribu/gui/form_article.py +++ b/qtribu/gui/form_article.py @@ -171,6 +171,7 @@ def accept(self) -> bool: # inform if len(invalid_fields): self.log( + parent_location=self, message=self.tr("Some of required fields are incorrectly filled."), push=True, log_level=2, diff --git a/qtribu/gui/form_article.ui b/qtribu/gui/form_article.ui index 698ff427..342fefa8 100644 --- a/qtribu/gui/form_article.ui +++ b/qtribu/gui/form_article.ui @@ -7,14 +7,14 @@ 0 0 763 - 1060 + 810 GeoRDP - News Form - 0.98 + 0.980000000000000 @@ -205,6 +205,9 @@ + + + @@ -228,21 +231,8 @@ - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + @@ -253,6 +243,12 @@
qtribu.gui.wdg_authoring
1 + + QgsMessageBar + QWidget +
qgsmessagebar.h
+ 1 +
diff --git a/qtribu/gui/form_rdp_news.py b/qtribu/gui/form_rdp_news.py index be99df22..75815b8a 100644 --- a/qtribu/gui/form_rdp_news.py +++ b/qtribu/gui/form_rdp_news.py @@ -222,6 +222,7 @@ def accept(self) -> bool: # inform if len(invalid_fields): self.log( + parent_location=self, message=self.tr("Some of required fields are incorrectly filled."), push=True, log_level=2, diff --git a/qtribu/gui/form_rdp_news.ui b/qtribu/gui/form_rdp_news.ui index 3004e22a..7a77cc43 100644 --- a/qtribu/gui/form_rdp_news.ui +++ b/qtribu/gui/form_rdp_news.ui @@ -7,7 +7,7 @@ 0 0 763 - 1060 + 1156 @@ -338,6 +338,35 @@ p, li { white-space: pre-wrap; }
+ + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -347,6 +376,12 @@ p, li { white-space: pre-wrap; }
qtribu.gui.wdg_authoring
1 + + QgsMessageBar + QWidget +
qgsmessagebar.h
+ 1 +