37 lines
1.4 KiB
Python
37 lines
1.4 KiB
Python
from PySide6.QtWidgets import (QDialog, QVBoxLayout, QTextBrowser,
|
|
QPushButton, QCheckBox, QHBoxLayout)
|
|
from PySide6.QtCore import Qt
|
|
import markdown2
|
|
|
|
class ReleaseNoteDialog(QDialog):
|
|
def __init__(self, version: str, release_note: str, parent=None):
|
|
super().__init__(parent)
|
|
self.setWindowTitle(f"릴리즈 노트 - 버전 {version}")
|
|
self.setMinimumSize(500, 400)
|
|
|
|
layout = QVBoxLayout()
|
|
|
|
# 마크다운 텍스트를 HTML로 변환하여 표시
|
|
text_browser = QTextBrowser()
|
|
text_browser.setOpenExternalLinks(True)
|
|
html_content = markdown2.markdown(release_note)
|
|
text_browser.setHtml(html_content)
|
|
layout.addWidget(text_browser)
|
|
|
|
# 하단 버튼 영역
|
|
bottom_layout = QHBoxLayout()
|
|
|
|
# "다음부터 보지 않기" 체크박스
|
|
self.dont_show_checkbox = QCheckBox("다음부터 이 버전의 릴리즈 노트 보지 않기")
|
|
bottom_layout.addWidget(self.dont_show_checkbox)
|
|
|
|
# 확인 버튼
|
|
ok_button = QPushButton("확인")
|
|
ok_button.clicked.connect(self.accept)
|
|
bottom_layout.addWidget(ok_button)
|
|
|
|
layout.addLayout(bottom_layout)
|
|
self.setLayout(layout)
|
|
|
|
def dont_show_again(self) -> bool:
|
|
return self.dont_show_checkbox.isChecked() |