Skip to content

Commit

Permalink
Merge pull request #162 from geotribu/ui/add-msg-bar-to-forms
Browse files Browse the repository at this point in the history
ui(forms): add message bars to forms
  • Loading branch information
Guts authored Apr 29, 2024
2 parents 0f7ac01 + 9d41465 commit cf3b1c7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 18 deletions.
1 change: 1 addition & 0 deletions qtribu/gui/form_article.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
30 changes: 13 additions & 17 deletions qtribu/gui/form_article.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<x>0</x>
<y>0</y>
<width>763</width>
<height>1060</height>
<height>810</height>
</rect>
</property>
<property name="windowTitle">
<string>GeoRDP - News Form</string>
</property>
<property name="windowOpacity">
<double>0.98</double>
<double>0.980000000000000</double>
</property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
Expand Down Expand Up @@ -205,6 +205,9 @@
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="AuthoringWidget" name="wdg_author" native="true"/>
</item>
<item row="9" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
Expand All @@ -228,21 +231,8 @@
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="AuthoringWidget" name="wdg_author" native="true"/>
</item>
<item row="11" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
<item row="0" column="1">
<widget class="QgsMessageBar" name="msg_bar" native="true"/>
</item>
</layout>
</widget>
Expand All @@ -253,6 +243,12 @@
<header>qtribu.gui.wdg_authoring</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsMessageBar</class>
<extends>QWidget</extends>
<header>qgsmessagebar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
Expand Down
1 change: 1 addition & 0 deletions qtribu/gui/form_rdp_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
37 changes: 36 additions & 1 deletion qtribu/gui/form_rdp_news.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>763</width>
<height>1060</height>
<height>1156</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -338,6 +338,35 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QgsMessageBar" name="msg_bar" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
Expand All @@ -347,6 +376,12 @@ p, li { white-space: pre-wrap; }
<header>qtribu.gui.wdg_authoring</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsMessageBar</class>
<extends>QWidget</extends>
<header>qgsmessagebar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
Expand Down

0 comments on commit cf3b1c7

Please sign in to comment.