mirror of
https://github.com/283375/arcaea-offline-ocr-model.git
synced 2025-11-14 08:22:14 +00:00
init
This commit is contained in:
33
ui/components/projectEntry.py
Normal file
33
ui/components/projectEntry.py
Normal file
@ -0,0 +1,33 @@
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
from project import Project
|
||||
|
||||
from .projectEntry_ui import Ui_ProjectEntry
|
||||
|
||||
|
||||
class ProjectEntry(Ui_ProjectEntry, QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.project = None
|
||||
|
||||
def setProject(self, project: Project):
|
||||
self.project = project
|
||||
self.updateLabels()
|
||||
|
||||
def updateLabels(self):
|
||||
if not self.project:
|
||||
self.projectNameLabel.setText("-")
|
||||
self.projectDescriptionLabel.setText("-")
|
||||
return
|
||||
|
||||
self.projectNameLabel.setText(self.project.name)
|
||||
self.projectDescriptionLabel.setText(
|
||||
"<br>".join(
|
||||
[
|
||||
str(self.project.path.resolve()),
|
||||
f"{len(self.project.sources)} sources",
|
||||
f"{len(self.project.samples)} samples ({len(self.project.samplesUnclassified)} unclassified)",
|
||||
]
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user