From 0428bfc1408e01bc5016d4267e98a26df94c2e5f Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Thu, 10 Aug 2023 14:55:52 +0200 Subject: [PATCH] Add the icon for the main menu entry --- QgisModelBaker/qgismodelbaker.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/QgisModelBaker/qgismodelbaker.py b/QgisModelBaker/qgismodelbaker.py index 27061fae9..5182c0ba7 100644 --- a/QgisModelBaker/qgismodelbaker.py +++ b/QgisModelBaker/qgismodelbaker.py @@ -241,6 +241,18 @@ def initGui(self): self.iface.addPluginToDatabaseMenu(self.tr("Model Baker"), self.__help_action) self.iface.addPluginToDatabaseMenu(self.tr("Model Baker"), self.__about_action) + databaseMenuActions = self.iface.databaseMenu().actions() + for action in databaseMenuActions: + if action.text() == self.tr("Model Baker"): + action.setIcon( + QIcon( + os.path.join( + os.path.dirname(__file__), "images/QgisModelBaker-icon.svg" + ) + ) + ) + break + self.toolbar = self.iface.addToolBar(self.tr("Model Baker")) self.toolbar.setObjectName("ModelBakerToolbar") self.toolbar.setToolTip(self.tr("Model Baker Toolbar"))