warchron_app/src/warchron/view/objective_dialog.py

25 lines
793 B
Python
Raw Normal View History

from PyQt6.QtWidgets import QWidget, QDialog
from warchron.view.ui.ui_objective_dialog import Ui_objectiveDialog
class ObjectiveDialog(QDialog):
def __init__(
self,
parent: QWidget | None = None,
*,
default_name: str = "",
default_description: str | None = "",
) -> None:
super().__init__(parent)
self.ui: Ui_objectiveDialog = Ui_objectiveDialog()
self.ui.setupUi(self) # type: ignore
self.ui.objectiveName.setText(default_name)
self.ui.objectiveDescription.setPlainText(default_description)
def get_objective_name(self) -> str:
return self.ui.objectiveName.text().strip()
def get_objective_description(self) -> str:
return self.ui.objectiveDescription.toPlainText().strip()