feature: add changelog to about dialog

This commit is contained in:
2025-03-24 20:36:18 +01:00
parent 8ce0c1bf9e
commit c19cdf6f41
4 changed files with 43 additions and 2 deletions

16
changelog.txt Normal file
View File

@@ -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.

View File

@@ -2,5 +2,6 @@ import os
krow_icon = "icons" + os.sep + "krowlog.svg" krow_icon = "icons" + os.sep + "krowlog.svg"
license_file = os.path.dirname(os.path.realpath(__file__)) + os.sep + "LICENSE" 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 tab_width = 4

View File

@@ -14,6 +14,7 @@ PyInstaller.__main__.run([
'--add-binary', 'icons' + os.pathsep + 'icons', '--add-binary', 'icons' + os.pathsep + 'icons',
'--add-binary', 'locales' + os.pathsep + 'locales', '--add-binary', 'locales' + os.pathsep + 'locales',
'--add-binary', 'LICENSE' + os.pathsep + '.', '--add-binary', 'LICENSE' + os.pathsep + '.',
'--add-binary', 'changelog.txt' + os.pathsep + '.',
'--add-binary', 'version.txt' + os.pathsep + '.', '--add-binary', 'version.txt' + os.pathsep + '.',
'--hidden-import=krowlog', '--hidden-import=krowlog',
'--hidden-import=watchdog', '--hidden-import=watchdog',

View File

@@ -22,8 +22,8 @@ class AboutDialog(QDialog):
super(AboutDialog, self).__init__(parent) super(AboutDialog, self).__init__(parent)
self.setWindowTitle(_("About KrowLog")) self.setWindowTitle(_("About KrowLog"))
self.setModal(True) self.setModal(True)
self.setMinimumWidth(650) self.setMinimumWidth(850)
self.setFixedHeight(300) self.setFixedHeight(400)
self.layout = QVBoxLayout(self) self.layout = QVBoxLayout(self)
@@ -50,6 +50,7 @@ class AboutDialog(QDialog):
tabs.addTab(self._about(), _("About")) tabs.addTab(self._about(), _("About"))
tabs.addTab(self._libraries(), _("Libraries")) tabs.addTab(self._libraries(), _("Libraries"))
tabs.addTab(self._license(), _("License")) tabs.addTab(self._license(), _("License"))
tabs.addTab(self._changelog(), _("Changelog"))
self.layout.addWidget(tabs) self.layout.addWidget(tabs)
@@ -106,3 +107,25 @@ class AboutDialog(QDialog):
panel.setBackgroundRole(QPalette.ColorRole.Light) panel.setBackgroundRole(QPalette.ColorRole.Light)
result.layout.addWidget(panel) result.layout.addWidget(panel)
return result 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