Über Menü "Einstellungen ..." wird der AppSettings-Dialog eröffnet
This commit is contained in:
@@ -9,6 +9,8 @@ from PySide6.QtPdf import QPdfDocument
|
||||
from PySide6.QtPdfWidgets import QPdfView
|
||||
|
||||
from ui.MainWinddow_ui import Ui_MainWindow
|
||||
from ui.AppSettings import AppSettingsDlg
|
||||
from conf import app_settings
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
@@ -438,6 +440,9 @@ class MainWindow(QMainWindow):
|
||||
# Alpha-Slider verbinden
|
||||
self.ui.alpha.valueChanged.connect(self.on_alpha_changed)
|
||||
self.ui.alpha.mouseDoubleClickEvent = lambda event: self.ui.alpha.setValue(0)
|
||||
|
||||
# Menü-Aktionen verbinden
|
||||
self.ui.actionEinstellungen.triggered.connect(self.open_settings_dialog)
|
||||
|
||||
def on_alpha_changed(self, alpha_value):
|
||||
"""
|
||||
@@ -455,6 +460,17 @@ class MainWindow(QMainWindow):
|
||||
alpha_time = time.time() - start_time
|
||||
print(f"Alpha-Update in {alpha_time:.6f}s")
|
||||
|
||||
def open_settings_dialog(self):
|
||||
"""Öffnet den Einstellungen-Dialog."""
|
||||
try:
|
||||
# Erstelle und zeige den Dialog
|
||||
dialog = AppSettingsDlg(self, app_settings)
|
||||
if dialog.exec() == AppSettingsDlg.DialogCode.Accepted:
|
||||
# Einstellungen wurden gespeichert, hier könnten weitere Aktionen folgen
|
||||
print("Einstellungen wurden gespeichert")
|
||||
except Exception as e:
|
||||
print(f"Fehler beim Öffnen des Einstellungen-Dialogs: {e}")
|
||||
|
||||
def on_button_clicked(self):
|
||||
"""Wird ausgeführt, wenn der Button geklickt wird."""
|
||||
print("Button wurde geklickt!")
|
||||
|
||||
Reference in New Issue
Block a user