Skip to content

Commit

Permalink
Move resources into resources folder
Browse files Browse the repository at this point in the history
  • Loading branch information
fieldOfView committed Mar 24, 2023
1 parent d074ade commit 3b9e78c
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/translation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
id: translation
uses: Elkin-Vasily/cura-plugin-translation@v1
with:
translation_folder: 'i18n'
translation_folder: 'resources/i18n'
translation_name: 'meshtools'
plugin_name: 'Mesh Tools'

Expand Down
26 changes: 22 additions & 4 deletions MeshTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
from typing import Optional, List, Dict

Resources.addSearchPath(
os.path.join(os.path.abspath(os.path.dirname(__file__)))
os.path.join(
os.path.abspath(os.path.dirname(__file__)),
"resources"
)
) # Plugin translation file import

catalog = i18nCatalog("meshtools")
Expand Down Expand Up @@ -105,7 +108,12 @@ def __init__(self, parent = None) -> None:
self._additional_menu = None # type: Optional[QObject]

def showSettingsDialog(self) -> None:
path = os.path.join(os.path.dirname(os.path.abspath(__file__)), self._qml_folder, "SettingsDialog.qml")
path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"resources",
self._qml_folder,
"SettingsDialog.qml"
)

self._settings_dialog = self._application.createQmlComponent(path, {"manager": self})
if self._settings_dialog:
Expand Down Expand Up @@ -135,7 +143,12 @@ def _onEngineCreated(self) -> None:
return

Logger.log("d", "Inserting item in context menu")
qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), self._qml_folder, "MeshToolsMenu.qml")
qml_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"resources",
self._qml_folder,
"MeshToolsMenu.qml"
)
self._additional_menu = self._application.createQmlComponent(qml_path, {"manager": self})
if not self._additional_menu:
return
Expand Down Expand Up @@ -433,7 +446,12 @@ def renameMesh(self) -> None:
if not self._node_queue:
return

path = os.path.join(os.path.dirname(os.path.abspath(__file__)), self._qml_folder, "RenameDialog.qml")
path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"resources",
self._qml_folder,
"RenameDialog.qml"
)
self._rename_dialog = self._application.createQmlComponent(path, {"manager": self})
if not self._rename_dialog:
return
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3b9e78c

Please sign in to comment.