AppSettings-Dialog um PDF-Projekte erweitert

This commit is contained in:
2025-06-14 20:35:32 +02:00
parent aa34be783e
commit 7dc77cb310
3 changed files with 390 additions and 277 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ app_name = "DocuMentor"
if platform == "win32": if platform == "win32":
config_path = f"%APPDATA%\\{app_name}\\config.json" config_path = f"%APPDATA%\\{app_name}\\config.json"
elif platform in ("linux", "linux2"): elif platform in ("linux", "linux2"):
config_path = f"~/.config/{app_name}/config.json" config_path = f"~/.config/{app_name}/config.json"
elif platform == "darwin": elif platform == "darwin":
config_path = f"~/Library/Application Support/{app_name}/͏͏͏͏config.json" config_path = f"~/Library/Application Support/{app_name}/͏͏͏͏config.json"
@@ -90,8 +90,8 @@ class AppSettings(BaseSettings):
def save(self): def save(self):
global config_path global config_path
# Ordner existert nicht
if not config_path.parent.exists(): if not config_path.parent.exists():
# Ordner existert nicht
config_path.parent.mkdir(parents=True, exist_ok=True) config_path.parent.mkdir(parents=True, exist_ok=True)
# Konfiguration speichern # Konfiguration speichern
@@ -100,7 +100,7 @@ class AppSettings(BaseSettings):
app_settings = AppSettings() app_settings = AppSettings()
print(app_settings)
class PdfProjectSettings(BaseSettings): class PdfProjectSettings(BaseSettings):
""" """
+77 -6
View File
@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>833</width> <width>833</width>
<height>513</height> <height>387</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -20,7 +20,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>5</number>
</property> </property>
<widget class="QWidget" name="tabXsls"> <widget class="QWidget" name="tabXsls">
<attribute name="title"> <attribute name="title">
@@ -374,6 +374,74 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabPdfProject">
<attribute name="title">
<string>PDF-Projekte</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QTableWidget" name="tablePdfProjekts">
<property name="columnCount">
<number>1</number>
</property>
<column/>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="removeProject">
<property name="text">
<string>Hinzufügen</string>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::ListAdd"/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addProject">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Entfernen</string>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::ListRemove"/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>
@@ -384,6 +452,9 @@
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set> <set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property> </property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -397,8 +468,8 @@
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>248</x> <x>257</x>
<y>254</y> <y>377</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>157</x> <x>157</x>
@@ -413,8 +484,8 @@
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>316</x> <x>325</x>
<y>260</y> <y>377</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>286</x> <x>286</x>
+45 -3
View File
@@ -3,7 +3,7 @@
################################################################################ ################################################################################
## Form generated from reading UI file 'AppSettings.ui' ## Form generated from reading UI file 'AppSettings.ui'
## ##
## Created by: Qt User Interface Compiler version 6.9.0 ## Created by: Qt User Interface Compiler version 6.9.1
## ##
## WARNING! All changes made in this file will be lost when recompiling UI file! ## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################ ################################################################################
@@ -24,7 +24,7 @@ class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
if not Dialog.objectName(): if not Dialog.objectName():
Dialog.setObjectName(u"Dialog") Dialog.setObjectName(u"Dialog")
Dialog.resize(833, 513) Dialog.resize(833, 387)
self.verticalLayout = QVBoxLayout(Dialog) self.verticalLayout = QVBoxLayout(Dialog)
self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setObjectName(u"verticalLayout")
self.tabSettings = QTabWidget(Dialog) self.tabSettings = QTabWidget(Dialog)
@@ -226,6 +226,44 @@ class Ui_Dialog(object):
self.verticalLayout_6.addWidget(self.frame_5) self.verticalLayout_6.addWidget(self.frame_5)
self.tabSettings.addTab(self.tabDiffPdf, "") self.tabSettings.addTab(self.tabDiffPdf, "")
self.tabPdfProject = QWidget()
self.tabPdfProject.setObjectName(u"tabPdfProject")
self.verticalLayout_7 = QVBoxLayout(self.tabPdfProject)
self.verticalLayout_7.setObjectName(u"verticalLayout_7")
self.tablePdfProjekts = QTableWidget(self.tabPdfProject)
if (self.tablePdfProjekts.columnCount() < 1):
self.tablePdfProjekts.setColumnCount(1)
self.tablePdfProjekts.setObjectName(u"tablePdfProjekts")
self.tablePdfProjekts.setColumnCount(1)
self.verticalLayout_7.addWidget(self.tablePdfProjekts)
self.frame_6 = QFrame(self.tabPdfProject)
self.frame_6.setObjectName(u"frame_6")
sizePolicy.setHeightForWidth(self.frame_6.sizePolicy().hasHeightForWidth())
self.frame_6.setSizePolicy(sizePolicy)
self.frame_6.setFrameShape(QFrame.Shape.StyledPanel)
self.frame_6.setFrameShadow(QFrame.Shadow.Raised)
self.horizontalLayout_6 = QHBoxLayout(self.frame_6)
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0)
self.removeProject = QPushButton(self.frame_6)
self.removeProject.setObjectName(u"removeProject")
self.removeProject.setIcon(icon)
self.horizontalLayout_6.addWidget(self.removeProject)
self.addProject = QPushButton(self.frame_6)
self.addProject.setObjectName(u"addProject")
self.addProject.setEnabled(False)
self.addProject.setIcon(icon1)
self.horizontalLayout_6.addWidget(self.addProject)
self.verticalLayout_7.addWidget(self.frame_6)
self.tabSettings.addTab(self.tabPdfProject, "")
self.verticalLayout.addWidget(self.tabSettings) self.verticalLayout.addWidget(self.tabSettings)
@@ -233,6 +271,7 @@ class Ui_Dialog(object):
self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setObjectName(u"buttonBox")
self.buttonBox.setOrientation(Qt.Orientation.Horizontal) self.buttonBox.setOrientation(Qt.Orientation.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton.Cancel|QDialogButtonBox.StandardButton.Ok) self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton.Cancel|QDialogButtonBox.StandardButton.Ok)
self.buttonBox.setCenterButtons(True)
self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.addWidget(self.buttonBox)
@@ -241,7 +280,7 @@ class Ui_Dialog(object):
self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.accepted.connect(Dialog.accept)
self.buttonBox.rejected.connect(Dialog.reject) self.buttonBox.rejected.connect(Dialog.reject)
self.tabSettings.setCurrentIndex(0) self.tabSettings.setCurrentIndex(5)
QMetaObject.connectSlotsByName(Dialog) QMetaObject.connectSlotsByName(Dialog)
@@ -264,5 +303,8 @@ class Ui_Dialog(object):
self.addDiffPdf.setText(QCoreApplication.translate("Dialog", u"Hinzuf\u00fcgen", None)) self.addDiffPdf.setText(QCoreApplication.translate("Dialog", u"Hinzuf\u00fcgen", None))
self.removeDiffPdf.setText(QCoreApplication.translate("Dialog", u"Entfernen", None)) self.removeDiffPdf.setText(QCoreApplication.translate("Dialog", u"Entfernen", None))
self.tabSettings.setTabText(self.tabSettings.indexOf(self.tabDiffPdf), QCoreApplication.translate("Dialog", u"Diff-PDF", None)) self.tabSettings.setTabText(self.tabSettings.indexOf(self.tabDiffPdf), QCoreApplication.translate("Dialog", u"Diff-PDF", None))
self.removeProject.setText(QCoreApplication.translate("Dialog", u"Hinzuf\u00fcgen", None))
self.addProject.setText(QCoreApplication.translate("Dialog", u"Entfernen", None))
self.tabSettings.setTabText(self.tabSettings.indexOf(self.tabPdfProject), QCoreApplication.translate("Dialog", u"PDF-Projekte", None))
# retranslateUi # retranslateUi