Add install.sh / run.sh / bundled icon; fully pin requirements
- install.sh: one-time Linux Mint setup (apt, .venv, requirements, .desktop entry with absolute paths). Re-runnable. - run.sh: launches the app from .venv (called by the menu entry). - icon.png: bundled 256px red-cross launcher/window icon; app prefers it over the runtime-drawn fallback (data/icon.png). - requirements.txt: fully pinned incl. transitive deps, tested on Python 3.12; numpy held at 2.2.6 so it installs on Python 3.10 too. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,8 @@ CSV_PATH = DATA_DIR / "orte.csv"
|
||||
MAP_PATH = DATA_DIR / "karte.html"
|
||||
BACKUP_DIR = DATA_DIR / "backups"
|
||||
LOG_PATH = DATA_DIR / "app.log"
|
||||
ICON_PATH = DATA_DIR / "icon.png"
|
||||
ICON_PATH = BASE_DIR / "icon.png" # mitgeliefert (für Fenster + Startmenü)
|
||||
ICON_FALLBACK_PATH = DATA_DIR / "icon.png" # zur Laufzeit gezeichnet, falls obiges fehlt
|
||||
WINDOW_STATE_PATH = DATA_DIR / "window.json"
|
||||
CSV_COLUMNS = ["date", "city", "postal_code", "lat", "lon"]
|
||||
|
||||
@@ -735,8 +736,12 @@ class App(ttk.Window):
|
||||
)
|
||||
|
||||
def _install_icon(self) -> None:
|
||||
"""Zeichnet ein einfaches rotes Kreuz als Fenster-Icon (ohne Extra-Abhängigkeit)."""
|
||||
"""Setzt das Fenster-Icon: mitgelieferte icon.png, sonst ein gezeichnetes Kreuz."""
|
||||
try:
|
||||
if ICON_PATH.exists():
|
||||
self._icon_img = tk.PhotoImage(file=str(ICON_PATH))
|
||||
self.iconphoto(True, self._icon_img)
|
||||
return
|
||||
size = 64
|
||||
img = tk.PhotoImage(width=size, height=size)
|
||||
img.put("white", to=(0, 0, size, size))
|
||||
@@ -745,11 +750,10 @@ class App(ttk.Window):
|
||||
img.put(DRK_RED, to=(7, arm, size - 7, size - arm))
|
||||
self.iconphoto(True, img)
|
||||
self._icon_img = img # Referenz halten
|
||||
if not ICON_PATH.exists():
|
||||
try:
|
||||
img.write(str(ICON_PATH), format="png")
|
||||
except tk.TclError:
|
||||
pass # Tk < 8.6 kann kein PNG schreiben – nicht kritisch
|
||||
try:
|
||||
img.write(str(ICON_FALLBACK_PATH), format="png")
|
||||
except tk.TclError:
|
||||
pass # Tk < 8.6 kann kein PNG schreiben – nicht kritisch
|
||||
except tk.TclError:
|
||||
log.warning("Fenster-Icon konnte nicht gesetzt werden.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user