From af779a2664d350d462631afccd92284653e30724 Mon Sep 17 00:00:00 2001
From: Nils <>
Date: Sun, 26 Dec 2021 21:37:42 +0100
Subject: [PATCH] Provide changelog as menu item
---
CHANGELOG | 3 ++
Makefile.in | 1 +
documentation/out/CHANGELOG | 1 +
qtgui/changelog.py | 63 +++++++++++++++++++++++++
qtgui/designer/mainwindow.py | 6 ++-
qtgui/designer/mainwindow.ui | 6 +++
qtgui/mainwindow.py | 3 ++
qtgui/resources/translations/config.pro | 3 +-
8 files changed, 83 insertions(+), 3 deletions(-)
create mode 120000 documentation/out/CHANGELOG
create mode 100644 qtgui/changelog.py
diff --git a/CHANGELOG b/CHANGELOG
index a8d5860..4ec4e3f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,9 @@ Format: Double ## for a version number followed by a space, ISO-Date, Semantic V
Two empty lines before the next entry.
External contributors notice at the end of the line: (LastName, FirstName / nick)
+## 2022-01-15 0.3.1
+This CHANGELOG is now available through the programs help menu directly.
+
## 2021-07-08 0.3.0
Remove "Quick" mode. As it turns out "Full" mode is quick enough. Port convenience features to full mode.
diff --git a/Makefile.in b/Makefile.in
index 4a116d1..d00c892 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -50,6 +50,7 @@ install:
install -D -m 644 documentation/out/* -t $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)
install -D -m 644 README.md $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/README.md
install -D -m 644 LICENSE $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/LICENSE
+ install -D -m 644 CHANGELOG $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/CHANGELOG
install -D -m 644 desktop/desktop.desktop $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo.desktop
install -D -m 644 desktop/agordejo-continue.desktop $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo-continue.desktop
diff --git a/documentation/out/CHANGELOG b/documentation/out/CHANGELOG
new file mode 120000
index 0000000..6fc2e33
--- /dev/null
+++ b/documentation/out/CHANGELOG
@@ -0,0 +1 @@
+../../CHANGELOG
\ No newline at end of file
diff --git a/qtgui/changelog.py b/qtgui/changelog.py
new file mode 100644
index 0000000..825b191
--- /dev/null
+++ b/qtgui/changelog.py
@@ -0,0 +1,63 @@
+#! /usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+Copyright 2021, Nils Hilbricht, Germany ( https://www.hilbricht.net )
+
+This file is part of the Laborejo Software Suite ( https://www.laborejo.org ),
+
+This application is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
+"""
+
+import logging; logger = logging.getLogger(__name__); logger.info("import")
+
+#Standard Lib
+
+#System Wide Modules
+from PyQt5 import QtCore, QtWidgets, QtGui
+
+#Local Modules
+from engine.config import * #imports METADATA
+from engine.start import PATHS
+
+class Changelog(QtWidgets.QWidget):
+ """
+ A modal window that is hidden.
+ Just shows the file CHANGELOG
+ """
+
+ def __init__(self, mainWindow):
+ super().__init__()
+ self.mainWindow = mainWindow
+
+ ourLayout = QtWidgets.QVBoxLayout()
+ #ourLayout.setSpacing(0)
+ #ourLayout.setContentsMargins(0,0,0,0)
+ self.setLayout(ourLayout)
+
+
+ self.setWindowTitle(METADATA["name"] + " " + QtCore.QCoreApplication.translate("TemplateChangelog", "Changelog"))
+ introtext = QtCore.QCoreApplication.translate("TemplateChangelog", "The Changelog is only available in English.")
+ ourLayout.addWidget(QtWidgets.QLabel(introtext))
+
+ textEdit = QtWidgets.QPlainTextEdit()
+ textEdit.setReadOnly(True)
+ with open(PATHS["doc"] + "/CHANGELOG", "r") as f:
+ textEdit.setPlainText(f.read())
+
+ ourLayout.addWidget(textEdit)
+
+ self.hide()
+
+ def closeEvent(self, event):
+ self.hide()
diff --git a/qtgui/designer/mainwindow.py b/qtgui/designer/mainwindow.py
index 006ef78..871cc83 100644
--- a/qtgui/designer/mainwindow.py
+++ b/qtgui/designer/mainwindow.py
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'mainwindow.ui'
#
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@@ -273,7 +273,10 @@ class Ui_MainWindow(object):
self.actionSettings.setObjectName("actionSettings")
self.actionManual = QtWidgets.QAction(MainWindow)
self.actionManual.setObjectName("actionManual")
+ self.actionChangelog = QtWidgets.QAction(MainWindow)
+ self.actionChangelog.setObjectName("actionChangelog")
self.menuControl.addAction(self.actionManual)
+ self.menuControl.addAction(self.actionChangelog)
self.menuControl.addAction(self.actionRebuild_Program_Database)
self.menuControl.addAction(self.actionHide_in_System_Tray)
self.menuControl.addAction(self.actionSettings)
@@ -374,3 +377,4 @@ class Ui_MainWindow(object):
self.actionClientRename.setShortcut(_translate("MainWindow", "F2"))
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionManual.setText(_translate("MainWindow", "Manual"))
+ self.actionChangelog.setText(_translate("MainWindow", "News and Changelog"))
diff --git a/qtgui/designer/mainwindow.ui b/qtgui/designer/mainwindow.ui
index 0a6d9ae..b2fbe33 100644
--- a/qtgui/designer/mainwindow.ui
+++ b/qtgui/designer/mainwindow.ui
@@ -564,6 +564,7 @@
Control
+
@@ -732,6 +733,11 @@
Manual
+
+
+ News and Changelog
+
+
diff --git a/qtgui/mainwindow.py b/qtgui/mainwindow.py
index c4d0d1c..efa88ba 100644
--- a/qtgui/mainwindow.py
+++ b/qtgui/mainwindow.py
@@ -39,6 +39,7 @@ from .systemtray import SystemTray
from .eventloop import EventLoop
from .designer.mainwindow import Ui_MainWindow
from .usermanual import UserManual
+from .changelog import Changelog
from .helper import setPaletteAndFont
from .helper import iconFromString
from .sessiontreecontroller import SessionTreeController
@@ -140,6 +141,7 @@ class MainWindow(QtWidgets.QMainWindow):
assert self.ui.tabbyCat.currentIndex() == 0, self.ui.tabbyCat.currentIndex() # this is critical. If you left the Qt Designer with the wrong tab open this is the error that happens. It will trigger the tab changed later that will go wrong because setup is not complete yet and you'll get AttributeError
self.userManual = UserManual(mainWindow=self)
+ self.changelog = Changelog(mainWindow=self)
self.ui.mainPageSwitcher.setCurrentIndex(0) #1 is messageLabel 0 is the tab widget
@@ -399,6 +401,7 @@ class MainWindow(QtWidgets.QMainWindow):
def connectMenu(self):
#Control
self.ui.actionManual.triggered.connect(self.userManual.show)
+ self.ui.actionChangelog.triggered.connect(self.changelog.show)
self.ui.actionRebuild_Program_Database.triggered.connect(self.updateProgramDatabase)
self.ui.actionSettings.triggered.connect(self._reactMenu_settings)
self.ui.actionHide_in_System_Tray.triggered.connect(lambda: self.toggleVisible(force=False))
diff --git a/qtgui/resources/translations/config.pro b/qtgui/resources/translations/config.pro
index 19d23dd..d780fc4 100644
--- a/qtgui/resources/translations/config.pro
+++ b/qtgui/resources/translations/config.pro
@@ -1,3 +1,2 @@
-SOURCES = ../../addclientprompt.py ../../descriptiontextwidget.py ../../mainwindow.py ../../projectname.py ../../sessiontreecontroller.py ../../opensessioncontroller.py ../../systemtray.py ../../waitdialog.py ../../usermanual.py ../../designer/mainwindow.py ../../designer/newsession.py ../../designer/projectname.py ../../designer/settings.py ../../designer/usermanual.py
+SOURCES = ../../addclientprompt.py ../../changelog.py ../../descriptiontextwidget.py ../../mainwindow.py ../../projectname.py ../../sessiontreecontroller.py ../../opensessioncontroller.py ../../systemtray.py ../../waitdialog.py ../../usermanual.py ../../designer/mainwindow.py ../../designer/newsession.py ../../designer/projectname.py ../../designer/settings.py ../../designer/usermanual.py
TRANSLATIONS = de.ts it.ts
-