From: Urban Wallasch Date: Thu, 8 Jul 2021 14:15:37 +0000 (+0200) Subject: * Finished "About" dialog. X-Git-Tag: v0.1.0~2 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=3b281a640c4accaad35195524d4fd0ab2596760b;p=jiten-pai.git * Finished "About" dialog. --- diff --git a/ROADMAP.txt b/ROADMAP.txt index 13daf56..30700f3 100644 --- a/ROADMAP.txt +++ b/ROADMAP.txt @@ -14,7 +14,7 @@ Phase II [x] preferences, config file [x] history [x] Romaji input -[ ] program name, icon, "About & Help" dialog +[x] program name, icon, "About" dialog [ ] README [x] verb de-inflection diff --git a/jiten-pai.py b/jiten-pai.py index 97c435d..f553a27 100755 --- a/jiten-pai.py +++ b/jiten-pai.py @@ -19,7 +19,20 @@ _JITENPAI_DIR = 'jiten-pai' _JITENPAI_CFG = 'jiten-pai.conf' _JITENPAI_VCONJ = 'vconj.utf8' -_JITENPAI_HELP = 'todo' +_JITENPAI_INFO = """

Jiten-pai incorporates parts taken from other projects: +

+Kana conversion code adapted from jaconv.
+Copyright (c) 2014 Yukino Ikegami; MIT License +

+VCONJ verb de-inflection rule file adapted from XJDIC.
+Copyright (c) 1998-2003 J.W. Breen; GNU General Public License v2.0
+Modifications for Gjiten 1999-2005 by Botond Botyanszki +

+RADKFILE and KRADFILE kanji radical cross-reference adapted from +The KRADFILE/RADKFILE Project.
+Copyright (c) James William BREEN and The Electronic Dictionary Research +and Development Group; Creative Commons Attribution-ShareAlike Licence (V3.0) +

""" import sys @@ -622,36 +635,40 @@ class aboutDialog(QDialog): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.setAttribute(Qt.WA_DeleteOnClose) - self.setWindowTitle('Help & About') - self.setFixedSize(600, 600) - self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) + self.setWindowTitle('About') + self.resize(600, 500) self.icon_label = QLabel() - #self.icon_label.setPixmap(jpIcon.jitenpai_pxm) + self.icon_label.setPixmap(jpIcon.jiten_pai_pxm) self.tag_label = QLabel('%s %s\n' 'Copyright (c) 2021, Urban Wallasch\n' 'BSD 3-Clause License\n' 'Contributors: volpol' % (_JITENPAI_NAME, _JITENPAI_VERSION)) self.tag_label.setAlignment(Qt.AlignCenter) + self.tag_label.setTextInteractionFlags(Qt.TextSelectableByMouse) self.hdr_layout = QHBoxLayout() self.hdr_layout.addWidget(self.icon_label, 1) self.hdr_layout.addWidget(self.tag_label, 100) - self.help_pane = QTextEdit() - self.help_pane.setReadOnly(True) - self.help_pane.setStyleSheet('QTextEdit {border: none;}') - self.help_pane.setHtml(_JITENPAI_HELP) + self.info_pane = QTextBrowser() + self.info_pane.setReadOnly(True) + self.info_pane.setOpenExternalLinks(True) + self.info_pane.viewport().setAutoFillBackground(False) + self.info_pane.setStyleSheet('QTextEdit {border: none;}') + self.info_pane.setHtml(_JITENPAI_INFO) self.qt_button = QPushButton('About Qt') self.qt_button.clicked.connect(lambda: QMessageBox.aboutQt(self)) self.ok_button = QPushButton('Ok') self.ok_button.setIcon(jpIcon.ok) self.ok_button.clicked.connect(self.accept) + self.ok_button.setDefault(True) self.btn_layout = QHBoxLayout() self.btn_layout.addWidget(self.qt_button) self.btn_layout.addStretch() self.btn_layout.addWidget(self.ok_button) self.dlg_layout = QVBoxLayout(self) self.dlg_layout.addLayout(self.hdr_layout) - self.dlg_layout.addWidget(self.help_pane) + self.dlg_layout.addSpacing(20) + self.dlg_layout.addWidget(self.info_pane) self.dlg_layout.addLayout(self.btn_layout)