Über Menü "Einstellungen ..." wird der AppSettings-Dialog eröffnet
This commit is contained in:
@@ -320,6 +320,8 @@
|
||||
<addaction name="actionNeu"/>
|
||||
<addaction name="action_ffnen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionEinstellungen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionBeenden"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuThema">
|
||||
@@ -361,6 +363,17 @@
|
||||
<string>Beenden</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEinstellungen">
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::DocumentProperties"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Einstellungen ...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
||||
@@ -39,6 +39,10 @@ class Ui_MainWindow(object):
|
||||
self.actionBeenden.setObjectName(u"actionBeenden")
|
||||
icon2 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.ApplicationExit))
|
||||
self.actionBeenden.setIcon(icon2)
|
||||
self.actionEinstellungen = QAction(MainWindow)
|
||||
self.actionEinstellungen.setObjectName(u"actionEinstellungen")
|
||||
icon3 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.DocumentProperties))
|
||||
self.actionEinstellungen.setIcon(icon3)
|
||||
self.centralwidget = QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
self.horizontalLayout = QHBoxLayout(self.centralwidget)
|
||||
@@ -77,16 +81,16 @@ class Ui_MainWindow(object):
|
||||
self.pushButton = QPushButton(self.frame_2)
|
||||
self.pushButton.setObjectName(u"pushButton")
|
||||
self.pushButton.setLayoutDirection(Qt.LayoutDirection.LeftToRight)
|
||||
icon3 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStart))
|
||||
self.pushButton.setIcon(icon3)
|
||||
icon4 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStart))
|
||||
self.pushButton.setIcon(icon4)
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.pushButton)
|
||||
|
||||
self.pushButton_2 = QPushButton(self.frame_2)
|
||||
self.pushButton_2.setObjectName(u"pushButton_2")
|
||||
self.pushButton_2.setAutoFillBackground(False)
|
||||
icon4 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.MediaSeekForward))
|
||||
self.pushButton_2.setIcon(icon4)
|
||||
icon5 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.MediaSeekForward))
|
||||
self.pushButton_2.setIcon(icon5)
|
||||
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_2)
|
||||
|
||||
@@ -233,6 +237,8 @@ class Ui_MainWindow(object):
|
||||
self.menuProjekt.addAction(self.actionNeu)
|
||||
self.menuProjekt.addAction(self.action_ffnen)
|
||||
self.menuProjekt.addSeparator()
|
||||
self.menuProjekt.addAction(self.actionEinstellungen)
|
||||
self.menuProjekt.addSeparator()
|
||||
self.menuProjekt.addAction(self.actionBeenden)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
@@ -252,6 +258,10 @@ class Ui_MainWindow(object):
|
||||
self.action_ffnen.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+O", None))
|
||||
#endif // QT_CONFIG(shortcut)
|
||||
self.actionBeenden.setText(QCoreApplication.translate("MainWindow", u"Beenden", None))
|
||||
self.actionEinstellungen.setText(QCoreApplication.translate("MainWindow", u"Einstellungen ...", None))
|
||||
#if QT_CONFIG(shortcut)
|
||||
self.actionEinstellungen.setShortcut(QCoreApplication.translate("MainWindow", u"Ctrl+S", None))
|
||||
#endif // QT_CONFIG(shortcut)
|
||||
self.pushButton.setText(QCoreApplication.translate("MainWindow", u"nur ge\u00e4nderte generieren", None))
|
||||
self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"Alle generieren", None))
|
||||
self.label.setText("")
|
||||
|
||||
@@ -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):
|
||||
@@ -439,6 +441,9 @@ class MainWindow(QMainWindow):
|
||||
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):
|
||||
"""
|
||||
Wird ausgeführt, wenn der Alpha-Slider geändert wird.
|
||||
@@ -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