From e6de739d0cce9ed202f4b6e82445591aa8184149 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Sun, 27 Oct 2024 00:45:04 +0200 Subject: [PATCH] Rewirring paths to improve import names and such. --- common/rollup.config.mjs | 2 +- .../eu/ad5001/LogarithmPlotter/AppMenuBar.qml | 2 +- .../eu/ad5001/LogarithmPlotter/Common/qmldir | 3 +++ .../{HistoryBrowser.qml => Browser.qml} | 6 +++--- .../{HistoryItem.qml => SingleItem.qml} | 2 +- .../eu/ad5001/LogarithmPlotter/History/qmldir | 4 ++-- .../LogarithmPlotter/LogarithmPlotter.qml | 21 ++++++++++++------- .../ObjectLists/Editor/CustomPropertyList.qml | 2 +- .../ObjectLists/Editor/Dialog.qml | 3 +-- .../ObjectLists/ObjectCreationGrid.qml | 2 +- .../ObjectLists/ObjectRow.qml | 2 +- .../LogarithmPlotter/Overlay/Loading.qml | 19 +++++++++++++++++ .../PickLocation.qml} | 19 +++++++---------- .../ViewPositionChange.qml} | 2 +- .../eu/ad5001/LogarithmPlotter/Overlay/qmldir | 4 ++++ .../LogarithmPlotter/Popup/Preferences.qml | 2 +- .../Setting/ExpressionEditor.qml | 2 +- .../eu/ad5001/LogarithmPlotter/Settings.qml | 2 +- .../qml/eu/ad5001/LogarithmPlotter/qmldir | 2 -- .../LogarithmPlotter/util/latex.py | 1 - .../LogarithmPlotter/util/promise.py | 2 ++ scripts/build.sh | 20 +++++++++++------- 22 files changed, 79 insertions(+), 45 deletions(-) create mode 100644 runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Common/qmldir rename runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/{HistoryBrowser.qml => Browser.qml} (98%) rename runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/{HistoryItem.qml => SingleItem.qml} (99%) create mode 100644 runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/Loading.qml rename runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/{PickLocationOverlay.qml => Overlay/PickLocation.qml} (97%) rename runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/{ViewPositionChangeOverlay.qml => Overlay/ViewPositionChange.qml} (99%) create mode 100644 runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/qmldir diff --git a/common/rollup.config.mjs b/common/rollup.config.mjs index 6a18a41..6156873 100644 --- a/common/rollup.config.mjs +++ b/common/rollup.config.mjs @@ -22,7 +22,7 @@ import { babel } from "@rollup/plugin-babel" import cleanup from "rollup-plugin-cleanup" const src = "./src/index.mjs" -const dest = "../build/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/index.mjs" +const dest = "../build/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Common/index.mjs" export default { input: src, diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml index 87dd625..79fa6b0 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml @@ -20,7 +20,7 @@ import QtQuick import Qt.labs.platform as Native //import QtQuick.Controls 2.15 import eu.ad5001.MixedMenu 1.1 -import "js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Common/qmldir b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Common/qmldir new file mode 100644 index 0000000..af9eb16 --- /dev/null +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Common/qmldir @@ -0,0 +1,3 @@ +module eu.ad5001.LogarithmPlotter.Common + +JS 1.0 index.mjs diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/Browser.qml similarity index 98% rename from runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml rename to runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/Browser.qml index eb84340..645916c 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryBrowser.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/Browser.qml @@ -24,7 +24,7 @@ import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting /*! - \qmltype HistoryBrowser + \qmltype Browser \inqmlmodule eu.ad5001.LogarithmPlotter.History \brief Tab of the drawer that allows to navigate through the undo and redo history. @@ -95,7 +95,7 @@ Item { Repeater { model: historyBrowser.redoCount - HistoryItem { + SingleItem { id: redoButton width: historyBrowser.actionWidth //height: actionHeight @@ -147,7 +147,7 @@ Item { model: historyBrowser.undoCount - HistoryItem { + SingleItem { id: undoButton width: historyBrowser.actionWidth //height: actionHeight diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/SingleItem.qml similarity index 99% rename from runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml rename to runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/SingleItem.qml index 6ad6556..bffdb9b 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/HistoryItem.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/SingleItem.qml @@ -22,7 +22,7 @@ import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting /*! - \qmltype HistoryItem + \qmltype SingleItem \inqmlmodule eu.ad5001.LogarithmPlotter.History \brief Item representing an history action. diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir index 7f8a628..66c4408 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History/qmldir @@ -1,4 +1,4 @@ module eu.ad5001.LogarithmPlotter.History -HistoryBrowser 1.0 HistoryBrowser.qml -HistoryItem 1.0 HistoryItem.qml +Browser 1.0 Browser.qml +SingleItem 1.0 SingleItem.qml diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml index d541a0c..b8799de 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml @@ -23,10 +23,11 @@ import QtQuick.Layouts 1.12 import QtQuick // Auto loading all modules. -import "js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common -import eu.ad5001.LogarithmPlotter.History 1.0 +import eu.ad5001.LogarithmPlotter.History 1.0 as History import eu.ad5001.LogarithmPlotter.ObjectLists 1.0 +import eu.ad5001.LogarithmPlotter.Overlay 1.0 as Overlay import eu.ad5001.LogarithmPlotter.Popup 1.0 as Popup /*! @@ -120,16 +121,16 @@ ApplicationWindow { ObjectLists { id: objectLists - onChanged: drawCanvas.requestPaint() + onChanged: Modules.Canvas.requestPaint() } Settings { id: settings canvas: drawCanvas - onChanged: drawCanvas.requestPaint() + onChanged: Modules.Canvas.requestPaint() } - HistoryBrowser { + History.Browser { id: historyBrowser } } @@ -154,18 +155,24 @@ ApplicationWindow { } } - ViewPositionChangeOverlay { + Overlay.ViewPositionChange { id: viewPositionChanger anchors.fill: parent canvas: parent settingsInstance: settings } - PickLocationOverlay { + Overlay.PickLocation { id: positionPicker anchors.fill: parent canvas: parent } + + // Overlay.Loading { + // id: loadingOverlay + // anchors.fill: parent + // canvas: parent + // } } Timer { diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml index 49cea8e..e688202 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/CustomPropertyList.qml @@ -20,7 +20,7 @@ import QtQuick import QtQuick.Controls import Qt.labs.platform as Native import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting -import "../../js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! \qmltype CustomPropertyList diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml index 715602a..ced0cdd 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/Editor/Dialog.qml @@ -18,11 +18,10 @@ import QtQuick import QtQuick.Controls -import QtQuick.Dialogs as D import Qt.labs.platform as Native import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting import eu.ad5001.LogarithmPlotter.Popup 1.0 as Popup -import "../../js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! \qmltype Dialog diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml index e8d4912..e3894cd 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml @@ -19,7 +19,7 @@ import QtQuick import QtQuick.Controls import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting -import "../js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml index 9624d23..5812252 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectRow.qml @@ -21,7 +21,7 @@ import QtQuick.Dialogs import QtQuick.Controls import QtQuick.Window import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting -import "../js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/Loading.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/Loading.qml new file mode 100644 index 0000000..a69f2cd --- /dev/null +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/Loading.qml @@ -0,0 +1,19 @@ +/** + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and distribution functions. + * Copyright (C) 2021-2024 Ad5001 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import QtQuick diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/PickLocation.qml similarity index 97% rename from runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml rename to runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/PickLocation.qml index b364e73..f005756 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/PickLocation.qml @@ -18,12 +18,12 @@ import QtQuick import QtQuick.Controls -import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting -import "js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Setting as Setting +import eu.ad5001.LogarithmPlotter.Common /*! - \qmltype PickLocationOverlay - \inqmlmodule eu.ad5001.LogarithmPlotter + \qmltype PickLocation + \inqmlmodule eu.ad5001.LogarithmPlotter.Overlay \brief Overlay used to pick a new location for an object. Provides an overlay over the canvas that can be shown when the user clicks the "Set position" button @@ -32,11 +32,13 @@ import "js/index.mjs" as JS \sa LogarithmPlotter, LogGraphCanvas */ -Item { +Rectangle { id: pickerRoot visible: false clip: true - + color: sysPalette.window + opacity: 0.35 + /*! \qmlsignal PickLocationOverlay::picked(var obj) @@ -96,11 +98,6 @@ Item { */ readonly property bool userPickY: pickY && pickYCheckbox.checked - Rectangle { - color: sysPalette.window - opacity: 0.35 - anchors.fill: parent - } MouseArea { id: picker diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ViewPositionChangeOverlay.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/ViewPositionChange.qml similarity index 99% rename from runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ViewPositionChangeOverlay.qml rename to runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/ViewPositionChange.qml index 7a7072b..1931536 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ViewPositionChangeOverlay.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/ViewPositionChange.qml @@ -19,7 +19,7 @@ import QtQuick /*! - \qmltype ViewPositionChangeOverlay + \qmltype ViewPositionChange.Overlay \inqmlmodule eu.ad5001.LogarithmPlotter \brief Overlay used allow the user to drag the canvas' position and change the zoom level. diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/qmldir b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/qmldir new file mode 100644 index 0000000..8daae21 --- /dev/null +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Overlay/qmldir @@ -0,0 +1,4 @@ +module eu.ad5001.LogarithmPlotter.Overlay + +PickLocation 1.0 PickLocation.qml +ViewPositionChange 1.0 ViewPositionChange.qml diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Popup/Preferences.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Popup/Preferences.qml index a76410f..70d77a9 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Popup/Preferences.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Popup/Preferences.qml @@ -20,7 +20,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting -import "../js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! \qmltype Preferences diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml index bb99f52..8251a3f 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Setting/ExpressionEditor.qml @@ -20,7 +20,7 @@ import QtQuick.Controls import QtQuick import Qt.labs.platform as Native import eu.ad5001.LogarithmPlotter.Popup 1.0 as P -import "../js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml index 992e9b1..3f17ea3 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml @@ -20,7 +20,7 @@ import QtQuick import QtQuick.Controls import eu.ad5001.LogarithmPlotter.Setting 1.0 as Setting import eu.ad5001.LogarithmPlotter.Popup 1.0 as Popup -import "js/index.mjs" as JS +import eu.ad5001.LogarithmPlotter.Common /*! \qmltype Settings diff --git a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/qmldir b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/qmldir index 3aeaa15..c80cae5 100644 --- a/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/qmldir +++ b/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/qmldir @@ -2,6 +2,4 @@ module eu.ad5001.LogarithmPlotter AppMenuBar 1.0 AppMenuBar.qml LogGraphCanvas 1.0 LogGraphCanvas.qml -PickLocationOverlay 1.0 PickLocationOverlay.qml Settings 1.0 Settings.qml -ViewPositionChangeOverlay 1.0 ViewPositionChangeOverlay.qml \ No newline at end of file diff --git a/runtime-pyside6/LogarithmPlotter/util/latex.py b/runtime-pyside6/LogarithmPlotter/util/latex.py index 71064fa..78c9d44 100644 --- a/runtime-pyside6/LogarithmPlotter/util/latex.py +++ b/runtime-pyside6/LogarithmPlotter/util/latex.py @@ -181,7 +181,6 @@ class Latex(QObject): """ markup_hash, render_hash, export_path = self.create_export_path(latex_markup, font_size, color) if self.latexSupported and not path.exists(export_path + ".png"): - print("Rendering", latex_markup) # Generating file latex_path = path.join(self.tempdir, str(markup_hash)) # If the formula is just recolored or the font is just changed, no need to recreate the DVI. diff --git a/runtime-pyside6/LogarithmPlotter/util/promise.py b/runtime-pyside6/LogarithmPlotter/util/promise.py index f65efa8..c917660 100644 --- a/runtime-pyside6/LogarithmPlotter/util/promise.py +++ b/runtime-pyside6/LogarithmPlotter/util/promise.py @@ -100,6 +100,7 @@ class PyPromise(QObject): Starts the thread that will run the promise. """ if not self._started: # Avoid getting started twice. + print("Starting", self._runner.args) QThreadPool.globalInstance().start(self._runner) self._started = True @@ -153,6 +154,7 @@ class PyPromise(QObject): def _fulfill(self, data): self._state = "fulfilled" no_return = [None, QJSValue.SpecialValue.UndefinedValue] + print("Finished", self._runner.args) for i in range(len(self._fulfills)): try: result = self._fulfills[i](data) diff --git a/scripts/build.sh b/scripts/build.sh index be25274..b63d7f6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -22,6 +22,10 @@ DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$DIR/.." || exit 1 +BUILD_DIR="build/runtime-pyside6" +BUILD_QML_DIR="$BUILD_DIR/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter" + + box() { len=${#1} echo "┌─$(printf '─%.0s' $(seq 1 "$len"))─┐" @@ -30,20 +34,22 @@ box() { } rm -rf build -mkdir -p build/runtime-pyside6 +mkdir -p "$BUILD_DIR" # Copy python box "Copying pyside6 python runtime..." -cp -r runtime-pyside6/{setup.py,LogarithmPlotter} build/runtime-pyside6 +cp -r runtime-pyside6/{setup.py,LogarithmPlotter} "$BUILD_DIR" box "Building ecmascript modules..." -mkdir -p build/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js -cd common && (npm run build || exit) && cd .. +mkdir -p "$BUILD_QML_DIR/js" +cd common && \ + (npm run build || exit) && \ + cd .. box "Building translations..." cd assets/i18n/ && (bash release.sh || exit) && cd ../../ -mkdir -p build/runtime-pyside6/LogarithmPlotter/i18n && cp assets/i18n/*.qm build/runtime-pyside6/LogarithmPlotter/i18n/ +mkdir -p "$BUILD_DIR/LogarithmPlotter/i18n" && cp assets/i18n/*.qm "$BUILD_DIR/LogarithmPlotter/i18n/" box "Building icons..." -cp -r assets/icons build/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ -cp assets/logarithmplotter.svg build/runtime-pyside6/LogarithmPlotter/ +cp -r assets/icons "$BUILD_QML_DIR" +cp assets/logarithmplotter.svg "$BUILD_DIR/LogarithmPlotter/"