From c19cdf6f4121f4a6a054c5f26a3dbf44e02efe0b Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Mon, 24 Mar 2025 20:36:18 +0100 Subject: [PATCH] feature: add changelog to about dialog --- changelog.txt | 16 ++++++++++++++++ constants.py | 1 + make_installer.py | 1 + src/plugins/krowlog/aboutdialog.py | 27 +++++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 changelog.txt diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..335cd5a --- /dev/null +++ b/changelog.txt @@ -0,0 +1,16 @@ + +Next Version +* Feature: Add changelog. +* Fix: When the range sliders are overlapping the end slider cannot be moved. +* Feature: Get version number from git tags. +* Feature: You can now "follow" a file. When enabled the file is automatically reloaded + and scrolled to the end. Any manual scroll action disables "follow" mode. +* Feature: Better support for fonts and characters with non-uniform width. +* Fix: Cannot scroll to arbitrary positions in a file if the file is larger than 2GB +* Feature: File type specific highlighters. + +0.2.1 +* Feature: Show how many bytes are selected. +* Feature: Highlighters can be disabled. +* Feature: If a regex contains a group, then only the group is highlighted. + Using a filter expression like '(\d+)ms' will only hightlight the number. \ No newline at end of file diff --git a/constants.py b/constants.py index 2f026ec..2e54c21 100644 --- a/constants.py +++ b/constants.py @@ -2,5 +2,6 @@ import os krow_icon = "icons" + os.sep + "krowlog.svg" license_file = os.path.dirname(os.path.realpath(__file__)) + os.sep + "LICENSE" +changelog_file = os.path.dirname(os.path.realpath(__file__)) + os.sep + "changelog.txt" tab_width = 4 diff --git a/make_installer.py b/make_installer.py index d48ae54..8a2f3d7 100644 --- a/make_installer.py +++ b/make_installer.py @@ -14,6 +14,7 @@ PyInstaller.__main__.run([ '--add-binary', 'icons' + os.pathsep + 'icons', '--add-binary', 'locales' + os.pathsep + 'locales', '--add-binary', 'LICENSE' + os.pathsep + '.', + '--add-binary', 'changelog.txt' + os.pathsep + '.', '--add-binary', 'version.txt' + os.pathsep + '.', '--hidden-import=krowlog', '--hidden-import=watchdog', diff --git a/src/plugins/krowlog/aboutdialog.py b/src/plugins/krowlog/aboutdialog.py index b628adb..3aa3ee0 100644 --- a/src/plugins/krowlog/aboutdialog.py +++ b/src/plugins/krowlog/aboutdialog.py @@ -22,8 +22,8 @@ class AboutDialog(QDialog): super(AboutDialog, self).__init__(parent) self.setWindowTitle(_("About KrowLog")) self.setModal(True) - self.setMinimumWidth(650) - self.setFixedHeight(300) + self.setMinimumWidth(850) + self.setFixedHeight(400) self.layout = QVBoxLayout(self) @@ -50,6 +50,7 @@ class AboutDialog(QDialog): tabs.addTab(self._about(), _("About")) tabs.addTab(self._libraries(), _("Libraries")) tabs.addTab(self._license(), _("License")) + tabs.addTab(self._changelog(), _("Changelog")) self.layout.addWidget(tabs) @@ -106,3 +107,25 @@ class AboutDialog(QDialog): panel.setBackgroundRole(QPalette.ColorRole.Light) result.layout.addWidget(panel) return result + + def _changelog(self) -> QWidget: + with open(constants.changelog_file, 'r') as file: + text = file.read() + + result = QWidget() + result.layout = QVBoxLayout(result) + result.layout.setContentsMargins(0, 0, 0, 0) + result.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.MinimumExpanding) + + label = Label(text) + label.setFont(QFont("Monospace")) + label.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.MinimumExpanding) + + panel = QScrollArea(result) + panel.setContentsMargins(0, 0, 0, 0) + panel.setViewportMargins(0, 0, 0, 0) + panel.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.MinimumExpanding) + panel.setWidget(label) + panel.setBackgroundRole(QPalette.ColorRole.Light) + result.layout.addWidget(panel) + return result