Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo committed Nov 4, 2023
1 parent d4dfe01 commit 46293c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,9 @@ def event(self, event):
"""Handle Qt events"""

if event.type() == QEvent.Type.FileOpen:
Logger.log("i", "FileOpen event received")
Logger.log("i", "File to open: {}", event.file())
Logger.log("i", "Url to open: {}", event.url())
if self._plugins_loaded:
self._openFile(event.file())
else:
Expand Down Expand Up @@ -1764,6 +1767,8 @@ def _reloadMeshFinished(self, job) -> None:
job._node.setMeshData(mesh_data)

def _openFile(self, filename):
print("TEST")
print(filename)
Logger.log("i", "Open file request %s", filename)
self.readLocalFile(QUrl.fromLocalFile(filename))

Expand Down
2 changes: 2 additions & 0 deletions cura/SingleInstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def __readCommands(self, connection: QLocalSocket) -> None:
payload = json.loads(str(line, encoding = "ascii").strip())
command = payload["command"]

Logger.log("d", "Received command: %s", command)

# Command: Remove all models from the build plate.
if command == "clear-all":
self._application.callLater(lambda: self._application.deleteAll())
Expand Down

0 comments on commit 46293c3

Please sign in to comment.