Skip to content

Commit aab3cac

Browse files
committed
ui(qtribu): add QChat in QField web menu action
1 parent b40fc69 commit aab3cac

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

qtribu/plugin_main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ def initGui(self):
144144
self.action_open_chat.setToolTip(self.tr("QChat"))
145145
self.action_open_chat.triggered.connect(self.open_chat)
146146

147+
self.action_open_qfield_qchat = QAction(
148+
QIcon(str(DIR_PLUGIN_ROOT / "resources/images/qfield.svg")),
149+
self.tr("QChat in QField"),
150+
self.iface.mainWindow(),
151+
)
152+
self.action_open_qfield_qchat.setToolTip(self.tr("QChat in QField"))
153+
self.action_open_qfield_qchat.triggered.connect(
154+
partial(
155+
open_url_in_browser,
156+
"https://github.com/geotribu/qchat-qfield-plugin",
157+
)
158+
)
159+
147160
self.action_help = QAction(
148161
QIcon(QgsApplication.iconPath("mActionHelpContents.svg")),
149162
self.tr("Help"),
@@ -167,6 +180,7 @@ def initGui(self):
167180

168181
# -- Menu
169182
self.iface.addPluginToWebMenu(__title__, self.action_open_chat)
183+
self.iface.addPluginToWebMenu(__title__, self.action_open_qfield_qchat)
170184
self.iface.addPluginToWebMenu(__title__, self.action_show_latest_content)
171185
self.iface.addPluginToWebMenu(__title__, self.action_form_rdp_news)
172186
self.iface.addPluginToWebMenu(__title__, self.action_form_article)
@@ -235,6 +249,7 @@ def unload(self):
235249
self.iface.removePluginWebMenu(__title__, self.action_form_rdp_news)
236250
self.iface.removePluginWebMenu(__title__, self.action_show_latest_content)
237251
self.iface.removePluginWebMenu(__title__, self.action_open_chat)
252+
self.iface.removePluginWebMenu(__title__, self.action_open_qfield_qchat)
238253
self.iface.removePluginWebMenu(__title__, self.action_settings)
239254
self.iface.removePluginWebMenu(__title__, self.action_splash)
240255

qtribu/resources/images/qfield.svg

Lines changed: 63 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)