diff --git a/LogarithmPlotter/__init__.py b/LogarithmPlotter/__init__.py index 9301af8..917bac4 100644 --- a/LogarithmPlotter/__init__.py +++ b/LogarithmPlotter/__init__.py @@ -122,7 +122,10 @@ def run(): if not engine.rootObjects(): print("No root object") exit(-1) - app.exec_() + exit_code = app.exec_() os.remove(tempfile) - + exit(exit_code) + +if __name__ == "__main__": + run() diff --git a/LogarithmPlotter/qml/About.qml b/LogarithmPlotter/qml/About.qml index e2ab2d3..c8bf377 100644 --- a/LogarithmPlotter/qml/About.qml +++ b/LogarithmPlotter/qml/About.qml @@ -29,7 +29,7 @@ D.Dialog { Image { id: logo - source: "../logplotter.svg" + source: "../../logplotter.svg" sourceSize.width: 64 sourceSize.height: 64 width: 64 diff --git a/LogarithmPlotter/qml/ObjectLists.qml b/LogarithmPlotter/qml/ObjectLists.qml index 1f7a593..e9ddc90 100644 --- a/LogarithmPlotter/qml/ObjectLists.qml +++ b/LogarithmPlotter/qml/ObjectLists.qml @@ -438,7 +438,7 @@ ListView { icon.name: modelData icon.width: 24 icon.height: 24 - icon.color: 'white'//sysPalette.windowText + icon.color: sysPalette.windowText onClicked: { var newObj = Objects.createNewRegisteredObject(modelData) diff --git a/build-macosx.sh b/build-macosx.sh new file mode 100755 index 0000000..fe6d498 --- /dev/null +++ b/build-macosx.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Untested yet +rm $(find . -name "*.qmlc") +rm $(find . -name "*.pyc") +python3 -m pip install -U pyinstaller +iconutil -c icns "mac/logarithmplotter.iconset" + --add-data "AccountLogarithmPlotter/qml:qml" \ + --add-data "LICENSE.md:." \ + --add-data "README.md:." \ + --exclude-module "FixTk" \ + --exclude-module "tcl" \ + --exclude-module "tk" \ + --exclude-module "_tkinter" \ + --exclude-module "tkinter" \ + --exclude-module "Tkinter" \ + --noconsole \ + --noconfirm \ + --icon=mac/logarithmplotter.icns \ + --osx-bundle-identifier eu.ad5001.logarithmplotter \ + -n LogarithmPlotter \ + LogarithmPlotter/__init__.py diff --git a/build-windows.bat b/build-windows.bat new file mode 100644 index 0000000..aff04f7 --- /dev/null +++ b/build-windows.bat @@ -0,0 +1,2 @@ +python -m pip install -U pyinstaller +pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --noconsole LogarithmPlotter/__init__.py --icon=win/logarithmplotter.ico -n logarithmplotter diff --git a/build-wine.sh b/build-wine.sh new file mode 100644 index 0000000..b0eb0ac --- /dev/null +++ b/build-wine.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Giving pyinstaller another run +rm $(find . -name "*.qmlc") +rm $(find . -name "*.pyc") +wine python -m pip install -U pyinstaller +wine pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --noconsole LogarithmPlotter/__init__.py --icon=win/logarithmplotter.ico -n logarithmplotter diff --git a/linux/install_local.sh b/linux/install_local.sh index e095e89..b3aeff3 100644 --- a/linux/install_local.sh +++ b/linux/install_local.sh @@ -5,7 +5,7 @@ mkdir -p ~/.local/share/applications sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/logplotter.desktop" > ~/.local/share/applications/logarithmplotter.desktop echo "Installing mime-type..." mkdir -p ~/.local/share/applications -sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter-old.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml +sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml mkdir -p ~/.local/share/icons/hicolor/scalable/mimetypes cp "$APPROOT/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg update-mime-database ~/.local/share/mime/ diff --git a/linux/x-logarithm-plotter-old.xml b/linux/x-logarithm-plotter-old.xml deleted file mode 100644 index ed4f8f1..0000000 --- a/linux/x-logarithm-plotter-old.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Logarithm Plot File - Fichier Graphe Logarithmique - - - - - - - diff --git a/mac/logarithmplotter.icns b/mac/logarithmplotter.icns new file mode 100644 index 0000000..267d38b Binary files /dev/null and b/mac/logarithmplotter.icns differ diff --git a/mac/logarithmplotter.iconset/icon_128x128.png b/mac/logarithmplotter.iconset/icon_128x128.png new file mode 100644 index 0000000..0f68d7b Binary files /dev/null and b/mac/logarithmplotter.iconset/icon_128x128.png differ diff --git a/mac/logarithmplotter.iconset/icon_16x16.png b/mac/logarithmplotter.iconset/icon_16x16.png new file mode 100644 index 0000000..2e3cbde Binary files /dev/null and b/mac/logarithmplotter.iconset/icon_16x16.png differ diff --git a/mac/logarithmplotter.iconset/icon_256x256.png b/mac/logarithmplotter.iconset/icon_256x256.png new file mode 100644 index 0000000..124cd88 Binary files /dev/null and b/mac/logarithmplotter.iconset/icon_256x256.png differ diff --git a/mac/logarithmplotter.iconset/icon_32x32.png b/mac/logarithmplotter.iconset/icon_32x32.png new file mode 100644 index 0000000..75daca5 Binary files /dev/null and b/mac/logarithmplotter.iconset/icon_32x32.png differ diff --git a/mac/logarithmplotter.iconset/icon_512x512.png b/mac/logarithmplotter.iconset/icon_512x512.png new file mode 100644 index 0000000..08c025f Binary files /dev/null and b/mac/logarithmplotter.iconset/icon_512x512.png differ diff --git a/package-windows.bat b/package-windows.bat new file mode 100644 index 0000000..700159c --- /dev/null +++ b/package-windows.bat @@ -0,0 +1,4 @@ +cp win/* README.md LICENSE.md dist/logarithmplotter/ +rem Creating installer +cd dist/logarithmplotter/ +"C:\Program Files (x86)\NSIS\makensis" installer.nsi diff --git a/package-wine.sh b/package-wine.sh new file mode 100644 index 0000000..2c2757f --- /dev/null +++ b/package-wine.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Moving files +cp win/* README.md LICENSE.md dist/logarithmplotter/ +# Creating installer +cd dist/logarithmplotter/ +makensis installer.nsi diff --git a/setup.py b/setup.py index 24957a5..f39eafe 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,6 @@ def package_data(): for d,folders,files in os.walk("LogarithmPlotter/qml"): d = d[17:] pkg_data += [os.path.join(d, f) for f in files] - print("Pkgdata", pkg_data) return pkg_data data_files = [] diff --git a/win/installer.nsi b/win/installer.nsi index 8873715..2fdc33d 100644 --- a/win/installer.nsi +++ b/win/installer.nsi @@ -1,3 +1,4 @@ +Unicode True ; Modern UI definitions ;-------------------------------- ;Include Modern UI @@ -8,10 +9,10 @@ ;Definitions !define APP_NAME "LogarithmPlotter" !define DEV_NAME "Ad5001" -!define WEBSITE "https://logarithmplotter.org" +!define WEBSITE "https://apps.ad5001.eu/LogarithmPlotter" !define APP_VERSION "0.0.1.0" !define COPYRIGHT "Ad5001 © 2021" -!define DESCRIPTION "Browse and use online services, free of account." +!define DESCRIPTION "Create graphs with logarithm scales." !define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter" @@ -34,7 +35,7 @@ VIAddVersionKey "ProductName" "${APP_NAME}" VIAddVersionKey "CompanyName" "${DEV_NAME}" VIAddVersionKey "LegalCopyright" "${COPYRIGHT}" VIAddVersionKey "FileDescription" "${DESCRIPTION}" -VIAddVersionKey "FileVersion" "${VERSION}" +VIAddVersionKey "FileVersion" "${APP_VERSION}" ;-------------------------------- @@ -50,7 +51,7 @@ VIAddVersionKey "FileVersion" "${VERSION}" ;!insertmacro MUI_WELCOMEPAGE_TITLE_3LINES ;Icons -Icon "logplotter.ico" +Icon "logarithmplotter.ico" ;!define MUI_HEADERIMAGE ;!define MUI_HEADERIMAGE_BITMAP "logarithmplotter.bmp" !define MUI_WELCOMEFINISHPAGE_BITMAP "inst_banner.bmp" @@ -167,16 +168,16 @@ Section "" WriteRegStr HKLM ${REG_UNINSTALL} "UninstallString" "$INSTDIR\uninstall.exe" WriteRegStr HKLM ${REG_UNINSTALL} "QuietUninstallString" "$INSTDIR\uninstall.exe /S" WriteRegStr HKLM ${REG_UNINSTALL} "DisplayIcon" "$INSTDIR\logarithmplotter.bmp" - WriteRegStr HKLM ${REG_UNINSTALL} "DisplayVersion" "${VERSION}" + WriteRegStr HKLM ${REG_UNINSTALL} "DisplayVersion" "${APP_VERSION}" WriteRegStr HKLM ${REG_UNINSTALL} "Readme" "$INSTDIR\README.md" WriteRegStr HKLM ${REG_UNINSTALL} "URLInfoAbout" "${WEBSITE}" - SectionEnd +SectionEnd - ;-------------------------------- - ;Uninstaller Section - ; - Section "Uninstall" +;-------------------------------- +;Uninstaller Section +; +Section "Uninstall" RMDir /r "$INSTDIR" diff --git a/win/logplotter.ico b/win/logarithmplotter.ico similarity index 100% rename from win/logplotter.ico rename to win/logarithmplotter.ico