From c32989e607a7d71c414a05bf7a6c90ba84c7f836 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 29 Nov 2022 13:17:11 +0100 Subject: [PATCH 01/15] Delayed reporting - added button to generate html/charts. --- .../Gui/Pages/Summary/MainContentReport.qml | 30 +++++++++++++++---- .../Gui/Pages/Summary/SideBarBasic.qml | 23 ++++++++++++-- easyDiffractionApp/Logic/Proxies/Project.py | 8 +++++ 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/easyDiffractionApp/Gui/Pages/Summary/MainContentReport.qml b/easyDiffractionApp/Gui/Pages/Summary/MainContentReport.qml index eedc9e4d..4311e3df 100644 --- a/easyDiffractionApp/Gui/Pages/Summary/MainContentReport.qml +++ b/easyDiffractionApp/Gui/Pages/Summary/MainContentReport.qml @@ -83,9 +83,18 @@ Item { saveConfirmationDialog.open() } + // handlers for clicking the "Create Report" button in the side bar + signal reportRequested() + onReportRequested: { + ExGlobals.Constants.proxy.project.setReport(html) + webView.loadHtml(html) + } + Component.onCompleted: { ExGlobals.Variables.reportWebView = this + // Notify the python proxies ExGlobals.Constants.proxy.project.htmlExportingFinished.connect(htmlExportingFinished) + ExGlobals.Constants.proxy.project.reportRequested.connect(reportRequested) } } @@ -135,14 +144,23 @@ Item { } } - //} - onHtmlChanged: { - //print(html) - ExGlobals.Constants.proxy.project.setReport(html) - webView.loadHtml(html) + // when the state changes, the html display is reset + const list = [ + '', + '\n', + '\n', + head+'\n', + '\n', + '\n', + '\n', + '' + ] + const empty_html = list.join('\n') + ExGlobals.Constants.proxy.project.setReport(empty_html) + webView.loadHtml(empty_html) } - + ///////////// // HTML parts ///////////// diff --git a/easyDiffractionApp/Gui/Pages/Summary/SideBarBasic.qml b/easyDiffractionApp/Gui/Pages/Summary/SideBarBasic.qml index 8f654edd..6a4cd5db 100644 --- a/easyDiffractionApp/Gui/Pages/Summary/SideBarBasic.qml +++ b/easyDiffractionApp/Gui/Pages/Summary/SideBarBasic.qml @@ -18,10 +18,29 @@ import Gui.Pages.Summary 1.0 as ExSummaryPage EaComponents.SideBarColumn { + EaElements.GroupBox { + title: qsTr("Create report") + enabled: !ExGlobals.Constants.proxy.project.readOnly + collapsible: false + last: true + + // Create button + EaElements.SideBarButton { + wide: true + fontIcon: "flask" + text: qsTr("Create") + + onClicked: { + ExGlobals.Constants.proxy.project.requestReport() + } + + Component.onCompleted: ExGlobals.Variables.exportReportButton = this + } + } + EaElements.GroupBox { title: qsTr("Export report") - enabled: ExGlobals.Constants.proxy.project.projectCreated && - !ExGlobals.Constants.proxy.project.readOnly + enabled: !ExGlobals.Constants.proxy.project.readOnly collapsible: false last: true diff --git a/easyDiffractionApp/Logic/Proxies/Project.py b/easyDiffractionApp/Logic/Proxies/Project.py index fb9d25c7..3a187b03 100644 --- a/easyDiffractionApp/Logic/Proxies/Project.py +++ b/easyDiffractionApp/Logic/Proxies/Project.py @@ -12,6 +12,7 @@ class ProjectProxy(QObject): stateChanged = Signal(bool) htmlExportingFinished = Signal(bool, str) statusInfoChanged = Signal() + reportRequested = Signal() def __init__(self, parent=None, logic=None): # , interface=None): super().__init__(parent) @@ -131,6 +132,13 @@ def saveReport(self, filepath): success = self.logic.saveReport(filepath) self.htmlExportingFinished.emit(success, filepath) + @Slot() + def requestReport(self): + """ + Request a report generation + """ + self.reportRequested.emit() + # status @Property('QVariant', notify=statusInfoChanged) def statusModelAsObj(self): From fabcfe2207115f988836f5b0099dd29c16f01124 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Fri, 6 Jan 2023 13:45:19 +0100 Subject: [PATCH 02/15] try without pyobjc --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 222609b7..1b0ad56b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' darkdetect = '^0.3.1' -pyobjc-core = { version = '^7.1', platform = 'darwin' } -pyobjc-framework-cocoa = { version = '^7.1', platform = 'darwin' } +# pyobjc-core = { version = '^7.1', platform = 'darwin' } +# pyobjc-framework-cocoa = { version = '^7.1', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From 9af154ec5640015219ac54ebf3be36409b623a6c Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Fri, 6 Jan 2023 14:19:35 +0100 Subject: [PATCH 03/15] try with version >=9.0 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1b0ad56b..a3c60fc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' darkdetect = '^0.3.1' -# pyobjc-core = { version = '^7.1', platform = 'darwin' } -# pyobjc-framework-cocoa = { version = '^7.1', platform = 'darwin' } +pyobjc-core = { version = '^9.0', platform = 'darwin' } +pyobjc-framework-cocoa = { version = '^9.0', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From 93a335d8791c74e3bb9fe2bf53e14c64b4b1d5c6 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Fri, 6 Jan 2023 15:29:52 +0100 Subject: [PATCH 04/15] test >8.5 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a3c60fc4..1655d981 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' darkdetect = '^0.3.1' -pyobjc-core = { version = '^9.0', platform = 'darwin' } -pyobjc-framework-cocoa = { version = '^9.0', platform = 'darwin' } +pyobjc-core = { version = '^8.5', platform = 'darwin' } +pyobjc-framework-cocoa = { version = '^8.5', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From f932db407e38c244ca29e532a845e4d1433d6dfe Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Fri, 6 Jan 2023 15:56:19 +0100 Subject: [PATCH 05/15] is this a python 3.8 issue? --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1655d981..afbe250c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,8 @@ url = "https://easyscience.github.io/pypi/" secondary = true [tool.poetry.dependencies] -python = '^3.8, <3.9' +# python = '^3.8, <3.9' +python = '^3.9, <3.10' darkdetect = '^0.3.1' pyobjc-core = { version = '^8.5', platform = 'darwin' } pyobjc-framework-cocoa = { version = '^8.5', platform = 'darwin' } From 8df607ea4722b33476c419c03ea427130681d044 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Fri, 6 Jan 2023 16:29:10 +0100 Subject: [PATCH 06/15] update the workflow for 3.9 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe31a38b..ec7b5df0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: Set up Python environment uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Upgrade PIP run: python -m pip install --upgrade pip From 21b60e4e71be6037d33c0a1bf5d67ee4e3156842 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Mon, 9 Jan 2023 10:15:35 +0100 Subject: [PATCH 07/15] temporarily skip the gui test --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec7b5df0..2d537ce5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,13 +121,13 @@ jobs: - name: Install app run: poetry run python ${{ env.SCRIPTS_PATH }}/InstallApp.py - - name: Run app in testmode, record screen and quit - run: poetry run python ${{ env.SCRIPTS_PATH }}/RunApp.py --testmode + # - name: Run app in testmode, record screen and quit + # run: poetry run python ${{ env.SCRIPTS_PATH }}/RunApp.py --testmode - - name: Rename test videos - run: > - poetry run python ${{ env.SCRIPTS_PATH }}/RenameTestVideos.py - ${{ env.BRANCH_NAME }} + # - name: Rename test videos + # run: > + # poetry run python ${{ env.SCRIPTS_PATH }}/RenameTestVideos.py + # ${{ env.BRANCH_NAME }} - name: Sign app installer if: github.event_name == 'push' && env.BRANCH_NAME == 'master' @@ -151,7 +151,8 @@ jobs: allowUpdates: true replacesArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "${{ env.DISTRIBUTION_PATH }}/*.zip,${{ env.DISTRIBUTION_PATH }}/*.mp4" + # artifacts: "${{ env.DISTRIBUTION_PATH }}/*.zip,${{ env.DISTRIBUTION_PATH }}/*.mp4" + artifacts: "${{ env.DISTRIBUTION_PATH }}/*.zip" tag: ${{ env.BRANCH_NAME }} name: ${{ env.BRANCH_NAME }} bodyFile: "RELEASE.md" From 6cfadf1b2240d625db8204d5a2e299b42829e597 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 10 Jan 2023 10:24:27 +0100 Subject: [PATCH 08/15] python 3.8 with pyobjc=3.7 --- .github/workflows/build.yml | 2 +- pyproject.toml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d537ce5..dfae7550 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: Set up Python environment uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.8 - name: Upgrade PIP run: python -m pip install --upgrade pip diff --git a/pyproject.toml b/pyproject.toml index afbe250c..36e91879 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,11 +22,11 @@ url = "https://easyscience.github.io/pypi/" secondary = true [tool.poetry.dependencies] -# python = '^3.8, <3.9' -python = '^3.9, <3.10' +python = '^3.8, <3.9' +# python = '^3.9, <3.10' darkdetect = '^0.3.1' -pyobjc-core = { version = '^8.5', platform = 'darwin' } -pyobjc-framework-cocoa = { version = '^8.5', platform = 'darwin' } +pyobjc-core = { version = '7.3', platform = 'darwin' } +pyobjc-framework-cocoa = { version = '7.3', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From d104b826e6b30e92e75ed3d440a4b7f7dfa91ff1 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 10 Jan 2023 11:32:30 +0100 Subject: [PATCH 09/15] go back to 7.0.1 with universal2 binaries --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 36e91879..b02b7adb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,10 +23,9 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' -# python = '^3.9, <3.10' darkdetect = '^0.3.1' -pyobjc-core = { version = '7.3', platform = 'darwin' } -pyobjc-framework-cocoa = { version = '7.3', platform = 'darwin' } +pyobjc-core = { version = '7.0.1', platform = 'darwin' } +pyobjc-framework-cocoa = { version = '7.0.1', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From 22428a2a6213290c1d0db7d5f76a14dba42bae2d Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 10 Jan 2023 11:46:34 +0100 Subject: [PATCH 10/15] try building pyobjc locally --- .github/workflows/build.yml | 6 ++++++ pyproject.toml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfae7550..5bb8a76a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,6 +55,12 @@ jobs: python -m pip install toml python utils.py --update + - name: Compile and install pyobjc on macos-11 + if: runner.os == 'macOS' + run: | + python -m pip install pyobjc-core --no-binary :all: + python -m pip install pyobjc-framework-Cocoa --no-binary :all: + # https://docs.github.com/en/actions/reference/environment-variables - name: Declare env variables on push and pull_request shell: bash diff --git a/pyproject.toml b/pyproject.toml index b02b7adb..803be771 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,8 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' darkdetect = '^0.3.1' -pyobjc-core = { version = '7.0.1', platform = 'darwin' } -pyobjc-framework-cocoa = { version = '7.0.1', platform = 'darwin' } +# pyobjc-core = { version = '7.0.1', platform = 'darwin' } +# pyobjc-framework-cocoa = { version = '7.0.1', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From c02ed1fafb39860f1a7d50a42ad4bb4dfdc1d78b Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 10 Jan 2023 13:20:54 +0100 Subject: [PATCH 11/15] explicit version for pyobjc --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bb8a76a..3e2ea218 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,8 +58,8 @@ jobs: - name: Compile and install pyobjc on macos-11 if: runner.os == 'macOS' run: | - python -m pip install pyobjc-core --no-binary :all: - python -m pip install pyobjc-framework-Cocoa --no-binary :all: + python -m pip install pyobjc-core==7.0.1 --no-binary :all: + python -m pip install pyobjc-framework-Cocoa==7.0.1 --no-binary :all: # https://docs.github.com/en/actions/reference/environment-variables - name: Declare env variables on push and pull_request From 31fd26938051af1cf294f9349bb24fa0389e15af Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Tue, 10 Jan 2023 13:36:00 +0100 Subject: [PATCH 12/15] Use macos only and bump the versions --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e2ea218..e0b31478 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,8 @@ jobs: strategy: matrix: - os: [macos-11, ubuntu-20.04, windows-2019] + # os: [macos-11, ubuntu-20.04, windows-2019] + os: [macos-11] steps: - name: Cancel previous workflow runs @@ -58,8 +59,8 @@ jobs: - name: Compile and install pyobjc on macos-11 if: runner.os == 'macOS' run: | - python -m pip install pyobjc-core==7.0.1 --no-binary :all: - python -m pip install pyobjc-framework-Cocoa==7.0.1 --no-binary :all: + python -m pip install pyobjc-core>=7.1 --no-binary :all: + python -m pip install pyobjc-framework-Cocoa>=7.1 --no-binary :all: # https://docs.github.com/en/actions/reference/environment-variables - name: Declare env variables on push and pull_request From 7f694dca394e18a55a0a3677ba5aaf2683e5253f Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Wed, 11 Jan 2023 09:40:28 +0100 Subject: [PATCH 13/15] switch on all platforms --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0b31478..90ee867a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,7 @@ jobs: strategy: matrix: - # os: [macos-11, ubuntu-20.04, windows-2019] - os: [macos-11] + os: [macos-11, ubuntu-20.04, windows-2019] steps: - name: Cancel previous workflow runs From cbf502f464b285a648fe52e0c03083d11c14be26 Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Wed, 11 Jan 2023 13:19:15 +0100 Subject: [PATCH 14/15] enable tutorials, clean up --- .github/workflows/build.yml | 15 +++++++-------- pyproject.toml | 2 -- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90ee867a..6ce4b6ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -127,13 +127,13 @@ jobs: - name: Install app run: poetry run python ${{ env.SCRIPTS_PATH }}/InstallApp.py - # - name: Run app in testmode, record screen and quit - # run: poetry run python ${{ env.SCRIPTS_PATH }}/RunApp.py --testmode + - name: Run app in testmode, record screen and quit + run: poetry run python ${{ env.SCRIPTS_PATH }}/RunApp.py --testmode - # - name: Rename test videos - # run: > - # poetry run python ${{ env.SCRIPTS_PATH }}/RenameTestVideos.py - # ${{ env.BRANCH_NAME }} + - name: Rename test videos + run: > + poetry run python ${{ env.SCRIPTS_PATH }}/RenameTestVideos.py + ${{ env.BRANCH_NAME }} - name: Sign app installer if: github.event_name == 'push' && env.BRANCH_NAME == 'master' @@ -157,8 +157,7 @@ jobs: allowUpdates: true replacesArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} - # artifacts: "${{ env.DISTRIBUTION_PATH }}/*.zip,${{ env.DISTRIBUTION_PATH }}/*.mp4" - artifacts: "${{ env.DISTRIBUTION_PATH }}/*.zip" + artifacts: "${{ env.DISTRIBUTION_PATH }}/*.zip,${{ env.DISTRIBUTION_PATH }}/*.mp4" tag: ${{ env.BRANCH_NAME }} name: ${{ env.BRANCH_NAME }} bodyFile: "RELEASE.md" diff --git a/pyproject.toml b/pyproject.toml index 803be771..8d0e4264 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,6 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' darkdetect = '^0.3.1' -# pyobjc-core = { version = '7.0.1', platform = 'darwin' } -# pyobjc-framework-cocoa = { version = '7.0.1', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1' From bb6743cea5715754850f9773464aab68e410addd Mon Sep 17 00:00:00 2001 From: Piotr Rozyczko Date: Wed, 11 Jan 2023 14:21:37 +0100 Subject: [PATCH 15/15] back to the original code for PR merge --- .github/workflows/build.yml | 6 ------ pyproject.toml | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce4b6ff..fe31a38b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,12 +55,6 @@ jobs: python -m pip install toml python utils.py --update - - name: Compile and install pyobjc on macos-11 - if: runner.os == 'macOS' - run: | - python -m pip install pyobjc-core>=7.1 --no-binary :all: - python -m pip install pyobjc-framework-Cocoa>=7.1 --no-binary :all: - # https://docs.github.com/en/actions/reference/environment-variables - name: Declare env variables on push and pull_request shell: bash diff --git a/pyproject.toml b/pyproject.toml index 8d0e4264..222609b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,8 @@ secondary = true [tool.poetry.dependencies] python = '^3.8, <3.9' darkdetect = '^0.3.1' +pyobjc-core = { version = '^7.1', platform = 'darwin' } +pyobjc-framework-cocoa = { version = '^7.1', platform = 'darwin' } CFML = '^0.0.1' GSASII = '^0.0.1'