cancel and logo metrics; error-proof report btn

This commit is contained in:
KatKatKateryna
2023-09-29 19:50:24 +01:00
parent eb7f90dacb
commit ca6b63fea8
2 changed files with 15 additions and 6 deletions
+11 -6
View File
@@ -61,7 +61,6 @@ class LogWidget(QWidget):
button = QPushButton(f"👌 Error") # to '{streamName}' Sent , v
#button.setStyleSheet("QPushButton {color: black; border: 0px;border-radius: 17px;padding: 20px;height: 40px;text-align: left;"+ f"{BACKGR_COLOR_GREY}" + "}")
button.clicked.connect(lambda: self.btnClicked())
#button.clicked.connect(lambda: self.hide())
self.btns.append(button)
# overriding the mouseReleaseEvent method
@@ -124,11 +123,12 @@ class LogWidget(QWidget):
if report is True:
# color report btn
reportList = self.dataStorage.latestActionReport
for item in reportList:
if item["errors"] != "":
reportBtn.setText("⚠️ Report")
#reportBtn.setStyleSheet("QPushButton {color: white; border-radius: 17px;padding:0px;padding-left: 10px;padding-right: 10px;text-align: center;"+ f"{BACKGR_ERROR_COLOR}" + "} QPushButton:hover { "+ f"{BACKGR_ERROR_COLOR_LIGHT}" + " }")
break
if reportList is not None:
for item in reportList:
if item["errors"] != "":
reportBtn.setText("⚠️ Report")
#reportBtn.setStyleSheet("QPushButton {color: white; border-radius: 17px;padding:0px;padding-left: 10px;padding-right: 10px;text-align: center;"+ f"{BACKGR_ERROR_COLOR}" + "} QPushButton:hover { "+ f"{BACKGR_ERROR_COLOR_LIGHT}" + " }")
break
boxLayout.addWidget(reportBtn)
boxLayout.addWidget(spacer)
@@ -179,6 +179,11 @@ class LogWidget(QWidget):
if url.startswith("http"):
self.openURL(url)
elif url.startswith("cancel"):
try: metrics.track("Connector Action", self.dataStorage.active_account, {"name": "Cancel Operation", "connector_version": str(self.dataStorage.plugin_version)})
except Exception as e: print(e)
self.hide()
self.parentWidget.cancelOperations()
except Exception as e:
+4
View File
@@ -309,6 +309,10 @@ class SpeckleQGISDialog(QtWidgets.QDockWidget, FORM_CLASS):
import webbrowser
url = "https://speckle.systems/"
webbrowser.open(url, new=0, autoraise=True)
try: metrics.track("Connector Action", self.dataStorage.active_account, {"name": "Logo Click", "connector_version": str(self.dataStorage.plugin_version)})
except Exception as e: print(e)
def refreshClicked(self, plugin):
try: