✨ Window icon will be shown. App will be built with specific icons per OS.
This commit is contained in:
@@ -102,7 +102,7 @@ jobs:
|
|||||||
CMD_BUILD: >
|
CMD_BUILD: >
|
||||||
brew install create-dmg &&
|
brew install create-dmg &&
|
||||||
source $VENV &&
|
source $VENV &&
|
||||||
poetry run make gui-macos APP_NAME=${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
poetry run make gui-macos-dmg APP_NAME=${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
||||||
cd dist &&
|
cd dist &&
|
||||||
zip -r ${{needs.compute.outputs.OUT_NAME_FILE}}_${{needs.compute.outputs.ARCH_MACOS_X64}}${{needs.compute.outputs.ASSET_EXTENSION}} ${{needs.compute.outputs.OUT_NAME_FILE}}.dmg -x "*.DS_Store" &&
|
zip -r ${{needs.compute.outputs.OUT_NAME_FILE}}_${{needs.compute.outputs.ARCH_MACOS_X64}}${{needs.compute.outputs.ASSET_EXTENSION}} ${{needs.compute.outputs.OUT_NAME_FILE}}.dmg -x "*.DS_Store" &&
|
||||||
cd ..
|
cd ..
|
||||||
@@ -120,7 +120,7 @@ jobs:
|
|||||||
OS_ARCH: ${{needs.compute.outputs.ARCH_LINUX_X64}}
|
OS_ARCH: ${{needs.compute.outputs.ARCH_LINUX_X64}}
|
||||||
CMD_BUILD: >
|
CMD_BUILD: >
|
||||||
source $VENV &&
|
source $VENV &&
|
||||||
poetry run make gui APP_NAME=${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
poetry run make gui-linux APP_NAME=${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
||||||
cd dist &&
|
cd dist &&
|
||||||
zip -r ${{needs.compute.outputs.OUT_NAME_FILE}}_${{needs.compute.outputs.ARCH_LINUX_X64}}${{needs.compute.outputs.ASSET_EXTENSION}} ${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
zip -r ${{needs.compute.outputs.OUT_NAME_FILE}}_${{needs.compute.outputs.ARCH_LINUX_X64}}${{needs.compute.outputs.ASSET_EXTENSION}} ${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
||||||
cd ..
|
cd ..
|
||||||
@@ -130,7 +130,7 @@ jobs:
|
|||||||
CMD_BUILD: >
|
CMD_BUILD: >
|
||||||
choco install zip make -y &&
|
choco install zip make -y &&
|
||||||
source $VENV &&
|
source $VENV &&
|
||||||
poetry run make gui APP_NAME=${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
poetry run make gui-windows APP_NAME=${{needs.compute.outputs.OUT_NAME_FILE}} &&
|
||||||
cd dist &&
|
cd dist &&
|
||||||
zip -r ${{needs.compute.outputs.OUT_NAME_FILE}}_${{needs.compute.outputs.ARCH_WINDOWS_X64}}${{needs.compute.outputs.ASSET_EXTENSION}} ${{needs.compute.outputs.OUT_NAME_FILE}}.exe &&
|
zip -r ${{needs.compute.outputs.OUT_NAME_FILE}}_${{needs.compute.outputs.ARCH_WINDOWS_X64}}${{needs.compute.outputs.ASSET_EXTENSION}} ${{needs.compute.outputs.OUT_NAME_FILE}}.exe &&
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
@@ -57,8 +57,17 @@ docs: ## Build and serve the documentation
|
|||||||
help:
|
help:
|
||||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
.PHONY: gui
|
.PHONY: gui-windows
|
||||||
gui: ## Build GUI app with PyInstaller
|
gui-windows: ## Build GUI app with PyInstaller
|
||||||
|
@poetry run pyinstaller --noconfirm \
|
||||||
|
--windowed --onefile \
|
||||||
|
--name "$(APP_NAME)" \
|
||||||
|
--noupx \
|
||||||
|
--icon $(path_asset)/icon.ico \
|
||||||
|
tidal_dl_ng/gui.py
|
||||||
|
|
||||||
|
.PHONY: gui-linux
|
||||||
|
gui-linux: ## Build GUI app with PyInstaller
|
||||||
@poetry run pyinstaller --noconfirm \
|
@poetry run pyinstaller --noconfirm \
|
||||||
--windowed --onefile \
|
--windowed --onefile \
|
||||||
--name "$(APP_NAME)" \
|
--name "$(APP_NAME)" \
|
||||||
@@ -66,9 +75,18 @@ gui: ## Build GUI app with PyInstaller
|
|||||||
--icon $(path_asset)/icon.png \
|
--icon $(path_asset)/icon.png \
|
||||||
tidal_dl_ng/gui.py
|
tidal_dl_ng/gui.py
|
||||||
|
|
||||||
# TODO: macos Signing: https://gist.github.com/txoof/0636835d3cc65245c6288b2374799c43
|
|
||||||
.PHONY: gui-macos
|
.PHONY: gui-macos
|
||||||
gui-macos: gui ## Package GUI in a *.dmg file
|
gui-macos: ## Build GUI app with PyInstaller
|
||||||
|
@poetry run pyinstaller --noconfirm \
|
||||||
|
--windowed --onefile \
|
||||||
|
--name "$(APP_NAME)" \
|
||||||
|
--noupx \
|
||||||
|
--icon $(path_asset)/icon.icns \
|
||||||
|
tidal_dl_ng/gui.py
|
||||||
|
|
||||||
|
# TODO: macos Signing: https://gist.github.com/txoof/0636835d3cc65245c6288b2374799c43
|
||||||
|
.PHONY: gui-macos-dmg
|
||||||
|
gui-macos-dmg: gui-macos ## Package GUI in a *.dmg file
|
||||||
@poetry run mkdir -p $(app_path_dist)/dmg
|
@poetry run mkdir -p $(app_path_dist)/dmg
|
||||||
@poetry run mv "$(app_path_dist)/$(APP_NAME).app" $(app_path_dist)/dmg
|
@poetry run mv "$(app_path_dist)/$(APP_NAME).app" $(app_path_dist)/dmg
|
||||||
@poetry run create-dmg \
|
@poetry run create-dmg \
|
||||||
|
|||||||
+7
-13
@@ -30,7 +30,6 @@ from tidal_dl_ng.worker import Worker
|
|||||||
|
|
||||||
|
|
||||||
# TODO: Make more use of Exceptions
|
# TODO: Make more use of Exceptions
|
||||||
# TODO: Add File -> Version
|
|
||||||
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||||
settings: Settings = None
|
settings: Settings = None
|
||||||
tidal: Tidal = None
|
tidal: Tidal = None
|
||||||
@@ -56,7 +55,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
# self.setGeometry(50, 50, 500, 300)
|
# self.setGeometry(50, 50, 500, 300)
|
||||||
self.setWindowTitle("TIDAL Downloader Next Gen!")
|
self.setWindowTitle("TIDAL Downloader Next Gen!")
|
||||||
self._init_tray()
|
|
||||||
|
|
||||||
# Logging redirect.
|
# Logging redirect.
|
||||||
XStream.stdout().messageWritten.connect(self._log_output)
|
XStream.stdout().messageWritten.connect(self._log_output)
|
||||||
@@ -473,24 +471,20 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
def on_version(self) -> None:
|
def on_version(self) -> None:
|
||||||
DialogVersion(self)
|
DialogVersion(self)
|
||||||
|
|
||||||
def _init_tray(self):
|
|
||||||
# TODO: Fix icons (make them visible).
|
|
||||||
# my_pixmap = QtGui.QPixmap("tidal_dl_ng/ui/icon.png")
|
|
||||||
my_icon = QtGui.QIcon("tidal_dl_ng/ui/icon.png")
|
|
||||||
# self.setWindowIcon(my_icon)
|
|
||||||
self.tray = QtWidgets.QSystemTrayIcon()
|
|
||||||
self.tray.setIcon(my_icon)
|
|
||||||
self.tray.setVisible(True)
|
|
||||||
self.tray.setContextMenu(self.m_file)
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Comment with Google Docstrings.
|
# TODO: Comment with Google Docstrings.
|
||||||
def gui_activate(tidal: Tidal | None = None):
|
def gui_activate(tidal: Tidal | None = None):
|
||||||
|
# Set dark theme and create QT app.
|
||||||
qdarktheme.enable_hi_dpi()
|
qdarktheme.enable_hi_dpi()
|
||||||
app = QtWidgets.QApplication(sys.argv)
|
app = QtWidgets.QApplication(sys.argv)
|
||||||
qdarktheme.setup_theme()
|
qdarktheme.setup_theme()
|
||||||
|
|
||||||
window = MainWindow(tidal)
|
# Create icon object and apply it to app window.
|
||||||
|
pixmap: QtGui.QPixmap = QtGui.QPixmap("tidal_dl_ng/ui/icon.png")
|
||||||
|
icon: QtGui.QIcon = QtGui.QIcon(pixmap)
|
||||||
|
app.setWindowIcon(icon)
|
||||||
|
|
||||||
|
window = MainWindow(tidal=tidal)
|
||||||
window.show()
|
window.show()
|
||||||
|
|
||||||
sys.exit(app.exec())
|
sys.exit(app.exec())
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 215 KiB |
Reference in New Issue
Block a user