Files
photostation/src/ui/main_window.py
Jules b39308af95 Photo strips, photo d'identité, NFC tap-to-upload
- Photo strips : 2 templates (3 ou 4 photos), toujours 2 strips côte à côte sur un 10x15
- Photo d'identité : écran dédié, cadrage 35x45mm guidé (ovale + ligne yeux), planche 8 photos sur 10x15
- NFC : service nfcpy optionnel, écrit URL upload sur tag NDEF, configurable dans admin
- Config : option NFC on/off ajoutée
- Matériel cible : mini-PC (plus RPi), imprimante DNP DS-RX1HS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:15:03 +01:00

56 lines
1.8 KiB
Python

"""Fenêtre principale — navigation entre les écrans."""
from PyQt6.QtWidgets import QMainWindow, QStackedWidget
from PyQt6.QtCore import Qt
from ui.screens.home_screen import HomeScreen
from ui.screens.import_screen import ImportScreen
from ui.screens.editor_screen import EditorScreen
from ui.screens.print_screen import PrintScreen
from ui.screens.id_photo_screen import IdPhotoScreen
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Photostation")
self.setAttribute(Qt.WidgetAttribute.WA_AcceptTouchEvents, True)
self.stack = QStackedWidget()
self.setCentralWidget(self.stack)
# Écrans
self.home_screen = HomeScreen(self)
self.import_screen = ImportScreen(self)
self.editor_screen = EditorScreen(self)
self.print_screen = PrintScreen(self)
self.id_photo_screen = IdPhotoScreen(self)
self.stack.addWidget(self.home_screen) # 0
self.stack.addWidget(self.import_screen) # 1
self.stack.addWidget(self.editor_screen) # 2
self.stack.addWidget(self.print_screen) # 3
self.stack.addWidget(self.id_photo_screen) # 4
self.show_home()
def show_home(self):
self.stack.setCurrentIndex(0)
def show_import(self):
self.stack.setCurrentIndex(1)
def show_editor(self, image_path=None):
if image_path:
self.editor_screen.load_image(image_path)
self.stack.setCurrentIndex(2)
def show_print(self, image_path=None):
if image_path:
self.print_screen.set_image(image_path)
self.stack.setCurrentIndex(3)
def show_id_photo(self, image_path=None):
if image_path:
self.id_photo_screen.load_image(image_path)
self.stack.setCurrentIndex(4)