Modernes Design: neue Symbole und Programm-Icon, ohne „95“ im Namen, Tipp des Tages ohne Büroklammer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No files matched your search
@@ -12,7 +12,7 @@ from datetime import date
|
||||
from pathlib import Path
|
||||
from tkinter import filedialog
|
||||
|
||||
from provtool import APP_NAME, config
|
||||
from provtool import config
|
||||
from provtool import export as exp
|
||||
from provtool import regeln
|
||||
from provtool.db import EIGEN, UNZUGEORDNET, AbrechnungErledigt, Datenbank
|
||||
@@ -79,8 +79,8 @@ class App:
|
||||
root.report_callback_exception = self._fehler_handler
|
||||
klassisch = w.DESIGN == "win95" # Win95: eigene Titelleiste; modern: normaler Windows-Rahmen
|
||||
w.KLASSISCH = klassisch
|
||||
self.rahmen = rh.Hauptrahmen(root, APP_NAME, self.icons("app"), self.beenden, klassisch=klassisch)
|
||||
self.rahmen.set_titel(APP_NAME)
|
||||
self.rahmen = rh.Hauptrahmen(root, w.APP_NAME, self.icons("app"), self.beenden, klassisch=klassisch)
|
||||
self.rahmen.set_titel(w.APP_NAME)
|
||||
self.inhalt = self.rahmen.inhalt
|
||||
|
||||
self._menue()
|
||||
@@ -151,7 +151,7 @@ class App:
|
||||
hi.add_separator()
|
||||
hi.add_command(label="Einrichtungs-Assistent...", command=self.assistent)
|
||||
hi.add_separator()
|
||||
hi.add_command(label=f"Info über {APP_NAME}...", command=lambda: dlg.InfoDialog(self.root).zeigen())
|
||||
hi.add_command(label=f"Info über {w.APP_NAME}...", command=lambda: dlg.InfoDialog(self.root).zeigen())
|
||||
|
||||
def _toolbar(self):
|
||||
tb = tk.Frame(self.inhalt, bg=w.FACE, bd=0 if w.MODERN else 1, relief="raised")
|
||||
@@ -277,12 +277,12 @@ class App:
|
||||
if self.aid and self.db.abrechnung(self.aid):
|
||||
self.positionen = self.db.positionen(self.aid)
|
||||
titel = self.db.abrechnung(self.aid)["titel"] + (" – erledigt" if self.db.erledigt(self.aid) else "")
|
||||
self.rahmen.set_titel(f"{APP_NAME} - [{titel}]")
|
||||
self.rahmen.set_titel(f"{w.APP_NAME} - [{titel}]")
|
||||
self.status.set("info", f" Abrechnung: {titel}")
|
||||
else:
|
||||
self.aid = None
|
||||
self.positionen = []
|
||||
self.rahmen.set_titel(APP_NAME)
|
||||
self.rahmen.set_titel(w.APP_NAME)
|
||||
self.status.set("info", " Keine Abrechnung geöffnet – Datei > Neue Abrechnung oder Import")
|
||||
self._haendlerliste(behalte_auswahl)
|
||||
self._tabelle()
|
||||
@@ -1061,7 +1061,7 @@ class App:
|
||||
"Rufnummer, Name oder Tarif eingeben – die Liste filtert sofort. Tastenkürzel: Strg+F."),
|
||||
(self.menueleiste.knoepfe["?"], "Das war's!",
|
||||
"Diesen Rundgang, den Einrichtungs-Assistenten und die Tipps finden Sie jederzeit hier im Menü „?“.\n\n"
|
||||
"Viel Erfolg mit dem Provisions-Manager 95!"),
|
||||
f"Viel Erfolg mit dem {w.APP_NAME}!"),
|
||||
]
|
||||
self._rundgang = ass.Rundgang(self, schritte)
|
||||
|
||||
@@ -1073,7 +1073,7 @@ class App:
|
||||
text = "".join(traceback.format_exception(exc, val, tb))
|
||||
try:
|
||||
with (config.app_dir() / "fehler.log").open("a", encoding="utf-8") as f:
|
||||
f.write(f"--- {date.today().isoformat()} {APP_NAME}\n{text}\n")
|
||||
f.write(f"--- {date.today().isoformat()} {w.APP_NAME}\n{text}\n")
|
||||
except OSError:
|
||||
pass
|
||||
# Beim/nach dem Beenden keine Meldung mehr zeigen – das Fenster gibt es dann nicht mehr
|
||||
|
||||
@@ -7,7 +7,6 @@ from collections import Counter, defaultdict
|
||||
from pathlib import Path
|
||||
from tkinter import filedialog, ttk
|
||||
|
||||
from provtool import APP_NAME
|
||||
from provtool.db import CAPS_ANBIETER, CAPS_WERT, Haendler, ist_grossgeschrieben
|
||||
from provtool.gui import win32
|
||||
from provtool.gui import win95 as w
|
||||
@@ -33,7 +32,7 @@ class Einrichtungsassistent(w.Dialog):
|
||||
BREITE, HOEHE = 470, 340
|
||||
|
||||
def __init__(self, app):
|
||||
super().__init__(app.root, "Provisions-Manager 95 – Einrichtung")
|
||||
super().__init__(app.root, f"{w.APP_NAME} – Einrichtung")
|
||||
self.app = app
|
||||
self.dateien: list[str] = []
|
||||
self.vorschlaege: dict[str, list[str]] = {"freenet": [], "vodafone": []}
|
||||
@@ -77,7 +76,7 @@ class Einrichtungsassistent(w.Dialog):
|
||||
for i, (x, y) in enumerate(((20, 30), (120, 55), (35, 120), (128, 150), (60, 20))):
|
||||
c.create_rectangle(x, y, x + 2 + i % 2, y + 2 + i % 2, fill=w.WHITE, outline="")
|
||||
c.create_image(77, self.HOEHE // 2 - 10, image=self._img)
|
||||
c.create_text(77, self.HOEHE - 38, text="Provisions-\nManager 95", fill=w.WHITE, font=w.FONT_BOLD,
|
||||
c.create_text(77, self.HOEHE - 38, text=w.APP_NAME.replace("-", "-\n", 1), fill=w.WHITE, font=w.FONT_BOLD,
|
||||
justify="center")
|
||||
|
||||
def _leeren(self):
|
||||
@@ -100,7 +99,7 @@ class Einrichtungsassistent(w.Dialog):
|
||||
self.b_zurueck.configure(state="normal" if nr > 0 else "disabled")
|
||||
self.b_weiter.configure(text="Fertig stellen" if nr == len(self.seiten) - 1 else "Weiter >")
|
||||
if self.titelleiste:
|
||||
self.titelleiste.set_titel(f"Provisions-Manager 95 – Einrichtung (Schritt {nr + 1} von {len(self.seiten)})")
|
||||
self.titelleiste.set_titel(f"{w.APP_NAME} – Einrichtung (Schritt {nr + 1} von {len(self.seiten)})")
|
||||
|
||||
def _weiter(self):
|
||||
pruefer = getattr(self, f"_pruefe_{self.nr}", None)
|
||||
@@ -128,7 +127,7 @@ class Einrichtungsassistent(w.Dialog):
|
||||
|
||||
# ---------------------------------------------------------------- Seite 1
|
||||
def _s_willkommen(self):
|
||||
self._ueberschrift(f"Willkommen beim {APP_NAME}!")
|
||||
self._ueberschrift(f"Willkommen beim {w.APP_NAME}!")
|
||||
self._text("Dieser Assistent richtet das Programm in wenigen Schritten ein:")
|
||||
for punkt in ("Speicherort der Daten festlegen",
|
||||
"Unterhändler mit ihren Kennungen anlegen",
|
||||
@@ -384,7 +383,7 @@ class Einrichtungsassistent(w.Dialog):
|
||||
def _s_fertig(self):
|
||||
self._ueberschrift("Fertig!")
|
||||
n = len(self.app.db.haendler_liste())
|
||||
self._text(f"Der {APP_NAME} ist eingerichtet.")
|
||||
self._text(f"Der {w.APP_NAME} ist eingerichtet.")
|
||||
self._text(f" - {n} Händler angelegt")
|
||||
if self.v_abrechnung.get():
|
||||
self._text(f" - Abrechnung „{self.v_titel.get().strip()}“"
|
||||
@@ -582,13 +581,14 @@ class TippDesTages(w.Dialog):
|
||||
haupt.pack(padx=12, pady=12)
|
||||
box = tk.Frame(haupt, bg=w.WHITE, bd=2, relief="sunken")
|
||||
box.pack(side="left", fill="both")
|
||||
self._bild = tipp_bild(self)
|
||||
self.bild_ok = self._bild is not None
|
||||
if self._bild is None: # Ersatz, falls das Bild fehlt
|
||||
# Büroklammer nur im Win95-Design; modern eine schlichte Glühbirne
|
||||
self._bild = None if w.MODERN else tipp_bild(self)
|
||||
self.bild_ok = self._bild is not None or w.MODERN
|
||||
if self._bild is None:
|
||||
self._bild = w.make_icon(self, "birne", 3)
|
||||
tk.Label(box, image=self._bild, bg=w.WHITE).pack(side="left", anchor="n", padx=(12, 4), pady=10)
|
||||
# fester Textbereich: der Tipp bricht darin um und kann nicht mehr abgeschnitten werden
|
||||
rechts = tk.Frame(box, bg=w.WHITE, padx=12, pady=10, width=380, height=self._bild.height() + 20)
|
||||
rechts = tk.Frame(box, bg=w.WHITE, padx=12, pady=10, width=380, height=max(self._bild.height(), 170) + 20)
|
||||
rechts.pack(side="left", fill="both")
|
||||
rechts.pack_propagate(False)
|
||||
tk.Label(rechts, text="Wussten Sie schon...", bg=w.WHITE, font=(w.FONT_FAMILY, w.FONT_SIZE + 6, "bold"),
|
||||
|
||||
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 787 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 951 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 964 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 876 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 594 B |
|
After Width: | Height: | Size: 1007 B |
|
After Width: | Height: | Size: 827 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 789 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 539 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 686 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 583 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog, ttk
|
||||
|
||||
from provtool import APP_NAME, APP_ORG, __version__
|
||||
from provtool import APP_ORG, __version__
|
||||
from provtool import regeln
|
||||
from provtool import zeitraum as zr
|
||||
from provtool.db import CAPS_ANBIETER, CAPS_WERT, AbrechnungErledigt, Datenbank, Haendler
|
||||
@@ -1022,7 +1022,7 @@ class EinstellungenDialog(w.Dialog):
|
||||
|
||||
class InfoDialog(w.Dialog):
|
||||
def __init__(self, master):
|
||||
super().__init__(master, f"Info über {APP_NAME}")
|
||||
super().__init__(master, f"Info über {w.APP_NAME}")
|
||||
top = tk.Frame(self, bg=w.FACE)
|
||||
top.pack(padx=14, pady=14)
|
||||
c = tk.Canvas(top, width=110, height=110, bg=w.TEAL, bd=2, relief="sunken", highlightthickness=0)
|
||||
@@ -1031,7 +1031,7 @@ class InfoDialog(w.Dialog):
|
||||
c.create_image(57, 57, image=self._img)
|
||||
rechts = tk.Frame(top, bg=w.FACE)
|
||||
rechts.pack(side="left", padx=(14, 0), anchor="n")
|
||||
tk.Label(rechts, text=APP_NAME, font=w.FONT_BIG).pack(anchor="w")
|
||||
tk.Label(rechts, text=w.APP_NAME, font=w.FONT_BIG).pack(anchor="w")
|
||||
tk.Label(rechts, text=f"Version {__version__}", anchor="w").pack(anchor="w")
|
||||
w.trenner(rechts, vertikal=False).pack(fill="x", pady=8)
|
||||
tk.Label(rechts, text=f"Lizenziert für:\n{APP_ORG}\n\nProvisionsabrechnung für Unterhändler\n"
|
||||
|
||||
@@ -7,6 +7,7 @@ from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import tkinter as tk
|
||||
from pathlib import Path
|
||||
from tkinter import ttk
|
||||
|
||||
FACE = "#c0c0c0"
|
||||
@@ -22,6 +23,7 @@ SEL_BG, SEL_FG = NAVY, WHITE # Auswahl/Markierung
|
||||
RAND = SHADOW # dünne Rahmenlinien (nur modern)
|
||||
DESIGN = "win95"
|
||||
MODERN = False
|
||||
APP_NAME = "Provisions-Manager 95" # modern: ohne „95“
|
||||
|
||||
_PALETTEN = {
|
||||
"win95": dict(FACE="#c0c0c0", HILITE="#ffffff", LIGHT="#dfdfdf", SHADOW="#808080", DARK="#000000",
|
||||
@@ -43,9 +45,10 @@ FONT_MONO = ("Courier New" if IS_WIN else "DejaVu Sans Mono", FONT_SIZE + 1)
|
||||
|
||||
def design_setzen(name: str) -> None:
|
||||
"""„modern“ oder „win95“ – setzt Farben und Schriften (Feinschliff der Schrift in apply())."""
|
||||
global DESIGN, MODERN, FONT_FAMILY, FONT_SIZE
|
||||
global DESIGN, MODERN, FONT_FAMILY, FONT_SIZE, APP_NAME
|
||||
DESIGN = name if name in _PALETTEN else "modern"
|
||||
MODERN = DESIGN == "modern"
|
||||
APP_NAME = "Provisions-Manager" if MODERN else "Provisions-Manager 95"
|
||||
globals().update(_PALETTEN[DESIGN])
|
||||
FONT_FAMILY = ("Segoe UI" if MODERN else "MS Sans Serif") if IS_WIN else "DejaVu Sans"
|
||||
FONT_SIZE = 9 if (MODERN or not IS_WIN) else 8
|
||||
@@ -295,7 +298,13 @@ def _icon_rows(name: str) -> list[str]:
|
||||
return [r.ljust(16, ".")[:16] for r in rows[:16]] + ["." * 16] * (16 - len(rows))
|
||||
|
||||
|
||||
MODERNE_ICONS = Path(__file__).resolve().parent / "bilder" / "modern"
|
||||
|
||||
|
||||
def make_icon(master, name: str, scale: int = 1) -> tk.PhotoImage:
|
||||
datei = MODERNE_ICONS / f"{name}{'_gross' if scale > 1 else ''}.png"
|
||||
if MODERN and datei.exists(): # glatte Symbole aus build/make_moderne_icons.py
|
||||
return tk.PhotoImage(master=master, file=str(datei))
|
||||
img = tk.PhotoImage(master=master, width=16 * scale, height=16 * scale)
|
||||
for y, row in enumerate(_icon_rows(name)):
|
||||
for x, ch in enumerate(row):
|
||||
|
||||