Make the app cross-platform and add a Windows build
- paths: per-platform detection behind an injectable Env. Windows finds Player.log in the user profile and the install via Steam (registry), the standalone installer, Epic, or the uninstall registry. App dirs come from platformdirs (unchanged XDG locations on Linux). - logtail: open Player.log only while reading, so Windows can still rotate it when MTGA restarts. - carddb: on Windows read a private copy of the card database so MTGA's updater can replace the original. - App icon (SVG source + generated ICO/PNG), Windows taskbar identity, and a Windows-safe timer glyph. - PyInstaller spec, launcher and PowerShell build script producing a one-folder windowed build and zip. - Tests for path detection, the log follower and the card-DB copy; README covers Windows usage, building and per-OS locations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
171fc64ca9
commit
e82f8d1858
19 files changed
+685
-54
No files matched your search
@@ -6,10 +6,11 @@ import argparse
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtGui import QIcon
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
from . import paths
|
||||
from .carddb import CardDB
|
||||
from .carddb import open_card_db
|
||||
from .history import HistoryStore
|
||||
from .images import ImageCache
|
||||
from .ui import theme
|
||||
@@ -30,14 +31,20 @@ def main() -> int:
|
||||
if args.mtga_dir:
|
||||
cfg.mtga_dir = args.mtga_dir
|
||||
|
||||
if sys.platform == "win32":
|
||||
# Own taskbar identity (icon and grouping) instead of python.exe's.
|
||||
import ctypes
|
||||
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("mtga-assistant")
|
||||
app = QApplication([sys.argv[0], *qt_args])
|
||||
app.setWindowIcon(QIcon(str(Path(__file__).with_name("icon.png"))))
|
||||
app.setApplicationName("MTGA Assistant")
|
||||
app.setDesktopFileName("mtga-assistant") # Wayland app_id, usable in Hyprland window rules
|
||||
theme.apply(app)
|
||||
|
||||
mtga_dir = paths.find_mtga_dir(cfg)
|
||||
db_path = paths.find_card_db(mtga_dir) if mtga_dir else None
|
||||
cards = CardDB(db_path)
|
||||
cards = open_card_db(db_path, paths.CACHE_DIR / "carddb")
|
||||
images = ImageCache(paths.CACHE_DIR, cards, cfg.cache_max_mb * 1024 * 1024)
|
||||
|
||||
history = HistoryStore(paths.DATA_DIR / "history.db", cfg.history_max_mb)
|
||||
|
||||
Reference in new issue
Block a user