Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
shell: bash
working-directory: Desktop_App
run: |
pyinstaller --noconfirm --onefile --windowed \
pyinstaller --noconfirm --onedir --windowed \
--collect-all charset_normalizer \
--name "NPM-AutoCode-AI" \
--icon "../npmai.png" \
Expand Down
28 changes: 18 additions & 10 deletions Desktop_App/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
from pathlib import Path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))


def resource_path(filename: str) -> str:
"""Resolve a bundled data file (icon, config) whether running from source
or from a PyInstaller-frozen build. PyInstaller unpacks --add-data files
next to sys.executable (onedir) or into sys._MEIPASS (onefile); neither
is the current working directory, so a bare relative path silently fails."""
base = getattr(sys, "_MEIPASS", None) or os.path.dirname(os.path.abspath(__file__))
return os.path.join(base, filename)


APP_ICON_PATH = resource_path("npmai.png")

from npmai_agents import AgentBrain, Workspace, CredStore

from PySide6.QtWidgets import (
Expand Down Expand Up @@ -495,7 +507,7 @@ def __init__(self, link_mgr, parent=None):
super().__init__(parent)
self._mgr = link_mgr
self.setWindowTitle("Log in — MCP Link")
self.setWindowIcon(QIcon("npmai.png"))
self.setWindowIcon(QIcon(APP_ICON_PATH))
self.setFixedSize(360, 260)
self.setStyleSheet(f"QDialog{{background:{P['void']};}}")
lay = QVBoxLayout(self); lay.setContentsMargins(28,24,28,24); lay.setSpacing(12)
Expand Down Expand Up @@ -656,7 +668,7 @@ class LLMConfigDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Configure LLMs")
self.setWindowIcon(QIcon("npmai.png"))
self.setWindowIcon(QIcon(APP_ICON_PATH))
self.resize(640, 720)
self.setStyleSheet(f"QDialog{{background:{P['void']};}}")

Expand Down Expand Up @@ -1058,14 +1070,10 @@ def __init__(self, parent=None, group_name="", existing_data=None, lock_name=Fal
self.setStyleSheet(f"QDialog{{background:{P['void']};}}")
self._row_widgets = []

# === FIXED ICON LOADING ===
from pathlib import Path
from PySide6.QtGui import QIcon
icon_path = Path(__file__).parent / "npmai.png"
if icon_path.exists():
self.setWindowIcon(QIcon(str(icon_path)))
if os.path.exists(APP_ICON_PATH):
self.setWindowIcon(QIcon(APP_ICON_PATH))
else:
print("Warning: npmai.png not found for CredKeyValueDialog")
print(f"Warning: npmai.png not found at {APP_ICON_PATH}")

lay = QVBoxLayout(self); lay.setContentsMargins(26,22,26,22); lay.setSpacing(12)

Expand Down Expand Up @@ -1450,7 +1458,7 @@ class AppWindow(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("NPM-AutoCode-AI — NPMAI Ecosystem v3.0")
self.setWindowIcon(QIcon("npmai.png"))
self.setWindowIcon(QIcon(APP_ICON_PATH))
self.resize(1220,780); self.setMinimumSize(920,640)
self._build()

Expand Down
Loading