Skip to content

Commit 99bb210

Browse files
committed
merge: bring the message bar fix from feat/step-based-dock
2 parents 589d711 + 7bb85c2 commit 99bb210

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎loopstructural/gui/messages.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def push_success(title: str, text: str, duration: int = 5):
1111
confirmation before a destructive action.
1212
"""
1313
if iface is not None:
14-
iface.messageBar().pushSuccess(title, text, duration=duration)
14+
iface.messageBar().pushMessage(title, text, level=Qgis.MessageLevel.Success, duration=duration)
1515
else:
1616
# No main window, for example in the tests
1717
QgsMessageLog.logMessage(f"{title}: {text}", "LoopStructural", Qgis.MessageLevel.Success)
@@ -20,14 +20,14 @@ def push_success(title: str, text: str, duration: int = 5):
2020
def push_info(title: str, text: str, duration: int = 5):
2121
"""Show an information message in the message bar of QGIS."""
2222
if iface is not None:
23-
iface.messageBar().pushInfo(title, text, duration=duration)
23+
iface.messageBar().pushMessage(title, text, level=Qgis.MessageLevel.Info, duration=duration)
2424
else:
2525
QgsMessageLog.logMessage(f"{title}: {text}", "LoopStructural", Qgis.MessageLevel.Info)
2626

2727

2828
def push_warning(title: str, text: str, duration: int = 10):
2929
"""Show a warning in the message bar of QGIS, for a result that is not an error."""
3030
if iface is not None:
31-
iface.messageBar().pushWarning(title, text, duration=duration)
31+
iface.messageBar().pushMessage(title, text, level=Qgis.MessageLevel.Warning, duration=duration)
3232
else:
3333
QgsMessageLog.logMessage(f"{title}: {text}", "LoopStructural", Qgis.MessageLevel.Warning)

0 commit comments

Comments
 (0)