Füge Option zum Ausschließen von Ruhepausen hinzu
- Neue Exportoption "Ruhepausen ausschließen - Ruhe" in GUI - Parameter exclude_rest in create_ics_from_dienstplan() hinzugefügt - Filtert Events mit dem finalen Titel "Ruhe" (R56, R36, vRWF48, RWE, vR48) - Einstellung wird in Konfiguration gespeichert und beim nächsten Start wiederhergestellt
This commit is contained in:
20
gui.py
20
gui.py
@@ -47,6 +47,9 @@ class PDFtoICSGUI:
|
||||
# Letztes PDF-Verzeichnis merken
|
||||
self.last_pdf_dir = self.config.get('last_pdf_dir', str(Path.home()))
|
||||
|
||||
# Exportoptionen
|
||||
self.exclude_rest = tk.BooleanVar(value=self.config.get('exclude_rest', False))
|
||||
|
||||
# UI erstellen
|
||||
self.create_widgets()
|
||||
|
||||
@@ -190,6 +193,18 @@ class PDFtoICSGUI:
|
||||
)
|
||||
browse_btn.pack(side=tk.LEFT)
|
||||
|
||||
# Exportoptionen
|
||||
options_frame = tk.Frame(content_frame)
|
||||
options_frame.pack(fill=tk.X, pady=(10, 5))
|
||||
|
||||
exclude_rest_check = tk.Checkbutton(
|
||||
options_frame,
|
||||
text="🧘 Ruhetage ausschließen - (Ruhe, R56, R36, vRWF48, RWE, vR48)",
|
||||
variable=self.exclude_rest,
|
||||
font=("Arial", 10)
|
||||
)
|
||||
exclude_rest_check.pack(anchor=tk.W)
|
||||
|
||||
# Log-Bereich
|
||||
log_label = tk.Label(
|
||||
content_frame,
|
||||
@@ -231,7 +246,8 @@ class PDFtoICSGUI:
|
||||
try:
|
||||
config = {
|
||||
'last_output_dir': self.output_dir.get(),
|
||||
'last_pdf_dir': self.last_pdf_dir
|
||||
'last_pdf_dir': self.last_pdf_dir,
|
||||
'exclude_rest': self.exclude_rest.get()
|
||||
}
|
||||
with open(CONFIG_FILE, 'w') as f:
|
||||
json.dump(config, f, indent=2)
|
||||
@@ -406,7 +422,7 @@ class PDFtoICSGUI:
|
||||
ics_filename = Path(pdf_path).stem + '.ics'
|
||||
ics_path = output_dir / ics_filename
|
||||
|
||||
create_ics_from_dienstplan(dienstplan, str(ics_path))
|
||||
create_ics_from_dienstplan(dienstplan, str(ics_path), exclude_rest=self.exclude_rest.get())
|
||||
|
||||
self.log(f" ✓ ICS erstellt: {ics_filename}")
|
||||
success_count += 1
|
||||
|
||||
Reference in New Issue
Block a user